/* 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/htslib_util.h", 
            "/Library/Python/2.7/site-packages/pysam/include/htslib/htslib/sam.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/pysam_stream.h", 
            "/Library/Python/2.7/site-packages/pysam/include/htslib/htslib/hts.h", 
            "/Library/Python/2.7/site-packages/pysam/include/htslib/htslib/tbx.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__query_muts
#define __PYX_HAVE_API__query_muts
#include "stdint.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 "math.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;


static const char *__pyx_f[] = {
  "query_muts.pyx",
  "stringsource",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
  "cfaidx.pxd",
  "calignmentfile.pxd",
  "csamfile.pxd",
};

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

/* "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;
};
struct __pyx_t_10query_muts__CountAllele;

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

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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



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

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


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

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


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

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


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

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


/* "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 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);

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

#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

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

#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

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

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

#include <string.h>

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

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

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

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

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

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

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

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

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

static void* __Pyx_GetVtable(PyObject *dict);

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

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);

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

static PyObject* __Pyx_Globals(void);

struct __pyx_t_10query_muts__CountAllele;
static PyObject* __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(struct __pyx_t_10query_muts__CountAllele s);
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static int __Pyx_check_binary_version(void);

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

static PyObject *__Pyx_ImportModule(const char *name);

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 '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 'query_muts' */
static char *__pyx_v_10query_muts_CODE2CIGAR;
static char *__pyx_v_10query_muts_bam_nt16_rev_table;
static PyObject *__pyx_f_10query_muts_read_mutation_bed(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_10query_muts__get_seq_base(bam1_t *, uint32_t); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_10query_muts__init_count(struct __pyx_t_10query_muts__CountAllele *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_10query_muts__incr_count(struct __pyx_t_10query_muts__CountAllele *, int, double, int); /*proto*/
static struct __pyx_t_10query_muts__CountAllele __pyx_convert__from_py___pyx_t_10query_muts__CountAllele(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "query_muts"
int __pyx_module_is_main_query_muts = 0;

/* Implementation of 'query_muts' */
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_eval;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_pf_10query_muts_chernoff(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_m, double __pyx_v_d); /* proto */
static PyObject *__pyx_pf_10query_muts_2query_mutations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_muts_fn, PyObject *__pyx_v_samfile_name, PyObject *__pyx_v_min_mapq, PyObject *__pyx_v_min_baseq, PyObject *__pyx_v_min_reads, PyObject *__pyx_v_min_support, PyObject *__pyx_v_out_fn); /* proto */
static char __pyx_k_[] = "\t";
static char __pyx_k_A[] = "A";
static char __pyx_k_C[] = "C";
static char __pyx_k_G[] = "G";
static char __pyx_k_T[] = "T";
static char __pyx_k_a[] = "a";
static char __pyx_k_d[] = "d";
static char __pyx_k_i[] = "i";
static char __pyx_k_m[] = "m";
static char __pyx_k_n[] = "n";
static char __pyx_k_r[] = "r";
static char __pyx_k__3[] = ",";
static char __pyx_k_it[] = "it";
static char __pyx_k_aln[] = "aln";
static char __pyx_k_col[] = "col";
static char __pyx_k_end[] = "end";
static char __pyx_k_fmt[] = "fmt";
static char __pyx_k_fwd[] = "fwd";
static char __pyx_k_nan[] = "nan";
static char __pyx_k_out[] = "out";
static char __pyx_k_plp[] = "plp";
static char __pyx_k_pos[] = "pos";
static char __pyx_k_rev[] = "rev";
static char __pyx_k_eval[] = "eval";
static char __pyx_k_flag[] = "flag";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_mapq[] = "mapq";
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_test[] = "__test__";
static char __pyx_k_baseq[] = "baseq";
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_range[] = "range";
static char __pyx_k_split[] = "split";
static char __pyx_k_start[] = "start";
static char __pyx_k_strip[] = "strip";
static char __pyx_k_write[] = "write";
static char __pyx_k_format[] = "format";
static char __pyx_k_out_fn[] = "out_fn";
static char __pyx_k_pileup[] = "pileup";
static char __pyx_k_pvalue[] = "pvalue";
static char __pyx_k_xrange[] = "xrange";
static char __pyx_k_alnbase[] = "alnbase";
static char __pyx_k_alt_mut[] = "alt_mut";
static char __pyx_k_forward[] = "forward";
static char __pyx_k_mapqual[] = "mapqual";
static char __pyx_k_muts_fn[] = "muts_fn";
static char __pyx_k_prob_se[] = "prob_se";
static char __pyx_k_refbase[] = "refbase";
static char __pyx_k_reverse[] = "reverse";
static char __pyx_k_samfile[] = "samfile";
static char __pyx_k_KeyError[] = "KeyError";
static char __pyx_k_chernoff[] = "chernoff";
static char __pyx_k_getrname[] = "getrname";
static char __pyx_k_min_mapq[] = "min_mapq";
static char __pyx_k_truncate[] = "truncate";
static char __pyx_k_MIDNSHP_X[] = "MIDNSHP=X";
static char __pyx_k_TypeError[] = "TypeError";
static char __pyx_k_a_mapping[] = "a mapping";
static char __pyx_k_fwd_ratio[] = "fwd_ratio";
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_is_reverse[] = "is_reverse";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_query_muts[] = "query_muts";
static char __pyx_k_current_pos[] = "current_pos";
static char __pyx_k_in_germline[] = "in_germline";
static char __pyx_k_min_support[] = "min_support";
static char __pyx_k_seen_chroms[] = "seen_chroms";
static char __pyx_k_total_baseq[] = "total_baseq";
static char __pyx_k_total_reads[] = "total_reads";
static char __pyx_k_possible_mut[] = "possible_mut";
static char __pyx_k_samfile_name[] = "samfile_name";
static char __pyx_k_possible_muts[] = "possible_muts";
static char __pyx_k_prob_germline[] = "prob_germline";
static char __pyx_k_total_alleles[] = "total_alleles";
static char __pyx_k_is_proper_pair[] = "is_proper_pair";
static char __pyx_k_ACMGRSVTWYHKDBN[] = "=ACMGRSVTWYHKDBN";
static char __pyx_k_alt_allele_freq[] = "alt_allele_freq";
static char __pyx_k_query_mutations[] = "query_mutations";
static char __pyx_k_SOMATIC_AMBIGUOUS[] = "SOMATIC/AMBIGUOUS";
static char __pyx_k_GERMLINE_AMBIGUOUS[] = "GERMLINE/AMBIGUOUS";
static char __pyx_k_Expected_16s_got_200s[] = "Expected %.16s, got %.200s";
static char __pyx_k_GT_GQ_DP_1_0_60_total_reads[] = "GT:GQ:DP\t1|0:60:{total_reads}\n";
static char __pyx_k_GP_prob_germline_DP_total_reads[] = "GP={prob_germline};DP={total_reads};MQ={mean_mapq};BQ={mean_qual}\t";
static char __pyx_k_Users_smithk_Documents_git_repo[] = "/Users/smithk/Documents/git_repos/SomVarIUS/SomVarIUS/query_muts.pyx";
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_NS_1_AF_alt_allele_freq_P_pvalue[] = "NS=1;AF={alt_allele_freq};P={pvalue};SP={prob_se};";
static char __pyx_k_No_value_specified_for_struct_at[] = "No value specified for struct attribute 'fwd'";
static char __pyx_k_No_value_specified_for_struct_at_2[] = "No value specified for struct attribute 'rev'";
static char __pyx_k_No_value_specified_for_struct_at_3[] = "No value specified for struct attribute 'pres'";
static char __pyx_k_No_value_specified_for_struct_at_4[] = "No value specified for struct attribute 'count'";
static char __pyx_k_No_value_specified_for_struct_at_5[] = "No value specified for struct attribute 'mapqual'";
static char __pyx_k_No_value_specified_for_struct_at_6[] = "No value specified for struct attribute 'qual'";
static PyObject *__pyx_kp_s_;
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_n_b_G;
static PyObject *__pyx_n_s_G;
static PyObject *__pyx_kp_s_GERMLINE_AMBIGUOUS;
static PyObject *__pyx_kp_s_GP_prob_germline_DP_total_reads;
static PyObject *__pyx_kp_s_GT_GQ_DP_1_0_60_total_reads;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_kp_s_NS_1_AF_alt_allele_freq_P_pvalue;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_2;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_3;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_4;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_5;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_6;
static PyObject *__pyx_kp_s_SOMATIC_AMBIGUOUS;
static PyObject *__pyx_n_b_T;
static PyObject *__pyx_n_s_T;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_s_Users_smithk_Documents_git_repo;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s__3;
static PyObject *__pyx_n_s_a;
static PyObject *__pyx_n_s_aln;
static PyObject *__pyx_n_s_alnbase;
static PyObject *__pyx_n_s_alt_allele;
static PyObject *__pyx_n_s_alt_allele_freq;
static PyObject *__pyx_n_s_alt_mut;
static PyObject *__pyx_n_s_baseq;
static PyObject *__pyx_n_s_chernoff;
static PyObject *__pyx_n_s_chrom;
static PyObject *__pyx_kp_s_chrom_pos_refbase_alt_allele_PA;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_col;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_current_pos;
static PyObject *__pyx_n_s_d;
static PyObject *__pyx_n_s_delta;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_eval;
static PyObject *__pyx_n_s_flag;
static PyObject *__pyx_n_s_fmt;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_forward;
static PyObject *__pyx_n_s_fwd;
static PyObject *__pyx_n_s_fwd_ratio;
static PyObject *__pyx_n_s_getrname;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_in_germline;
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_m;
static PyObject *__pyx_n_s_main;
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_mapq;
static PyObject *__pyx_n_s_mean_qual;
static PyObject *__pyx_n_s_min_baseq;
static PyObject *__pyx_n_s_min_mapq;
static PyObject *__pyx_n_s_min_reads;
static PyObject *__pyx_n_s_min_support;
static PyObject *__pyx_n_s_muts_fn;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_nan;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_out;
static PyObject *__pyx_n_s_out_fn;
static PyObject *__pyx_n_s_pileup;
static PyObject *__pyx_n_s_plp;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_possible_mut;
static PyObject *__pyx_n_s_possible_muts;
static PyObject *__pyx_n_s_pres;
static PyObject *__pyx_n_s_prob_germline;
static PyObject *__pyx_n_s_prob_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_query_mutations;
static PyObject *__pyx_n_s_query_muts;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_refbase;
static PyObject *__pyx_n_s_reference;
static PyObject *__pyx_n_s_rev;
static PyObject *__pyx_n_s_reverse;
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_seen_chroms;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_strip;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_total_alleles;
static PyObject *__pyx_n_s_total_baseq;
static PyObject *__pyx_n_s_total_reads;
static PyObject *__pyx_n_s_truncate;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_80000;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_codeobj__12;
static PyObject *__pyx_codeobj__14;

/* "query_muts.pyx":45
 * 
 * 
 * def chernoff(double m, double d):             # <<<<<<<<<<<<<<
 * 
 * 	prob_se = pow((exp(d) / pow((1+d), (1+d))), m)
 */

/* Python wrapper */
static PyObject *__pyx_pw_10query_muts_1chernoff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_10query_muts_1chernoff = {"chernoff", (PyCFunction)__pyx_pw_10query_muts_1chernoff, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10query_muts_1chernoff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_m;
  double __pyx_v_d;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chernoff (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_m,&__pyx_n_s_d,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("chernoff", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chernoff") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_m = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_m == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_d = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_d == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chernoff", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("query_muts.chernoff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10query_muts_chernoff(__pyx_self, __pyx_v_m, __pyx_v_d);

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

static PyObject *__pyx_pf_10query_muts_chernoff(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_m, double __pyx_v_d) {
  PyObject *__pyx_v_prob_se = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long double __pyx_t_1;
  long double __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("chernoff", 0);

  /* "query_muts.pyx":47
 * def chernoff(double m, double d):
 * 
 * 	prob_se = pow((exp(d) / pow((1+d), (1+d))), m)             # <<<<<<<<<<<<<<
 * 	prob_se=fmax(1e-15, prob_se)
 * 
 */
  __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = PyFloat_FromDouble(pow((__pyx_t_1 / __pyx_t_2), __pyx_v_m)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_prob_se = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "query_muts.pyx":48
 * 
 * 	prob_se = pow((exp(d) / pow((1+d), (1+d))), m)
 * 	prob_se=fmax(1e-15, prob_se)             # <<<<<<<<<<<<<<
 * 
 * 	return prob_se
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_prob_se); if (unlikely((__pyx_t_2 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyFloat_FromDouble(fmax(1e-15, __pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_prob_se, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "query_muts.pyx":50
 * 	prob_se=fmax(1e-15, prob_se)
 * 
 * 	return prob_se             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_prob_se);
  __pyx_r = __pyx_v_prob_se;
  goto __pyx_L0;

  /* "query_muts.pyx":45
 * 
 * 
 * def chernoff(double m, double d):             # <<<<<<<<<<<<<<
 * 
 * 	prob_se = pow((exp(d) / pow((1+d), (1+d))), m)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("query_muts.chernoff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_prob_se);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "query_muts.pyx":53
 * 
 * 
 * cdef dict read_mutation_bed(str mut_fn):             # <<<<<<<<<<<<<<
 * 
 * 	cdef dict possible_muts = {}
 */

static PyObject *__pyx_f_10query_muts_read_mutation_bed(PyObject *__pyx_v_mut_fn) {
  PyObject *__pyx_v_possible_muts = 0;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_line = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_mutation_bed", 0);

  /* "query_muts.pyx":55
 * cdef dict read_mutation_bed(str mut_fn):
 * 
 * 	cdef dict possible_muts = {}             # <<<<<<<<<<<<<<
 * 	cdef list fields
 * 	cdef str line
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_possible_muts = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "query_muts.pyx":59
 * 	cdef str line
 * 
 * 	for line in open(mut_fn,'r'):             # <<<<<<<<<<<<<<
 * 		fields = line.strip().split('\t')
 * 		possible_muts[(fields[0], int(fields[1]))] = (fields[3], fields[4])
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_mut_fn);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_mut_fn);
  __Pyx_GIVEREF(__pyx_v_mut_fn);
  __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 = 59; __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 = 59; __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 = 59; __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 = 59; __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 = 59; __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 = 59; __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 = 59; __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 = 59; __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 = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_line, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "query_muts.pyx":60
 * 
 * 	for line in open(mut_fn,'r'):
 * 		fields = line.strip().split('\t')             # <<<<<<<<<<<<<<
 * 		possible_muts[(fields[0], int(fields[1]))] = (fields[3], fields[4])
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __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 = 60; __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 = 60; __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 = 60; __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__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "query_muts.pyx":61
 * 	for line in open(mut_fn,'r'):
 * 		fields = line.strip().split('\t')
 * 		possible_muts[(fields[0], int(fields[1]))] = (fields[3], fields[4])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_fields, 3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_fields, 4, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    if (unlikely(__pyx_v_fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_fields, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__pyx_v_fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_fields, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __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);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_5 = 0;
    __pyx_t_7 = 0;
    if (unlikely(PyDict_SetItem(__pyx_v_possible_muts, __pyx_t_2, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "query_muts.pyx":59
 * 	cdef str line
 * 
 * 	for line in open(mut_fn,'r'):             # <<<<<<<<<<<<<<
 * 		fields = line.strip().split('\t')
 * 		possible_muts[(fields[0], int(fields[1]))] = (fields[3], fields[4])
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "query_muts.pyx":64
 * 
 * 
 * 	return possible_muts             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_possible_muts);
  __pyx_r = __pyx_v_possible_muts;
  goto __pyx_L0;

  /* "query_muts.pyx":53
 * 
 * 
 * cdef dict read_mutation_bed(str mut_fn):             # <<<<<<<<<<<<<<
 * 
 * 	cdef dict possible_muts = {}
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("query_muts.read_mutation_bed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_possible_muts);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "query_muts.pyx":67
 * 
 * 
 * def query_mutations(muts_fn, samfile_name, min_mapq, min_baseq, min_reads, min_support,             # <<<<<<<<<<<<<<
 * 					out_fn):
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10query_muts_3query_mutations(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_10query_muts_3query_mutations = {"query_mutations", (PyCFunction)__pyx_pw_10query_muts_3query_mutations, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10query_muts_3query_mutations(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_muts_fn = 0;
  PyObject *__pyx_v_samfile_name = 0;
  PyObject *__pyx_v_min_mapq = 0;
  PyObject *__pyx_v_min_baseq = 0;
  PyObject *__pyx_v_min_reads = 0;
  PyObject *__pyx_v_min_support = 0;
  PyObject *__pyx_v_out_fn = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("query_mutations (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_muts_fn,&__pyx_n_s_samfile_name,&__pyx_n_s_min_mapq,&__pyx_n_s_min_baseq,&__pyx_n_s_min_reads,&__pyx_n_s_min_support,&__pyx_n_s_out_fn,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_muts_fn)) != 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("query_mutations", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_mapq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("query_mutations", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_baseq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("query_mutations", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_reads)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("query_mutations", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_support)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("query_mutations", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_fn)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("query_mutations", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "query_mutations") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_muts_fn = values[0];
    __pyx_v_samfile_name = values[1];
    __pyx_v_min_mapq = values[2];
    __pyx_v_min_baseq = values[3];
    __pyx_v_min_reads = values[4];
    __pyx_v_min_support = values[5];
    __pyx_v_out_fn = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("query_mutations", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("query_muts.query_mutations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10query_muts_2query_mutations(__pyx_self, __pyx_v_muts_fn, __pyx_v_samfile_name, __pyx_v_min_mapq, __pyx_v_min_baseq, __pyx_v_min_reads, __pyx_v_min_support, __pyx_v_out_fn);

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

static PyObject *__pyx_pf_10query_muts_2query_mutations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_muts_fn, PyObject *__pyx_v_samfile_name, PyObject *__pyx_v_min_mapq, PyObject *__pyx_v_min_baseq, PyObject *__pyx_v_min_reads, PyObject *__pyx_v_min_support, PyObject *__pyx_v_out_fn) {
  struct __pyx_obj_5pysam_8csamfile_Samfile *__pyx_v_samfile = 0;
  int __pyx_v_current_pos;
  PyObject *__pyx_v_seen_chroms = 0;
  PyObject *__pyx_v_possible_muts = 0;
  int __pyx_v_in_germline;
  bam_pileup1_t **__pyx_v_plp;
  bam_pileup1_t *__pyx_v_read;
  bam1_t *__pyx_v_aln;
  uint32_t __pyx_v_flag;
  int __pyx_v_is_reverse;
  int __pyx_v_is_proper_pair;
  int __pyx_v_i;
  int __pyx_v_n;
  double __pyx_v_baseq;
  double __pyx_v_total_baseq;
  struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_col = 0;
  double __pyx_v_alt_allele_freq;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_alnbase = 0;
  int __pyx_v_pos;
  double __pyx_v_mean_qual;
  struct __pyx_t_10query_muts__CountAllele __pyx_v_A;
  struct __pyx_t_10query_muts__CountAllele __pyx_v_T;
  struct __pyx_t_10query_muts__CountAllele __pyx_v_G;
  struct __pyx_t_10query_muts__CountAllele __pyx_v_C;
  struct __pyx_t_10query_muts__CountAllele __pyx_v_alt_mut;
  PyObject *__pyx_v_alt_allele = 0;
  double __pyx_v_fwd_ratio;
  double __pyx_v_rvs_ratio;
  int __pyx_v_total_alleles;
  long double __pyx_v_prob_se;
  double __pyx_v_delta;
  double __pyx_v_reverse;
  double __pyx_v_forward;
  PyObject *__pyx_v_fmt = NULL;
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_v_it = NULL;
  uint8_t __pyx_v_mapq;
  double __pyx_v_total_reads;
  PyObject *__pyx_v_possible_mut = NULL;
  double __pyx_v_mean_mapq;
  PyObject *__pyx_v_refbase = NULL;
  PyObject *__pyx_v_prob_germline = NULL;
  PyObject *__pyx_v_pvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  bam_pileup1_t **__pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  bam1_t *__pyx_t_13;
  uint16_t __pyx_t_14;
  uint8_t __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  Py_ssize_t __pyx_t_19;
  struct __pyx_t_10query_muts__CountAllele __pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  long double __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("query_mutations", 0);

  /* "query_muts.pyx":73
 * 	#statically type variables
 * 	cdef Samfile samfile
 * 	cdef int current_pos = 0             # <<<<<<<<<<<<<<
 * 	cdef set seen_chroms = set()
 * 	cdef dict possible_muts
 */
  __pyx_v_current_pos = 0;

  /* "query_muts.pyx":74
 * 	cdef Samfile samfile
 * 	cdef int current_pos = 0
 * 	cdef set seen_chroms = set()             # <<<<<<<<<<<<<<
 * 	cdef dict possible_muts
 * 	cdef bint in_germline
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_seen_chroms = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "query_muts.pyx":85
 * 	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_v_total_baseq = 0.0;

  /* "query_muts.pyx":101
 * 
 * 
 * 	fmt = '{chrom}\t{pos}\t.\t{refbase}\t{alt_allele}\t.\tPASS\t'             # <<<<<<<<<<<<<<
 * 	fmt+='NS=1;AF={alt_allele_freq};P={pvalue};SP={prob_se};'
 * 	fmt+='GP={prob_germline};DP={total_reads};MQ={mean_mapq};BQ={mean_qual}\t'
 */
  __Pyx_INCREF(__pyx_kp_s_chrom_pos_refbase_alt_allele_PA);
  __pyx_v_fmt = __pyx_kp_s_chrom_pos_refbase_alt_allele_PA;

  /* "query_muts.pyx":102
 * 
 * 	fmt = '{chrom}\t{pos}\t.\t{refbase}\t{alt_allele}\t.\tPASS\t'
 * 	fmt+='NS=1;AF={alt_allele_freq};P={pvalue};SP={prob_se};'             # <<<<<<<<<<<<<<
 * 	fmt+='GP={prob_germline};DP={total_reads};MQ={mean_mapq};BQ={mean_qual}\t'
 * 	fmt+='GT:GQ:DP\t1|0:60:{total_reads}\n'
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__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 = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "query_muts.pyx":103
 * 	fmt = '{chrom}\t{pos}\t.\t{refbase}\t{alt_allele}\t.\tPASS\t'
 * 	fmt+='NS=1;AF={alt_allele_freq};P={pvalue};SP={prob_se};'
 * 	fmt+='GP={prob_germline};DP={total_reads};MQ={mean_mapq};BQ={mean_qual}\t'             # <<<<<<<<<<<<<<
 * 	fmt+='GT:GQ:DP\t1|0:60:{total_reads}\n'
 * 
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_fmt, __pyx_kp_s_GP_prob_germline_DP_total_reads); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "query_muts.pyx":104
 * 	fmt+='NS=1;AF={alt_allele_freq};P={pvalue};SP={prob_se};'
 * 	fmt+='GP={prob_germline};DP={total_reads};MQ={mean_mapq};BQ={mean_qual}\t'
 * 	fmt+='GT:GQ:DP\t1|0:60:{total_reads}\n'             # <<<<<<<<<<<<<<
 * 
 * 	possible_muts = read_mutation_bed(muts_fn)
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_fmt, __pyx_kp_s_GT_GQ_DP_1_0_60_total_reads); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_fmt, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "query_muts.pyx":106
 * 	fmt+='GT:GQ:DP\t1|0:60:{total_reads}\n'
 * 
 * 	possible_muts = read_mutation_bed(muts_fn)             # <<<<<<<<<<<<<<
 * 
 * 	out = open(out_fn,'a')
 */
  if (!(likely(PyString_CheckExact(__pyx_v_muts_fn))||((__pyx_v_muts_fn) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_muts_fn)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_f_10query_muts_read_mutation_bed(((PyObject*)__pyx_v_muts_fn)); 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_v_possible_muts = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "query_muts.pyx":108
 * 	possible_muts = read_mutation_bed(muts_fn)
 * 
 * 	out = open(out_fn,'a')             # <<<<<<<<<<<<<<
 * 	samfile = Samfile(samfile_name)
 * 	it = samfile.pileup(reference=None, start=None, end=None,
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_out_fn);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_out_fn);
  __Pyx_GIVEREF(__pyx_v_out_fn);
  __Pyx_INCREF(__pyx_n_s_a);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_a);
  __Pyx_GIVEREF(__pyx_n_s_a);
  __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_out = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "query_muts.pyx":109
 * 
 * 	out = open(out_fn,'a')
 * 	samfile = Samfile(samfile_name)             # <<<<<<<<<<<<<<
 * 	it = samfile.pileup(reference=None, start=None, end=None,
 * 							truncate=False, max_depth=80000)
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_samfile_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_samfile_name);
  __Pyx_GIVEREF(__pyx_v_samfile_name);
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_8csamfile_Samfile)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_samfile = ((struct __pyx_obj_5pysam_8csamfile_Samfile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "query_muts.pyx":110
 * 	out = open(out_fn,'a')
 * 	samfile = Samfile(samfile_name)
 * 	it = samfile.pileup(reference=None, start=None, end=None,             # <<<<<<<<<<<<<<
 * 							truncate=False, max_depth=80000)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_samfile), __pyx_n_s_pileup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_reference, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_start, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_end, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "query_muts.pyx":111
 * 	samfile = Samfile(samfile_name)
 * 	it = samfile.pileup(reference=None, start=None, end=None,
 * 							truncate=False, max_depth=80000)             # <<<<<<<<<<<<<<
 * 
 * 	for col in it:
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_truncate, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "query_muts.pyx":110
 * 	out = open(out_fn,'a')
 * 	samfile = Samfile(samfile_name)
 * 	it = samfile.pileup(reference=None, start=None, end=None,             # <<<<<<<<<<<<<<
 * 							truncate=False, max_depth=80000)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_it = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "query_muts.pyx":113
 * 							truncate=False, max_depth=80000)
 * 
 * 	for col in it:             # <<<<<<<<<<<<<<
 * 		# initialise variables
 * 		n = col.n
 */
  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 = 113; __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 = 113; __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_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __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_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_col, ((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_t_2));
    __pyx_t_2 = 0;

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

    /* "query_muts.pyx":116
 * 		# initialise variables
 * 		n = col.n
 * 		if n >= min_reads:             # <<<<<<<<<<<<<<
 * 			plp = col.plp
 * 			total_baseq = 0.0
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); 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_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_min_reads, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__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_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_7) {

      /* "query_muts.pyx":117
 * 		n = col.n
 * 		if n >= min_reads:
 * 			plp = col.plp             # <<<<<<<<<<<<<<
 * 			total_baseq = 0.0
 * 			_init_count(&A)
 */
      __pyx_t_8 = __pyx_v_col->plp;
      __pyx_v_plp = __pyx_t_8;

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

      /* "query_muts.pyx":119
 * 			plp = col.plp
 * 			total_baseq = 0.0
 * 			_init_count(&A)             # <<<<<<<<<<<<<<
 * 			_init_count(&T)
 * 			_init_count(&G)
 */
      __pyx_t_1 = __pyx_f_10query_muts__init_count((&__pyx_v_A)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "query_muts.pyx":120
 * 			total_baseq = 0.0
 * 			_init_count(&A)
 * 			_init_count(&T)             # <<<<<<<<<<<<<<
 * 			_init_count(&G)
 * 			_init_count(&C)
 */
      __pyx_t_1 = __pyx_f_10query_muts__init_count((&__pyx_v_T)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

      /* "query_muts.pyx":122
 * 			_init_count(&T)
 * 			_init_count(&G)
 * 			_init_count(&C)             # <<<<<<<<<<<<<<
 * 
 * 			# get chromosome name and position
 */
      __pyx_t_1 = __pyx_f_10query_muts__init_count((&__pyx_v_C)); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "query_muts.pyx":125
 * 
 * 			# get chromosome name and position
 * 			chrom = samfile.getrname(col.tid)             # <<<<<<<<<<<<<<
 * 			pos = col.pos + 1
 * 
 */
      __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 = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_col->tid); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_10) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __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 = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 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 = 125; __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;
      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 = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

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

      /* "query_muts.pyx":129
 * 
 * 			# loop over reads, extract what we need
 * 			for i from 0<=i < n:             # <<<<<<<<<<<<<<
 * 				read = &(plp[0][i])
 * 
 */
      __pyx_t_6 = __pyx_v_n;
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {

        /* "query_muts.pyx":130
 * 			# 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_v_read = (&((__pyx_v_plp[0])[__pyx_v_i]));

        /* "query_muts.pyx":132
 * 				read = &(plp[0][i])
 * 
 * 				if read.indel == 0 and read.is_del == False:             # <<<<<<<<<<<<<<
 * 					aln = read.b
 * 					flag = aln.core.flag
 */
        __pyx_t_12 = ((__pyx_v_read->indel == 0) != 0);
        if (__pyx_t_12) {
        } else {
          __pyx_t_7 = __pyx_t_12;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_12 = ((__pyx_v_read->is_del == 0) != 0);
        __pyx_t_7 = __pyx_t_12;
        __pyx_L9_bool_binop_done:;
        if (__pyx_t_7) {

          /* "query_muts.pyx":133
 * 
 * 				if read.indel == 0 and read.is_del == False:
 * 					aln = read.b             # <<<<<<<<<<<<<<
 * 					flag = aln.core.flag
 * 					mapq = aln.core.qual
 */
          __pyx_t_13 = __pyx_v_read->b;
          __pyx_v_aln = __pyx_t_13;

          /* "query_muts.pyx":134
 * 				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_14 = __pyx_v_aln->core.flag;
          __pyx_v_flag = __pyx_t_14;

          /* "query_muts.pyx":135
 * 					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_15 = __pyx_v_aln->core.qual;
          __pyx_v_mapq = __pyx_t_15;

          /* "query_muts.pyx":136
 * 					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_v_is_reverse = ((__pyx_v_flag & 16) != 0);

          /* "query_muts.pyx":137
 * 					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_v_is_proper_pair = ((__pyx_v_flag & 2) != 0);

          /* "query_muts.pyx":138
 * 					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_1 = __pyx_f_10query_muts__get_seq_base(__pyx_v_aln, __pyx_v_read->qpos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          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 = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_XDECREF_SET(__pyx_v_alnbase, ((PyObject*)__pyx_t_1));
          __pyx_t_1 = 0;

          /* "query_muts.pyx":139
 * 					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_v_baseq = (pysam_bam_get_qual(__pyx_v_aln)[__pyx_v_read->qpos]);

          /* "query_muts.pyx":140
 * 					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_v_total_baseq = (__pyx_v_total_baseq + pow(10.0, ((-__pyx_v_baseq) / 10.0)));

          /* "query_muts.pyx":142
 * 					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_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_mapq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_min_mapq, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_12) {
          } else {
            __pyx_t_7 = __pyx_t_12;
            goto __pyx_L12_bool_binop_done;
          }
          __pyx_t_2 = PyFloat_FromDouble(__pyx_v_baseq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_min_baseq, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_12) {
          } else {
            __pyx_t_7 = __pyx_t_12;
            goto __pyx_L12_bool_binop_done;
          }
          __pyx_t_12 = (__pyx_v_is_proper_pair != 0);
          __pyx_t_7 = __pyx_t_12;
          __pyx_L12_bool_binop_done:;
          if (__pyx_t_7) {

            /* "query_muts.pyx":143
 * 
 * 					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_7 = (__Pyx_PyBytes_Equals(__pyx_v_alnbase, __pyx_n_b_A, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_12 = (__pyx_t_7 != 0);
            if (__pyx_t_12) {

              /* "query_muts.pyx":144
 * 					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_1 = __pyx_f_10query_muts__incr_count((&__pyx_v_A), __pyx_v_is_reverse, __pyx_v_baseq, __pyx_v_mapq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              goto __pyx_L15;
            }

            /* "query_muts.pyx":145
 * 						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_12 = (__Pyx_PyBytes_Equals(__pyx_v_alnbase, __pyx_n_b_T, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_7 = (__pyx_t_12 != 0);
            if (__pyx_t_7) {

              /* "query_muts.pyx":146
 * 							_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_1 = __pyx_f_10query_muts__incr_count((&__pyx_v_T), __pyx_v_is_reverse, __pyx_v_baseq, __pyx_v_mapq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              goto __pyx_L15;
            }

            /* "query_muts.pyx":147
 * 						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_7 = (__Pyx_PyBytes_Equals(__pyx_v_alnbase, __pyx_n_b_G, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_12 = (__pyx_t_7 != 0);
            if (__pyx_t_12) {

              /* "query_muts.pyx":148
 * 							_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_1 = __pyx_f_10query_muts__incr_count((&__pyx_v_G), __pyx_v_is_reverse, __pyx_v_baseq, __pyx_v_mapq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              goto __pyx_L15;
            }

            /* "query_muts.pyx":149
 * 						elif alnbase == b'G':
 * 							_incr_count(&G, is_reverse, baseq, mapq)
 * 						elif alnbase == b'C':             # <<<<<<<<<<<<<<
 * 							_incr_count(&C, is_reverse, baseq, mapq)
 * 			#determine if more than 1 allele is observed
 */
            __pyx_t_12 = (__Pyx_PyBytes_Equals(__pyx_v_alnbase, __pyx_n_b_C, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_7 = (__pyx_t_12 != 0);
            if (__pyx_t_7) {

              /* "query_muts.pyx":150
 * 							_incr_count(&G, is_reverse, baseq, mapq)
 * 						elif alnbase == b'C':
 * 							_incr_count(&C, is_reverse, baseq, mapq)             # <<<<<<<<<<<<<<
 * 			#determine if more than 1 allele is observed
 * 			if A.pres+T.pres+G.pres+C.pres > 1:
 */
              __pyx_t_1 = __pyx_f_10query_muts__incr_count((&__pyx_v_C), __pyx_v_is_reverse, __pyx_v_baseq, __pyx_v_mapq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              goto __pyx_L15;
            }
            __pyx_L15:;
            goto __pyx_L11;
          }
          __pyx_L11:;
          goto __pyx_L8;
        }
        __pyx_L8:;
      }

      /* "query_muts.pyx":152
 * 							_incr_count(&C, is_reverse, baseq, mapq)
 * 			#determine if more than 1 allele is observed
 * 			if A.pres+T.pres+G.pres+C.pres > 1:             # <<<<<<<<<<<<<<
 * 				total_reads = float(A.count+T.count+C.count+G.count)
 * 				#check if position is in possible mutations
 */
      __pyx_t_7 = (((((__pyx_v_A.pres + __pyx_v_T.pres) + __pyx_v_G.pres) + __pyx_v_C.pres) > 1) != 0);
      if (__pyx_t_7) {

        /* "query_muts.pyx":153
 * 			#determine if more than 1 allele is observed
 * 			if A.pres+T.pres+G.pres+C.pres > 1:
 * 				total_reads = float(A.count+T.count+C.count+G.count)             # <<<<<<<<<<<<<<
 * 				#check if position is in possible mutations
 * 				try:
 */
        __pyx_v_total_reads = ((double)(((__pyx_v_A.count + __pyx_v_T.count) + __pyx_v_C.count) + __pyx_v_G.count));

        /* "query_muts.pyx":155
 * 				total_reads = float(A.count+T.count+C.count+G.count)
 * 				#check if position is in possible mutations
 * 				try:             # <<<<<<<<<<<<<<
 * 					possible_muts[(chrom, pos)]
 * 					#check if there is more than one mutation present
 */
        {
          __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          /*try:*/ {

            /* "query_muts.pyx":156
 * 				#check if position is in possible mutations
 * 				try:
 * 					possible_muts[(chrom, pos)]             # <<<<<<<<<<<<<<
 * 					#check if there is more than one mutation present
 * 					if len(possible_muts[(chrom, pos)][1]) > 1:
 */
            if (unlikely(__pyx_v_possible_muts == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L17_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);
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_possible_muts, __pyx_t_2); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "query_muts.pyx":158
 * 					possible_muts[(chrom, pos)]
 * 					#check if there is more than one mutation present
 * 					if len(possible_muts[(chrom, pos)][1]) > 1:             # <<<<<<<<<<<<<<
 * 						possible_mut = possible_muts[(chrom, pos)][1].split(',')
 * 						alt_mut = eval(possible_mut[0])
 */
            if (unlikely(__pyx_v_possible_muts == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L17_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);
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_possible_muts, __pyx_t_2); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_19 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_7 = ((__pyx_t_19 > 1) != 0);
            if (__pyx_t_7) {

              /* "query_muts.pyx":159
 * 					#check if there is more than one mutation present
 * 					if len(possible_muts[(chrom, pos)][1]) > 1:
 * 						possible_mut = possible_muts[(chrom, pos)][1].split(',')             # <<<<<<<<<<<<<<
 * 						alt_mut = eval(possible_mut[0])
 * 						alt_allele = possible_mut[0]
 */
              if (unlikely(__pyx_v_possible_muts == Py_None)) {
                PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_INCREF(__pyx_v_chrom);
              PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
              __Pyx_GIVEREF(__pyx_v_chrom);
              PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_possible_muts, __pyx_t_1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L17_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 = 159; __pyx_clineno = __LINE__; goto __pyx_L17_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__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF_SET(__pyx_v_possible_mut, __pyx_t_1);
              __pyx_t_1 = 0;

              /* "query_muts.pyx":160
 * 					if len(possible_muts[(chrom, pos)][1]) > 1:
 * 						possible_mut = possible_muts[(chrom, pos)][1].split(',')
 * 						alt_mut = eval(possible_mut[0])             # <<<<<<<<<<<<<<
 * 						alt_allele = possible_mut[0]
 * 						for i in xrange(1, len(possible_mut)):
 */
              __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_possible_mut, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_9 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_A); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_A, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_C); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_C, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_G); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_G, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_T); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_T, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_alnbase) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_alnbase, __pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_alt_allele) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_alt_allele, __pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_alt_allele_freq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_alt_mut); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_alt_mut, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_baseq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_baseq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_chrom) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_chrom, __pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (((PyObject *)__pyx_v_col)) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_col, ((PyObject *)__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_current_pos); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_current_pos, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_delta, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_flag, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_fmt) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_fmt, __pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_forward); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_forward, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_fwd_ratio, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_i, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_in_germline); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_in_germline, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_is_proper_pair, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_is_reverse); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_is_reverse, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_it) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_it, __pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = __Pyx_PyInt_From_uint8_t(__pyx_v_mapq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_mapq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_mean_mapq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_mean_mapq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_mean_qual); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_mean_qual, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_min_baseq) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_min_baseq, __pyx_v_min_baseq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_min_mapq) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_min_mapq, __pyx_v_min_mapq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_min_reads) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_min_reads, __pyx_v_min_reads) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_min_support) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_min_support, __pyx_v_min_support) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_muts_fn) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_muts_fn, __pyx_v_muts_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_n, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_out) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_out, __pyx_v_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_out_fn) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_out_fn, __pyx_v_out_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_pos, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_possible_mut) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_possible_mut, __pyx_v_possible_mut) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_possible_muts) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_possible_muts, __pyx_v_possible_muts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_prob_germline) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_prob_germline, __pyx_v_prob_germline) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_prob_se); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_prob_se, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_pvalue) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_pvalue, __pyx_v_pvalue) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_refbase) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_refbase, __pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_reverse); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_reverse, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_rvs_ratio, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (((PyObject *)__pyx_v_samfile)) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_samfile, ((PyObject *)__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_samfile_name) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_samfile_name, __pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_seen_chroms) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_seen_chroms, __pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_total_alleles); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_total_alleles, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_total_baseq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_total_baseq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_total_reads); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_total_reads, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_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 = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_1);
              PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_11);
              __pyx_t_1 = 0;
              __pyx_t_2 = 0;
              __pyx_t_11 = 0;
              __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_20 = __pyx_convert__from_py___pyx_t_10query_muts__CountAllele(__pyx_t_11); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              __pyx_v_alt_mut = __pyx_t_20;

              /* "query_muts.pyx":161
 * 						possible_mut = possible_muts[(chrom, pos)][1].split(',')
 * 						alt_mut = eval(possible_mut[0])
 * 						alt_allele = possible_mut[0]             # <<<<<<<<<<<<<<
 * 						for i in xrange(1, len(possible_mut)):
 * 							if eval(possible_mut[i])['count'] > alt_mut.count:
 */
              __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_possible_mut, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
              __Pyx_GOTREF(__pyx_t_11);
              if (!(likely(PyString_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_11)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_XDECREF_SET(__pyx_v_alt_allele, ((PyObject*)__pyx_t_11));
              __pyx_t_11 = 0;

              /* "query_muts.pyx":162
 * 						alt_mut = eval(possible_mut[0])
 * 						alt_allele = possible_mut[0]
 * 						for i in xrange(1, len(possible_mut)):             # <<<<<<<<<<<<<<
 * 							if eval(possible_mut[i])['count'] > alt_mut.count:
 * 								alt_mut = eval(possible_mut[i])
 */
              __pyx_t_19 = PyObject_Length(__pyx_v_possible_mut); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_19; __pyx_t_6+=1) {
                __pyx_v_i = __pyx_t_6;

                /* "query_muts.pyx":163
 * 						alt_allele = possible_mut[0]
 * 						for i in xrange(1, len(possible_mut)):
 * 							if eval(possible_mut[i])['count'] > alt_mut.count:             # <<<<<<<<<<<<<<
 * 								alt_mut = eval(possible_mut[i])
 * 								alt_allele = possible_mut[i]
 */
                __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_possible_mut, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
                __Pyx_GOTREF(__pyx_t_11);
                __pyx_t_9 = __Pyx_Globals(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_9);
                __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_1 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_A); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_A, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_C); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_C, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_G); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_G, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_T); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_T, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_v_alnbase) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alnbase, __pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_alt_allele) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alt_allele, __pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alt_allele_freq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_alt_mut); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alt_mut, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_baseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_baseq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_v_chrom) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chrom, __pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (((PyObject *)__pyx_v_col)) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_col, ((PyObject *)__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_current_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_current_pos, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_delta, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_flag, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_v_fmt) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fmt, __pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_forward); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_forward, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fwd_ratio, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_i, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_in_germline); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_in_germline, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_proper_pair, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_is_reverse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_reverse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_v_it) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_it, __pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_mapq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mapq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_mean_mapq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mean_mapq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_mean_qual); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mean_qual, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_v_min_baseq) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_baseq, __pyx_v_min_baseq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_min_mapq) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_mapq, __pyx_v_min_mapq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_min_reads) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_reads, __pyx_v_min_reads) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_min_support) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_support, __pyx_v_min_support) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_muts_fn) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_muts_fn, __pyx_v_muts_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_n, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_v_out) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_out, __pyx_v_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_out_fn) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_out_fn, __pyx_v_out_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pos, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_v_possible_mut) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_possible_mut, __pyx_v_possible_mut) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_possible_muts) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_possible_muts, __pyx_v_possible_muts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_prob_germline) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_prob_germline, __pyx_v_prob_germline) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_prob_se); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_prob_se, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_v_pvalue) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pvalue, __pyx_v_pvalue) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_refbase) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_refbase, __pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_reverse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_reverse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rvs_ratio, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (((PyObject *)__pyx_v_samfile)) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_samfile, ((PyObject *)__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_samfile_name) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_samfile_name, __pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_seen_chroms) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seen_chroms, __pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_total_alleles); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_total_alleles, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_total_baseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_total_baseq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_v_total_reads); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_total_reads, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_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 = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
                __Pyx_GIVEREF(__pyx_t_11);
                PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9);
                __Pyx_GIVEREF(__pyx_t_9);
                PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
                __Pyx_GIVEREF(__pyx_t_2);
                __pyx_t_11 = 0;
                __pyx_t_9 = 0;
                __pyx_t_2 = 0;
                __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_count); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_alt_mut.count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_t_7) {

                  /* "query_muts.pyx":164
 * 						for i in xrange(1, len(possible_mut)):
 * 							if eval(possible_mut[i])['count'] > alt_mut.count:
 * 								alt_mut = eval(possible_mut[i])             # <<<<<<<<<<<<<<
 * 								alt_allele = possible_mut[i]
 * 					else:
 */
                  __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_possible_mut, __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 = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
                  __Pyx_GOTREF(__pyx_t_9);
                  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_11 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_A); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_A, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_C); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_C, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_G); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_G, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_T); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_T, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (__pyx_v_alnbase) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alnbase, __pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (__pyx_v_alt_allele) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_allele, __pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_allele_freq, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_alt_mut); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_mut, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_baseq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_baseq, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (__pyx_v_chrom) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom, __pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (((PyObject *)__pyx_v_col)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_col, ((PyObject *)__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_current_pos); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_current_pos, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_delta, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_flag, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (__pyx_v_fmt) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fmt, __pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_forward); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_forward, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fwd_ratio, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_in_germline); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_in_germline, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_proper_pair, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_is_reverse); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_reverse, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (__pyx_v_it) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_it, __pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __pyx_t_11 = __Pyx_PyInt_From_uint8_t(__pyx_v_mapq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mapq, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_mean_mapq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mean_mapq, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_mean_qual); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mean_qual, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (__pyx_v_min_baseq) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_baseq, __pyx_v_min_baseq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (__pyx_v_min_mapq) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_mapq, __pyx_v_min_mapq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (__pyx_v_min_reads) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_reads, __pyx_v_min_reads) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (__pyx_v_min_support) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_support, __pyx_v_min_support) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (__pyx_v_muts_fn) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_muts_fn, __pyx_v_muts_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_n, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (__pyx_v_out) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_out, __pyx_v_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (__pyx_v_out_fn) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_out_fn, __pyx_v_out_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pos, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (__pyx_v_possible_mut) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_possible_mut, __pyx_v_possible_mut) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (__pyx_v_possible_muts) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_possible_muts, __pyx_v_possible_muts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (__pyx_v_prob_germline) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prob_germline, __pyx_v_prob_germline) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_prob_se); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prob_se, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (__pyx_v_pvalue) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pvalue, __pyx_v_pvalue) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (__pyx_v_refbase) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_refbase, __pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_reverse); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_reverse, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rvs_ratio, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (((PyObject *)__pyx_v_samfile)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_samfile, ((PyObject *)__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (__pyx_v_samfile_name) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_samfile_name, __pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  if (__pyx_v_seen_chroms) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seen_chroms, __pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_total_alleles); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_alleles, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_total_baseq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_baseq, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_total_reads); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  if (__pyx_t_11) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_reads, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  }
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_11);
                  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
                  __Pyx_GIVEREF(__pyx_t_9);
                  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2);
                  __Pyx_GIVEREF(__pyx_t_2);
                  PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_1);
                  __Pyx_GIVEREF(__pyx_t_1);
                  __pyx_t_9 = 0;
                  __pyx_t_2 = 0;
                  __pyx_t_1 = 0;
                  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __pyx_t_20 = __pyx_convert__from_py___pyx_t_10query_muts__CountAllele(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __pyx_v_alt_mut = __pyx_t_20;

                  /* "query_muts.pyx":165
 * 							if eval(possible_mut[i])['count'] > alt_mut.count:
 * 								alt_mut = eval(possible_mut[i])
 * 								alt_allele = possible_mut[i]             # <<<<<<<<<<<<<<
 * 					else:
 * 						alt_mut = eval(possible_muts[(chrom, pos)][1])
 */
                  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_possible_mut, __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 = 165; __pyx_clineno = __LINE__; goto __pyx_L17_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 = 165; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_DECREF_SET(__pyx_v_alt_allele, ((PyObject*)__pyx_t_1));
                  __pyx_t_1 = 0;
                  goto __pyx_L28;
                }
                __pyx_L28:;
              }
              goto __pyx_L25;
            }
            /*else*/ {

              /* "query_muts.pyx":167
 * 								alt_allele = possible_mut[i]
 * 					else:
 * 						alt_mut = eval(possible_muts[(chrom, pos)][1])             # <<<<<<<<<<<<<<
 * 						alt_allele = possible_muts[(chrom, pos)][1]
 * 
 */
              if (unlikely(__pyx_v_possible_muts == Py_None)) {
                PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_INCREF(__pyx_v_chrom);
              PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_chrom);
              __Pyx_GIVEREF(__pyx_v_chrom);
              PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_1);
              __pyx_t_1 = 0;
              __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_possible_muts, __pyx_t_11); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_9 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_A); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_A, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_C); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_C, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_G); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_G, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_T); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_T, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_alnbase) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alnbase, __pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_alt_allele) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alt_allele, __pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alt_allele_freq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_alt_mut); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alt_mut, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_baseq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_baseq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_chrom) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chrom, __pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (((PyObject *)__pyx_v_col)) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_col, ((PyObject *)__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_current_pos); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_current_pos, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_delta, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_flag, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_fmt) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fmt, __pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_forward); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_forward, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fwd_ratio, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_i, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_in_germline); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_in_germline, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_proper_pair, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_is_reverse); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_reverse, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_it) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_it, __pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = __Pyx_PyInt_From_uint8_t(__pyx_v_mapq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mapq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_mean_mapq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mean_mapq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_mean_qual); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mean_qual, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_min_baseq) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_baseq, __pyx_v_min_baseq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_min_mapq) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_mapq, __pyx_v_min_mapq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_min_reads) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_reads, __pyx_v_min_reads) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_min_support) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_support, __pyx_v_min_support) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_muts_fn) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_muts_fn, __pyx_v_muts_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_n, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_out) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_out, __pyx_v_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_out_fn) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_out_fn, __pyx_v_out_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pos, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_possible_mut) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_possible_mut, __pyx_v_possible_mut) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_possible_muts) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_possible_muts, __pyx_v_possible_muts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_prob_germline) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_prob_germline, __pyx_v_prob_germline) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_prob_se); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_prob_se, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (__pyx_v_pvalue) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pvalue, __pyx_v_pvalue) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_refbase) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_refbase, __pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_reverse); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_reverse, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rvs_ratio, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (((PyObject *)__pyx_v_samfile)) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_samfile, ((PyObject *)__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_samfile_name) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_samfile_name, __pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              if (__pyx_v_seen_chroms) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seen_chroms, __pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_total_alleles); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_total_alleles, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_total_baseq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_total_baseq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = PyFloat_FromDouble(__pyx_v_total_reads); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_9) {
                if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_total_reads, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_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 = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_1);
              PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_11 = 0;
              __pyx_t_1 = 0;
              __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_20 = __pyx_convert__from_py___pyx_t_10query_muts__CountAllele(__pyx_t_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_v_alt_mut = __pyx_t_20;

              /* "query_muts.pyx":168
 * 					else:
 * 						alt_mut = eval(possible_muts[(chrom, pos)][1])
 * 						alt_allele = possible_muts[(chrom, pos)][1]             # <<<<<<<<<<<<<<
 * 
 * 					if eval(possible_muts[(chrom, pos)][0])['count'] > 0 and alt_mut.count > 0:
 */
              if (unlikely(__pyx_v_possible_muts == Py_None)) {
                PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_INCREF(__pyx_v_chrom);
              PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_chrom);
              __Pyx_GIVEREF(__pyx_v_chrom);
              PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_possible_muts, __pyx_t_9); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (!(likely(PyString_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_9)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_XDECREF_SET(__pyx_v_alt_allele, ((PyObject*)__pyx_t_9));
              __pyx_t_9 = 0;
            }
            __pyx_L25:;

            /* "query_muts.pyx":170
 * 						alt_allele = possible_muts[(chrom, pos)][1]
 * 
 * 					if eval(possible_muts[(chrom, pos)][0])['count'] > 0 and alt_mut.count > 0:             # <<<<<<<<<<<<<<
 * 
 * 						if alt_mut.count >= min_support:
 */
            if (unlikely(__pyx_v_possible_muts == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_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);
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_9);
            __pyx_t_9 = 0;
            __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_possible_muts, __pyx_t_2); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_t_9 = __Pyx_Globals(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_11 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_A); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_A, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_C); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_C, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_G); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_G, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_T); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_T, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_v_alnbase) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alnbase, __pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (__pyx_v_alt_allele) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_allele, __pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_allele_freq, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_alt_mut); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_mut, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_baseq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_baseq, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_v_chrom) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom, __pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (((PyObject *)__pyx_v_col)) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_col, ((PyObject *)__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_current_pos); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_current_pos, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_delta, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_flag, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_v_fmt) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fmt, __pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_forward); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_forward, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fwd_ratio, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_in_germline); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_in_germline, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_proper_pair, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_is_reverse); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_reverse, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_v_it) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_it, __pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_11 = __Pyx_PyInt_From_uint8_t(__pyx_v_mapq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mapq, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_mean_mapq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mean_mapq, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_mean_qual); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mean_qual, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_v_min_baseq) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_baseq, __pyx_v_min_baseq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (__pyx_v_min_mapq) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_mapq, __pyx_v_min_mapq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (__pyx_v_min_reads) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_reads, __pyx_v_min_reads) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (__pyx_v_min_support) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_support, __pyx_v_min_support) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (__pyx_v_muts_fn) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_muts_fn, __pyx_v_muts_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_n, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_v_out) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_out, __pyx_v_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (__pyx_v_out_fn) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_out_fn, __pyx_v_out_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pos, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_v_possible_mut) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_possible_mut, __pyx_v_possible_mut) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (__pyx_v_possible_muts) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_possible_muts, __pyx_v_possible_muts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (__pyx_v_prob_germline) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prob_germline, __pyx_v_prob_germline) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_prob_se); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prob_se, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_v_pvalue) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pvalue, __pyx_v_pvalue) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (__pyx_v_refbase) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_refbase, __pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_reverse); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_reverse, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rvs_ratio, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (((PyObject *)__pyx_v_samfile)) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_samfile, ((PyObject *)__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (__pyx_v_samfile_name) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_samfile_name, __pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            if (__pyx_v_seen_chroms) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seen_chroms, __pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_total_alleles); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_alleles, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_total_baseq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_baseq, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyFloat_FromDouble(__pyx_v_total_reads); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_11) {
              if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_reads, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_9);
            PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            __pyx_t_2 = 0;
            __pyx_t_9 = 0;
            __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_count); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_12) {
            } else {
              __pyx_t_7 = __pyx_t_12;
              goto __pyx_L30_bool_binop_done;
            }
            __pyx_t_12 = ((__pyx_v_alt_mut.count > 0) != 0);
            __pyx_t_7 = __pyx_t_12;
            __pyx_L30_bool_binop_done:;
            if (__pyx_t_7) {

              /* "query_muts.pyx":172
 * 					if eval(possible_muts[(chrom, pos)][0])['count'] > 0 and alt_mut.count > 0:
 * 
 * 						if alt_mut.count >= min_support:             # <<<<<<<<<<<<<<
 * 							mean_mapq = alt_mut.mapqual / float(alt_mut.count)
 * 							mean_qual = alt_mut.qual / alt_mut.count
 */
              __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_alt_mut.count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_11 = PyObject_RichCompare(__pyx_t_1, __pyx_v_min_support, Py_GE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (__pyx_t_7) {

                /* "query_muts.pyx":173
 * 
 * 						if alt_mut.count >= min_support:
 * 							mean_mapq = alt_mut.mapqual / float(alt_mut.count)             # <<<<<<<<<<<<<<
 * 							mean_qual = alt_mut.qual / alt_mut.count
 * 							fwd_ratio = alt_mut.fwd / float(alt_mut.fwd+alt_mut.rev)
 */
                if (unlikely(((double)__pyx_v_alt_mut.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 = 173; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_v_mean_mapq = (__pyx_v_alt_mut.mapqual / ((double)__pyx_v_alt_mut.count));

                /* "query_muts.pyx":174
 * 						if alt_mut.count >= min_support:
 * 							mean_mapq = alt_mut.mapqual / float(alt_mut.count)
 * 							mean_qual = alt_mut.qual / alt_mut.count             # <<<<<<<<<<<<<<
 * 							fwd_ratio = alt_mut.fwd / float(alt_mut.fwd+alt_mut.rev)
 * 							rvs_ratio = alt_mut.rev / float(alt_mut.fwd+alt_mut.rev)
 */
                if (unlikely(__pyx_v_alt_mut.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 = 174; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_v_mean_qual = (__pyx_v_alt_mut.qual / __pyx_v_alt_mut.count);

                /* "query_muts.pyx":175
 * 							mean_mapq = alt_mut.mapqual / float(alt_mut.count)
 * 							mean_qual = alt_mut.qual / alt_mut.count
 * 							fwd_ratio = alt_mut.fwd / float(alt_mut.fwd+alt_mut.rev)             # <<<<<<<<<<<<<<
 * 							rvs_ratio = alt_mut.rev / float(alt_mut.fwd+alt_mut.rev)
 * 							total_baseq = fmax(1e-25,total_baseq)
 */
                if (unlikely(((double)(__pyx_v_alt_mut.fwd + __pyx_v_alt_mut.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 = 175; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_v_fwd_ratio = (__pyx_v_alt_mut.fwd / ((double)(__pyx_v_alt_mut.fwd + __pyx_v_alt_mut.rev)));

                /* "query_muts.pyx":176
 * 							mean_qual = alt_mut.qual / alt_mut.count
 * 							fwd_ratio = alt_mut.fwd / float(alt_mut.fwd+alt_mut.rev)
 * 							rvs_ratio = alt_mut.rev / float(alt_mut.fwd+alt_mut.rev)             # <<<<<<<<<<<<<<
 * 							total_baseq = fmax(1e-25,total_baseq)
 * 							delta = (alt_mut.count/total_baseq) - 1
 */
                if (unlikely(((double)(__pyx_v_alt_mut.fwd + __pyx_v_alt_mut.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 = 176; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_v_rvs_ratio = (__pyx_v_alt_mut.rev / ((double)(__pyx_v_alt_mut.fwd + __pyx_v_alt_mut.rev)));

                /* "query_muts.pyx":177
 * 							fwd_ratio = alt_mut.fwd / float(alt_mut.fwd+alt_mut.rev)
 * 							rvs_ratio = alt_mut.rev / float(alt_mut.fwd+alt_mut.rev)
 * 							total_baseq = fmax(1e-25,total_baseq)             # <<<<<<<<<<<<<<
 * 							delta = (alt_mut.count/total_baseq) - 1
 * 							prob_se = chernoff(total_baseq, delta)
 */
                __pyx_v_total_baseq = fmax(1e-25, __pyx_v_total_baseq);

                /* "query_muts.pyx":178
 * 							rvs_ratio = alt_mut.rev / float(alt_mut.fwd+alt_mut.rev)
 * 							total_baseq = fmax(1e-25,total_baseq)
 * 							delta = (alt_mut.count/total_baseq) - 1             # <<<<<<<<<<<<<<
 * 							prob_se = chernoff(total_baseq, delta)
 * 							refbase = possible_muts[(chrom,pos)][0]
 */
                if (unlikely(__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 = 178; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_v_delta = ((__pyx_v_alt_mut.count / __pyx_v_total_baseq) - 1.0);

                /* "query_muts.pyx":179
 * 							total_baseq = fmax(1e-25,total_baseq)
 * 							delta = (alt_mut.count/total_baseq) - 1
 * 							prob_se = chernoff(total_baseq, delta)             # <<<<<<<<<<<<<<
 * 							refbase = possible_muts[(chrom,pos)][0]
 * 							alt_allele_freq = alt_mut.count / total_reads
 */
                __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_chernoff); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_9 = PyFloat_FromDouble(__pyx_v_total_baseq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_9);
                __pyx_t_2 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_10 = NULL;
                __pyx_t_19 = 0;
                if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
                  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
                  if (likely(__pyx_t_10)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                    __Pyx_INCREF(__pyx_t_10);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_1, function);
                    __pyx_t_19 = 1;
                  }
                }
                __pyx_t_21 = PyTuple_New(2+__pyx_t_19); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_21);
                if (__pyx_t_10) {
                  PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
                }
                PyTuple_SET_ITEM(__pyx_t_21, 0+__pyx_t_19, __pyx_t_9);
                __Pyx_GIVEREF(__pyx_t_9);
                PyTuple_SET_ITEM(__pyx_t_21, 1+__pyx_t_19, __pyx_t_2);
                __Pyx_GIVEREF(__pyx_t_2);
                __pyx_t_9 = 0;
                __pyx_t_2 = 0;
                __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_21, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_11);
                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_22 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                __pyx_v_prob_se = __pyx_t_22;

                /* "query_muts.pyx":180
 * 							delta = (alt_mut.count/total_baseq) - 1
 * 							prob_se = chernoff(total_baseq, delta)
 * 							refbase = possible_muts[(chrom,pos)][0]             # <<<<<<<<<<<<<<
 * 							alt_allele_freq = alt_mut.count / total_reads
 * 							if alt_allele_freq <= 0.4:
 */
                if (unlikely(__pyx_v_possible_muts == Py_None)) {
                  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_11);
                __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_INCREF(__pyx_v_chrom);
                PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
                __Pyx_GIVEREF(__pyx_v_chrom);
                PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_11);
                __Pyx_GIVEREF(__pyx_t_11);
                __pyx_t_11 = 0;
                __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_possible_muts, __pyx_t_1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
                __Pyx_GOTREF(__pyx_t_11);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_XDECREF_SET(__pyx_v_refbase, __pyx_t_1);
                __pyx_t_1 = 0;

                /* "query_muts.pyx":181
 * 							prob_se = chernoff(total_baseq, delta)
 * 							refbase = possible_muts[(chrom,pos)][0]
 * 							alt_allele_freq = alt_mut.count / total_reads             # <<<<<<<<<<<<<<
 * 							if alt_allele_freq <= 0.4:
 * 								prob_germline = 'SOMATIC/AMBIGUOUS'
 */
                if (unlikely(__pyx_v_total_reads == 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 = 181; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_v_alt_allele_freq = (__pyx_v_alt_mut.count / __pyx_v_total_reads);

                /* "query_muts.pyx":182
 * 							refbase = possible_muts[(chrom,pos)][0]
 * 							alt_allele_freq = alt_mut.count / total_reads
 * 							if alt_allele_freq <= 0.4:             # <<<<<<<<<<<<<<
 * 								prob_germline = 'SOMATIC/AMBIGUOUS'
 * 							else:
 */
                __pyx_t_7 = ((__pyx_v_alt_allele_freq <= 0.4) != 0);
                if (__pyx_t_7) {

                  /* "query_muts.pyx":183
 * 							alt_allele_freq = alt_mut.count / total_reads
 * 							if alt_allele_freq <= 0.4:
 * 								prob_germline = 'SOMATIC/AMBIGUOUS'             # <<<<<<<<<<<<<<
 * 							else:
 * 								prob_germline = 'GERMLINE/AMBIGUOUS'
 */
                  __Pyx_INCREF(__pyx_kp_s_SOMATIC_AMBIGUOUS);
                  __Pyx_XDECREF_SET(__pyx_v_prob_germline, __pyx_kp_s_SOMATIC_AMBIGUOUS);
                  goto __pyx_L33;
                }
                /*else*/ {

                  /* "query_muts.pyx":185
 * 								prob_germline = 'SOMATIC/AMBIGUOUS'
 * 							else:
 * 								prob_germline = 'GERMLINE/AMBIGUOUS'             # <<<<<<<<<<<<<<
 * 							pvalue = 'nan'
 * 
 */
                  __Pyx_INCREF(__pyx_kp_s_GERMLINE_AMBIGUOUS);
                  __Pyx_XDECREF_SET(__pyx_v_prob_germline, __pyx_kp_s_GERMLINE_AMBIGUOUS);
                }
                __pyx_L33:;

                /* "query_muts.pyx":186
 * 							else:
 * 								prob_germline = 'GERMLINE/AMBIGUOUS'
 * 							pvalue = 'nan'             # <<<<<<<<<<<<<<
 * 
 * 							out.write(fmt.format(**locals()))
 */
                __Pyx_INCREF(__pyx_n_s_nan);
                __Pyx_XDECREF_SET(__pyx_v_pvalue, __pyx_n_s_nan);

                /* "query_muts.pyx":188
 * 							pvalue = 'nan'
 * 
 * 							out.write(fmt.format(**locals()))             # <<<<<<<<<<<<<<
 * 
 * 				except KeyError:
 */
                __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_11);
                __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_format); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_21);
                __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_9);
                __pyx_t_10 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_A); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_A, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_C); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_C, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_G); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_G, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_T); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_T, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (__pyx_v_alnbase) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_alnbase, __pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_alt_allele) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_alt_allele, __pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_alt_allele_freq, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = __pyx_convert__to_py___pyx_t_10query_muts__CountAllele(__pyx_v_alt_mut); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_alt_mut, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_baseq); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_baseq, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (__pyx_v_chrom) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_chrom, __pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (((PyObject *)__pyx_v_col)) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_col, ((PyObject *)__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_current_pos); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_current_pos, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_delta, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_flag, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (__pyx_v_fmt) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_fmt, __pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_forward); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_forward, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_fwd_ratio, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_i, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_in_germline); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_in_germline, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_is_proper_pair, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_is_reverse); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_is_reverse, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (__pyx_v_it) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_it, __pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_10 = __Pyx_PyInt_From_uint8_t(__pyx_v_mapq); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_mapq, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_mean_mapq); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_mean_mapq, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_mean_qual); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_mean_qual, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (__pyx_v_min_baseq) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_min_baseq, __pyx_v_min_baseq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_min_mapq) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_min_mapq, __pyx_v_min_mapq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_min_reads) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_min_reads, __pyx_v_min_reads) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_min_support) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_min_support, __pyx_v_min_support) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_muts_fn) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_muts_fn, __pyx_v_muts_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_n, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (__pyx_v_out) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_out, __pyx_v_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_out_fn) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_out_fn, __pyx_v_out_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_pos, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (__pyx_v_possible_mut) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_possible_mut, __pyx_v_possible_mut) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_possible_muts) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_possible_muts, __pyx_v_possible_muts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_prob_germline) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_prob_germline, __pyx_v_prob_germline) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_prob_se); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_prob_se, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (__pyx_v_pvalue) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_pvalue, __pyx_v_pvalue) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_refbase) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_refbase, __pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_reverse); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_reverse, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_rvs_ratio, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (((PyObject *)__pyx_v_samfile)) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_samfile, ((PyObject *)__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_samfile_name) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_samfile_name, __pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                if (__pyx_v_seen_chroms) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_seen_chroms, __pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_total_alleles); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_total_alleles, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_total_baseq); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_total_baseq, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = PyFloat_FromDouble(__pyx_v_total_reads); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_10);
                if (__pyx_t_10) {
                  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_total_reads, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_2 = __pyx_t_9;
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_9);
                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __pyx_t_2 = NULL;
                if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
                  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
                  if (likely(__pyx_t_2)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
                    __Pyx_INCREF(__pyx_t_2);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_11, function);
                  }
                }
                if (!__pyx_t_2) {
                  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  __Pyx_GOTREF(__pyx_t_1);
                } else {
                  __pyx_t_21 = PyTuple_New(1+1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_21);
                  PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
                  PyTuple_SET_ITEM(__pyx_t_21, 0+1, __pyx_t_9);
                  __Pyx_GIVEREF(__pyx_t_9);
                  __pyx_t_9 = 0;
                  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_21, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                }
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                goto __pyx_L32;
              }
              __pyx_L32:;
              goto __pyx_L29;
            }
            __pyx_L29:;
          }
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          goto __pyx_L24_try_end;
          __pyx_L17_error:;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "query_muts.pyx":190
 * 							out.write(fmt.format(**locals()))
 * 
 * 				except KeyError:             # <<<<<<<<<<<<<<
 * 					pass
 * 
 */
          __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
          if (__pyx_t_6) {
            PyErr_Restore(0,0,0);
            goto __pyx_L18_exception_handled;
          }
          goto __pyx_L19_except_error;
          __pyx_L19_except_error:;
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          goto __pyx_L1_error;
          __pyx_L18_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_L24_try_end:;
        }
        goto __pyx_L16;
      }
      __pyx_L16:;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "query_muts.pyx":113
 * 							truncate=False, max_depth=80000)
 * 
 * 	for col in it:             # <<<<<<<<<<<<<<
 * 		# initialise variables
 * 		n = col.n
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "query_muts.pyx":193
 * 					pass
 * 
 * 	out.close()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_11) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __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;

  /* "query_muts.pyx":67
 * 
 * 
 * def query_mutations(muts_fn, samfile_name, min_mapq, min_baseq, min_reads, min_support,             # <<<<<<<<<<<<<<
 * 					out_fn):
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_AddTraceback("query_muts.query_mutations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_samfile);
  __Pyx_XDECREF(__pyx_v_seen_chroms);
  __Pyx_XDECREF(__pyx_v_possible_muts);
  __Pyx_XDECREF((PyObject *)__pyx_v_col);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_alnbase);
  __Pyx_XDECREF(__pyx_v_alt_allele);
  __Pyx_XDECREF(__pyx_v_fmt);
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_possible_mut);
  __Pyx_XDECREF(__pyx_v_refbase);
  __Pyx_XDECREF(__pyx_v_prob_germline);
  __Pyx_XDECREF(__pyx_v_pvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "query_muts.pyx":198
 * 
 * 
 * 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_10query_muts__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);

  /* "query_muts.pyx":202
 * 	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) {

    /* "query_muts.pyx":203
 * 
 * 	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;
  }

  /* "query_muts.pyx":205
 * 		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 = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_seq = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "query_muts.pyx":206
 * 
 * 	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 = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_s = ((char *)__pyx_t_3);

  /* "query_muts.pyx":207
 * 	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);

  /* "query_muts.pyx":209
 * 	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_10query_muts_bam_nt16_rev_table[(((__pyx_v_p[__Pyx_div_long(__pyx_v_k, 2)]) >> (4 * (1 - __Pyx_mod_long(__pyx_v_k, 2)))) & 0xf)]);

  /* "query_muts.pyx":211
 * 	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;

  /* "query_muts.pyx":198
 * 
 * 
 * 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("query_muts._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;
}

/* "query_muts.pyx":217
 * 	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_10query_muts__init_count(struct __pyx_t_10query_muts__CountAllele *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_count", 0);

  /* "query_muts.pyx":218
 * 
 * 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;

  /* "query_muts.pyx":217
 * 	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;
}

/* "query_muts.pyx":220
 * 	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_10query_muts__incr_count(struct __pyx_t_10query_muts__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);

  /* "query_muts.pyx":221
 * 
 * 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);

  /* "query_muts.pyx":222
 * 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;

  /* "query_muts.pyx":223
 * 	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);

  /* "query_muts.pyx":224
 * 	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);

  /* "query_muts.pyx":225
 * 	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) {

    /* "query_muts.pyx":226
 * 	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*/ {

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

  /* "query_muts.pyx":220
 * 	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;
}

/* "FromPyStructUtility":11
 * 
 * @cname("__pyx_convert__from_py___pyx_t_10query_muts__CountAllele")
 * cdef _CountAllele __pyx_convert__from_py___pyx_t_10query_muts__CountAllele(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef _CountAllele result
 *     if not PyMapping_Check(obj):
 */

static struct __pyx_t_10query_muts__CountAllele __pyx_convert__from_py___pyx_t_10query_muts__CountAllele(PyObject *__pyx_v_obj) {
  struct __pyx_t_10query_muts__CountAllele __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  struct __pyx_t_10query_muts__CountAllele __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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py___pyx_t_10query_muts__CountAllele", 0);

  /* "FromPyStructUtility":13
 * cdef _CountAllele __pyx_convert__from_py___pyx_t_10query_muts__CountAllele(obj) except *:
 *     cdef _CountAllele result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":14
 *     cdef _CountAllele result
 *     if not PyMapping_Check(obj):
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = PyErr_Format(__pyx_builtin_TypeError, __pyx_k_Expected_16s_got_200s, __pyx_k_a_mapping, Py_TYPE(__pyx_v_obj)->tp_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "FromPyStructUtility":16
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fwd']
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":17
 * 
 *     try:
 *         value = obj['fwd']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fwd'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_fwd); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_value = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L11_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":18
 *     try:
 *         value = obj['fwd']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'fwd'")
 *     result.fwd = value
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py___pyx_t_10query_muts__CountAllele", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":19
 *         value = obj['fwd']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fwd'")             # <<<<<<<<<<<<<<
 *     result.fwd = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L11_try_end:;
  }

  /* "FromPyStructUtility":20
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fwd'")
 *     result.fwd = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['rev']
 */
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result.fwd = __pyx_t_6;

  /* "FromPyStructUtility":21
 *         raise ValueError("No value specified for struct attribute 'fwd'")
 *     result.fwd = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['rev']
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":22
 *     result.fwd = value
 *     try:
 *         value = obj['rev']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'rev'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_rev); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L14_error;};
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L21_try_end;
    __pyx_L14_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":23
 *     try:
 *         value = obj['rev']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'rev'")
 *     result.rev = value
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py___pyx_t_10query_muts__CountAllele", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":24
 *         value = obj['rev']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'rev'")             # <<<<<<<<<<<<<<
 *     result.rev = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
    }
    goto __pyx_L16_except_error;
    __pyx_L16_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L21_try_end:;
  }

  /* "FromPyStructUtility":25
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'rev'")
 *     result.rev = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['pres']
 */
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result.rev = __pyx_t_6;

  /* "FromPyStructUtility":26
 *         raise ValueError("No value specified for struct attribute 'rev'")
 *     result.rev = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['pres']
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":27
 *     result.rev = value
 *     try:
 *         value = obj['pres']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'pres'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_pres); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L24_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L31_try_end;
    __pyx_L24_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":28
 *     try:
 *         value = obj['pres']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'pres'")
 *     result.pres = value
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py___pyx_t_10query_muts__CountAllele", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":29
 *         value = obj['pres']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'pres'")             # <<<<<<<<<<<<<<
 *     result.pres = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
    }
    goto __pyx_L26_except_error;
    __pyx_L26_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L31_try_end:;
  }

  /* "FromPyStructUtility":30
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'pres'")
 *     result.pres = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['count']
 */
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result.pres = __pyx_t_6;

  /* "FromPyStructUtility":31
 *         raise ValueError("No value specified for struct attribute 'pres'")
 *     result.pres = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['count']
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":32
 *     result.pres = value
 *     try:
 *         value = obj['count']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'count'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_count); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L34_error;};
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L41_try_end;
    __pyx_L34_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":33
 *     try:
 *         value = obj['count']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'count'")
 *     result.count = value
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py___pyx_t_10query_muts__CountAllele", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":34
 *         value = obj['count']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'count'")             # <<<<<<<<<<<<<<
 *     result.count = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;}
    }
    goto __pyx_L36_except_error;
    __pyx_L36_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L41_try_end:;
  }

  /* "FromPyStructUtility":35
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'count'")
 *     result.count = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['mapqual']
 */
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result.count = __pyx_t_6;

  /* "FromPyStructUtility":36
 *         raise ValueError("No value specified for struct attribute 'count'")
 *     result.count = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['mapqual']
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":37
 *     result.count = value
 *     try:
 *         value = obj['mapqual']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'mapqual'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_mapqual); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L44_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L51_try_end;
    __pyx_L44_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":38
 *     try:
 *         value = obj['mapqual']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'mapqual'")
 *     result.mapqual = value
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py___pyx_t_10query_muts__CountAllele", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":39
 *         value = obj['mapqual']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'mapqual'")             # <<<<<<<<<<<<<<
 *     result.mapqual = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L46_except_error;}
    }
    goto __pyx_L46_except_error;
    __pyx_L46_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L51_try_end:;
  }

  /* "FromPyStructUtility":40
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'mapqual'")
 *     result.mapqual = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['qual']
 */
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result.mapqual = __pyx_t_6;

  /* "FromPyStructUtility":41
 *         raise ValueError("No value specified for struct attribute 'mapqual'")
 *     result.mapqual = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['qual']
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":42
 *     result.mapqual = value
 *     try:
 *         value = obj['qual']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'qual'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_qual); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L54_error;};
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L61_try_end;
    __pyx_L54_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":43
 *     try:
 *         value = obj['qual']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'qual'")
 *     result.qual = value
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py___pyx_t_10query_muts__CountAllele", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":44
 *         value = obj['qual']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'qual'")             # <<<<<<<<<<<<<<
 *     result.qual = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;}
    }
    goto __pyx_L56_except_error;
    __pyx_L56_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L61_try_end:;
  }

  /* "FromPyStructUtility":45
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'qual'")
 *     result.qual = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result.qual = __pyx_t_10;

  /* "FromPyStructUtility":46
 *         raise ValueError("No value specified for struct attribute 'qual'")
 *     result.qual = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":11
 * 
 * @cname("__pyx_convert__from_py___pyx_t_10query_muts__CountAllele")
 * cdef _CountAllele __pyx_convert__from_py___pyx_t_10query_muts__CountAllele(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef _CountAllele result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py___pyx_t_10query_muts__CountAllele", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "query_muts",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
  {&__pyx_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_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_GERMLINE_AMBIGUOUS, __pyx_k_GERMLINE_AMBIGUOUS, sizeof(__pyx_k_GERMLINE_AMBIGUOUS), 0, 0, 1, 0},
  {&__pyx_kp_s_GP_prob_germline_DP_total_reads, __pyx_k_GP_prob_germline_DP_total_reads, sizeof(__pyx_k_GP_prob_germline_DP_total_reads), 0, 0, 1, 0},
  {&__pyx_kp_s_GT_GQ_DP_1_0_60_total_reads, __pyx_k_GT_GQ_DP_1_0_60_total_reads, sizeof(__pyx_k_GT_GQ_DP_1_0_60_total_reads), 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_kp_s_No_value_specified_for_struct_at, __pyx_k_No_value_specified_for_struct_at, sizeof(__pyx_k_No_value_specified_for_struct_at), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_2, __pyx_k_No_value_specified_for_struct_at_2, sizeof(__pyx_k_No_value_specified_for_struct_at_2), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_3, __pyx_k_No_value_specified_for_struct_at_3, sizeof(__pyx_k_No_value_specified_for_struct_at_3), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_4, __pyx_k_No_value_specified_for_struct_at_4, sizeof(__pyx_k_No_value_specified_for_struct_at_4), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_5, __pyx_k_No_value_specified_for_struct_at_5, sizeof(__pyx_k_No_value_specified_for_struct_at_5), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_6, __pyx_k_No_value_specified_for_struct_at_6, sizeof(__pyx_k_No_value_specified_for_struct_at_6), 0, 0, 1, 0},
  {&__pyx_kp_s_SOMATIC_AMBIGUOUS, __pyx_k_SOMATIC_AMBIGUOUS, sizeof(__pyx_k_SOMATIC_AMBIGUOUS), 0, 0, 1, 0},
  {&__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_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 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__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 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_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_n_s_alt_mut, __pyx_k_alt_mut, sizeof(__pyx_k_alt_mut), 0, 0, 1, 1},
  {&__pyx_n_s_baseq, __pyx_k_baseq, sizeof(__pyx_k_baseq), 0, 0, 1, 1},
  {&__pyx_n_s_chernoff, __pyx_k_chernoff, sizeof(__pyx_k_chernoff), 0, 0, 1, 1},
  {&__pyx_n_s_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 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_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_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_current_pos, __pyx_k_current_pos, sizeof(__pyx_k_current_pos), 0, 0, 1, 1},
  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
  {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 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_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 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_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_getrname, __pyx_k_getrname, sizeof(__pyx_k_getrname), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_in_germline, __pyx_k_in_germline, sizeof(__pyx_k_in_germline), 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_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 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_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_baseq, __pyx_k_min_baseq, sizeof(__pyx_k_min_baseq), 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_reads, __pyx_k_min_reads, sizeof(__pyx_k_min_reads), 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_muts_fn, __pyx_k_muts_fn, sizeof(__pyx_k_muts_fn), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
  {&__pyx_n_s_out_fn, __pyx_k_out_fn, sizeof(__pyx_k_out_fn), 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_mut, __pyx_k_possible_mut, sizeof(__pyx_k_possible_mut), 0, 0, 1, 1},
  {&__pyx_n_s_possible_muts, __pyx_k_possible_muts, sizeof(__pyx_k_possible_muts), 0, 0, 1, 1},
  {&__pyx_n_s_pres, __pyx_k_pres, sizeof(__pyx_k_pres), 0, 0, 1, 1},
  {&__pyx_n_s_prob_germline, __pyx_k_prob_germline, sizeof(__pyx_k_prob_germline), 0, 0, 1, 1},
  {&__pyx_n_s_prob_se, __pyx_k_prob_se, sizeof(__pyx_k_prob_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_query_mutations, __pyx_k_query_mutations, sizeof(__pyx_k_query_mutations), 0, 0, 1, 1},
  {&__pyx_n_s_query_muts, __pyx_k_query_muts, sizeof(__pyx_k_query_muts), 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_read, __pyx_k_read, sizeof(__pyx_k_read), 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_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_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_seen_chroms, __pyx_k_seen_chroms, sizeof(__pyx_k_seen_chroms), 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_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 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_reads, __pyx_k_total_reads, sizeof(__pyx_k_total_reads), 0, 0, 1, 1},
  {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __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 = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __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 = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __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 = 19; __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);

  /* "query_muts.pyx":60
 * 
 * 	for line in open(mut_fn,'r'):
 * 		fields = line.strip().split('\t')             # <<<<<<<<<<<<<<
 * 		possible_muts[(fields[0], int(fields[1]))] = (fields[3], fields[4])
 * 
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "query_muts.pyx":159
 * 					#check if there is more than one mutation present
 * 					if len(possible_muts[(chrom, pos)][1]) > 1:
 * 						possible_mut = possible_muts[(chrom, pos)][1].split(',')             # <<<<<<<<<<<<<<
 * 						alt_mut = eval(possible_mut[0])
 * 						alt_allele = possible_mut[0]
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s__3); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "FromPyStructUtility":19
 *         value = obj['fwd']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fwd'")             # <<<<<<<<<<<<<<
 *     result.fwd = value
 *     try:
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "FromPyStructUtility":24
 *         value = obj['rev']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'rev'")             # <<<<<<<<<<<<<<
 *     result.rev = value
 *     try:
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "FromPyStructUtility":29
 *         value = obj['pres']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'pres'")             # <<<<<<<<<<<<<<
 *     result.pres = value
 *     try:
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "FromPyStructUtility":34
 *         value = obj['count']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'count'")             # <<<<<<<<<<<<<<
 *     result.count = value
 *     try:
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "FromPyStructUtility":39
 *         value = obj['mapqual']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'mapqual'")             # <<<<<<<<<<<<<<
 *     result.mapqual = value
 *     try:
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_5); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "FromPyStructUtility":44
 *         value = obj['qual']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'qual'")             # <<<<<<<<<<<<<<
 *     result.qual = value
 *     return result
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_6); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "query_muts.pyx":45
 * 
 * 
 * def chernoff(double m, double d):             # <<<<<<<<<<<<<<
 * 
 * 	prob_se = pow((exp(d) / pow((1+d), (1+d))), m)
 */
  __pyx_tuple__11 = PyTuple_Pack(3, __pyx_n_s_m, __pyx_n_s_d, __pyx_n_s_prob_se); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_smithk_Documents_git_repo, __pyx_n_s_chernoff, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "query_muts.pyx":67
 * 
 * 
 * def query_mutations(muts_fn, samfile_name, min_mapq, min_baseq, min_reads, min_support,             # <<<<<<<<<<<<<<
 * 					out_fn):
 * 
 */
  __pyx_tuple__13 = PyTuple_Pack(51, __pyx_n_s_muts_fn, __pyx_n_s_samfile_name, __pyx_n_s_min_mapq, __pyx_n_s_min_baseq, __pyx_n_s_min_reads, __pyx_n_s_min_support, __pyx_n_s_out_fn, __pyx_n_s_samfile, __pyx_n_s_current_pos, __pyx_n_s_seen_chroms, __pyx_n_s_possible_muts, __pyx_n_s_in_germline, __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_mean_qual, __pyx_n_s_A, __pyx_n_s_T, __pyx_n_s_G, __pyx_n_s_C, __pyx_n_s_alt_mut, __pyx_n_s_alt_allele, __pyx_n_s_fwd_ratio, __pyx_n_s_rvs_ratio, __pyx_n_s_total_alleles, __pyx_n_s_prob_se, __pyx_n_s_delta, __pyx_n_s_reverse, __pyx_n_s_forward, __pyx_n_s_fmt, __pyx_n_s_out, __pyx_n_s_it, __pyx_n_s_mapq, __pyx_n_s_total_reads, __pyx_n_s_possible_mut, __pyx_n_s_mean_mapq, __pyx_n_s_refbase, __pyx_n_s_prob_germline, __pyx_n_s_pvalue); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);
  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(7, 0, 51, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_smithk_Documents_git_repo, __pyx_n_s_query_mutations, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_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 initquery_muts(void); /*proto*/
PyMODINIT_FUNC initquery_muts(void)
#else
PyMODINIT_FUNC PyInit_query_muts(void); /*proto*/
PyMODINIT_FUNC PyInit_query_muts(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_query_muts(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("query_muts", __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_query_muts) {
    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, "query_muts")) {
      if (unlikely(PyDict_SetItemString(modules, "query_muts", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[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;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "query_muts.pyx":35
 * 
 * 
 * cdef char* CODE2CIGAR= "MIDNSHP=X"             # <<<<<<<<<<<<<<
 * 
 * cdef char * bam_nt16_rev_table = "=ACMGRSVTWYHKDBN"
 */
  __pyx_v_10query_muts_CODE2CIGAR = __pyx_k_MIDNSHP_X;

  /* "query_muts.pyx":37
 * cdef char* CODE2CIGAR= "MIDNSHP=X"
 * 
 * cdef char * bam_nt16_rev_table = "=ACMGRSVTWYHKDBN"             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "math.h":
 */
  __pyx_v_10query_muts_bam_nt16_rev_table = __pyx_k_ACMGRSVTWYHKDBN;

  /* "query_muts.pyx":45
 * 
 * 
 * def chernoff(double m, double d):             # <<<<<<<<<<<<<<
 * 
 * 	prob_se = pow((exp(d) / pow((1+d), (1+d))), m)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10query_muts_1chernoff, NULL, __pyx_n_s_query_muts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chernoff, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "query_muts.pyx":67
 * 
 * 
 * def query_mutations(muts_fn, samfile_name, min_mapq, min_baseq, min_reads, min_support,             # <<<<<<<<<<<<<<
 * 					out_fn):
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10query_muts_3query_mutations, NULL, __pyx_n_s_query_muts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_query_mutations, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "query_muts.pyx":1
 * from libc.stdint cimport uint32_t, uint8_t, uint64_t, int64_t             # <<<<<<<<<<<<<<
 * from cpython cimport PyBytes_FromStringAndSize
 * from pysam.chtslib cimport bam1_t, bam_pileup1_t
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "FromPyStructUtility":11
 * 
 * @cname("__pyx_convert__from_py___pyx_t_10query_muts__CountAllele")
 * cdef _CountAllele __pyx_convert__from_py___pyx_t_10query_muts__CountAllele(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef _CountAllele result
 *     if not PyMapping_Check(obj):
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init query_muts", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init query_muts");
  }
  __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 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;
}

#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

#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

#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 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_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

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

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 CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
    long r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

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

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (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 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);
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_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 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_uint8_t(uint8_t value) {
    const uint8_t neg_one = (uint8_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint8_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(uint8_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_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_10query_muts__CountAllele(struct __pyx_t_10query_muts__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 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 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 */
