/* Generated by Cython 0.18 on Thu May  2 00:54:55 2013 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
    #error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define CYTHON_FORMAT_SSIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
                                (PyErr_Format(PyExc_TypeError, \
                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
                                 (PyObject*)0))
  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
                                  !PyComplex_Check(o))
  #define PyIndex_Check __Pyx_PyIndex_Check
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
  #define CYTHON_FORMAT_SSIZE_T "z"
  #define __Pyx_PyIndex_Check PyIndex_Check
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)
  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;
  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__MACS2__IO__cScoreTrack
#define __PYX_HAVE_API__MACS2__IO__cScoreTrack
#include "string.h"
#include "stdio.h"
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "pythread.h"
#include "math.h"
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#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_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#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))


#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

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


static const char *__pyx_f[] = {
  "cScoreTrack.pyx",
  "numpy.pxd",
  "stringsource",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name; /* for error messages only */
  struct __Pyx_StructField_* fields;
  size_t size;     /* sizeof(type) */
  size_t arraysize[8]; /* length of array in each dimension */
  int ndim;
  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;

struct __pyx_memoryview_obj;
typedef struct {
  struct __pyx_memoryview_obj *memview;
  char *data;
  Py_ssize_t shape[8];
  Py_ssize_t strides[8];
  Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;

#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __pyx_atomic_int_type int
/* todo: Portland pgcc, maybe OS X's OSAtomicIncrement32,
   libatomic + autotools-like distutils support? Such a pain... */
#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 || \
                    (__GNUC_MINOR__ == 1 && __GNUC_PATHLEVEL >= 2))
    #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && MSC_VER
    #include <Windows.h>
    #define __pyx_atomic_int_type LONG
    #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
    #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using MSVC atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
    #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
    #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using Intel atomics"
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
    #define __pyx_add_acquisition_count(memview) \
             __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview) \
            __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
#else
    #define __pyx_add_acquisition_count(memview) \
            __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview) \
            __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif


/* "numpy.pxd":724
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5MACS2_2IO_5numpy_int8_t;

/* "numpy.pxd":725
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5MACS2_2IO_5numpy_int16_t;

/* "numpy.pxd":726
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5MACS2_2IO_5numpy_int32_t;

/* "numpy.pxd":727
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5MACS2_2IO_5numpy_int64_t;

/* "numpy.pxd":731
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5MACS2_2IO_5numpy_uint8_t;

/* "numpy.pxd":732
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5MACS2_2IO_5numpy_uint16_t;

/* "numpy.pxd":733
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5MACS2_2IO_5numpy_uint32_t;

/* "numpy.pxd":734
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5MACS2_2IO_5numpy_uint64_t;

/* "numpy.pxd":738
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float16    float16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t
 */
typedef npy_float16 __pyx_t_5MACS2_2IO_5numpy_float16_t;

/* "numpy.pxd":739
 * 
 * ctypedef npy_float16    float16_t
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5MACS2_2IO_5numpy_float32_t;

/* "numpy.pxd":740
 * ctypedef npy_float16    float16_t
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5MACS2_2IO_5numpy_float64_t;

/* "numpy.pxd":749
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5MACS2_2IO_5numpy_int_t;

/* "numpy.pxd":750
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5MACS2_2IO_5numpy_long_t;

/* "numpy.pxd":751
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5MACS2_2IO_5numpy_longlong_t;

/* "numpy.pxd":753
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5MACS2_2IO_5numpy_uint_t;

/* "numpy.pxd":754
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5MACS2_2IO_5numpy_ulong_t;

/* "numpy.pxd":755
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5MACS2_2IO_5numpy_ulonglong_t;

/* "numpy.pxd":757
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5MACS2_2IO_5numpy_intp_t;

/* "numpy.pxd":758
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5MACS2_2IO_5numpy_uintp_t;

/* "numpy.pxd":760
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5MACS2_2IO_5numpy_float_t;

/* "numpy.pxd":761
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5MACS2_2IO_5numpy_double_t;

/* "numpy.pxd":762
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5MACS2_2IO_5numpy_longdouble_t;
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif

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


/*--- Type declarations ---*/
struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI;
struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII;
struct __pyx_obj_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak;
struct __pyx_memoryviewslice_obj;
struct __pyx_array_obj;
struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores;

/* "numpy.pxd":764
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5MACS2_2IO_5numpy_cfloat_t;

/* "numpy.pxd":765
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5MACS2_2IO_5numpy_cdouble_t;

/* "numpy.pxd":766
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5MACS2_2IO_5numpy_clongdouble_t;

/* "numpy.pxd":768
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5MACS2_2IO_5numpy_complex_t;
struct __pyx_opt_args_5MACS2_5cProb_poisson_cdf;
struct __pyx_opt_args_5MACS2_5cProb_poisson_cdf_inv;
struct __pyx_opt_args_5MACS2_5cProb_poisson_cdf_Q_inv;
struct __pyx_opt_args_5MACS2_5cProb_binomial_cdf;

/* "MACS2/cProb.pxd":5
 * cpdef factorial ( unsigned int n )
 * 
 * cpdef double poisson_cdf ( unsigned int n, double lam, bool lower = ?, bool log10 = ? )             # <<<<<<<<<<<<<<
 * 
 * cdef inline double __poisson_cdf ( unsigned int k, double a )
 */
struct __pyx_opt_args_5MACS2_5cProb_poisson_cdf {
  int __pyx_n;
  PyBoolObject *lower;
  PyBoolObject *log10;
};

/* "MACS2/cProb.pxd":21
 * cdef inline double logspace_add ( double logx, double logy )
 * 
 * cpdef poisson_cdf_inv ( double cdf, double lam, int maximum = ? )             # <<<<<<<<<<<<<<
 * 
 * cpdef poisson_cdf_Q_inv ( double cdf, double lam, int maximum = ? )
 */
struct __pyx_opt_args_5MACS2_5cProb_poisson_cdf_inv {
  int __pyx_n;
  int maximum;
};

/* "MACS2/cProb.pxd":23
 * cpdef poisson_cdf_inv ( double cdf, double lam, int maximum = ? )
 * 
 * cpdef poisson_cdf_Q_inv ( double cdf, double lam, int maximum = ? )             # <<<<<<<<<<<<<<
 * 
 * cpdef poisson_pdf ( unsigned int k, double a )
 */
struct __pyx_opt_args_5MACS2_5cProb_poisson_cdf_Q_inv {
  int __pyx_n;
  int maximum;
};

/* "MACS2/cProb.pxd":29
 * cdef binomial_coef ( long n, long k )
 * 
 * cpdef binomial_cdf ( long x, long a, double b, bool lower = ? )             # <<<<<<<<<<<<<<
 * 
 * cdef _binomial_cdf_r ( long x, long a, double b )
 */
struct __pyx_opt_args_5MACS2_5cProb_binomial_cdf {
  int __pyx_n;
  PyBoolObject *lower;
};
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_write_bedGraph;
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_peaks;
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak;
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak2;
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_broadpeaks;
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_bedGraph;
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_matrix;
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_call_peaks;
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_peaks;
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_write_bedGraph;
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_diff_peaks;
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_print_some_peaks;

/* "MACS2/IO/cScoreTrack.pyx":939
 *         return
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in bedGraph Format.
 * 
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_write_bedGraph {
  int __pyx_n;
  short column;
};

/* "MACS2/IO/cScoreTrack.pyx":1045
 *         return ret_peaks
 * 
 *     cpdef call_peaks (self, float cutoff=5.0, int min_length=200, int max_gap=50, bool call_summits=False):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_peaks {
  int __pyx_n;
  float cutoff;
  int min_length;
  int max_gap;
  PyBoolObject *call_summits;
};

/* "MACS2/IO/cScoreTrack.pyx":1118
 *         return peaks
 * 
 *     cdef bool __close_peak (self, list peak_content, peaks, int min_length,             # <<<<<<<<<<<<<<
 *                             str chrom, int smoothlen=0):
 *         """Close the peak region, output peak boundaries, peak summit
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak {
  int __pyx_n;
  int smoothlen;
};

/* "MACS2/IO/cScoreTrack.pyx":1169
 *             return True
 * 
 *     cdef bool __close_peak2 (self, list peak_content, peaks, int min_length,             # <<<<<<<<<<<<<<
 *                              str chrom, int smoothlen=51,
 *                              float min_valley = 0.9):
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak2 {
  int __pyx_n;
  int smoothlen;
  float min_valley;
};

/* "MACS2/IO/cScoreTrack.pyx":1258
 *         return t
 * 
 *     cpdef tuple call_broadpeaks (self, float lvl1_cutoff=5.0, float lvl2_cutoff=1.0, int min_length=200, int lvl1_max_gap=50, int lvl2_max_gap=400):             # <<<<<<<<<<<<<<
 *         """This function try to find enriched regions within which,
 *         scores are continuously higher than a given cutoff for level
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_broadpeaks {
  int __pyx_n;
  float lvl1_cutoff;
  float lvl2_cutoff;
  int min_length;
  int lvl1_max_gap;
  int lvl2_max_gap;
};

/* "MACS2/IO/cScoreTrack.pyx":1739
 *         return l
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in bedGraph Format.
 * 
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_bedGraph {
  int __pyx_n;
  short column;
};

/* "MACS2/IO/cScoreTrack.pyx":1784
 *         return True
 * 
 *     cpdef write_matrix ( self, fhd, str name, str description, short column = 3 ):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd into five columns Format:
 * 
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_matrix {
  int __pyx_n;
  short column;
};

/* "MACS2/IO/cScoreTrack.pyx":1822
 *         return True
 * 
 *     cpdef call_peaks (self, float cutoff=0.05, int min_length=200,             # <<<<<<<<<<<<<<
 *                       bool call_summits=False):
 *         """This function try to find regions within which, scores
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_call_peaks {
  int __pyx_n;
  float cutoff;
  int min_length;
  PyBoolObject *call_summits;
};

/* "MACS2/IO/cScoreTrack.pyx":2399
 *         """
 * 
 *     cpdef call_peaks (self, float cutoff=2.0, int min_length=200, int max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_peaks {
  int __pyx_n;
  float cutoff;
  int min_length;
  int max_gap;
};

/* "MACS2/IO/cScoreTrack.pyx":2746
 *         return l
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in bedGraph Format.
 * 
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_write_bedGraph {
  int __pyx_n;
  short column;
};

/* "MACS2/IO/cScoreTrack.pyx":2830
 * 
 *     @cython.boundscheck(False)
 *     cpdef call_diff_peaks (self, float cutoff=2.0, int min_length=50,             # <<<<<<<<<<<<<<
 *                            str score_method='q'):
 *         """This function try to find regions within which, scores
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_diff_peaks {
  int __pyx_n;
  float cutoff;
  int min_length;
  PyObject *score_method;
};

/* "MACS2/IO/cScoreTrack.pyx":2926
 *         return
 * 
 *     cpdef print_some_peaks(self, int max = 10):             # <<<<<<<<<<<<<<
 *         """for testing only
 *         """
 */
struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_print_some_peaks {
  int __pyx_n;
  int max;
};

/* "View.MemoryView":275
 * 
 * @cname('__pyx_MemviewEnum')
 * cdef class Enum(object):             # <<<<<<<<<<<<<<
 *     cdef object name
 *     def __init__(self, name):
 */
struct __pyx_MemviewEnum_obj {
  PyObject_HEAD
  PyObject *name;
};


/* "View.MemoryView":308
 * 
 * @cname('__pyx_memoryview')
 * cdef class memoryview(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef object obj
 */
struct __pyx_memoryview_obj {
  PyObject_HEAD
  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
  PyObject *obj;
  PyObject *_size;
  PyObject *_array_interface;
  PyThread_type_lock lock;
  __pyx_atomic_int acquisition_count[2];
  __pyx_atomic_int *acquisition_count_aligned_p;
  Py_buffer view;
  int flags;
  int dtype_is_object;
  __Pyx_TypeInfo *typeinfo;
};


/* "MACS2/IO/cScoreTrack.pyx":2020
 *         return t
 * 
 * cdef class DiffScoreTrackI:             # <<<<<<<<<<<<<<
 *     cdef:
 *         dict pos, t1, c1, t2, c2, tvsc1, tvsc2, t1vs2, tlogLR
 */
struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI {
  PyObject_HEAD
  struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_vtab;
  PyObject *pos;
  PyObject *t1;
  PyObject *c1;
  PyObject *t2;
  PyObject *c2;
  PyObject *tvsc1;
  PyObject *tvsc2;
  PyObject *t1vs2;
  PyObject *tlogLR;
  PyObject *where_peaks;
  PyObject *diff_peaks;
  PyObject *diff_qvalues;
  PyObject *which_peaks1;
  PyObject *which_peaks2;
  PyObject *p1io;
  PyObject *p2io;
  PyObject *datalength;
  float cond1_depth;
  float cond2_depth;
  int pseudocount;
  float cutoff;
  PyObject *pvalue_stat1;
  PyObject *pvalue_stat2;
  PyObject *track_scoring_method;
  PyObject *diff_scoring_method;
};


/* "MACS2/IO/cScoreTrack.pyx":448
 *         return ret
 * 
 * cdef class scoreTrackII:             # <<<<<<<<<<<<<<
 *     """Class for scoreGraph type data. Modified from scoreTrackI. The
 *     difference is that we store a single score data, not
 */
struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII {
  PyObject_HEAD
  struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_vtab;
  PyObject *data;
  PyObject *data_stderr;
  PyObject *datalength;
  PyBoolObject *trackline;
  PyBoolObject *stderr_on;
  double treat_edm;
  double ctrl_edm;
  char scoring_method;
  char normalization_method;
  float pseudocount;
  float cutoff;
  PyObject *pvalue_stat;
};


/* "MACS2/IO/cScoreTrack.pyx":1313
 *         return lvl1_peaks, broadpeaks
 * 
 *     def __add_broadpeak (self, bpeaks, str chrom, dict lvl2peak, list lvl1peakset):             # <<<<<<<<<<<<<<
 *         """Internal function to create broad peak.
 *         """
 */
struct __pyx_obj_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak {
  PyObject_HEAD
  int __pyx_v_start;
};


/* "View.MemoryView":927
 * 
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
 *     "Internal class for passing memoryview slices to Python"
 * 
 */
struct __pyx_memoryviewslice_obj {
  struct __pyx_memoryview_obj __pyx_base;
  __Pyx_memviewslice from_slice;
  PyObject *from_object;
  PyObject *(*to_object_func)(char *);
  int (*to_dtype_func)(char *, PyObject *);
};


/* "View.MemoryView":96
 * 
 * @cname("__pyx_array")
 * cdef class array:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_array_obj {
  PyObject_HEAD
  char *data;
  Py_ssize_t len;
  char *format;
  int ndim;
  Py_ssize_t *_shape;
  Py_ssize_t *_strides;
  Py_ssize_t itemsize;
  PyObject *mode;
  PyObject *_format;
  void (*callback_free_data)(void *);
  int free_data;
  int dtype_is_object;
};


/* "MACS2/IO/cScoreTrack.pyx":1343
 *         return bpeaks
 * 
 * cdef class TwoConditionScores:             # <<<<<<<<<<<<<<
 *     cdef:
 *         dict data                       # dictionary for data of each chromosome
 */
struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores {
  PyObject_HEAD
  struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_vtab;
  PyObject *data;
  PyObject *datalength;
  float cond1_depth;
  float cond2_depth;
  float pseudocount;
  float cutoff;
  PyObject *t1bdg;
  PyObject *c1bdg;
  PyObject *t2bdg;
  PyObject *c2bdg;
  PyObject *pvalue_stat1;
  PyObject *pvalue_stat2;
  PyObject *pvalue_stat3;
};



/* "View.MemoryView":308
 * 
 * @cname('__pyx_memoryview')
 * cdef class memoryview(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef object obj
 */

struct __pyx_vtabstruct_memoryview {
  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
};
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;


/* "View.MemoryView":927
 * 
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
 *     "Internal class for passing memoryview slices to Python"
 * 
 */

struct __pyx_vtabstruct__memoryviewslice {
  struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;



/* "MACS2/IO/cScoreTrack.pyx":2020
 *         return t
 * 
 * cdef class DiffScoreTrackI:             # <<<<<<<<<<<<<<
 *     cdef:
 *         dict pos, t1, c1, t2, c2, tvsc1, tvsc2, t1vs2, tlogLR
 */

struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI {
  PyObject *(*set_pseudocount)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int, int __pyx_skip_dispatch);
  PyObject *(*build_chromosome)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *);
  PyObject *(*rebuild_chromosomes)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch);
  PyObject *(*add_chromosome)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, int);
  PyObject *(*add)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, int, float, float, float, float);
  PyObject *(*finalize)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch);
  PyObject *(*set_track_score_method)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*compute_treatcontrol_pvalues)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *);
  PyObject *(*compute_treatcontrol_qvalues)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *);
  PyObject *(*break_on_peaks)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*call_peaks)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_peaks *__pyx_optional_args);
  PyObject *(*store_peaks)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*annotate_peaks)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch);
  PyObject *(*make_treatcontrol_pq_tables)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch);
  PyObject *(*compute_diff_pvalues)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch);
  PyObject *(*compute_diff_qvalues)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch);
  PyObject *(*get_data_by_chr)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_chr_names)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch);
  PyObject *(*write_bedGraph)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_write_bedGraph *__pyx_optional_args);
  PyObject *(*call_diff_peaks)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_diff_peaks *__pyx_optional_args);
  PyObject *(*print_some_peaks)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_print_some_peaks *__pyx_optional_args);
  PyObject *(*print_diff_peaks)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch);
  PyObject *(*_write_peaks_by_summit)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, PyObject *, PyObject *, PyObject *, PyBoolObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *);
  long (*total)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *);
};
static struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_vtabptr_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI;


/* "MACS2/IO/cScoreTrack.pyx":1343
 *         return bpeaks
 * 
 * cdef class TwoConditionScores:             # <<<<<<<<<<<<<<
 *     cdef:
 *         dict data                       # dictionary for data of each chromosome
 */

struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores {
  PyObject *(*set_pseudocount)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, float, int __pyx_skip_dispatch);
  PyObject *(*build)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch);
  PyObject *(*build_chromosome)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *);
  PyObject *(*add_chromosome)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, int);
  PyObject *(*add)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, int, float, float, float, float);
  PyObject *(*finalize)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch);
  PyObject *(*compute_all_pvalues)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch);
  PyObject *(*compute_track_qvalues)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch);
  PyObject *(*compute_category_qvalues)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*make_pq_tables)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *);
  PyObject *(*get_data_by_chr)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_chr_names)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch);
  PyObject *(*write_bedGraph)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_bedGraph *__pyx_optional_args);
  PyObject *(*write_matrix)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_matrix *__pyx_optional_args);
  PyObject *(*call_peaks)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_call_peaks *__pyx_optional_args);
  long (*total)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *);
};
static struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_vtabptr_5MACS2_2IO_11cScoreTrack_TwoConditionScores;


/* "MACS2/IO/cScoreTrack.pyx":448
 *         return ret
 * 
 * cdef class scoreTrackII:             # <<<<<<<<<<<<<<
 *     """Class for scoreGraph type data. Modified from scoreTrackI. The
 *     difference is that we store a single score data, not
 */

struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII {
  PyObject *(*set_pseudocount)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, float, int __pyx_skip_dispatch);
  PyObject *(*enable_trackline)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch);
  PyObject *(*add_chromosome)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, int, int __pyx_skip_dispatch);
  PyObject *(*add)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, int, float, float, int __pyx_skip_dispatch);
  PyObject *(*finalize)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch);
  PyObject *(*get_data_by_chr)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_chr_names)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch);
  PyObject *(*change_normalization_method)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, char, int __pyx_skip_dispatch);
  PyObject *(*normalize)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, double, double);
  PyObject *(*change_score_method)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, char, int __pyx_skip_dispatch);
  PyObject *(*compute_pvalue)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *);
  PyObject *(*compute_qvalue)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *);
  PyObject *(*make_pq_table)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch);
  PyObject *(*compute_likelihood)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *);
  PyObject *(*compute_logFE)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *);
  PyObject *(*compute_foldenrichment)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *);
  PyObject *(*compute_subtraction)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *);
  PyObject *(*compute_SPMR)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *);
  PyObject *(*write_bedGraph)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_write_bedGraph *__pyx_optional_args);
  PyObject *(*reassign_peaks)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*call_peaks)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_peaks *__pyx_optional_args);
  PyBoolObject *(*__pyx___close_peak)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, PyObject *, int, PyObject *, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak *__pyx_optional_args);
  PyBoolObject *(*__pyx___close_peak2)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, PyObject *, int, PyObject *, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak2 *__pyx_optional_args);
  long (*total)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *);
  PyObject *(*call_broadpeaks)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_broadpeaks *__pyx_optional_args);
};
static struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_vtabptr_5MACS2_2IO_11cScoreTrack_scoreTrackII;
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext() \
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/

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

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

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

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

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

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

#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_SetItemInt_Fast(o, i, v) : \
                                                    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {  /* inlined PySequence_SetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return -1;
                i += l;
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PySequence_Check(o) && !PyDict_Check(o)) {
#else
    if (PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

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

#include <string.h>

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

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

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

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

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

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

static void __Pyx_RaiseBufferFallbackError(void); /*proto*/

static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/

#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
  static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {  /* inlined PySequence_GetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return NULL;
                i += l;
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

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

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

#if 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())
            PyErr_SetObject(PyExc_KeyError, key);
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

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

static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj) \
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \
 likely(PyInt_CheckExact(obj)) ? \
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj) \
((likely(PyFloat_CheckExact(obj))) ? \
 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(PyList_Append(L, x) < 0)) return NULL;
        Py_INCREF(Py_None);
        return Py_None; /* this is just to have an accurate signature */
    } else {
        PyObject *r, *m;
        m = __Pyx_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}

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

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */

static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);

#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT   1
#define __Pyx_MEMVIEW_PTR      2
#define __Pyx_MEMVIEW_FULL     4
#define __Pyx_MEMVIEW_CONTIG   8
#define __Pyx_MEMVIEW_STRIDED  16
#define __Pyx_MEMVIEW_FOLLOW   32
#define __Pyx_IS_C_CONTIG 1
#define __Pyx_IS_F_CONTIG 2
static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                __Pyx_TypeInfo *dtype,
                __Pyx_BufFmt_StackElem stack[],
                __Pyx_memviewslice *memviewslice,
                PyObject *original_obj);
static int __Pyx_init_memviewslice(
                struct __pyx_memoryview_obj *memview,
                int ndim,
                __Pyx_memviewslice *memviewslice,
                int memview_is_new_reference);
static CYTHON_INLINE int __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
                                                            PyThread_type_lock lock);
static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
                                                            PyThread_type_lock lock);
#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
  static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/

#define UNARY_NEG_WOULD_OVERFLOW(x)            (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
  static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
  static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
  static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
  static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
  static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
  static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
  static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
  static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
  static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
  static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
  #ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

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

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

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


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

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

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *qualname, PyObject *modname); /*proto*/

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

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_int32(npy_int32);

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

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

static CYTHON_INLINE npy_int32 __Pyx_PyInt_from_py_npy_int32(PyObject *);

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

static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

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

static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

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

static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
                                        char order, int ndim);

static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
                                __Pyx_memviewslice *slice2,
                                int ndim, size_t itemsize);

static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                 const char *mode, int ndim,
                                 size_t sizeof_dtype, int contig_flag,
                                 int dtype_is_object);

static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

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

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *);

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *);

static int __Pyx_check_binary_version(void);

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

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

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

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

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

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

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

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


/* Module declarations from 'cpython.buffer' */

/* Module declarations from 'cpython.ref' */

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

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

/* Module declarations from 'cpython.object' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

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

/* Module declarations from 'numpy' */

/* Module declarations from 'MACS2.IO.numpy' */
static PyTypeObject *__pyx_ptype_5MACS2_2IO_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5MACS2_2IO_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5MACS2_2IO_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5MACS2_2IO_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5MACS2_2IO_5numpy_ufunc = 0;
static CYTHON_INLINE char *__pyx_f_5MACS2_2IO_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/

/* Module declarations from 'cpython.version' */

/* Module declarations from 'cpython.exc' */

/* Module declarations from 'cpython.module' */

/* Module declarations from 'cpython.mem' */

/* Module declarations from 'cpython.tuple' */

/* Module declarations from 'cpython.list' */

/* Module declarations from 'cpython.sequence' */

/* Module declarations from 'cpython.mapping' */

/* Module declarations from 'cpython.iterator' */

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

/* Module declarations from 'cpython.pycapsule' */

/* Module declarations from 'cpython' */

/* Module declarations from 'cython.view' */

/* Module declarations from 'cython' */

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

/* Module declarations from 'MACS2.cProb' */
static double (*__pyx_f_5MACS2_5cProb_poisson_cdf)(unsigned int, double, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_5cProb_poisson_cdf *__pyx_optional_args); /*proto*/

/* Module declarations from 'MACS2.IO.cScoreTrack' */
static PyTypeObject *__pyx_ptype_5MACS2_2IO_11cScoreTrack_scoreTrackII = 0;
static PyTypeObject *__pyx_ptype_5MACS2_2IO_11cScoreTrack_TwoConditionScores = 0;
static PyTypeObject *__pyx_ptype_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI = 0;
static PyTypeObject *__pyx_ptype_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak = 0;
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
static PyTypeObject *__pyx_memoryviewslice_type = 0;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
static CYTHON_INLINE double __pyx_f_5MACS2_2IO_11cScoreTrack_get_pscore(int, double); /*proto*/
static double __pyx_f_5MACS2_2IO_11cScoreTrack_get_interpolated_pscore(double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_5MACS2_2IO_11cScoreTrack_logLR_adjusted(int, int); /*proto*/
static CYTHON_INLINE double __pyx_f_5MACS2_2IO_11cScoreTrack_logLR(double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_5MACS2_2IO_11cScoreTrack_get_logFE(float, float); /*proto*/
static CYTHON_INLINE int __pyx_f_5MACS2_2IO_11cScoreTrack__get_all_subpeaks(PyObject *, PyArrayObject *, PyArrayObject *); /*proto*/
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
static void *__pyx_align_pointer(void *, size_t); /*proto*/
static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
static int __pyx_memoryview_check(PyObject *); /*proto*/
static PyObject *_unellipsify(PyObject *, int); /*proto*/
static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, int); /*proto*/
static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5MACS2_2IO_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5MACS2_2IO_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5MACS2_2IO_5numpy_int32_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5MACS2_2IO_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
#define __Pyx_MODULE_NAME "MACS2.IO.cScoreTrack"
int __pyx_module_is_main_MACS2__IO__cScoreTrack = 0;

/* Implementation of 'MACS2.IO.cScoreTrack' */
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_ord;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_sorted;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_reduce;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_min;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_do_nothing(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_2add_chromosome(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, int __pyx_v_chrom_max_len); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_4add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_v_endpos, double __pyx_v_V1, double __pyx_v_V2); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_6finalize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_8get_data_by_chr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_10get_chr_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_12write_bedGraph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fhd, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_description, PyObject *__pyx_v_colname); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_14total(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_16extract_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_18extract_average(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_20extract_sum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2); /* proto */
static int __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII___init__(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, float __pyx_v_treat_depth, float __pyx_v_ctrl_depth, CYTHON_UNUSED PyBoolObject *__pyx_v_stderr_on, float __pyx_v_pseudocount); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, float __pyx_v_pseudocount); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_4enable_trackline(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_6add_chromosome(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chrom, int __pyx_v_chrom_max_len); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_8add(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_v_endpos, float __pyx_v_chip, float __pyx_v_control); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_10finalize(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_12get_data_by_chr(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_14get_chr_names(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_16change_normalization_method(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_normalization_method); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_18change_score_method(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_scoring_method); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_20make_pq_table(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_22write_bedGraph(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_24reassign_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_peaks); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_26call_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, float __pyx_v_cutoff, int __pyx_v_min_length, int __pyx_v_max_gap, PyBoolObject *__pyx_v_call_summits); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_28call_broadpeaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, float __pyx_v_lvl1_cutoff, float __pyx_v_lvl2_cutoff, int __pyx_v_min_length, int __pyx_v_lvl1_max_gap, int __pyx_v_lvl2_max_gap); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_30__add_broadpeak(CYTHON_UNUSED struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_bpeaks, PyObject *__pyx_v_chrom, PyObject *__pyx_v_lvl2peak, PyObject *__pyx_v_lvl1peakset); /* proto */
static int __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores___init__(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_t1bdg, PyObject *__pyx_v_c1bdg, PyObject *__pyx_v_t2bdg, PyObject *__pyx_v_c2bdg, float __pyx_v_cond1_depth, float __pyx_v_cond2_depth, float __pyx_v_pseudocount); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, float __pyx_v_pseudocount); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_4build(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_6get_common_chrs(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_8finalize(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_10compute_all_pvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_12compute_track_qvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_14compute_category_qvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_category); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_16get_data_by_chr(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chromosome); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_18get_chr_names(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_20write_bedGraph(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_22write_matrix(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_24call_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, float __pyx_v_cutoff, int __pyx_v_min_length, PyBoolObject *__pyx_v_call_summits); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static int __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI___init__(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_t1bdg, PyObject *__pyx_v_c1bdg, PyObject *__pyx_v_t2bdg, PyObject *__pyx_v_c2bdg, float __pyx_v_cond1_depth, float __pyx_v_cond2_depth, int __pyx_v_pseudocount); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_v_pseudocount); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_4rebuild_chromosomes(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_6finalize(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_8set_track_score_method(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_scoring_method); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_10break_on_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_p1io, PyObject *__pyx_v_p2io); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_12call_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, float __pyx_v_cutoff, int __pyx_v_min_length, int __pyx_v_max_gap); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_14store_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_p1io, PyObject *__pyx_v_p2io); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_16annotate_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_18make_treatcontrol_pq_tables(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_20compute_diff_pvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_22compute_diff_qvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_24get_data_by_chr(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_chromosome); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_26get_chr_names(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_28write_bedGraph(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_30call_diff_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, float __pyx_v_cutoff, int __pyx_v_min_length, PyObject *__pyx_v_score_method); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_32print_some_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_v_max); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_34print_diff_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_36write_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_xls, PyObject *__pyx_v_bed, PyObject *__pyx_v_name_prefix, PyObject *__pyx_v_name, PyObject *__pyx_v_description, PyObject *__pyx_v_trackline); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_38write_peaks2(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_xls, PyObject *__pyx_v_bed, PyObject *__pyx_v_name_prefix, PyObject *__pyx_v_name, PyObject *__pyx_v_description, PyObject *__pyx_v_trackline); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_40has_peakio(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_42write_peaks_by_summit(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_xls1, PyObject *__pyx_v_xls2, PyObject *__pyx_v_name_prefix, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_44write_bedgraphs(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_logLR, PyObject *__pyx_v_pvalue, PyObject *__pyx_v_logFC, PyObject *__pyx_v_name, PyObject *__pyx_v_description, PyBoolObject *__pyx_v_trackline); /* proto */
static int __pyx_pf_5MACS2_2IO_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5MACS2_2IO_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static char __pyx_k_4[] = "%s not supported!";
static char __pyx_k_5[] = "%s\t%d\t%d\t%.5f\n";
static char __pyx_k_6[] = ".";
static char __pyx_k_10[] = "change_normalization_method";
static char __pyx_k_12[] = "column should be between 1, 2 or 3.";
static char __pyx_k_13[] = "track type=bedGraph name=\"%s\" description=\"%s\"\n";
static char __pyx_k_14[] = "peaks must be a PeakIO object!";
static char __pyx_k_16[] = "level 1 cutoff should be larger than level 2.";
static char __pyx_k_17[] = "level 2 maximum gap should be larger than level 1.";
static char __pyx_k_18[] = ",";
static char __pyx_k_19[] = "scoreTrackII.__add_broadpeak.<locals>.<lambda>";
static char __pyx_k_20[] = "MACS2.IO.cScoreTrack";
static char __pyx_k_21[] = "1,";
static char __pyx_k_22[] = "0,";
static char __pyx_k_23[] = ",1";
static char __pyx_k_24[] = "TwoConditionScores.get_common_chrs.<locals>.<lambda>";
static char __pyx_k_29[] = "compute_track_qvalues";
static char __pyx_k_31[] = "compute_category_qvalues";
static char __pyx_k_33[] = "%s:%d_%d\t%.5f\t%.5f\t%.5f\t%.5f\n";
static char __pyx_k_41[] = "DiffScoreTrackI.__init__.<locals>.<lambda>";
static char __pyx_k_46[] = "set_track_score_method";
static char __pyx_k_53[] = "make_treatcontrol_pq_tables";
static char __pyx_k_54[] = "compute_diff_pvalues";
static char __pyx_k_57[] = "compute_diff_qvalues";
static char __pyx_k_59[] = "%s\t%d (%d)";
static char __pyx_k_60[] = "%s\t%d\t%d";
static char __pyx_k_61[] = "%s_peak_";
static char __pyx_k_62[] = "%s";
static char __pyx_k_64[] = "# values are maxmimum in region\n";
static char __pyx_k_66[] = "# Depth multiplier used: %f (treat/control values are after multiplication)\n";
static char __pyx_k_68[] = "# log10_fold_change is positive if t1 > t2\n";
static char __pyx_k_70[] = "\t";
static char __pyx_k_71[] = "log2.fold.change";
static char __pyx_k_72[] = "-log10.diff.pvalue";
static char __pyx_k_73[] = "-log10.diff.qvalue";
static char __pyx_k_74[] = "diff.log10LR";
static char __pyx_k_75[] = "diff.peakname";
static char __pyx_k_76[] = "log2.fold.enrichment1";
static char __pyx_k_77[] = "-log10.%svalue1";
static char __pyx_k_78[] = "log2.fold.enrichment2";
static char __pyx_k_79[] = "-log10.%svalue2";
static char __pyx_k_80[] = "\n";
static char __pyx_k_81[] = "\"";
static char __pyx_k_82[] = "\\\"";
static char __pyx_k_85[] = "track name=\"%s (peaks)\" description=\"%s\" visibility=1\n";
static char __pyx_k_86[] = "track name=MACS description=Unknown\n";
static char __pyx_k_90[] = "%s%d";
static char __pyx_k_91[] = "%s\t%d\t%d\t%d";
static char __pyx_k_92[] = "\t%.5f";
static char __pyx_k_93[] = "\t%s";
static char __pyx_k_95[] = "%s\t%d\t%d\t%s\t%.5f\n";
static char __pyx_k_97[] = "No information on peaks";
static char __pyx_k_98[] = "# summit is defined as greatest summit from greatest sample in region \n";
static char __pyx_k__B[] = "B";
static char __pyx_k__H[] = "H";
static char __pyx_k__I[] = "I";
static char __pyx_k__L[] = "L";
static char __pyx_k__O[] = "O";
static char __pyx_k__Q[] = "Q";
static char __pyx_k__b[] = "b";
static char __pyx_k__c[] = "c";
static char __pyx_k__d[] = "d";
static char __pyx_k__f[] = "f";
static char __pyx_k__g[] = "g";
static char __pyx_k__h[] = "h";
static char __pyx_k__i[] = "i";
static char __pyx_k__l[] = "l";
static char __pyx_k__p[] = "p";
static char __pyx_k__q[] = "q";
static char __pyx_k__t[] = "t";
static char __pyx_k__x[] = "x";
static char __pyx_k__y[] = "y";
static char __pyx_k_100[] = "# values are reported for the summit, except for \n";
static char __pyx_k_102[] = "# fold_enrichment, sample/control qvalues, peaknames, which are copied from the peak info \n";
static char __pyx_k_105[] = "# differential values are reported at the taller sample peak\n";
static char __pyx_k_107[] = "# log2_fold_change is positive if t1 > t2\n";
static char __pyx_k_109[] = "log2.fold.change.w.psuedocounts";
static char __pyx_k_110[] = "-log10.qvalue1";
static char __pyx_k_111[] = "-log10.qvalue2";
static char __pyx_k_121[] = "\t%d";
static char __pyx_k_122[] = "\tNA\tNA\tNA\tNA";
static char __pyx_k_127[] = "# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n";
static char __pyx_k_132[] = "# log2_fold_change is positive if t2 > t1\n";
static char __pyx_k_138[] = "\tNA\tNA\tNA\tNA\tNA\tNA";
static char __pyx_k_140[] = "\tNA";
static char __pyx_k_156[] = "track type=bedGraph name=\"%s\" description=\"log10-likelihood ratio %s\" visibility=2 alwaysZero=on\n";
static char __pyx_k_157[] = "track type=bedGraph name=\"%s\" description=\"-log10(pvalue)%s\" visibility=2 alwaysZero=on\n";
static char __pyx_k_158[] = "track type=bedGraph name=\"%s\" description=\"log10(sample1/sample2) %s\" visibility=2 alwaysZero=on\n";
static char __pyx_k_159[] = "ndarray is not C contiguous";
static char __pyx_k_161[] = "ndarray is not Fortran contiguous";
static char __pyx_k_163[] = "Non-native byte order not supported";
static char __pyx_k_165[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_166[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_169[] = "Format string allocated too short.";
static char __pyx_k_171[] = "Empty shape tuple for cython.array";
static char __pyx_k_173[] = "itemsize <= 0 for cython.array";
static char __pyx_k_176[] = "unable to allocate shape or strides.";
static char __pyx_k_178[] = "Invalid shape in axis %d: %d.";
static char __pyx_k_179[] = "Invalid mode, expected 'c' or 'fortran', got %s";
static char __pyx_k_181[] = "unable to allocate array data.";
static char __pyx_k_183[] = "Can only create a buffer that is contiguous in memory.";
static char __pyx_k_185[] = "Unable to convert item to object";
static char __pyx_k_187[] = "Buffer view does not expose strides";
static char __pyx_k_189[] = "<MemoryView of %r at 0x%x>";
static char __pyx_k_190[] = "<MemoryView of %r object>";
static char __pyx_k_193[] = "Cannot index with type '%s'";
static char __pyx_k_195[] = "Indirect dimensions not supported";
static char __pyx_k_197[] = "Index out of bounds (axis %d)";
static char __pyx_k_198[] = "Step may not be zero (axis %d)";
static char __pyx_k_199[] = "All dimensions preceding dimension %d must be indexed and not sliced";
static char __pyx_k_200[] = "Out of bounds on buffer access (axis %d)";
static char __pyx_k_201[] = "Cannot transpose memoryview with indirect dimensions";
static char __pyx_k_202[] = "got differing extents in dimension %d (got %d and %d)";
static char __pyx_k_203[] = "Dimension %d is not direct";
static char __pyx_k_204[] = "Module for Feature IO classes.\n\nCopyright (c) 2010,2011 Tao Liu <taoliu@jimmy.harvard.edu>\n\nThis code is free software; you can redistribute it and/or modify it\nunder the terms of the Artistic License (see the file COPYING included\nwith the distribution).\n\n@status:  experimental\n@version: $Revision$\n@author:  Tao Liu\n@contact: taoliu@jimmy.harvard.edu\n";
static char __pyx_k_205[] = "MACS2.cSignal";
static char __pyx_k_206[] = "scipy.stats";
static char __pyx_k_207[] = "MACS2.Constants";
static char __pyx_k_208[] = "MACS2.IO.cPeakIO";
static char __pyx_k_209[] = "MACS2.hashtable";
static char __pyx_k_210[] = "scoreTrackI $Revision$";
static char __pyx_k_211[] = "Tao Liu <taoliu@jimmy.harvard.edu>";
static char __pyx_k_212[] = "scoreTrackI classes";
static char __pyx_k_215[] = "/Users/taoliu/Dropbox-UB/Dropbox/Projects/MACS2/MACS/MACS2/IO/cScoreTrack.pyx";
static char __pyx_k_218[] = "CombinedTwoTrack.__init__";
static char __pyx_k_221[] = "CombinedTwoTrack.add_chromosome";
static char __pyx_k_224[] = "CombinedTwoTrack.add";
static char __pyx_k_227[] = "CombinedTwoTrack.finalize";
static char __pyx_k_230[] = "CombinedTwoTrack.get_data_by_chr";
static char __pyx_k_233[] = "CombinedTwoTrack.get_chr_names";
static char __pyx_k_236[] = "CombinedTwoTrack.write_bedGraph";
static char __pyx_k_239[] = "CombinedTwoTrack.total";
static char __pyx_k_242[] = "CombinedTwoTrack.extract_value";
static char __pyx_k_245[] = "CombinedTwoTrack.extract_average";
static char __pyx_k_248[] = "CombinedTwoTrack.extract_sum";
static char __pyx_k_249[] = " For differential peak calling.\n    \n    ";
static char __pyx_k_250[] = "getbuffer(obj, view, flags)";
static char __pyx_k_251[] = "<strided and direct or indirect>";
static char __pyx_k_253[] = "<strided and direct>";
static char __pyx_k_255[] = "<strided and indirect>";
static char __pyx_k_257[] = "<contiguous and direct>";
static char __pyx_k_259[] = "<contiguous and indirect>";
static char __pyx_k__V1[] = "V1";
static char __pyx_k__V2[] = "V2";
static char __pyx_k__Zd[] = "Zd";
static char __pyx_k__Zf[] = "Zf";
static char __pyx_k__Zg[] = "Zg";
static char __pyx_k__fc[] = "fc";
static char __pyx_k__id[] = "id";
static char __pyx_k__np[] = "np";
static char __pyx_k__p1[] = "p1";
static char __pyx_k__p2[] = "p2";
static char __pyx_k__sf[] = "sf";
static char __pyx_k__v2[] = "v2";
static char __pyx_k__abs[] = "abs";
static char __pyx_k__add[] = "add";
static char __pyx_k__all[] = "all";
static char __pyx_k__bed[] = "bed";
static char __pyx_k__chr[] = "chr";
static char __pyx_k__end[] = "end";
static char __pyx_k__fhd[] = "fhd";
static char __pyx_k__map[] = "map";
static char __pyx_k__max[] = "max";
static char __pyx_k__min[] = "min";
static char __pyx_k__obj[] = "obj";
static char __pyx_k__ord[] = "ord";
static char __pyx_k__p1n[] = "p1n";
static char __pyx_k__p2n[] = "p2n";
static char __pyx_k__p2s[] = "p2s";
static char __pyx_k__pos[] = "pos";
static char __pyx_k__pre[] = "pre";
static char __pyx_k__ret[] = "ret";
static char __pyx_k__sum[] = "sum";
static char __pyx_k__v11[] = "v11";
static char __pyx_k__v21[] = "v21";
static char __pyx_k__v2n[] = "v2n";
static char __pyx_k__v2s[] = "v2s";
static char __pyx_k__xls[] = "xls";
static char __pyx_k__zip[] = "zip";
static char __pyx_k__MACS[] = "MACS";
static char __pyx_k__args[] = "args";
static char __pyx_k__base[] = "base";
static char __pyx_k__bool[] = "bool";
static char __pyx_k__chi2[] = "chi2";
static char __pyx_k__chip[] = "chip";
static char __pyx_k__chr1[] = "chr1";
static char __pyx_k__chr2[] = "chr2";
static char __pyx_k__chrs[] = "chrs";
static char __pyx_k__copy[] = "copy";
static char __pyx_k__data[] = "data";
static char __pyx_k__flat[] = "flat";
static char __pyx_k__join[] = "join";
static char __pyx_k__keys[] = "keys";
static char __pyx_k__ladd[] = "ladd";
static char __pyx_k__log2[] = "log2";
static char __pyx_k__mode[] = "mode";
static char __pyx_k__name[] = "name";
static char __pyx_k__ndim[] = "ndim";
static char __pyx_k__next[] = "next";
static char __pyx_k__ones[] = "ones";
static char __pyx_k__p1io[] = "p1io";
static char __pyx_k__p2io[] = "p2io";
static char __pyx_k__pack[] = "pack";
static char __pyx_k__radd[] = "radd";
static char __pyx_k__self[] = "self";
static char __pyx_k__size[] = "size";
static char __pyx_k__sort[] = "sort";
static char __pyx_k__step[] = "step";
static char __pyx_k__stop[] = "stop";
static char __pyx_k__v11n[] = "v11n";
static char __pyx_k__v21n[] = "v21n";
static char __pyx_k__xls1[] = "xls1";
static char __pyx_k__xls2[] = "xls2";
static char __pyx_k__ASCII[] = "ASCII";
static char __pyx_k__BYTE4[] = "BYTE4";
static char __pyx_k__array[] = "array";
static char __pyx_k__build[] = "build";
static char __pyx_k__c1bdg[] = "c1bdg";
static char __pyx_k__c2bdg[] = "c2bdg";
static char __pyx_k__chrom[] = "chrom";
static char __pyx_k__dtype[] = "dtype";
static char __pyx_k__error[] = "error";
static char __pyx_k__flags[] = "flags";
static char __pyx_k__int32[] = "int32";
static char __pyx_k__log10[] = "log10";
static char __pyx_k__logFC[] = "logFC";
static char __pyx_k__logLR[] = "logLR";
static char __pyx_k__numpy[] = "numpy";
static char __pyx_k__peaks[] = "peaks";
static char __pyx_k__pre_p[] = "pre_p";
static char __pyx_k__range[] = "range";
static char __pyx_k__right[] = "right";
static char __pyx_k__score[] = "score";
static char __pyx_k__shape[] = "shape";
static char __pyx_k__split[] = "split";
static char __pyx_k__start[] = "start";
static char __pyx_k__t1bdg[] = "t1bdg";
static char __pyx_k__t2bdg[] = "t2bdg";
static char __pyx_k__total[] = "total";
static char __pyx_k__v1add[] = "v1add";
static char __pyx_k__v2add[] = "v2add";
static char __pyx_k__value[] = "value";
static char __pyx_k__where[] = "where";
static char __pyx_k__write[] = "write";
static char __pyx_k__zeros[] = "zeros";
static char __pyx_k__FBYTE4[] = "FBYTE4";
static char __pyx_k__PeakIO[] = "PeakIO";
static char __pyx_k__append[] = "append";
static char __pyx_k__argmin[] = "argmin";
static char __pyx_k__astype[] = "astype";
static char __pyx_k__bpeaks[] = "bpeaks";
static char __pyx_k__column[] = "column";
static char __pyx_k__cutoff[] = "cutoff";
static char __pyx_k__decode[] = "decode";
static char __pyx_k__encode[] = "encode";
static char __pyx_k__endpos[] = "endpos";
static char __pyx_k__extend[] = "extend";
static char __pyx_k__format[] = "format";
static char __pyx_k__kwargs[] = "kwargs";
static char __pyx_k__larray[] = "larray";
static char __pyx_k__length[] = "length";
static char __pyx_k__maxima[] = "maxima";
static char __pyx_k__median[] = "median";
static char __pyx_k__pileup[] = "pileup";
static char __pyx_k__pscore[] = "pscore";
static char __pyx_k__pvalue[] = "pvalue";
static char __pyx_k__qscore[] = "qscore";
static char __pyx_k__rarray[] = "rarray";
static char __pyx_k__reduce[] = "reduce";
static char __pyx_k__resize[] = "resize";
static char __pyx_k__sorted[] = "sorted";
static char __pyx_k__struct[] = "struct";
static char __pyx_k__summit[] = "summit";
static char __pyx_k__treat1[] = "treat1";
static char __pyx_k__treat2[] = "treat2";
static char __pyx_k__unique[] = "unique";
static char __pyx_k__unpack[] = "unpack";
static char __pyx_k__xrange[] = "xrange";
static char __pyx_k__LOG10_E[] = "LOG10_E";
static char __pyx_k____doc__[] = "__doc__";
static char __pyx_k__colname[] = "colname";
static char __pyx_k__control[] = "control";
static char __pyx_k__float32[] = "float32";
static char __pyx_k__fortran[] = "fortran";
static char __pyx_k__has_key[] = "has_key";
static char __pyx_k__logging[] = "logging";
static char __pyx_k__max_gap[] = "max_gap";
static char __pyx_k__memview[] = "memview";
static char __pyx_k__nonzero[] = "nonzero";
static char __pyx_k__pointer[] = "pointer";
static char __pyx_k__pyarray[] = "pyarray";
static char __pyx_k__replace[] = "replace";
static char __pyx_k__reverse[] = "reverse";
static char __pyx_k__summit1[] = "summit1";
static char __pyx_k__summit2[] = "summit2";
static char __pyx_k__v1array[] = "v1array";
static char __pyx_k__v2array[] = "v2array";
static char __pyx_k__Ellipsis[] = "Ellipsis";
static char __pyx_k__KeyError[] = "KeyError";
static char __pyx_k____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____name__[] = "__name__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__blockNum[] = "blockNum";
static char __pyx_k__control1[] = "control1";
static char __pyx_k__control2[] = "control2";
static char __pyx_k__finalize[] = "finalize";
static char __pyx_k__get_item[] = "get_item";
static char __pyx_k__isfinite[] = "isfinite";
static char __pyx_k__itemsize[] = "itemsize";
static char __pyx_k__lvl2peak[] = "lvl2peak";
static char __pyx_k__operator[] = "operator";
static char __pyx_k__refcheck[] = "refcheck";
static char __pyx_k__set_item[] = "set_item";
static char __pyx_k__thickEnd[] = "thickEnd";
static char __pyx_k__Exception[] = "Exception";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k____class__[] = "__class__";
static char __pyx_k__bdgTrack2[] = "bdgTrack2";
static char __pyx_k__enumerate[] = "enumerate";
static char __pyx_k__peakname1[] = "peakname1";
static char __pyx_k__peakname2[] = "peakname2";
static char __pyx_k__stderr_on[] = "stderr_on";
static char __pyx_k__trackline[] = "trackline";
static char __pyx_k__IndexError[] = "IndexError";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k____author__[] = "__author__";
static char __pyx_k__blockSizes[] = "blockSizes";
static char __pyx_k__call_peaks[] = "call_peaks";
static char __pyx_k__chrom_data[] = "chrom_data";
static char __pyx_k__chromosome[] = "chromosome";
static char __pyx_k__common_chr[] = "common_chr";
static char __pyx_k__ctrl_depth[] = "ctrl_depth";
static char __pyx_k__cur_region[] = "cur_region";
static char __pyx_k__do_nothing[] = "do_nothing";
static char __pyx_k__has_peakio[] = "has_peakio";
static char __pyx_k__itemgetter[] = "itemgetter";
static char __pyx_k__logical_or[] = "logical_or";
static char __pyx_k__min_length[] = "min_length";
static char __pyx_k__peak_score[] = "peak_score";
static char __pyx_k__thickStart[] = "thickStart";
static char __pyx_k__BroadPeakIO[] = "BroadPeakIO";
static char __pyx_k__MemoryError[] = "MemoryError";
static char __pyx_k____version__[] = "__version__";
static char __pyx_k__blockStarts[] = "blockStarts";
static char __pyx_k__cond1_depth[] = "cond1_depth";
static char __pyx_k__cond2_depth[] = "cond2_depth";
static char __pyx_k__description[] = "description";
static char __pyx_k__extract_sum[] = "extract_sum";
static char __pyx_k__fold_change[] = "fold_change";
static char __pyx_k__logical_and[] = "logical_and";
static char __pyx_k__logical_not[] = "logical_not";
static char __pyx_k__lvl1_cutoff[] = "lvl1_cutoff";
static char __pyx_k__lvl1peakset[] = "lvl1peakset";
static char __pyx_k__lvl2_cutoff[] = "lvl2_cutoff";
static char __pyx_k__name_prefix[] = "name_prefix";
static char __pyx_k__pseudocount[] = "pseudocount";
static char __pyx_k__store_peaks[] = "store_peaks";
static char __pyx_k__treat_depth[] = "treat_depth";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static char __pyx_k__call_summits[] = "call_summits";
static char __pyx_k__intersection[] = "intersection";
static char __pyx_k__lvl1_max_gap[] = "lvl1_max_gap";
static char __pyx_k__lvl2_max_gap[] = "lvl2_max_gap";
static char __pyx_k__score_method[] = "score_method";
static char __pyx_k__searchsorted[] = "searchsorted";
static char __pyx_k__write_matrix[] = "write_matrix";
static char __pyx_k__write_peaks2[] = "write_peaks2";
static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k__chrom_max_len[] = "chrom_max_len";
static char __pyx_k__extract_value[] = "extract_value";
static char __pyx_k__get_chr_names[] = "get_chr_names";
static char __pyx_k__make_pq_table[] = "make_pq_table";
static char __pyx_k__Int64HashTable[] = "Int64HashTable";
static char __pyx_k__NotImplemented[] = "NotImplemented";
static char __pyx_k__add_chromosome[] = "add_chromosome";
static char __pyx_k__annotate_peaks[] = "annotate_peaks";
static char __pyx_k__break_on_peaks[] = "break_on_peaks";
static char __pyx_k__parse_peakname[] = "parse_peakname";
static char __pyx_k__reassign_peaks[] = "reassign_peaks";
static char __pyx_k__write_bedGraph[] = "write_bedGraph";
static char __pyx_k____add_broadpeak[] = "__add_broadpeak";
static char __pyx_k____pyx_getbuffer[] = "__pyx_getbuffer";
static char __pyx_k__allocate_buffer[] = "allocate_buffer";
static char __pyx_k__call_broadpeaks[] = "call_broadpeaks";
static char __pyx_k__call_diff_peaks[] = "call_diff_peaks";
static char __pyx_k__captureWarnings[] = "captureWarnings";
static char __pyx_k__dtype_is_object[] = "dtype_is_object";
static char __pyx_k__enforce_valleys[] = "enforce_valleys";
static char __pyx_k__extract_average[] = "extract_average";
static char __pyx_k__get_common_chrs[] = "get_common_chrs";
static char __pyx_k__get_data_by_chr[] = "get_data_by_chr";
static char __pyx_k__set_pseudocount[] = "set_pseudocount";
static char __pyx_k__CombinedTwoTrack[] = "CombinedTwoTrack";
static char __pyx_k__Float64HashTable[] = "Float64HashTable";
static char __pyx_k__enable_trackline[] = "enable_trackline";
static char __pyx_k__logLR_khashtable[] = "logLR_khashtable";
static char __pyx_k__print_diff_peaks[] = "print_diff_peaks";
static char __pyx_k__print_some_peaks[] = "print_some_peaks";
static char __pyx_k__enforce_peakyness[] = "enforce_peakyness";
static char __pyx_k__pscore_khashtable[] = "pscore_khashtable";
static char __pyx_k__NotImplementedError[] = "NotImplementedError";
static char __pyx_k__change_score_method[] = "change_score_method";
static char __pyx_k__compute_all_pvalues[] = "compute_all_pvalues";
static char __pyx_k__get_data_from_chrom[] = "get_data_from_chrom";
static char __pyx_k__rebuild_chromosomes[] = "rebuild_chromosomes";
static PyObject *__pyx_n_s_10;
static PyObject *__pyx_kp_s_100;
static PyObject *__pyx_kp_s_102;
static PyObject *__pyx_kp_s_105;
static PyObject *__pyx_kp_s_107;
static PyObject *__pyx_kp_s_109;
static PyObject *__pyx_kp_s_110;
static PyObject *__pyx_kp_s_111;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_kp_s_121;
static PyObject *__pyx_kp_s_122;
static PyObject *__pyx_kp_s_127;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_kp_s_132;
static PyObject *__pyx_kp_s_138;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_s_140;
static PyObject *__pyx_kp_s_156;
static PyObject *__pyx_kp_s_157;
static PyObject *__pyx_kp_s_158;
static PyObject *__pyx_kp_u_159;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_kp_u_161;
static PyObject *__pyx_kp_u_163;
static PyObject *__pyx_kp_u_165;
static PyObject *__pyx_kp_u_166;
static PyObject *__pyx_kp_u_169;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_kp_s_171;
static PyObject *__pyx_kp_s_173;
static PyObject *__pyx_kp_s_176;
static PyObject *__pyx_kp_s_178;
static PyObject *__pyx_kp_s_179;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_181;
static PyObject *__pyx_kp_s_183;
static PyObject *__pyx_kp_s_185;
static PyObject *__pyx_kp_s_187;
static PyObject *__pyx_kp_s_189;
static PyObject *__pyx_n_s_19;
static PyObject *__pyx_kp_s_190;
static PyObject *__pyx_kp_s_193;
static PyObject *__pyx_kp_s_195;
static PyObject *__pyx_n_s_20;
static PyObject *__pyx_kp_s_200;
static PyObject *__pyx_kp_s_202;
static PyObject *__pyx_n_s_205;
static PyObject *__pyx_n_s_206;
static PyObject *__pyx_n_s_207;
static PyObject *__pyx_n_s_208;
static PyObject *__pyx_n_s_209;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_210;
static PyObject *__pyx_kp_s_211;
static PyObject *__pyx_kp_s_212;
static PyObject *__pyx_kp_s_215;
static PyObject *__pyx_n_s_218;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_n_s_221;
static PyObject *__pyx_n_s_224;
static PyObject *__pyx_n_s_227;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_n_s_230;
static PyObject *__pyx_n_s_233;
static PyObject *__pyx_n_s_236;
static PyObject *__pyx_n_s_239;
static PyObject *__pyx_n_s_24;
static PyObject *__pyx_n_s_242;
static PyObject *__pyx_n_s_245;
static PyObject *__pyx_n_s_248;
static PyObject *__pyx_kp_s_249;
static PyObject *__pyx_kp_s_251;
static PyObject *__pyx_kp_s_253;
static PyObject *__pyx_kp_s_255;
static PyObject *__pyx_kp_s_257;
static PyObject *__pyx_kp_s_259;
static PyObject *__pyx_n_s_29;
static PyObject *__pyx_n_s_31;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_n_s_41;
static PyObject *__pyx_n_s_46;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_n_s_53;
static PyObject *__pyx_n_s_54;
static PyObject *__pyx_n_s_57;
static PyObject *__pyx_kp_s_59;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_60;
static PyObject *__pyx_kp_s_61;
static PyObject *__pyx_kp_s_62;
static PyObject *__pyx_kp_s_64;
static PyObject *__pyx_kp_s_66;
static PyObject *__pyx_kp_s_68;
static PyObject *__pyx_kp_s_70;
static PyObject *__pyx_kp_s_71;
static PyObject *__pyx_kp_s_72;
static PyObject *__pyx_kp_s_73;
static PyObject *__pyx_kp_s_74;
static PyObject *__pyx_kp_s_75;
static PyObject *__pyx_kp_s_76;
static PyObject *__pyx_kp_s_77;
static PyObject *__pyx_kp_s_78;
static PyObject *__pyx_kp_s_79;
static PyObject *__pyx_kp_s_80;
static PyObject *__pyx_kp_s_81;
static PyObject *__pyx_kp_s_82;
static PyObject *__pyx_kp_s_85;
static PyObject *__pyx_kp_s_86;
static PyObject *__pyx_kp_s_90;
static PyObject *__pyx_kp_s_91;
static PyObject *__pyx_kp_s_92;
static PyObject *__pyx_kp_s_93;
static PyObject *__pyx_kp_s_95;
static PyObject *__pyx_kp_s_97;
static PyObject *__pyx_kp_s_98;
static PyObject *__pyx_n_s__ASCII;
static PyObject *__pyx_n_s__BYTE4;
static PyObject *__pyx_n_s__BroadPeakIO;
static PyObject *__pyx_n_s__CombinedTwoTrack;
static PyObject *__pyx_n_s__Ellipsis;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__FBYTE4;
static PyObject *__pyx_n_s__Float64HashTable;
static PyObject *__pyx_n_s__IndexError;
static PyObject *__pyx_n_s__Int64HashTable;
static PyObject *__pyx_n_s__KeyError;
static PyObject *__pyx_n_s__LOG10_E;
static PyObject *__pyx_n_s__MACS;
static PyObject *__pyx_n_s__MemoryError;
static PyObject *__pyx_n_s__NotImplemented;
static PyObject *__pyx_n_s__NotImplementedError;
static PyObject *__pyx_n_b__O;
static PyObject *__pyx_n_s__PeakIO;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__StopIteration;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__V1;
static PyObject *__pyx_n_s__V2;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____add_broadpeak;
static PyObject *__pyx_n_s____author__;
static PyObject *__pyx_n_s____class__;
static PyObject *__pyx_n_s____doc__;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____name__;
static PyObject *__pyx_n_s____pyx_getbuffer;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s____version__;
static PyObject *__pyx_n_s__abs;
static PyObject *__pyx_n_s__add;
static PyObject *__pyx_n_s__add_chromosome;
static PyObject *__pyx_n_s__all;
static PyObject *__pyx_n_s__allocate_buffer;
static PyObject *__pyx_n_s__annotate_peaks;
static PyObject *__pyx_n_s__append;
static PyObject *__pyx_n_s__argmin;
static PyObject *__pyx_n_s__args;
static PyObject *__pyx_n_s__array;
static PyObject *__pyx_n_s__astype;
static PyObject *__pyx_n_s__base;
static PyObject *__pyx_n_s__bdgTrack2;
static PyObject *__pyx_n_s__bed;
static PyObject *__pyx_n_s__blockNum;
static PyObject *__pyx_n_s__blockSizes;
static PyObject *__pyx_n_s__blockStarts;
static PyObject *__pyx_n_s__bool;
static PyObject *__pyx_n_s__bpeaks;
static PyObject *__pyx_n_s__break_on_peaks;
static PyObject *__pyx_n_s__build;
static PyObject *__pyx_n_b__c;
static PyObject *__pyx_n_s__c;
static PyObject *__pyx_n_u__c;
static PyObject *__pyx_n_s__c1bdg;
static PyObject *__pyx_n_s__c2bdg;
static PyObject *__pyx_n_s__call_broadpeaks;
static PyObject *__pyx_n_s__call_diff_peaks;
static PyObject *__pyx_n_s__call_peaks;
static PyObject *__pyx_n_s__call_summits;
static PyObject *__pyx_n_s__captureWarnings;
static PyObject *__pyx_n_s__change_score_method;
static PyObject *__pyx_n_s__chi2;
static PyObject *__pyx_n_s__chip;
static PyObject *__pyx_n_s__chr;
static PyObject *__pyx_n_s__chr1;
static PyObject *__pyx_n_s__chr2;
static PyObject *__pyx_n_s__chrom;
static PyObject *__pyx_n_s__chrom_data;
static PyObject *__pyx_n_s__chrom_max_len;
static PyObject *__pyx_n_s__chromosome;
static PyObject *__pyx_n_s__chrs;
static PyObject *__pyx_n_s__colname;
static PyObject *__pyx_n_s__column;
static PyObject *__pyx_n_s__common_chr;
static PyObject *__pyx_n_s__compute_all_pvalues;
static PyObject *__pyx_n_s__cond1_depth;
static PyObject *__pyx_n_s__cond2_depth;
static PyObject *__pyx_n_s__control;
static PyObject *__pyx_n_s__control1;
static PyObject *__pyx_n_s__control2;
static PyObject *__pyx_n_s__copy;
static PyObject *__pyx_n_s__ctrl_depth;
static PyObject *__pyx_n_s__cur_region;
static PyObject *__pyx_n_s__cutoff;
static PyObject *__pyx_n_s__d;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__decode;
static PyObject *__pyx_n_s__description;
static PyObject *__pyx_n_s__do_nothing;
static PyObject *__pyx_n_s__dtype;
static PyObject *__pyx_n_s__dtype_is_object;
static PyObject *__pyx_n_s__enable_trackline;
static PyObject *__pyx_n_s__encode;
static PyObject *__pyx_n_s__end;
static PyObject *__pyx_n_s__endpos;
static PyObject *__pyx_n_s__enforce_peakyness;
static PyObject *__pyx_n_s__enforce_valleys;
static PyObject *__pyx_n_s__enumerate;
static PyObject *__pyx_n_s__error;
static PyObject *__pyx_n_s__extend;
static PyObject *__pyx_n_s__extract_average;
static PyObject *__pyx_n_s__extract_sum;
static PyObject *__pyx_n_s__extract_value;
static PyObject *__pyx_n_s__fc;
static PyObject *__pyx_n_s__fhd;
static PyObject *__pyx_n_s__finalize;
static PyObject *__pyx_n_s__flags;
static PyObject *__pyx_n_s__flat;
static PyObject *__pyx_n_s__float32;
static PyObject *__pyx_n_s__fold_change;
static PyObject *__pyx_n_s__format;
static PyObject *__pyx_n_b__fortran;
static PyObject *__pyx_n_s__fortran;
static PyObject *__pyx_n_s__get_chr_names;
static PyObject *__pyx_n_s__get_common_chrs;
static PyObject *__pyx_n_s__get_data_by_chr;
static PyObject *__pyx_n_s__get_data_from_chrom;
static PyObject *__pyx_n_s__get_item;
static PyObject *__pyx_n_s__has_key;
static PyObject *__pyx_n_s__has_peakio;
static PyObject *__pyx_n_s__i;
static PyObject *__pyx_n_s__id;
static PyObject *__pyx_n_s__int32;
static PyObject *__pyx_n_s__intersection;
static PyObject *__pyx_n_s__isfinite;
static PyObject *__pyx_n_s__itemgetter;
static PyObject *__pyx_n_s__itemsize;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__keys;
static PyObject *__pyx_n_s__kwargs;
static PyObject *__pyx_n_s__l;
static PyObject *__pyx_n_s__ladd;
static PyObject *__pyx_n_s__larray;
static PyObject *__pyx_n_s__length;
static PyObject *__pyx_n_s__log10;
static PyObject *__pyx_n_s__log2;
static PyObject *__pyx_n_s__logFC;
static PyObject *__pyx_n_s__logLR;
static PyObject *__pyx_n_s__logLR_khashtable;
static PyObject *__pyx_n_s__logging;
static PyObject *__pyx_n_s__logical_and;
static PyObject *__pyx_n_s__logical_not;
static PyObject *__pyx_n_s__logical_or;
static PyObject *__pyx_n_s__lvl1_cutoff;
static PyObject *__pyx_n_s__lvl1_max_gap;
static PyObject *__pyx_n_s__lvl1peakset;
static PyObject *__pyx_n_s__lvl2_cutoff;
static PyObject *__pyx_n_s__lvl2_max_gap;
static PyObject *__pyx_n_s__lvl2peak;
static PyObject *__pyx_n_s__make_pq_table;
static PyObject *__pyx_n_s__map;
static PyObject *__pyx_n_s__max;
static PyObject *__pyx_n_s__max_gap;
static PyObject *__pyx_n_s__maxima;
static PyObject *__pyx_n_s__median;
static PyObject *__pyx_n_s__memview;
static PyObject *__pyx_n_s__min;
static PyObject *__pyx_n_s__min_length;
static PyObject *__pyx_n_s__mode;
static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__name_prefix;
static PyObject *__pyx_n_s__ndim;
static PyObject *__pyx_n_s__next;
static PyObject *__pyx_n_s__nonzero;
static PyObject *__pyx_n_s__np;
static PyObject *__pyx_n_s__numpy;
static PyObject *__pyx_n_s__obj;
static PyObject *__pyx_n_s__ones;
static PyObject *__pyx_n_s__operator;
static PyObject *__pyx_n_s__ord;
static PyObject *__pyx_n_s__p;
static PyObject *__pyx_n_s__p1;
static PyObject *__pyx_n_s__p1io;
static PyObject *__pyx_n_s__p1n;
static PyObject *__pyx_n_s__p2;
static PyObject *__pyx_n_s__p2io;
static PyObject *__pyx_n_s__p2n;
static PyObject *__pyx_n_s__p2s;
static PyObject *__pyx_n_s__pack;
static PyObject *__pyx_n_s__parse_peakname;
static PyObject *__pyx_n_s__peak_score;
static PyObject *__pyx_n_s__peakname1;
static PyObject *__pyx_n_s__peakname2;
static PyObject *__pyx_n_s__peaks;
static PyObject *__pyx_n_s__pileup;
static PyObject *__pyx_n_s__pointer;
static PyObject *__pyx_n_s__pos;
static PyObject *__pyx_n_s__pre;
static PyObject *__pyx_n_s__pre_p;
static PyObject *__pyx_n_s__print_diff_peaks;
static PyObject *__pyx_n_s__print_some_peaks;
static PyObject *__pyx_n_s__pscore;
static PyObject *__pyx_n_s__pscore_khashtable;
static PyObject *__pyx_n_s__pseudocount;
static PyObject *__pyx_n_s__pvalue;
static PyObject *__pyx_n_s__pyarray;
static PyObject *__pyx_n_s__q;
static PyObject *__pyx_n_s__qscore;
static PyObject *__pyx_n_s__radd;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__rarray;
static PyObject *__pyx_n_s__reassign_peaks;
static PyObject *__pyx_n_s__rebuild_chromosomes;
static PyObject *__pyx_n_s__reduce;
static PyObject *__pyx_n_s__refcheck;
static PyObject *__pyx_n_s__replace;
static PyObject *__pyx_n_s__resize;
static PyObject *__pyx_n_s__ret;
static PyObject *__pyx_n_s__reverse;
static PyObject *__pyx_n_s__right;
static PyObject *__pyx_n_s__score;
static PyObject *__pyx_n_s__score_method;
static PyObject *__pyx_n_s__searchsorted;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__set_item;
static PyObject *__pyx_n_s__set_pseudocount;
static PyObject *__pyx_n_s__sf;
static PyObject *__pyx_n_s__shape;
static PyObject *__pyx_n_s__size;
static PyObject *__pyx_n_s__sort;
static PyObject *__pyx_n_s__sorted;
static PyObject *__pyx_n_s__split;
static PyObject *__pyx_n_s__start;
static PyObject *__pyx_n_s__stderr_on;
static PyObject *__pyx_n_s__step;
static PyObject *__pyx_n_s__stop;
static PyObject *__pyx_n_s__store_peaks;
static PyObject *__pyx_n_s__struct;
static PyObject *__pyx_n_s__sum;
static PyObject *__pyx_n_s__summit;
static PyObject *__pyx_n_s__summit1;
static PyObject *__pyx_n_s__summit2;
static PyObject *__pyx_n_s__t;
static PyObject *__pyx_n_s__t1bdg;
static PyObject *__pyx_n_s__t2bdg;
static PyObject *__pyx_n_s__thickEnd;
static PyObject *__pyx_n_s__thickStart;
static PyObject *__pyx_n_s__total;
static PyObject *__pyx_n_s__trackline;
static PyObject *__pyx_n_s__treat1;
static PyObject *__pyx_n_s__treat2;
static PyObject *__pyx_n_s__treat_depth;
static PyObject *__pyx_n_s__unique;
static PyObject *__pyx_n_s__unpack;
static PyObject *__pyx_n_s__v11;
static PyObject *__pyx_n_s__v11n;
static PyObject *__pyx_n_s__v1add;
static PyObject *__pyx_n_s__v1array;
static PyObject *__pyx_n_s__v2;
static PyObject *__pyx_n_s__v21;
static PyObject *__pyx_n_s__v21n;
static PyObject *__pyx_n_s__v2add;
static PyObject *__pyx_n_s__v2array;
static PyObject *__pyx_n_s__v2n;
static PyObject *__pyx_n_s__v2s;
static PyObject *__pyx_n_s__value;
static PyObject *__pyx_n_s__where;
static PyObject *__pyx_n_s__write;
static PyObject *__pyx_n_s__write_bedGraph;
static PyObject *__pyx_n_s__write_matrix;
static PyObject *__pyx_n_s__write_peaks2;
static PyObject *__pyx_n_s__x;
static PyObject *__pyx_n_s__xls;
static PyObject *__pyx_n_s__xls1;
static PyObject *__pyx_n_s__xls2;
static PyObject *__pyx_n_s__xrange;
static PyObject *__pyx_n_s__y;
static PyObject *__pyx_n_s__zeros;
static PyObject *__pyx_n_s__zip;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_15;
static PyObject *__pyx_int_78;
static PyBoolObject *__pyx_k_9;
static PyBoolObject *__pyx_k_15;
static PyBoolObject *__pyx_k_34;
static PyObject *__pyx_k_63;
static PyObject *__pyx_k_96;
static PyBoolObject *__pyx_k_153;
static PyObject *__pyx_k_tuple_1;
static PyObject *__pyx_k_tuple_2;
static PyObject *__pyx_k_tuple_3;
static PyObject *__pyx_k_tuple_7;
static PyObject *__pyx_k_tuple_8;
static PyObject *__pyx_k_tuple_11;
static PyObject *__pyx_k_tuple_25;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_27;
static PyObject *__pyx_k_tuple_28;
static PyObject *__pyx_k_tuple_30;
static PyObject *__pyx_k_tuple_32;
static PyObject *__pyx_k_tuple_35;
static PyObject *__pyx_k_tuple_36;
static PyObject *__pyx_k_tuple_37;
static PyObject *__pyx_k_tuple_38;
static PyObject *__pyx_k_tuple_39;
static PyObject *__pyx_k_tuple_40;
static PyObject *__pyx_k_tuple_42;
static PyObject *__pyx_k_tuple_43;
static PyObject *__pyx_k_tuple_44;
static PyObject *__pyx_k_tuple_45;
static PyObject *__pyx_k_tuple_47;
static PyObject *__pyx_k_tuple_48;
static PyObject *__pyx_k_tuple_49;
static PyObject *__pyx_k_tuple_50;
static PyObject *__pyx_k_tuple_51;
static PyObject *__pyx_k_tuple_52;
static PyObject *__pyx_k_tuple_55;
static PyObject *__pyx_k_tuple_56;
static PyObject *__pyx_k_tuple_58;
static PyObject *__pyx_k_tuple_65;
static PyObject *__pyx_k_tuple_67;
static PyObject *__pyx_k_tuple_69;
static PyObject *__pyx_k_tuple_83;
static PyObject *__pyx_k_tuple_84;
static PyObject *__pyx_k_tuple_87;
static PyObject *__pyx_k_tuple_88;
static PyObject *__pyx_k_tuple_89;
static PyObject *__pyx_k_tuple_94;
static PyObject *__pyx_k_tuple_99;
static PyObject *__pyx_k_tuple_101;
static PyObject *__pyx_k_tuple_103;
static PyObject *__pyx_k_tuple_104;
static PyObject *__pyx_k_tuple_106;
static PyObject *__pyx_k_tuple_108;
static PyObject *__pyx_k_tuple_112;
static PyObject *__pyx_k_tuple_113;
static PyObject *__pyx_k_tuple_114;
static PyObject *__pyx_k_tuple_115;
static PyObject *__pyx_k_tuple_116;
static PyObject *__pyx_k_tuple_117;
static PyObject *__pyx_k_tuple_118;
static PyObject *__pyx_k_tuple_119;
static PyObject *__pyx_k_tuple_120;
static PyObject *__pyx_k_tuple_123;
static PyObject *__pyx_k_tuple_124;
static PyObject *__pyx_k_tuple_125;
static PyObject *__pyx_k_tuple_126;
static PyObject *__pyx_k_tuple_128;
static PyObject *__pyx_k_tuple_129;
static PyObject *__pyx_k_tuple_130;
static PyObject *__pyx_k_tuple_131;
static PyObject *__pyx_k_tuple_133;
static PyObject *__pyx_k_tuple_134;
static PyObject *__pyx_k_tuple_135;
static PyObject *__pyx_k_tuple_136;
static PyObject *__pyx_k_tuple_137;
static PyObject *__pyx_k_tuple_139;
static PyObject *__pyx_k_tuple_141;
static PyObject *__pyx_k_tuple_142;
static PyObject *__pyx_k_tuple_143;
static PyObject *__pyx_k_tuple_144;
static PyObject *__pyx_k_tuple_145;
static PyObject *__pyx_k_tuple_146;
static PyObject *__pyx_k_tuple_147;
static PyObject *__pyx_k_tuple_148;
static PyObject *__pyx_k_tuple_149;
static PyObject *__pyx_k_tuple_150;
static PyObject *__pyx_k_tuple_151;
static PyObject *__pyx_k_tuple_152;
static PyObject *__pyx_k_tuple_154;
static PyObject *__pyx_k_tuple_155;
static PyObject *__pyx_k_tuple_160;
static PyObject *__pyx_k_tuple_162;
static PyObject *__pyx_k_tuple_164;
static PyObject *__pyx_k_tuple_167;
static PyObject *__pyx_k_tuple_168;
static PyObject *__pyx_k_tuple_170;
static PyObject *__pyx_k_tuple_172;
static PyObject *__pyx_k_tuple_174;
static PyObject *__pyx_k_tuple_175;
static PyObject *__pyx_k_tuple_177;
static PyObject *__pyx_k_tuple_180;
static PyObject *__pyx_k_tuple_182;
static PyObject *__pyx_k_tuple_184;
static PyObject *__pyx_k_tuple_186;
static PyObject *__pyx_k_tuple_188;
static PyObject *__pyx_k_tuple_191;
static PyObject *__pyx_k_tuple_192;
static PyObject *__pyx_k_tuple_194;
static PyObject *__pyx_k_tuple_196;
static PyObject *__pyx_k_tuple_213;
static PyObject *__pyx_k_tuple_216;
static PyObject *__pyx_k_tuple_219;
static PyObject *__pyx_k_tuple_222;
static PyObject *__pyx_k_tuple_225;
static PyObject *__pyx_k_tuple_228;
static PyObject *__pyx_k_tuple_231;
static PyObject *__pyx_k_tuple_234;
static PyObject *__pyx_k_tuple_237;
static PyObject *__pyx_k_tuple_240;
static PyObject *__pyx_k_tuple_243;
static PyObject *__pyx_k_tuple_246;
static PyObject *__pyx_k_tuple_252;
static PyObject *__pyx_k_tuple_254;
static PyObject *__pyx_k_tuple_256;
static PyObject *__pyx_k_tuple_258;
static PyObject *__pyx_k_tuple_260;
static PyObject *__pyx_k_codeobj_214;
static PyObject *__pyx_k_codeobj_217;
static PyObject *__pyx_k_codeobj_220;
static PyObject *__pyx_k_codeobj_223;
static PyObject *__pyx_k_codeobj_226;
static PyObject *__pyx_k_codeobj_229;
static PyObject *__pyx_k_codeobj_232;
static PyObject *__pyx_k_codeobj_235;
static PyObject *__pyx_k_codeobj_238;
static PyObject *__pyx_k_codeobj_241;
static PyObject *__pyx_k_codeobj_244;
static PyObject *__pyx_k_codeobj_247;

/* "MACS2/IO/cScoreTrack.pyx":59
 * # Misc functions
 * # ------------------------------------
 * cdef inline int int_max(int a, int b): return a if a >= b else b             # <<<<<<<<<<<<<<
 * cdef inline int int_min(int a, int b): return a if a <= b else b
 * def do_nothing(*args, **kwargs):
 */

static CYTHON_INLINE int __pyx_f_5MACS2_2IO_11cScoreTrack_int_max(int __pyx_v_a, int __pyx_v_b) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("int_max", 0);
  if ((__pyx_v_a >= __pyx_v_b)) {
    __pyx_t_1 = __pyx_v_a;
  } else {
    __pyx_t_1 = __pyx_v_b;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

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

/* "MACS2/IO/cScoreTrack.pyx":60
 * # ------------------------------------
 * cdef inline int int_max(int a, int b): return a if a >= b else b
 * cdef inline int int_min(int a, int b): return a if a <= b else b             # <<<<<<<<<<<<<<
 * def do_nothing(*args, **kwargs):
 *     pass
 */

static CYTHON_INLINE int __pyx_f_5MACS2_2IO_11cScoreTrack_int_min(int __pyx_v_a, int __pyx_v_b) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("int_min", 0);
  if ((__pyx_v_a <= __pyx_v_b)) {
    __pyx_t_1 = __pyx_v_a;
  } else {
    __pyx_t_1 = __pyx_v_b;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_1do_nothing(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_1do_nothing = {__Pyx_NAMESTR("do_nothing"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_1do_nothing, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_1do_nothing(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_nothing (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "do_nothing", 1))) return NULL;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_do_nothing(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":61
 * cdef inline int int_max(int a, int b): return a if a >= b else b
 * cdef inline int int_min(int a, int b): return a if a <= b else b
 * def do_nothing(*args, **kwargs):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_do_nothing(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_nothing", 0);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":67
 * pscore_khashtable = Int64HashTable()
 * 
 * cdef inline double get_pscore ( int observed, double expectation ):             # <<<<<<<<<<<<<<
 *     """Get p-value score from Poisson test. First check existing
 *     table, if failed, call poisson_cdf function, then store the result
 */

static CYTHON_INLINE double __pyx_f_5MACS2_2IO_11cScoreTrack_get_pscore(int __pyx_v_observed, double __pyx_v_expectation) {
  double __pyx_v_score;
  long __pyx_v_key_value;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  double __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  struct __pyx_opt_args_5MACS2_5cProb_poisson_cdf __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_pscore", 0);

  /* "MACS2/IO/cScoreTrack.pyx":78
 * 
 *     #key_value = ( observed, expectation )
 *     key_value = hash( (observed, expectation ) )             # <<<<<<<<<<<<<<
 *     try:
 *         return pscore_khashtable.get_item(key_value)
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_observed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_expectation); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_key_value = __pyx_t_4;

  /* "MACS2/IO/cScoreTrack.pyx":79
 *     #key_value = ( observed, expectation )
 *     key_value = hash( (observed, expectation ) )
 *     try:             # <<<<<<<<<<<<<<
 *         return pscore_khashtable.get_item(key_value)
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "MACS2/IO/cScoreTrack.pyx":80
 *     key_value = hash( (observed, expectation ) )
 *     try:
 *         return pscore_khashtable.get_item(key_value)             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         score = -1*poisson_cdf(observed,expectation,False,True)
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__pscore_khashtable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromLong(__pyx_v_key_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_8;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L10_try_end;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":81
 *     try:
 *         return pscore_khashtable.get_item(key_value)
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         score = -1*poisson_cdf(observed,expectation,False,True)
 *         pscore_khashtable.set_item(key_value, score)
 */
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("MACS2.IO.cScoreTrack.get_pscore", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);

      /* "MACS2/IO/cScoreTrack.pyx":82
 *         return pscore_khashtable.get_item(key_value)
 *     except KeyError:
 *         score = -1*poisson_cdf(observed,expectation,False,True)             # <<<<<<<<<<<<<<
 *         pscore_khashtable.set_item(key_value, score)
 *         return score
 */
      __pyx_t_10 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      if (!(likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (!(likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __pyx_t_12.__pyx_n = 2;
      __pyx_t_12.lower = ((PyBoolObject *)__pyx_t_10);
      __pyx_t_12.log10 = ((PyBoolObject *)__pyx_t_11);
      __pyx_t_8 = __pyx_f_5MACS2_5cProb_poisson_cdf(__pyx_v_observed, __pyx_v_expectation, 0, &__pyx_t_12); 
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_v_score = (-1.0 * __pyx_t_8);

      /* "MACS2/IO/cScoreTrack.pyx":83
 *     except KeyError:
 *         score = -1*poisson_cdf(observed,expectation,False,True)
 *         pscore_khashtable.set_item(key_value, score)             # <<<<<<<<<<<<<<
 *         return score
 *     #if pscore_dict.has_key(key_value):
 */
      __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__pscore_khashtable); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__set_item); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyInt_FromLong(__pyx_v_key_value); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13 = PyFloat_FromDouble(__pyx_v_score); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_11 = 0;
      __pyx_t_13 = 0;
      __pyx_t_13 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":84
 *         score = -1*poisson_cdf(observed,expectation,False,True)
 *         pscore_khashtable.set_item(key_value, score)
 *         return score             # <<<<<<<<<<<<<<
 *     #if pscore_dict.has_key(key_value):
 *     #    return pscore_dict[key_value]
 */
      __pyx_r = __pyx_v_score;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L10_try_end:;
  }

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_WriteUnraisable("MACS2.IO.cScoreTrack.get_pscore", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":94
 * logLR_khashtable = Int64HashTable()
 * 
 * cdef double get_interpolated_pscore ( double observed, double expectation ):             # <<<<<<<<<<<<<<
 *     cdef:
 *         double pscore
 */

static double __pyx_f_5MACS2_2IO_11cScoreTrack_get_interpolated_pscore(double __pyx_v_observed, double __pyx_v_expectation) {
  double __pyx_v_pscore;
  double __pyx_v_observed_floor;
  double __pyx_v_observed_ceil;
  CYTHON_UNUSED double __pyx_v_step;
  double __pyx_v_floor_pscore;
  double __pyx_v_ceil_pscore;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_interpolated_pscore", 0);

  /* "MACS2/IO/cScoreTrack.pyx":99
 *         double observed_floor, observed_ceil, step
 *         double floor_pscore, ceil_pscore
 *     observed_floor = floor(observed)             # <<<<<<<<<<<<<<
 *     observed_ceil = ceil(observed)
 *     step = observed - observed_floor
 */
  __pyx_v_observed_floor = floor(__pyx_v_observed);

  /* "MACS2/IO/cScoreTrack.pyx":100
 *         double floor_pscore, ceil_pscore
 *     observed_floor = floor(observed)
 *     observed_ceil = ceil(observed)             # <<<<<<<<<<<<<<
 *     step = observed - observed_floor
 *     floor_pscore = get_pscore( int(observed_floor), expectation)
 */
  __pyx_v_observed_ceil = ceil(__pyx_v_observed);

  /* "MACS2/IO/cScoreTrack.pyx":101
 *     observed_floor = floor(observed)
 *     observed_ceil = ceil(observed)
 *     step = observed - observed_floor             # <<<<<<<<<<<<<<
 *     floor_pscore = get_pscore( int(observed_floor), expectation)
 *     ceil_pscore = get_pscore( int(observed_ceil), expectation)
 */
  __pyx_v_step = (__pyx_v_observed - __pyx_v_observed_floor);

  /* "MACS2/IO/cScoreTrack.pyx":102
 *     observed_ceil = ceil(observed)
 *     step = observed - observed_floor
 *     floor_pscore = get_pscore( int(observed_floor), expectation)             # <<<<<<<<<<<<<<
 *     ceil_pscore = get_pscore( int(observed_ceil), expectation)
 *     pscore = (ceil_pscore - floor_pscore) * (observed - observed_floor) + \
 */
  __pyx_v_floor_pscore = __pyx_f_5MACS2_2IO_11cScoreTrack_get_pscore(((int)__pyx_v_observed_floor), __pyx_v_expectation);

  /* "MACS2/IO/cScoreTrack.pyx":103
 *     step = observed - observed_floor
 *     floor_pscore = get_pscore( int(observed_floor), expectation)
 *     ceil_pscore = get_pscore( int(observed_ceil), expectation)             # <<<<<<<<<<<<<<
 *     pscore = (ceil_pscore - floor_pscore) * (observed - observed_floor) + \
 *              floor_pscore
 */
  __pyx_v_ceil_pscore = __pyx_f_5MACS2_2IO_11cScoreTrack_get_pscore(((int)__pyx_v_observed_ceil), __pyx_v_expectation);

  /* "MACS2/IO/cScoreTrack.pyx":105
 *     ceil_pscore = get_pscore( int(observed_ceil), expectation)
 *     pscore = (ceil_pscore - floor_pscore) * (observed - observed_floor) + \
 *              floor_pscore             # <<<<<<<<<<<<<<
 *     return pscore
 * 
 */
  __pyx_v_pscore = (((__pyx_v_ceil_pscore - __pyx_v_floor_pscore) * (__pyx_v_observed - __pyx_v_observed_floor)) + __pyx_v_floor_pscore);

  /* "MACS2/IO/cScoreTrack.pyx":106
 *     pscore = (ceil_pscore - floor_pscore) * (observed - observed_floor) + \
 *              floor_pscore
 *     return pscore             # <<<<<<<<<<<<<<
 * 
 * cdef inline double oldlogLR ( double x, double y ):
 */
  __pyx_r = __pyx_v_pscore;
  goto __pyx_L0;

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

/* "MACS2/IO/cScoreTrack.pyx":108
 *     return pscore
 * 
 * cdef inline double oldlogLR ( double x, double y ):             # <<<<<<<<<<<<<<
 *     """Calculate log10 Likelihood between H1 ( enriched ) and H0 (
 *     chromatin bias ). Then store the values in integer form =
 */

static CYTHON_INLINE double __pyx_f_5MACS2_2IO_11cScoreTrack_oldlogLR(double __pyx_v_x, double __pyx_v_y) {
  double __pyx_v_s;
  long __pyx_v_key_value;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  double __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("oldlogLR", 0);

  /* "MACS2/IO/cScoreTrack.pyx":118
 *         long key_value
 * 
 *     key_value = hash( (x, y ) )             # <<<<<<<<<<<<<<
 *     try:
 *         return logLR_khashtable.get_item( key_value )
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_key_value = __pyx_t_4;

  /* "MACS2/IO/cScoreTrack.pyx":119
 * 
 *     key_value = hash( (x, y ) )
 *     try:             # <<<<<<<<<<<<<<
 *         return logLR_khashtable.get_item( key_value )
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "MACS2/IO/cScoreTrack.pyx":120
 *     key_value = hash( (x, y ) )
 *     try:
 *         return logLR_khashtable.get_item( key_value )             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         if x > y:
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logLR_khashtable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromLong(__pyx_v_key_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_8;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L10_try_end;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":121
 *     try:
 *         return logLR_khashtable.get_item( key_value )
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         if x > y:
 *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
 */
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("MACS2.IO.cScoreTrack.oldlogLR", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);

      /* "MACS2/IO/cScoreTrack.pyx":122
 *         return logLR_khashtable.get_item( key_value )
 *     except KeyError:
 *         if x > y:             # <<<<<<<<<<<<<<
 *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
 *         elif x < y:
 */
      __pyx_t_10 = (__pyx_v_x > __pyx_v_y);
      if (__pyx_t_10) {

        /* "MACS2/IO/cScoreTrack.pyx":123
 *     except KeyError:
 *         if x > y:
 *             s = (x*(log(x)-log(y))+y-x)*LOG10_E             # <<<<<<<<<<<<<<
 *         elif x < y:
 *             s = (x*(-log(x)+log(y))-y+x)*LOG10_E
 */
        __pyx_t_11 = PyFloat_FromDouble((((__pyx_v_x * (log(__pyx_v_x) - log(__pyx_v_y))) + __pyx_v_y) - __pyx_v_x)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__LOG10_E); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = PyNumber_Multiply(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_v_s = __pyx_t_8;
        goto __pyx_L13;
      }

      /* "MACS2/IO/cScoreTrack.pyx":124
 *         if x > y:
 *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
 *         elif x < y:             # <<<<<<<<<<<<<<
 *             s = (x*(-log(x)+log(y))-y+x)*LOG10_E
 *         else:
 */
      __pyx_t_10 = (__pyx_v_x < __pyx_v_y);
      if (__pyx_t_10) {

        /* "MACS2/IO/cScoreTrack.pyx":125
 *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
 *         elif x < y:
 *             s = (x*(-log(x)+log(y))-y+x)*LOG10_E             # <<<<<<<<<<<<<<
 *         else:
 *             s = 0
 */
        __pyx_t_13 = PyFloat_FromDouble((((__pyx_v_x * ((-log(__pyx_v_x)) + log(__pyx_v_y))) - __pyx_v_y) + __pyx_v_x)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__LOG10_E); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_11 = PyNumber_Multiply(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_v_s = __pyx_t_8;
        goto __pyx_L13;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":127
 *             s = (x*(-log(x)+log(y))-y+x)*LOG10_E
 *         else:
 *             s = 0             # <<<<<<<<<<<<<<
 *         logLR_khashtable.set_item(key_value, s)
 *         return s
 */
        __pyx_v_s = 0.0;
      }
      __pyx_L13:;

      /* "MACS2/IO/cScoreTrack.pyx":128
 *         else:
 *             s = 0
 *         logLR_khashtable.set_item(key_value, s)             # <<<<<<<<<<<<<<
 *         return s
 * 
 */
      __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__logLR_khashtable); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__set_item); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyInt_FromLong(__pyx_v_key_value); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_11 = 0;
      __pyx_t_13 = 0;
      __pyx_t_13 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":129
 *             s = 0
 *         logLR_khashtable.set_item(key_value, s)
 *         return s             # <<<<<<<<<<<<<<
 * 
 * cdef inline double logLR_adjusted (int x, int y):
 */
      __pyx_r = __pyx_v_s;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L10_try_end:;
  }

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_WriteUnraisable("MACS2.IO.cScoreTrack.oldlogLR", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":131
 *         return s
 * 
 * cdef inline double logLR_adjusted (int x, int y):             # <<<<<<<<<<<<<<
 *     """Calculate log10 Likelihood between H1 ( enriched ) and H0 (
 *     chromatin bias ). Then store the values in integer form =
 */

static CYTHON_INLINE double __pyx_f_5MACS2_2IO_11cScoreTrack_logLR_adjusted(int __pyx_v_x, int __pyx_v_y) {
  double __pyx_v_s;
  long __pyx_v_key_value;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  double __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("logLR_adjusted", 0);

  /* "MACS2/IO/cScoreTrack.pyx":141
 *         long key_value
 * 
 *     key_value = hash( (x, y) )             # <<<<<<<<<<<<<<
 *     try:
 *         return logLR_khashtable.get_item( key_value )
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_key_value = __pyx_t_4;

  /* "MACS2/IO/cScoreTrack.pyx":142
 * 
 *     key_value = hash( (x, y) )
 *     try:             # <<<<<<<<<<<<<<
 *         return logLR_khashtable.get_item( key_value )
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "MACS2/IO/cScoreTrack.pyx":143
 *     key_value = hash( (x, y) )
 *     try:
 *         return logLR_khashtable.get_item( key_value )             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         if y > x: y, x = x, y
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logLR_khashtable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromLong(__pyx_v_key_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_8;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L10_try_end;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":144
 *     try:
 *         return logLR_khashtable.get_item( key_value )
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         if y > x: y, x = x, y
 *         if x==y: s = 0
 */
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("MACS2.IO.cScoreTrack.logLR_adjusted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);

      /* "MACS2/IO/cScoreTrack.pyx":145
 *         return logLR_khashtable.get_item( key_value )
 *     except KeyError:
 *         if y > x: y, x = x, y             # <<<<<<<<<<<<<<
 *         if x==y: s = 0
 * 
 */
      __pyx_t_10 = (__pyx_v_y > __pyx_v_x);
      if (__pyx_t_10) {
        __pyx_t_9 = __pyx_v_x;
        __pyx_t_11 = __pyx_v_y;
        __pyx_v_y = __pyx_t_9;
        __pyx_v_x = __pyx_t_11;
        goto __pyx_L13;
      }
      __pyx_L13:;

      /* "MACS2/IO/cScoreTrack.pyx":146
 *     except KeyError:
 *         if y > x: y, x = x, y
 *         if x==y: s = 0             # <<<<<<<<<<<<<<
 * 
 *         else: s = (x*(log(x)-log(y))+y-x)*LOG10_E
 */
      __pyx_t_10 = (__pyx_v_x == __pyx_v_y);
      if (__pyx_t_10) {
        __pyx_v_s = 0.0;
        goto __pyx_L14;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":148
 *         if x==y: s = 0
 * 
 *         else: s = (x*(log(x)-log(y))+y-x)*LOG10_E             # <<<<<<<<<<<<<<
 *         logLR_khashtable.set_item(key_value, s)
 *         return s
 */
        __pyx_t_12 = PyFloat_FromDouble((((__pyx_v_x * (log(__pyx_v_x) - log(__pyx_v_y))) + __pyx_v_y) - __pyx_v_x)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__LOG10_E); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = PyNumber_Multiply(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_14); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_v_s = __pyx_t_8;
      }
      __pyx_L14:;

      /* "MACS2/IO/cScoreTrack.pyx":149
 * 
 *         else: s = (x*(log(x)-log(y))+y-x)*LOG10_E
 *         logLR_khashtable.set_item(key_value, s)             # <<<<<<<<<<<<<<
 *         return s
 * 
 */
      __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__logLR_khashtable); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_13 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__set_item); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyInt_FromLong(__pyx_v_key_value); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_12 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_14 = 0;
      __pyx_t_12 = 0;
      __pyx_t_12 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":150
 *         else: s = (x*(log(x)-log(y))+y-x)*LOG10_E
 *         logLR_khashtable.set_item(key_value, s)
 *         return s             # <<<<<<<<<<<<<<
 * 
 * cdef inline double logLR ( double x, double y ):
 */
      __pyx_r = __pyx_v_s;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L10_try_end:;
  }

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_WriteUnraisable("MACS2.IO.cScoreTrack.logLR_adjusted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":152
 *         return s
 * 
 * cdef inline double logLR ( double x, double y ):             # <<<<<<<<<<<<<<
 *     """Calculate log10 Likelihood between H1 ( enriched ) and H0 (
 *     chromatin bias ). Then store the values in integer form =
 */

static CYTHON_INLINE double __pyx_f_5MACS2_2IO_11cScoreTrack_logLR(double __pyx_v_x, double __pyx_v_y) {
  double __pyx_v_s;
  long __pyx_v_key_value;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  double __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  double __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("logLR", 0);

  /* "MACS2/IO/cScoreTrack.pyx":162
 *         long key_value
 * 
 *     key_value = hash( (x, y ) )             # <<<<<<<<<<<<<<
 *     try:
 *         return logLR_khashtable.get_item( key_value )
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_key_value = __pyx_t_4;

  /* "MACS2/IO/cScoreTrack.pyx":163
 * 
 *     key_value = hash( (x, y ) )
 *     try:             # <<<<<<<<<<<<<<
 *         return logLR_khashtable.get_item( key_value )
 *     except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "MACS2/IO/cScoreTrack.pyx":164
 *     key_value = hash( (x, y ) )
 *     try:
 *         return logLR_khashtable.get_item( key_value )             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         if y > x: y, x = x, y
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logLR_khashtable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromLong(__pyx_v_key_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_8;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L10_try_end;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":165
 *     try:
 *         return logLR_khashtable.get_item( key_value )
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         if y > x: y, x = x, y
 *         if x==y: s = 0
 */
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("MACS2.IO.cScoreTrack.logLR", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);

      /* "MACS2/IO/cScoreTrack.pyx":166
 *         return logLR_khashtable.get_item( key_value )
 *     except KeyError:
 *         if y > x: y, x = x, y             # <<<<<<<<<<<<<<
 *         if x==y: s = 0
 * 
 */
      __pyx_t_10 = (__pyx_v_y > __pyx_v_x);
      if (__pyx_t_10) {
        __pyx_t_8 = __pyx_v_x;
        __pyx_t_11 = __pyx_v_y;
        __pyx_v_y = __pyx_t_8;
        __pyx_v_x = __pyx_t_11;
        goto __pyx_L13;
      }
      __pyx_L13:;

      /* "MACS2/IO/cScoreTrack.pyx":167
 *     except KeyError:
 *         if y > x: y, x = x, y
 *         if x==y: s = 0             # <<<<<<<<<<<<<<
 * 
 *         else: s = (x*(log(x)-log(y))+y-x)*LOG10_E
 */
      __pyx_t_10 = (__pyx_v_x == __pyx_v_y);
      if (__pyx_t_10) {
        __pyx_v_s = 0.0;
        goto __pyx_L14;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":169
 *         if x==y: s = 0
 * 
 *         else: s = (x*(log(x)-log(y))+y-x)*LOG10_E             # <<<<<<<<<<<<<<
 *         logLR_khashtable.set_item(key_value, s)
 *         return s
 */
        __pyx_t_12 = PyFloat_FromDouble((((__pyx_v_x * (log(__pyx_v_x) - log(__pyx_v_y))) + __pyx_v_y) - __pyx_v_x)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__LOG10_E); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = PyNumber_Multiply(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_14); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_v_s = __pyx_t_11;
      }
      __pyx_L14:;

      /* "MACS2/IO/cScoreTrack.pyx":170
 * 
 *         else: s = (x*(log(x)-log(y))+y-x)*LOG10_E
 *         logLR_khashtable.set_item(key_value, s)             # <<<<<<<<<<<<<<
 *         return s
 * 
 */
      __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__logLR_khashtable); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_13 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__set_item); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyInt_FromLong(__pyx_v_key_value); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_12 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_14 = 0;
      __pyx_t_12 = 0;
      __pyx_t_12 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":171
 *         else: s = (x*(log(x)-log(y))+y-x)*LOG10_E
 *         logLR_khashtable.set_item(key_value, s)
 *         return s             # <<<<<<<<<<<<<<
 * 
 * cdef inline double get_logFE ( float x, float y ):
 */
      __pyx_r = __pyx_v_s;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L10_try_end:;
  }

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_WriteUnraisable("MACS2.IO.cScoreTrack.logLR", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":173
 *         return s
 * 
 * cdef inline double get_logFE ( float x, float y ):             # <<<<<<<<<<<<<<
 *     """ return 100* log10 fold enrichment with +1 pseudocount.
 *     """
 */

static CYTHON_INLINE double __pyx_f_5MACS2_2IO_11cScoreTrack_get_logFE(float __pyx_v_x, float __pyx_v_y) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_logFE", 0);

  /* "MACS2/IO/cScoreTrack.pyx":176
 *     """ return 100* log10 fold enrichment with +1 pseudocount.
 *     """
 *     return log10( x/y )             # <<<<<<<<<<<<<<
 * 
 * cdef inline float get_subtraction ( float x, float y):
 */
  if (unlikely(__pyx_v_y == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "float division");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_r = log10((__pyx_v_x / __pyx_v_y));
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("MACS2.IO.cScoreTrack.get_logFE", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":178
 *     return log10( x/y )
 * 
 * cdef inline float get_subtraction ( float x, float y):             # <<<<<<<<<<<<<<
 *     """ return subtraction.
 *     """
 */

static CYTHON_INLINE float __pyx_f_5MACS2_2IO_11cScoreTrack_get_subtraction(float __pyx_v_x, float __pyx_v_y) {
  float __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_subtraction", 0);

  /* "MACS2/IO/cScoreTrack.pyx":181
 *     """ return subtraction.
 *     """
 *     return x - y             # <<<<<<<<<<<<<<
 * 
 * # ------------------------------------
 */
  __pyx_r = (__pyx_v_x - __pyx_v_y);
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack___init__[] = "Different with bedGraphTrackI, missing values are simply\n        replaced with 0.\n        \n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_1__init__, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack___init__)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack___init__(__pyx_self, ((PyObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":191
 * 
 *     """
 *     def __init__ (self):             # <<<<<<<<<<<<<<
 *         """Different with bedGraphTrackI, missing values are simply
 *         replaced with 0.
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "MACS2/IO/cScoreTrack.pyx":196
 * 
 *         """
 *         self.data = {}             # <<<<<<<<<<<<<<
 *         self.pointer = {}
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__data, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":197
 *         """
 *         self.data = {}
 *         self.pointer = {}             # <<<<<<<<<<<<<<
 * 
 *     def add_chromosome ( self, str chrom, int chrom_max_len ):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pointer, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_3add_chromosome(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_3add_chromosome = {__Pyx_NAMESTR("add_chromosome"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_3add_chromosome, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_3add_chromosome(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_chrom_max_len;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_chromosome (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chrom,&__pyx_n_s__chrom_max_len,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom_max_len)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_chromosome") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_chrom = ((PyObject*)values[1]);
    __pyx_v_chrom_max_len = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_chrom_max_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyString_Type), 1, "chrom", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_2add_chromosome(__pyx_self, __pyx_v_self, __pyx_v_chrom, __pyx_v_chrom_max_len);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":199
 *         self.pointer = {}
 * 
 *     def add_chromosome ( self, str chrom, int chrom_max_len ):             # <<<<<<<<<<<<<<
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_2add_chromosome(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, int __pyx_v_chrom_max_len) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_chromosome", 0);

  /* "MACS2/IO/cScoreTrack.pyx":200
 * 
 *     def add_chromosome ( self, str chrom, int chrom_max_len ):
 *         if not self.data.has_key(chrom):             # <<<<<<<<<<<<<<
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 *                                                              ('V1','float32'), # value for the first track
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "MACS2/IO/cScoreTrack.pyx":201
 *     def add_chromosome ( self, str chrom, int chrom_max_len ):
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
 *                                                              ('V1','float32'), # value for the first track
 *                                                              ('V2','float32'), # value for the second track
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));

    /* "MACS2/IO/cScoreTrack.pyx":203
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 *                                                              ('V1','float32'), # value for the first track
 *                                                              ('V2','float32'), # value for the second track             # <<<<<<<<<<<<<<
 *                                                              ])
 *             self.pointer[chrom] = 0
 */
    __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_1));
    PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_k_tuple_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_1));
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_2));
    PyList_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_k_tuple_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_3));
    PyList_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_k_tuple_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_t_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":201
 *     def add_chromosome ( self, str chrom, int chrom_max_len ):
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
 *                                                              ('V1','float32'), # value for the first track
 *                                                              ('V2','float32'), # value for the second track
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_v_chrom), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":205
 *                                                              ('V2','float32'), # value for the second track
 *                                                              ])
 *             self.pointer[chrom] = 0             # <<<<<<<<<<<<<<
 * 
 *     def add ( self, str chromosome, int endpos, double V1, double V2 ):
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (PyObject_SetItem(__pyx_t_6, ((PyObject *)__pyx_v_chrom), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_5add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_4add[] = "Add a chr-endpos-sample-control block into data\n        dictionary. At the mean time, calculate pvalues.\n\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_5add = {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_5add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_4add)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_5add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_chromosome = 0;
  int __pyx_v_endpos;
  double __pyx_v_V1;
  double __pyx_v_V2;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chromosome,&__pyx_n_s__endpos,&__pyx_n_s__V1,&__pyx_n_s__V2,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chromosome)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__endpos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__V1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__V2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_self = values[0];
    __pyx_v_chromosome = ((PyObject*)values[1]);
    __pyx_v_endpos = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_endpos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_V1 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_V1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_V2 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_V2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chromosome), (&PyString_Type), 1, "chromosome", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_4add(__pyx_self, __pyx_v_self, __pyx_v_chromosome, __pyx_v_endpos, __pyx_v_V1, __pyx_v_V2);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":207
 *             self.pointer[chrom] = 0
 * 
 *     def add ( self, str chromosome, int endpos, double V1, double V2 ):             # <<<<<<<<<<<<<<
 *         """Add a chr-endpos-sample-control block into data
 *         dictionary. At the mean time, calculate pvalues.
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_4add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_v_endpos, double __pyx_v_V1, double __pyx_v_V2) {
  PyObject *__pyx_v_c = 0;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 0);

  /* "MACS2/IO/cScoreTrack.pyx":216
 *             int i
 * 
 *         c = self.data[chromosome]             # <<<<<<<<<<<<<<
 *         i = self.pointer[chromosome]
 *         # get the preceding region
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_c = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":217
 * 
 *         c = self.data[chromosome]
 *         i = self.pointer[chromosome]             # <<<<<<<<<<<<<<
 *         # get the preceding region
 *         c[i] = (endpos,V1,V2)
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_i = __pyx_t_3;

  /* "MACS2/IO/cScoreTrack.pyx":219
 *         i = self.pointer[chromosome]
 *         # get the preceding region
 *         c[i] = (endpos,V1,V2)             # <<<<<<<<<<<<<<
 *         self.pointer[chromosome] += 1
 * 
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_endpos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_V1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_V2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_c) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__Pyx_SetItemInt(((PyObject *)__pyx_v_c), __pyx_v_i, ((PyObject *)__pyx_t_5), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":220
 *         # get the preceding region
 *         c[i] = (endpos,V1,V2)
 *         self.pointer[chromosome] += 1             # <<<<<<<<<<<<<<
 * 
 *     def finalize ( self ):
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
  __pyx_t_6 = __pyx_v_chromosome;
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, ((PyObject *)__pyx_t_6)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, ((PyObject *)__pyx_t_6), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(((PyObject *)__pyx_t_6));
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_7finalize(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_7finalize = {__Pyx_NAMESTR("finalize"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_7finalize, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_7finalize(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_6finalize(__pyx_self, ((PyObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":222
 *         self.pointer[chromosome] += 1
 * 
 *     def finalize ( self ):             # <<<<<<<<<<<<<<
 *         cdef str chrom
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_6finalize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("finalize", 0);

  /* "MACS2/IO/cScoreTrack.pyx":225
 *         cdef str chrom
 * 
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             d = self.data[chrom]
 *             l = self.pointer[chrom]
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":226
 * 
 *         for chrom in self.data.keys():
 *             d = self.data[chrom]             # <<<<<<<<<<<<<<
 *             l = self.pointer[chrom]
 *             d.resize(l,refcheck=False)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_1, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_d);
    __pyx_v_d = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":227
 *         for chrom in self.data.keys():
 *             d = self.data[chrom]
 *             l = self.pointer[chrom]             # <<<<<<<<<<<<<<
 *             d.resize(l,refcheck=False)
 * 
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_GetItem(__pyx_t_5, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_l);
    __pyx_v_l = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":228
 *             d = self.data[chrom]
 *             l = self.pointer[chrom]
 *             d.resize(l,refcheck=False)             # <<<<<<<<<<<<<<
 * 
 *     def get_data_by_chr (self, str chromosome):
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_d, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_l);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_l);
    __Pyx_GIVEREF(__pyx_v_l);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_9get_data_by_chr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_8get_data_by_chr[] = "Return array of counts by chromosome.\n\n        The return value is a tuple:\n        ([end pos],[value])\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_9get_data_by_chr = {__Pyx_NAMESTR("get_data_by_chr"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_9get_data_by_chr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_8get_data_by_chr)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_9get_data_by_chr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_chromosome = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data_by_chr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chromosome,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chromosome)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_data_by_chr", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_data_by_chr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_chromosome = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_data_by_chr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chromosome), (&PyString_Type), 1, "chromosome", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_8get_data_by_chr(__pyx_self, __pyx_v_self, __pyx_v_chromosome);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":230
 *             d.resize(l,refcheck=False)
 * 
 *     def get_data_by_chr (self, str chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_8get_data_by_chr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data_by_chr", 0);

  /* "MACS2/IO/cScoreTrack.pyx":236
 *         ([end pos],[value])
 *         """
 *         if self.data.has_key(chromosome):             # <<<<<<<<<<<<<<
 *             return self.data[chromosome]
 *         else:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chromosome));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chromosome));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":237
 *         """
 *         if self.data.has_key(chromosome):
 *             return self.data[chromosome]             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":239
 *             return self.data[chromosome]
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def get_chr_names (self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_11get_chr_names(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_10get_chr_names[] = "Return all the chromosome names stored.\n        \n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_11get_chr_names = {__Pyx_NAMESTR("get_chr_names"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_11get_chr_names, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_10get_chr_names)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_11get_chr_names(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_chr_names (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_10get_chr_names(__pyx_self, ((PyObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":241
 *             return None
 * 
 *     def get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_10get_chr_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_chr_names", 0);

  /* "MACS2/IO/cScoreTrack.pyx":247
 *         cdef set l
 * 
 *         l = set(self.data.keys())             # <<<<<<<<<<<<<<
 *         return l
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":248
 * 
 *         l = set(self.data.keys())
 *         return l             # <<<<<<<<<<<<<<
 * 
 *     def write_bedGraph (self, fhd, str name, str description, str colname):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_l));
  __pyx_r = ((PyObject *)__pyx_v_l);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_13write_bedGraph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_12write_bedGraph[] = "Write all data to fhd in Wiggle Format.\n\n        fhd: a filehandler to save bedGraph.\n        name/description: the name and description in track line.\n\n        colname: can be 'sample','control','-100logp','-100logq'\n\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_13write_bedGraph = {__Pyx_NAMESTR("write_bedGraph"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_13write_bedGraph, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_12write_bedGraph)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_13write_bedGraph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_fhd = 0;
  CYTHON_UNUSED PyObject *__pyx_v_name = 0;
  CYTHON_UNUSED PyObject *__pyx_v_description = 0;
  PyObject *__pyx_v_colname = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_bedGraph (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__fhd,&__pyx_n_s__name,&__pyx_n_s__description,&__pyx_n_s__colname,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fhd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__description)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__colname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bedGraph") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_self = values[0];
    __pyx_v_fhd = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_description = ((PyObject*)values[3]);
    __pyx_v_colname = ((PyObject*)values[4]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_description), (&PyString_Type), 1, "description", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colname), (&PyString_Type), 1, "colname", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_12write_bedGraph(__pyx_self, __pyx_v_self, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_v_colname);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":250
 *         return l
 * 
 *     def write_bedGraph (self, fhd, str name, str description, str colname):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in Wiggle Format.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_12write_bedGraph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fhd, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_description, PyObject *__pyx_v_colname) {
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_chrs = 0;
  int __pyx_v_pre;
  int __pyx_v_i;
  int __pyx_v_l;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_value = 0;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_d = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
  __Pyx_Buffer __pyx_pybuffer_pos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value;
  __Pyx_Buffer __pyx_pybuffer_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyArrayObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_bedGraph", 0);
  __pyx_pybuffer_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_pos.refcount = 0;
  __pyx_pybuffernd_pos.data = NULL;
  __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
  __pyx_pybuffer_value.pybuffer.buf = NULL;
  __pyx_pybuffer_value.refcount = 0;
  __pyx_pybuffernd_value.data = NULL;
  __pyx_pybuffernd_value.rcbuffer = &__pyx_pybuffer_value;

  /* "MACS2/IO/cScoreTrack.pyx":266
 *             np.ndarray[np.float32_t, ndim=1] value
 * 
 *         if colname not in ['V1','V2']:             # <<<<<<<<<<<<<<
 *             raise Exception("%s not supported!" % colname)
 *         chrs = self.get_chr_names()
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_colname));
  __pyx_t_1 = __pyx_v_colname;
  __pyx_t_2 = (__Pyx_PyString_Equals(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_n_s__V1), Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (((int)__pyx_t_2)) {
    __pyx_t_3 = (__Pyx_PyString_Equals(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_n_s__V2), Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = ((int)__pyx_t_3);
  } else {
    __pyx_t_4 = ((int)__pyx_t_2);
  }
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_4;
  if (__pyx_t_2) {

    /* "MACS2/IO/cScoreTrack.pyx":267
 * 
 *         if colname not in ['V1','V2']:
 *             raise Exception("%s not supported!" % colname)             # <<<<<<<<<<<<<<
 *         chrs = self.get_chr_names()
 *         write = fhd.write
 */
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_v_colname)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "MACS2/IO/cScoreTrack.pyx":268
 *         if colname not in ['V1','V2']:
 *             raise Exception("%s not supported!" % colname)
 *         chrs = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         write = fhd.write
 *         for chrom in chrs:
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(PySet_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected set, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_chrs = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":269
 *             raise Exception("%s not supported!" % colname)
 *         chrs = self.get_chr_names()
 *         write = fhd.write             # <<<<<<<<<<<<<<
 *         for chrom in chrs:
 *             d = self.data[chrom]
 */
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_fhd, __pyx_n_s__write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_write = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":270
 *         chrs = self.get_chr_names()
 *         write = fhd.write
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             d = self.data[chrom]
 *             l = self.pointer[chrom]
 */
  __pyx_t_6 = PyObject_GetIter(((PyObject *)__pyx_v_chrs)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
  for (;;) {
    {
      __pyx_t_5 = __pyx_t_7(__pyx_t_6);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":271
 *         write = fhd.write
 *         for chrom in chrs:
 *             d = self.data[chrom]             # <<<<<<<<<<<<<<
 *             l = self.pointer[chrom]
 *             pos   = d['pos']
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyObject_GetItem(__pyx_t_5, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_d);
    __pyx_v_d = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":272
 *         for chrom in chrs:
 *             d = self.data[chrom]
 *             l = self.pointer[chrom]             # <<<<<<<<<<<<<<
 *             pos   = d['pos']
 *             value = d[colname]
 */
    __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_8, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_l = __pyx_t_9;

    /* "MACS2/IO/cScoreTrack.pyx":273
 *             d = self.data[chrom]
 *             l = self.pointer[chrom]
 *             pos   = d['pos']             # <<<<<<<<<<<<<<
 *             value = d[colname]
 *             pre = 0
 */
    __pyx_t_5 = PyObject_GetItem(__pyx_v_d, ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        }
      }
      __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":274
 *             l = self.pointer[chrom]
 *             pos   = d['pos']
 *             value = d[colname]             # <<<<<<<<<<<<<<
 *             pre = 0
 *             for i in range( l ):
 */
    __pyx_t_5 = PyObject_GetItem(__pyx_v_d, ((PyObject *)__pyx_v_colname)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_v_value, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
        }
      }
      __pyx_pybuffernd_value.diminfo[0].strides = __pyx_pybuffernd_value.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value.diminfo[0].shape = __pyx_pybuffernd_value.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_value));
    __pyx_v_value = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":275
 *             pos   = d['pos']
 *             value = d[colname]
 *             pre = 0             # <<<<<<<<<<<<<<
 *             for i in range( l ):
 *                 write("%s\t%d\t%d\t%.5f\n" % (chrom,pre,pos[i],value[i]))
 */
    __pyx_v_pre = 0;

    /* "MACS2/IO/cScoreTrack.pyx":276
 *             value = d[colname]
 *             pre = 0
 *             for i in range( l ):             # <<<<<<<<<<<<<<
 *                 write("%s\t%d\t%d\t%.5f\n" % (chrom,pre,pos[i],value[i]))
 *                 pre = pos[i]
 */
    __pyx_t_9 = __pyx_v_l;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_9; __pyx_t_15+=1) {
      __pyx_v_i = __pyx_t_15;

      /* "MACS2/IO/cScoreTrack.pyx":277
 *             pre = 0
 *             for i in range( l ):
 *                 write("%s\t%d\t%d\t%.5f\n" % (chrom,pre,pos[i],value[i]))             # <<<<<<<<<<<<<<
 *                 pre = pos[i]
 * 
 */
      __pyx_t_5 = PyInt_FromLong(__pyx_v_pre); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_pos.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_17 = 0;
      if (unlikely(__pyx_t_17 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_17);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_value.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_18 = 0;
      if (unlikely(__pyx_t_18 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_18);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_19 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_20 = PyTuple_New(4); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
      PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_chrom));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
      PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      __pyx_t_5 = 0;
      __pyx_t_8 = 0;
      __pyx_t_19 = 0;
      __pyx_t_19 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_20)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_19));
      __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
      __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_t_19));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_19));
      __pyx_t_19 = 0;
      __pyx_t_19 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":278
 *             for i in range( l ):
 *                 write("%s\t%d\t%d\t%.5f\n" % (chrom,pre,pos[i],value[i]))
 *                 pre = pos[i]             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_21 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_pos.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_21 = 0;
      if (unlikely(__pyx_t_21 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_21);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_pre = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_pos.diminfo[0].strides));
    }
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":280
 *                 pre = pos[i]
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def total ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(((PyObject *)__pyx_t_1));
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_15total(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_14total[] = "Return the number of regions in this object.\n\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_15total = {__Pyx_NAMESTR("total"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_15total, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_14total)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_15total(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("total (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_14total(__pyx_self, ((PyObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":282
 *         return True
 * 
 *     def total ( self ):             # <<<<<<<<<<<<<<
 *         """Return the number of regions in this object.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_14total(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  long __pyx_v_t;
  PyObject *__pyx_v_chrom = 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;
  long __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("total", 0);

  /* "MACS2/IO/cScoreTrack.pyx":290
 *             str chrom
 * 
 *         t = 0             # <<<<<<<<<<<<<<
 *         for chrom in self.data.keys():
 *             t += self.pointer[chrom]
 */
  __pyx_v_t = 0;

  /* "MACS2/IO/cScoreTrack.pyx":291
 * 
 *         t = 0
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             t += self.pointer[chrom]
 *         return t
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":292
 *         t = 0
 *         for chrom in self.data.keys():
 *             t += self.pointer[chrom]             # <<<<<<<<<<<<<<
 *         return t
 * 
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_GetItem(__pyx_t_5, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_5); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_t = __pyx_t_7;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":293
 *         for chrom in self.data.keys():
 *             t += self.pointer[chrom]
 *         return t             # <<<<<<<<<<<<<<
 * 
 *     def extract_value ( self, bdgTrack2 ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.total", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_17extract_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_16extract_value[] = "It's like overlie function. THe overlapped regions between\n        bdgTrack2 and self, will be recorded. The values from self in\n        the overlapped regions will be outputed in a single array for\n        follow statistics.\n\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_17extract_value = {__Pyx_NAMESTR("extract_value"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_17extract_value, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_16extract_value)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_17extract_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_bdgTrack2 = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extract_value (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__bdgTrack2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bdgTrack2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("extract_value", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract_value") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_bdgTrack2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extract_value", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.extract_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_16extract_value(__pyx_self, __pyx_v_self, __pyx_v_bdgTrack2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":295
 *         return t
 * 
 *     def extract_value ( self, bdgTrack2 ):             # <<<<<<<<<<<<<<
 *         """It's like overlie function. THe overlapped regions between
 *         bdgTrack2 and self, will be recorded. The values from self in
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_16extract_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2) {
  PyObject *__pyx_v_chr1 = 0;
  PyObject *__pyx_v_chr2 = 0;
  PyObject *__pyx_v_common_chr = 0;
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_pre_p;
  int __pyx_v_p1;
  int __pyx_v_p2;
  double __pyx_v_v11;
  double __pyx_v_v21;
  double __pyx_v_v2;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_radd = NULL;
  PyObject *__pyx_v_v1add = NULL;
  PyObject *__pyx_v_v2add = NULL;
  PyObject *__pyx_v_ladd = NULL;
  PyObject *__pyx_v_chrom_data = NULL;
  PyObject *__pyx_v_p1n = NULL;
  PyObject *__pyx_v_v11n = NULL;
  PyObject *__pyx_v_v21n = NULL;
  PyObject *__pyx_v_p2s = NULL;
  PyObject *__pyx_v_v2s = NULL;
  PyObject *__pyx_v_p2n = NULL;
  PyObject *__pyx_v_v2n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  double __pyx_t_14;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extract_value", 0);

  /* "MACS2/IO/cScoreTrack.pyx":310
 *         #assert isinstance(bdgTrack2,bedGraphTrackI), "bdgTrack2 is not a bedGraphTrackI object"
 * 
 *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[]),array(BYTE4,[])] # region,V1,V1,length             # <<<<<<<<<<<<<<
 *         radd = ret[0].append
 *         v1add = ret[1].append
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FBYTE4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FBYTE4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __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, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__BYTE4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyList_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_v_ret = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":311
 * 
 *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[]),array(BYTE4,[])] # region,V1,V1,length
 *         radd = ret[0].append             # <<<<<<<<<<<<<<
 *         v1add = ret[1].append
 *         v2add = ret[2].append
 */
  __pyx_t_7 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ret), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__append); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_radd = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":312
 *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[]),array(BYTE4,[])] # region,V1,V1,length
 *         radd = ret[0].append
 *         v1add = ret[1].append             # <<<<<<<<<<<<<<
 *         v2add = ret[2].append
 *         ladd = ret[3].append
 */
  __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ret), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__append); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_v1add = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":313
 *         radd = ret[0].append
 *         v1add = ret[1].append
 *         v2add = ret[2].append             # <<<<<<<<<<<<<<
 *         ladd = ret[3].append
 * 
 */
  __pyx_t_7 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ret), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__append); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_v2add = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":314
 *         v1add = ret[1].append
 *         v2add = ret[2].append
 *         ladd = ret[3].append             # <<<<<<<<<<<<<<
 * 
 *         chr1 = set(self.get_chr_names())
 */
  __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ret), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__append); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_ladd = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":316
 *         ladd = ret[3].append
 * 
 *         chr1 = set(self.get_chr_names())             # <<<<<<<<<<<<<<
 *         chr2 = set(bdgTrack2.get_chr_names())
 *         common_chr = chr1.intersection(chr2)
 */
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __pyx_v_chr1 = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":317
 * 
 *         chr1 = set(self.get_chr_names())
 *         chr2 = set(bdgTrack2.get_chr_names())             # <<<<<<<<<<<<<<
 *         common_chr = chr1.intersection(chr2)
 *         for chrom in common_chr:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_bdgTrack2, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_chr2 = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":318
 *         chr1 = set(self.get_chr_names())
 *         chr2 = set(bdgTrack2.get_chr_names())
 *         common_chr = chr1.intersection(chr2)             # <<<<<<<<<<<<<<
 *         for chrom in common_chr:
 *             chrom_data = self.get_data_by_chr(chrom) # arrays for position and values
 */
  __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_chr1), __pyx_n_s__intersection); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_chr2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chr2));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chr2));
  __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(PySet_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected set, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_common_chr = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":319
 *         chr2 = set(bdgTrack2.get_chr_names())
 *         common_chr = chr1.intersection(chr2)
 *         for chrom in common_chr:             # <<<<<<<<<<<<<<
 *             chrom_data = self.get_data_by_chr(chrom) # arrays for position and values
 *             p1n = chrom_data['pos'].flat.next
 */
  __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_common_chr)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
  for (;;) {
    {
      __pyx_t_2 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __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 str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":320
 *         common_chr = chr1.intersection(chr2)
 *         for chrom in common_chr:
 *             chrom_data = self.get_data_by_chr(chrom) # arrays for position and values             # <<<<<<<<<<<<<<
 *             p1n = chrom_data['pos'].flat.next
 *             v11n = chrom_data['V1'].flat.next
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_chrom));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_chrom_data);
    __pyx_v_chrom_data = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":321
 *         for chrom in common_chr:
 *             chrom_data = self.get_data_by_chr(chrom) # arrays for position and values
 *             p1n = chrom_data['pos'].flat.next             # <<<<<<<<<<<<<<
 *             v11n = chrom_data['V1'].flat.next
 *             v21n = chrom_data['V2'].flat.next
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_chrom_data, ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__flat); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_p1n);
    __pyx_v_p1n = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":322
 *             chrom_data = self.get_data_by_chr(chrom) # arrays for position and values
 *             p1n = chrom_data['pos'].flat.next
 *             v11n = chrom_data['V1'].flat.next             # <<<<<<<<<<<<<<
 *             v21n = chrom_data['V2'].flat.next
 * 
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_chrom_data, ((PyObject *)__pyx_n_s__V1)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__flat); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_v11n);
    __pyx_v_v11n = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":323
 *             p1n = chrom_data['pos'].flat.next
 *             v11n = chrom_data['V1'].flat.next
 *             v21n = chrom_data['V2'].flat.next             # <<<<<<<<<<<<<<
 * 
 *             (p2s,v2s) = bdgTrack2.get_data_by_chr(chrom) # arrays for position and values
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_chrom_data, ((PyObject *)__pyx_n_s__V2)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__flat); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_v21n);
    __pyx_v_v21n = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":325
 *             v21n = chrom_data['V2'].flat.next
 * 
 *             (p2s,v2s) = bdgTrack2.get_data_by_chr(chrom) # arrays for position and values             # <<<<<<<<<<<<<<
 *             p2n = iter(p2s).next         # assign the next function to a viable to speed up
 *             v2n = iter(v2s).next
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_bdgTrack2, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_chrom));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext;
      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_p2s);
    __pyx_v_p2s = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_v2s);
    __pyx_v_v2s = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":326
 * 
 *             (p2s,v2s) = bdgTrack2.get_data_by_chr(chrom) # arrays for position and values
 *             p2n = iter(p2s).next         # assign the next function to a viable to speed up             # <<<<<<<<<<<<<<
 *             v2n = iter(v2s).next
 * 
 */
    __pyx_t_2 = PyObject_GetIter(__pyx_v_p2s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_p2n);
    __pyx_v_p2n = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":327
 *             (p2s,v2s) = bdgTrack2.get_data_by_chr(chrom) # arrays for position and values
 *             p2n = iter(p2s).next         # assign the next function to a viable to speed up
 *             v2n = iter(v2s).next             # <<<<<<<<<<<<<<
 * 
 *             pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret
 */
    __pyx_t_4 = PyObject_GetIter(__pyx_v_v2s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_v2n);
    __pyx_v_v2n = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":329
 *             v2n = iter(v2s).next
 * 
 *             pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
    __pyx_v_pre_p = 0;

    /* "MACS2/IO/cScoreTrack.pyx":331
 *             pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 p1 = p1n()
 *                 v11 = v11n()
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "MACS2/IO/cScoreTrack.pyx":332
 * 
 *             try:
 *                 p1 = p1n()             # <<<<<<<<<<<<<<
 *                 v11 = v11n()
 *                 v21 = v21n()
 */
        __pyx_t_2 = PyObject_Call(__pyx_v_p1n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_p1 = __pyx_t_13;

        /* "MACS2/IO/cScoreTrack.pyx":333
 *             try:
 *                 p1 = p1n()
 *                 v11 = v11n()             # <<<<<<<<<<<<<<
 *                 v21 = v21n()
 * 
 */
        __pyx_t_2 = PyObject_Call(__pyx_v_v11n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_v11 = __pyx_t_14;

        /* "MACS2/IO/cScoreTrack.pyx":334
 *                 p1 = p1n()
 *                 v11 = v11n()
 *                 v21 = v21n()             # <<<<<<<<<<<<<<
 * 
 *                 p2 = p2n()
 */
        __pyx_t_2 = PyObject_Call(__pyx_v_v21n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_v21 = __pyx_t_14;

        /* "MACS2/IO/cScoreTrack.pyx":336
 *                 v21 = v21n()
 * 
 *                 p2 = p2n()             # <<<<<<<<<<<<<<
 *                 v2 = v2n()
 * 
 */
        __pyx_t_2 = PyObject_Call(__pyx_v_p2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_p2 = __pyx_t_13;

        /* "MACS2/IO/cScoreTrack.pyx":337
 * 
 *                 p2 = p2n()
 *                 v2 = v2n()             # <<<<<<<<<<<<<<
 * 
 *                 while True:
 */
        __pyx_t_2 = PyObject_Call(__pyx_v_v2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_v2 = __pyx_t_14;

        /* "MACS2/IO/cScoreTrack.pyx":339
 *                 v2 = v2n()
 * 
 *                 while True:             # <<<<<<<<<<<<<<
 *                     if p1 < p2:
 *                         # clip a region from pre_p to p1, then set pre_p as p1.
 */
        while (1) {
          if (!1) break;

          /* "MACS2/IO/cScoreTrack.pyx":340
 * 
 *                 while True:
 *                     if p1 < p2:             # <<<<<<<<<<<<<<
 *                         # clip a region from pre_p to p1, then set pre_p as p1.
 *                         if v2>0:
 */
          __pyx_t_15 = (__pyx_v_p1 < __pyx_v_p2);
          if (__pyx_t_15) {

            /* "MACS2/IO/cScoreTrack.pyx":342
 *                     if p1 < p2:
 *                         # clip a region from pre_p to p1, then set pre_p as p1.
 *                         if v2>0:             # <<<<<<<<<<<<<<
 *                             radd(chrom+"."+str(pre_p)+"."+str(p1))
 *                             v1add(v11)
 */
            __pyx_t_15 = (__pyx_v_v2 > 0.0);
            if (__pyx_t_15) {

              /* "MACS2/IO/cScoreTrack.pyx":343
 *                         # clip a region from pre_p to p1, then set pre_p as p1.
 *                         if v2>0:
 *                             radd(chrom+"."+str(pre_p)+"."+str(p1))             # <<<<<<<<<<<<<<
 *                             v1add(v11)
 *                             v2add(v21)
 */
              __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_chrom), ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(((PyObject *)__pyx_t_2));
              __pyx_t_4 = PyInt_FromLong(__pyx_v_pre_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_4);
              __pyx_t_4 = 0;
              __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
              __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_t_2), __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = PyNumber_Add(__pyx_t_7, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_7 = PyInt_FromLong(__pyx_v_p1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
              __Pyx_GIVEREF(__pyx_t_7);
              __pyx_t_7 = 0;
              __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
              __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_radd, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "MACS2/IO/cScoreTrack.pyx":344
 *                         if v2>0:
 *                             radd(chrom+"."+str(pre_p)+"."+str(p1))
 *                             v1add(v11)             # <<<<<<<<<<<<<<
 *                             v2add(v21)
 *                             ladd(p1-pre_p)
 */
              __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_v1add, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "MACS2/IO/cScoreTrack.pyx":345
 *                             radd(chrom+"."+str(pre_p)+"."+str(p1))
 *                             v1add(v11)
 *                             v2add(v21)             # <<<<<<<<<<<<<<
 *                             ladd(p1-pre_p)
 *                         pre_p = p1
 */
              __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_v2add, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "MACS2/IO/cScoreTrack.pyx":346
 *                             v1add(v11)
 *                             v2add(v21)
 *                             ladd(p1-pre_p)             # <<<<<<<<<<<<<<
 *                         pre_p = p1
 *                         # call for the next p1 and v1
 */
              __pyx_t_2 = PyInt_FromLong((__pyx_v_p1 - __pyx_v_pre_p)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_ladd, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L18;
            }
            __pyx_L18:;

            /* "MACS2/IO/cScoreTrack.pyx":347
 *                             v2add(v21)
 *                             ladd(p1-pre_p)
 *                         pre_p = p1             # <<<<<<<<<<<<<<
 *                         # call for the next p1 and v1
 *                         p1 = p1n()
 */
            __pyx_v_pre_p = __pyx_v_p1;

            /* "MACS2/IO/cScoreTrack.pyx":349
 *                         pre_p = p1
 *                         # call for the next p1 and v1
 *                         p1 = p1n()             # <<<<<<<<<<<<<<
 *                         v11 = v11n()
 *                         v21 = v21n()
 */
            __pyx_t_2 = PyObject_Call(__pyx_v_p1n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_p1 = __pyx_t_13;

            /* "MACS2/IO/cScoreTrack.pyx":350
 *                         # call for the next p1 and v1
 *                         p1 = p1n()
 *                         v11 = v11n()             # <<<<<<<<<<<<<<
 *                         v21 = v21n()
 *                     elif p2 < p1:
 */
            __pyx_t_2 = PyObject_Call(__pyx_v_v11n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_v11 = __pyx_t_14;

            /* "MACS2/IO/cScoreTrack.pyx":351
 *                         p1 = p1n()
 *                         v11 = v11n()
 *                         v21 = v21n()             # <<<<<<<<<<<<<<
 *                     elif p2 < p1:
 *                         # clip a region from pre_p to p2, then set pre_p as p2.
 */
            __pyx_t_2 = PyObject_Call(__pyx_v_v21n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_v21 = __pyx_t_14;
            goto __pyx_L17;
          }

          /* "MACS2/IO/cScoreTrack.pyx":352
 *                         v11 = v11n()
 *                         v21 = v21n()
 *                     elif p2 < p1:             # <<<<<<<<<<<<<<
 *                         # clip a region from pre_p to p2, then set pre_p as p2.
 *                         if v2>0:
 */
          __pyx_t_15 = (__pyx_v_p2 < __pyx_v_p1);
          if (__pyx_t_15) {

            /* "MACS2/IO/cScoreTrack.pyx":354
 *                     elif p2 < p1:
 *                         # clip a region from pre_p to p2, then set pre_p as p2.
 *                         if v2>0:             # <<<<<<<<<<<<<<
 *                             radd(chrom+"."+str(pre_p)+"."+str(p2))
 *                             v1add(v11)
 */
            __pyx_t_15 = (__pyx_v_v2 > 0.0);
            if (__pyx_t_15) {

              /* "MACS2/IO/cScoreTrack.pyx":355
 *                         # clip a region from pre_p to p2, then set pre_p as p2.
 *                         if v2>0:
 *                             radd(chrom+"."+str(pre_p)+"."+str(p2))             # <<<<<<<<<<<<<<
 *                             v1add(v11)
 *                             v2add(v21)
 */
              __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_chrom), ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(((PyObject *)__pyx_t_2));
              __pyx_t_7 = PyInt_FromLong(__pyx_v_pre_p); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
              __Pyx_GIVEREF(__pyx_t_7);
              __pyx_t_7 = 0;
              __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
              __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_2), __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_7 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = PyInt_FromLong(__pyx_v_p2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_4);
              __pyx_t_4 = 0;
              __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
              __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_radd, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "MACS2/IO/cScoreTrack.pyx":356
 *                         if v2>0:
 *                             radd(chrom+"."+str(pre_p)+"."+str(p2))
 *                             v1add(v11)             # <<<<<<<<<<<<<<
 *                             v2add(v21)
 *                             ladd(p2-pre_p)
 */
              __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_v1add, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "MACS2/IO/cScoreTrack.pyx":357
 *                             radd(chrom+"."+str(pre_p)+"."+str(p2))
 *                             v1add(v11)
 *                             v2add(v21)             # <<<<<<<<<<<<<<
 *                             ladd(p2-pre_p)
 *                         pre_p = p2
 */
              __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_v2add, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "MACS2/IO/cScoreTrack.pyx":358
 *                             v1add(v11)
 *                             v2add(v21)
 *                             ladd(p2-pre_p)             # <<<<<<<<<<<<<<
 *                         pre_p = p2
 *                         # call for the next p2 and v2
 */
              __pyx_t_2 = PyInt_FromLong((__pyx_v_p2 - __pyx_v_pre_p)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_ladd, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L19;
            }
            __pyx_L19:;

            /* "MACS2/IO/cScoreTrack.pyx":359
 *                             v2add(v21)
 *                             ladd(p2-pre_p)
 *                         pre_p = p2             # <<<<<<<<<<<<<<
 *                         # call for the next p2 and v2
 *                         p2 = p2n()
 */
            __pyx_v_pre_p = __pyx_v_p2;

            /* "MACS2/IO/cScoreTrack.pyx":361
 *                         pre_p = p2
 *                         # call for the next p2 and v2
 *                         p2 = p2n()             # <<<<<<<<<<<<<<
 *                         v2 = v2n()
 *                     elif p1 == p2:
 */
            __pyx_t_2 = PyObject_Call(__pyx_v_p2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_p2 = __pyx_t_13;

            /* "MACS2/IO/cScoreTrack.pyx":362
 *                         # call for the next p2 and v2
 *                         p2 = p2n()
 *                         v2 = v2n()             # <<<<<<<<<<<<<<
 *                     elif p1 == p2:
 *                         # from pre_p to p1 or p2, then set pre_p as p1 or p2.
 */
            __pyx_t_2 = PyObject_Call(__pyx_v_v2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_v2 = __pyx_t_14;
            goto __pyx_L17;
          }

          /* "MACS2/IO/cScoreTrack.pyx":363
 *                         p2 = p2n()
 *                         v2 = v2n()
 *                     elif p1 == p2:             # <<<<<<<<<<<<<<
 *                         # from pre_p to p1 or p2, then set pre_p as p1 or p2.
 *                         if v2>0:
 */
          __pyx_t_15 = (__pyx_v_p1 == __pyx_v_p2);
          if (__pyx_t_15) {

            /* "MACS2/IO/cScoreTrack.pyx":365
 *                     elif p1 == p2:
 *                         # from pre_p to p1 or p2, then set pre_p as p1 or p2.
 *                         if v2>0:             # <<<<<<<<<<<<<<
 *                             radd(chrom+"."+str(pre_p)+"."+str(p1))
 *                             v1add(v11)
 */
            __pyx_t_15 = (__pyx_v_v2 > 0.0);
            if (__pyx_t_15) {

              /* "MACS2/IO/cScoreTrack.pyx":366
 *                         # from pre_p to p1 or p2, then set pre_p as p1 or p2.
 *                         if v2>0:
 *                             radd(chrom+"."+str(pre_p)+"."+str(p1))             # <<<<<<<<<<<<<<
 *                             v1add(v11)
 *                             v2add(v21)
 */
              __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_chrom), ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(((PyObject *)__pyx_t_2));
              __pyx_t_4 = PyInt_FromLong(__pyx_v_pre_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_4);
              __pyx_t_4 = 0;
              __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
              __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_t_2), __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = PyNumber_Add(__pyx_t_7, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_7 = PyInt_FromLong(__pyx_v_p1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
              __Pyx_GIVEREF(__pyx_t_7);
              __pyx_t_7 = 0;
              __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
              __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_radd, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "MACS2/IO/cScoreTrack.pyx":367
 *                         if v2>0:
 *                             radd(chrom+"."+str(pre_p)+"."+str(p1))
 *                             v1add(v11)             # <<<<<<<<<<<<<<
 *                             v2add(v21)
 *                             ladd(p1-pre_p)
 */
              __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_v1add, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "MACS2/IO/cScoreTrack.pyx":368
 *                             radd(chrom+"."+str(pre_p)+"."+str(p1))
 *                             v1add(v11)
 *                             v2add(v21)             # <<<<<<<<<<<<<<
 *                             ladd(p1-pre_p)
 *                         pre_p = p1
 */
              __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_v2add, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "MACS2/IO/cScoreTrack.pyx":369
 *                             v1add(v11)
 *                             v2add(v21)
 *                             ladd(p1-pre_p)             # <<<<<<<<<<<<<<
 *                         pre_p = p1
 *                         # call for the next p1, v1, p2, v2.
 */
              __pyx_t_2 = PyInt_FromLong((__pyx_v_p1 - __pyx_v_pre_p)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_Call(__pyx_v_ladd, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L20;
            }
            __pyx_L20:;

            /* "MACS2/IO/cScoreTrack.pyx":370
 *                             v2add(v21)
 *                             ladd(p1-pre_p)
 *                         pre_p = p1             # <<<<<<<<<<<<<<
 *                         # call for the next p1, v1, p2, v2.
 *                         p1 = p1n()
 */
            __pyx_v_pre_p = __pyx_v_p1;

            /* "MACS2/IO/cScoreTrack.pyx":372
 *                         pre_p = p1
 *                         # call for the next p1, v1, p2, v2.
 *                         p1 = p1n()             # <<<<<<<<<<<<<<
 *                         v11 = v11n()
 *                         v21 = v21n()
 */
            __pyx_t_2 = PyObject_Call(__pyx_v_p1n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_p1 = __pyx_t_13;

            /* "MACS2/IO/cScoreTrack.pyx":373
 *                         # call for the next p1, v1, p2, v2.
 *                         p1 = p1n()
 *                         v11 = v11n()             # <<<<<<<<<<<<<<
 *                         v21 = v21n()
 *                         p2 = p2n()
 */
            __pyx_t_2 = PyObject_Call(__pyx_v_v11n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_v11 = __pyx_t_14;

            /* "MACS2/IO/cScoreTrack.pyx":374
 *                         p1 = p1n()
 *                         v11 = v11n()
 *                         v21 = v21n()             # <<<<<<<<<<<<<<
 *                         p2 = p2n()
 *                         v2 = v2n()
 */
            __pyx_t_2 = PyObject_Call(__pyx_v_v21n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_v21 = __pyx_t_14;

            /* "MACS2/IO/cScoreTrack.pyx":375
 *                         v11 = v11n()
 *                         v21 = v21n()
 *                         p2 = p2n()             # <<<<<<<<<<<<<<
 *                         v2 = v2n()
 *             except StopIteration:
 */
            __pyx_t_2 = PyObject_Call(__pyx_v_p2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_p2 = __pyx_t_13;

            /* "MACS2/IO/cScoreTrack.pyx":376
 *                         v21 = v21n()
 *                         p2 = p2n()
 *                         v2 = v2n()             # <<<<<<<<<<<<<<
 *             except StopIteration:
 *                 # meet the end of either bedGraphTrackI, simply exit
 */
            __pyx_t_2 = PyObject_Call(__pyx_v_v2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_v2 = __pyx_t_14;
            goto __pyx_L17;
          }
          __pyx_L17:;
        }
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":377
 *                         p2 = p2n()
 *                         v2 = v2n()
 *             except StopIteration:             # <<<<<<<<<<<<<<
 *                 # meet the end of either bedGraphTrackI, simply exit
 *                 pass
 */
      __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
      if (__pyx_t_13) {
        PyErr_Restore(0,0,0);
        goto __pyx_L8_exception_handled;
      }
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      __pyx_L14_try_end:;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":384
 *         #ret = np.array([ret[0],ret[1],ret[2]]).transpose()
 *         #ret = ret[ret[0,0,:].argsort()]
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def extract_average (self, bdgTrack2):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_v_ret);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.extract_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chr1);
  __Pyx_XDECREF(__pyx_v_chr2);
  __Pyx_XDECREF(__pyx_v_common_chr);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_radd);
  __Pyx_XDECREF(__pyx_v_v1add);
  __Pyx_XDECREF(__pyx_v_v2add);
  __Pyx_XDECREF(__pyx_v_ladd);
  __Pyx_XDECREF(__pyx_v_chrom_data);
  __Pyx_XDECREF(__pyx_v_p1n);
  __Pyx_XDECREF(__pyx_v_v11n);
  __Pyx_XDECREF(__pyx_v_v21n);
  __Pyx_XDECREF(__pyx_v_p2s);
  __Pyx_XDECREF(__pyx_v_v2s);
  __Pyx_XDECREF(__pyx_v_p2n);
  __Pyx_XDECREF(__pyx_v_v2n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_19extract_average(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_19extract_average = {__Pyx_NAMESTR("extract_average"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_19extract_average, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_19extract_average(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_bdgTrack2 = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extract_average (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__bdgTrack2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bdgTrack2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("extract_average", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract_average") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_bdgTrack2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extract_average", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.extract_average", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_18extract_average(__pyx_self, __pyx_v_self, __pyx_v_bdgTrack2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":386
 *         return ret
 * 
 *     def extract_average (self, bdgTrack2):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int i, l
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_18extract_average(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2) {
  int __pyx_v_i;
  int __pyx_v_l;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_end = 0;
  PyObject *__pyx_v_rarray = NULL;
  PyObject *__pyx_v_v1array = NULL;
  PyObject *__pyx_v_v2array = NULL;
  PyObject *__pyx_v_larray = NULL;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_radd = NULL;
  PyObject *__pyx_v_v1add = NULL;
  PyObject *__pyx_v_v2add = NULL;
  PyObject *__pyx_v_cur_region = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extract_average", 0);

  /* "MACS2/IO/cScoreTrack.pyx":391
 *             str chrom, start, end
 * 
 *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)             # <<<<<<<<<<<<<<
 *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
 *         radd = ret[0].append
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__extract_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_bdgTrack2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_bdgTrack2);
  __Pyx_GIVEREF(__pyx_v_bdgTrack2);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 3); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    Py_ssize_t i;
    PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_5};
    for (i=0; i < 4; i++) {
      PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(item);
      *(temps[i]) = item;
    }
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_5};
    __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_rarray = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_v1array = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_v2array = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_larray = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":392
 * 
 *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)
 *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1             # <<<<<<<<<<<<<<
 *         radd = ret[0].append
 *         v1add = ret[1].append
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FBYTE4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FBYTE4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_v_ret = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":393
 *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)
 *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
 *         radd = ret[0].append             # <<<<<<<<<<<<<<
 *         v1add = ret[1].append
 *         v2add = ret[2].append
 */
  __pyx_t_6 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ret), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__append); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_radd = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":394
 *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
 *         radd = ret[0].append
 *         v1add = ret[1].append             # <<<<<<<<<<<<<<
 *         v2add = ret[2].append
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
 */
  __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ret), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__append); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_v1add = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":395
 *         radd = ret[0].append
 *         v1add = ret[1].append
 *         v2add = ret[2].append             # <<<<<<<<<<<<<<
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
 *         for i in range(len(rarray)):
 */
  __pyx_t_6 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ret), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__append); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_v2add = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":396
 *         v1add = ret[1].append
 *         v2add = ret[2].append
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2             # <<<<<<<<<<<<<<
 *         for i in range(len(rarray)):
 *             (chrom,start,end) = rarray[i].split('.')
 */
  __pyx_t_4 = PyList_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 3, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 4, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_v_cur_region = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":397
 *         v2add = ret[2].append
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
 *         for i in range(len(rarray)):             # <<<<<<<<<<<<<<
 *             (chrom,start,end) = rarray[i].split('.')
 *             if chrom == cur_region[0] and start == cur_region[2]:
 */
  __pyx_t_8 = PyObject_Length(__pyx_v_rarray); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "MACS2/IO/cScoreTrack.pyx":398
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
 *         for i in range(len(rarray)):
 *             (chrom,start,end) = rarray[i].split('.')             # <<<<<<<<<<<<<<
 *             if chrom == cur_region[0] and start == cur_region[2]:
 *                 cur_region[2] =  end
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rarray, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 2; __pyx_t_3 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_2), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L8_unpacking_done:;
    }
    if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_start));
    __pyx_v_start = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_end));
    __pyx_v_end = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":399
 *         for i in range(len(rarray)):
 *             (chrom,start,end) = rarray[i].split('.')
 *             if chrom == cur_region[0] and start == cur_region[2]:             # <<<<<<<<<<<<<<
 *                 cur_region[2] =  end
 *                 cur_region[3] += v1array[i]*larray[i]
 */
    __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_v_chrom), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_10) {
      __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_start), __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_12 = __pyx_t_11;
    } else {
      __pyx_t_12 = __pyx_t_10;
    }
    if (__pyx_t_12) {

      /* "MACS2/IO/cScoreTrack.pyx":400
 *             (chrom,start,end) = rarray[i].split('.')
 *             if chrom == cur_region[0] and start == cur_region[2]:
 *                 cur_region[2] =  end             # <<<<<<<<<<<<<<
 *                 cur_region[3] += v1array[i]*larray[i]
 *                 cur_region[4] += v2array[i]*larray[i]
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_cur_region), 2, ((PyObject *)__pyx_v_end), sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "MACS2/IO/cScoreTrack.pyx":401
 *             if chrom == cur_region[0] and start == cur_region[2]:
 *                 cur_region[2] =  end
 *                 cur_region[3] += v1array[i]*larray[i]             # <<<<<<<<<<<<<<
 *                 cur_region[4] += v2array[i]*larray[i]
 *             else:
 */
      __pyx_t_13 = 3;
      __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), __pyx_t_13, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_v1array, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_cur_region), __pyx_t_13, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":402
 *                 cur_region[2] =  end
 *                 cur_region[3] += v1array[i]*larray[i]
 *                 cur_region[4] += v2array[i]*larray[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 if cur_region[0]:
 */
      __pyx_t_13 = 4;
      __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), __pyx_t_13, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_v2array, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyNumber_Multiply(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_cur_region), __pyx_t_13, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "MACS2/IO/cScoreTrack.pyx":404
 *                 cur_region[4] += v2array[i]*larray[i]
 *             else:
 *                 if cur_region[0]:             # <<<<<<<<<<<<<<
 *                     l = int(cur_region[2])-int(cur_region[1])
 *                     radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 */
      __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_12) {

        /* "MACS2/IO/cScoreTrack.pyx":405
 *             else:
 *                 if cur_region[0]:
 *                     l = int(cur_region[2])-int(cur_region[1])             # <<<<<<<<<<<<<<
 *                     radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 *                     v1add(cur_region[3]/float(l))
 */
        __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_14 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_l = __pyx_t_14;

        /* "MACS2/IO/cScoreTrack.pyx":406
 *                 if cur_region[0]:
 *                     l = int(cur_region[2])-int(cur_region[1])
 *                     radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))             # <<<<<<<<<<<<<<
 *                     v1add(cur_region[3]/float(l))
 *                     v2add(cur_region[4]/float(l))
 */
        __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_v_radd, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":407
 *                     l = int(cur_region[2])-int(cur_region[1])
 *                     radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 *                     v1add(cur_region[3]/float(l))             # <<<<<<<<<<<<<<
 *                     v2add(cur_region[4]/float(l))
 *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
 */
        __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(((double)__pyx_v_l)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_v_v1add, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":408
 *                     radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 *                     v1add(cur_region[3]/float(l))
 *                     v2add(cur_region[4]/float(l))             # <<<<<<<<<<<<<<
 *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
 * 
 */
        __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyFloat_FromDouble(((double)__pyx_v_l)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_v_v2add, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "MACS2/IO/cScoreTrack.pyx":409
 *                     v1add(cur_region[3]/float(l))
 *                     v2add(cur_region[4]/float(l))
 *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]             # <<<<<<<<<<<<<<
 * 
 *         radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 */
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_v1array, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_v2array, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyList_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
      PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_chrom));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
      __Pyx_INCREF(((PyObject *)__pyx_v_start));
      PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_start));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_start));
      __Pyx_INCREF(((PyObject *)__pyx_v_end));
      PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_end));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_end));
      PyList_SET_ITEM(__pyx_t_3, 3, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyList_SET_ITEM(__pyx_t_3, 4, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_1 = 0;
      __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_v_cur_region));
      __pyx_v_cur_region = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
    }
    __pyx_L9:;
  }

  /* "MACS2/IO/cScoreTrack.pyx":411
 *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
 * 
 *         radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))             # <<<<<<<<<<<<<<
 *         v1add(cur_region[3]/float(l))
 *         v2add(cur_region[4]/float(l))
 */
  __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_v_radd, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":412
 * 
 *         radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 *         v1add(cur_region[3]/float(l))             # <<<<<<<<<<<<<<
 *         v2add(cur_region[4]/float(l))
 *         return ret
 */
  __pyx_t_6 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_l)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_v_v1add, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":413
 *         radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 *         v1add(cur_region[3]/float(l))
 *         v2add(cur_region[4]/float(l))             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
  __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_l)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_v_v2add, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":414
 *         v1add(cur_region[3]/float(l))
 *         v2add(cur_region[4]/float(l))
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def extract_sum (self, bdgTrack2):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_v_ret);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.extract_average", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XDECREF(__pyx_v_rarray);
  __Pyx_XDECREF(__pyx_v_v1array);
  __Pyx_XDECREF(__pyx_v_v2array);
  __Pyx_XDECREF(__pyx_v_larray);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_radd);
  __Pyx_XDECREF(__pyx_v_v1add);
  __Pyx_XDECREF(__pyx_v_v2add);
  __Pyx_XDECREF(__pyx_v_cur_region);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_21extract_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_20extract_sum[] = "Get sum values in each region defined in bdgTrack2.\n        \n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_21extract_sum = {__Pyx_NAMESTR("extract_sum"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_21extract_sum, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_20extract_sum)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_21extract_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_bdgTrack2 = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extract_sum (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__bdgTrack2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bdgTrack2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("extract_sum", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract_sum") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_bdgTrack2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extract_sum", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.extract_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_20extract_sum(__pyx_self, __pyx_v_self, __pyx_v_bdgTrack2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":416
 *         return ret
 * 
 *     def extract_sum (self, bdgTrack2):             # <<<<<<<<<<<<<<
 *         """Get sum values in each region defined in bdgTrack2.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_20extract_sum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2) {
  int __pyx_v_i;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_end = 0;
  PyObject *__pyx_v_rarray = NULL;
  PyObject *__pyx_v_v1array = NULL;
  PyObject *__pyx_v_v2array = NULL;
  PyObject *__pyx_v_larray = NULL;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_radd = NULL;
  PyObject *__pyx_v_v1add = NULL;
  PyObject *__pyx_v_v2add = NULL;
  PyObject *__pyx_v_cur_region = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extract_sum", 0);

  /* "MACS2/IO/cScoreTrack.pyx":424
 *             str chrom, start, end
 * 
 *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)             # <<<<<<<<<<<<<<
 *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
 *         radd = ret[0].append
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__extract_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_bdgTrack2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_bdgTrack2);
  __Pyx_GIVEREF(__pyx_v_bdgTrack2);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 3); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    Py_ssize_t i;
    PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_5};
    for (i=0; i < 4; i++) {
      PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(item);
      *(temps[i]) = item;
    }
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_5};
    __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_rarray = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_v1array = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_v2array = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_larray = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":425
 * 
 *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)
 *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1             # <<<<<<<<<<<<<<
 *         radd = ret[0].append
 *         v1add = ret[1].append
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FBYTE4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FBYTE4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_v_ret = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":426
 *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)
 *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
 *         radd = ret[0].append             # <<<<<<<<<<<<<<
 *         v1add = ret[1].append
 *         v2add = ret[2].append
 */
  __pyx_t_6 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ret), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__append); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_radd = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":427
 *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
 *         radd = ret[0].append
 *         v1add = ret[1].append             # <<<<<<<<<<<<<<
 *         v2add = ret[2].append
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
 */
  __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ret), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__append); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_v1add = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":428
 *         radd = ret[0].append
 *         v1add = ret[1].append
 *         v2add = ret[2].append             # <<<<<<<<<<<<<<
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
 *         for i in range(len(rarray)):
 */
  __pyx_t_6 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ret), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__append); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_v2add = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":429
 *         v1add = ret[1].append
 *         v2add = ret[2].append
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2             # <<<<<<<<<<<<<<
 *         for i in range(len(rarray)):
 *             (chrom,start,end) = rarray[i].split('.')
 */
  __pyx_t_4 = PyList_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 3, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 4, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_v_cur_region = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":430
 *         v2add = ret[2].append
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
 *         for i in range(len(rarray)):             # <<<<<<<<<<<<<<
 *             (chrom,start,end) = rarray[i].split('.')
 *             if chrom == cur_region[0] and start == cur_region[2]:
 */
  __pyx_t_8 = PyObject_Length(__pyx_v_rarray); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "MACS2/IO/cScoreTrack.pyx":431
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
 *         for i in range(len(rarray)):
 *             (chrom,start,end) = rarray[i].split('.')             # <<<<<<<<<<<<<<
 *             if chrom == cur_region[0] and start == cur_region[2]:
 *                 cur_region[2] =  end
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rarray, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 2; __pyx_t_3 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_2), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L8_unpacking_done:;
    }
    if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_start));
    __pyx_v_start = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_end));
    __pyx_v_end = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":432
 *         for i in range(len(rarray)):
 *             (chrom,start,end) = rarray[i].split('.')
 *             if chrom == cur_region[0] and start == cur_region[2]:             # <<<<<<<<<<<<<<
 *                 cur_region[2] =  end
 *                 cur_region[3] += v1array[i]*larray[i]
 */
    __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_v_chrom), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_10) {
      __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_start), __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_12 = __pyx_t_11;
    } else {
      __pyx_t_12 = __pyx_t_10;
    }
    if (__pyx_t_12) {

      /* "MACS2/IO/cScoreTrack.pyx":433
 *             (chrom,start,end) = rarray[i].split('.')
 *             if chrom == cur_region[0] and start == cur_region[2]:
 *                 cur_region[2] =  end             # <<<<<<<<<<<<<<
 *                 cur_region[3] += v1array[i]*larray[i]
 *                 cur_region[4] += v2array[i]*larray[i]
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_cur_region), 2, ((PyObject *)__pyx_v_end), sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "MACS2/IO/cScoreTrack.pyx":434
 *             if chrom == cur_region[0] and start == cur_region[2]:
 *                 cur_region[2] =  end
 *                 cur_region[3] += v1array[i]*larray[i]             # <<<<<<<<<<<<<<
 *                 cur_region[4] += v2array[i]*larray[i]
 *             else:
 */
      __pyx_t_13 = 3;
      __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), __pyx_t_13, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_v1array, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_cur_region), __pyx_t_13, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":435
 *                 cur_region[2] =  end
 *                 cur_region[3] += v1array[i]*larray[i]
 *                 cur_region[4] += v2array[i]*larray[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 if cur_region[0]:
 */
      __pyx_t_13 = 4;
      __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), __pyx_t_13, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_v2array, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyNumber_Multiply(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_cur_region), __pyx_t_13, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "MACS2/IO/cScoreTrack.pyx":437
 *                 cur_region[4] += v2array[i]*larray[i]
 *             else:
 *                 if cur_region[0]:             # <<<<<<<<<<<<<<
 *                     radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 *                     v1add(cur_region[3])
 */
      __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_12) {

        /* "MACS2/IO/cScoreTrack.pyx":438
 *             else:
 *                 if cur_region[0]:
 *                     radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))             # <<<<<<<<<<<<<<
 *                     v1add(cur_region[3])
 *                     v2add(cur_region[4])
 */
        __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_v_radd, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":439
 *                 if cur_region[0]:
 *                     radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 *                     v1add(cur_region[3])             # <<<<<<<<<<<<<<
 *                     v2add(cur_region[4])
 *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
 */
        __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_v_v1add, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":440
 *                     radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 *                     v1add(cur_region[3])
 *                     v2add(cur_region[4])             # <<<<<<<<<<<<<<
 *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
 * 
 */
        __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_v_v2add, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "MACS2/IO/cScoreTrack.pyx":441
 *                     v1add(cur_region[3])
 *                     v2add(cur_region[4])
 *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]             # <<<<<<<<<<<<<<
 * 
 *         radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 */
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_v1array, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_v2array, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyList_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
      PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_chrom));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
      __Pyx_INCREF(((PyObject *)__pyx_v_start));
      PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_start));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_start));
      __Pyx_INCREF(((PyObject *)__pyx_v_end));
      PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_end));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_end));
      PyList_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyList_SET_ITEM(__pyx_t_3, 4, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_v_cur_region));
      __pyx_v_cur_region = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
    }
    __pyx_L9:;
  }

  /* "MACS2/IO/cScoreTrack.pyx":443
 *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
 * 
 *         radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))             # <<<<<<<<<<<<<<
 *         v1add(cur_region[3])
 *         v2add(cur_region[4])
 */
  __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_v_radd, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":444
 * 
 *         radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 *         v1add(cur_region[3])             # <<<<<<<<<<<<<<
 *         v2add(cur_region[4])
 *         return ret
 */
  __pyx_t_6 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_v_v1add, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":445
 *         radd(cur_region[0]+"."+str(cur_region[1])+"."+str(cur_region[2]))
 *         v1add(cur_region[3])
 *         v2add(cur_region[4])             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
  __pyx_t_6 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_cur_region), 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_v_v2add, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":446
 *         v1add(cur_region[3])
 *         v2add(cur_region[4])
 *         return ret             # <<<<<<<<<<<<<<
 * 
 * cdef class scoreTrackII:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_v_ret);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.CombinedTwoTrack.extract_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XDECREF(__pyx_v_rarray);
  __Pyx_XDECREF(__pyx_v_v1array);
  __Pyx_XDECREF(__pyx_v_v2array);
  __Pyx_XDECREF(__pyx_v_larray);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_radd);
  __Pyx_XDECREF(__pyx_v_v1add);
  __Pyx_XDECREF(__pyx_v_v2add);
  __Pyx_XDECREF(__pyx_v_cur_region);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII___init__[] = "Initialize.\n\n        treat_depth and ctrl_depth are effective depth in million:\n                                    sequencing depth in million after\n                                    duplicates being filtered. If\n                                    treatment is scaled down to\n                                    control sample size, then this\n                                    should be control sample size in\n                                    million. And vice versa.\n                                    \n        pseudocount: a pseudocount used to calculate logLR, FE or\n                     logFE. Please note this value will not be changed\n                     with normalization method. So if you really want\n                     to set pseudocount 1 per million reads, set it\n                     after you normalize treat and control by million\n                     reads by `change_normalizetion_method(ord('M'))`.\n\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5MACS2_2IO_11cScoreTrack_12scoreTrackII___init__;
#endif
static int __pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_treat_depth;
  float __pyx_v_ctrl_depth;
  CYTHON_UNUSED PyBoolObject *__pyx_v_stderr_on = 0;
  float __pyx_v_pseudocount;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__treat_depth,&__pyx_n_s__ctrl_depth,&__pyx_n_s__stderr_on,&__pyx_n_s__pseudocount,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = (PyObject *)__pyx_k_9;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__treat_depth)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ctrl_depth)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stderr_on);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pseudocount);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_treat_depth = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_treat_depth == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_ctrl_depth = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_ctrl_depth == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_stderr_on = ((PyBoolObject *)values[2]);
    if (values[3]) {
      __pyx_v_pseudocount = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_pseudocount == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "MACS2/IO/cScoreTrack.pyx":474
 * 
 * 
 *     def __init__ (self, float treat_depth, float ctrl_depth, bool stderr_on = False, float pseudocount = 1.0 ):             # <<<<<<<<<<<<<<
 *         """Initialize.
 * 
 */
      __pyx_v_pseudocount = ((float)1.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stderr_on), __pyx_ptype_7cpython_4bool_bool, 1, "stderr_on", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII___init__(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_treat_depth, __pyx_v_ctrl_depth, __pyx_v_stderr_on, __pyx_v_pseudocount);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII___init__(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, float __pyx_v_treat_depth, float __pyx_v_ctrl_depth, CYTHON_UNUSED PyBoolObject *__pyx_v_stderr_on, float __pyx_v_pseudocount) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "MACS2/IO/cScoreTrack.pyx":493
 * 
 *         """
 *         self.data = {}           # for each chromosome, there is a l*4             # <<<<<<<<<<<<<<
 *                                  # matrix. First column: end position
 *                                  # of a region; Second: treatment
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->data);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->data));
  __pyx_v_self->data = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":501
 *                                  # ratio/fold-enrichment/subtraction
 *                                  # depending on -c setting)
 *         self.datalength = {}             # <<<<<<<<<<<<<<
 *         self.trackline = False
 *         self.treat_edm = treat_depth
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->datalength);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->datalength));
  __pyx_v_self->datalength = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":502
 *                                  # depending on -c setting)
 *         self.datalength = {}
 *         self.trackline = False             # <<<<<<<<<<<<<<
 *         self.treat_edm = treat_depth
 *         self.ctrl_edm = ctrl_depth
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->trackline);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->trackline));
  __pyx_v_self->trackline = ((PyBoolObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":503
 *         self.datalength = {}
 *         self.trackline = False
 *         self.treat_edm = treat_depth             # <<<<<<<<<<<<<<
 *         self.ctrl_edm = ctrl_depth
 *         #scoring_method:  p: -log10 pvalue;
 */
  __pyx_v_self->treat_edm = __pyx_v_treat_depth;

  /* "MACS2/IO/cScoreTrack.pyx":504
 *         self.trackline = False
 *         self.treat_edm = treat_depth
 *         self.ctrl_edm = ctrl_depth             # <<<<<<<<<<<<<<
 *         #scoring_method:  p: -log10 pvalue;
 *         #                 q: -log10 qvalue;
 */
  __pyx_v_self->ctrl_edm = __pyx_v_ctrl_depth;

  /* "MACS2/IO/cScoreTrack.pyx":513
 *         #                 m: fragment pileup per million reads
 *         #                 N: not set
 *         self.scoring_method = ord("N")             # <<<<<<<<<<<<<<
 * 
 *         #normalization_method: T: scale to depth of treatment;
 */
  __pyx_t_2 = __Pyx_PyInt_AsChar(__pyx_int_78); if (unlikely((__pyx_t_2 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->scoring_method = __pyx_t_2;

  /* "MACS2/IO/cScoreTrack.pyx":519
 *         #                      M: scale to depth of 1 million;
 *         #                      N: not set/ raw pileup
 *         self.normalization_method = ord("N")             # <<<<<<<<<<<<<<
 * 
 *         self.pseudocount = pseudocount
 */
  __pyx_t_2 = __Pyx_PyInt_AsChar(__pyx_int_78); if (unlikely((__pyx_t_2 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->normalization_method = __pyx_t_2;

  /* "MACS2/IO/cScoreTrack.pyx":521
 *         self.normalization_method = ord("N")
 * 
 *         self.pseudocount = pseudocount             # <<<<<<<<<<<<<<
 *         self.pvalue_stat = {}
 * 
 */
  __pyx_v_self->pseudocount = __pyx_v_pseudocount;

  /* "MACS2/IO/cScoreTrack.pyx":522
 * 
 *         self.pseudocount = pseudocount
 *         self.pvalue_stat = {}             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_pseudocount( self, float pseudocount ):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->pvalue_stat);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->pvalue_stat));
  __pyx_v_self->pvalue_stat = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":524
 *         self.pvalue_stat = {}
 * 
 *     cpdef set_pseudocount( self, float pseudocount ):             # <<<<<<<<<<<<<<
 *         self.pseudocount = pseudocount
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_set_pseudocount(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, float __pyx_v_pseudocount, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_pseudocount", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_pseudocount); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_3set_pseudocount)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":525
 * 
 *     cpdef set_pseudocount( self, float pseudocount ):
 *         self.pseudocount = pseudocount             # <<<<<<<<<<<<<<
 * 
 *     cpdef enable_trackline( self ):
 */
  __pyx_v_self->pseudocount = __pyx_v_pseudocount;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount); /*proto*/
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount) {
  float __pyx_v_pseudocount;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_pseudocount (wrapper)", 0);
  assert(__pyx_arg_pseudocount); {
    __pyx_v_pseudocount = __pyx_PyFloat_AsFloat(__pyx_arg_pseudocount); if (unlikely((__pyx_v_pseudocount == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_2set_pseudocount(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), ((float)__pyx_v_pseudocount));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":524
 *         self.pvalue_stat = {}
 * 
 *     cpdef set_pseudocount( self, float pseudocount ):             # <<<<<<<<<<<<<<
 *         self.pseudocount = pseudocount
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, float __pyx_v_pseudocount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_pseudocount", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->set_pseudocount(__pyx_v_self, __pyx_v_pseudocount, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":527
 *         self.pseudocount = pseudocount
 * 
 *     cpdef enable_trackline( self ):             # <<<<<<<<<<<<<<
 *         """Turn on trackline with bedgraph output
 *         """
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_5enable_trackline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_enable_trackline(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enable_trackline", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__enable_trackline); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_5enable_trackline)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":530
 *         """Turn on trackline with bedgraph output
 *         """
 *         self.trackline = True             # <<<<<<<<<<<<<<
 * 
 *     cpdef add_chromosome ( self, str chrom, int chrom_max_len ):
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->trackline);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->trackline));
  __pyx_v_self->trackline = ((PyBoolObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.enable_trackline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_5enable_trackline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_4enable_trackline[] = "Turn on trackline with bedgraph output\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_5enable_trackline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enable_trackline (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_4enable_trackline(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":527
 *         self.pseudocount = pseudocount
 * 
 *     cpdef enable_trackline( self ):             # <<<<<<<<<<<<<<
 *         """Turn on trackline with bedgraph output
 *         """
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_4enable_trackline(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enable_trackline", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->enable_trackline(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.enable_trackline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":532
 *         self.trackline = True
 * 
 *     cpdef add_chromosome ( self, str chrom, int chrom_max_len ):             # <<<<<<<<<<<<<<
 *         """
 *         chrom: chromosome name
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_7add_chromosome(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_add_chromosome(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chrom, int __pyx_v_chrom_max_len, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_chromosome", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__add_chromosome); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_7add_chromosome)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_chrom));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":538
 * 
 *         """
 *         if not self.data.has_key(chrom):             # <<<<<<<<<<<<<<
 *             #self.data[chrom] = np.zeros( ( chrom_max_len, 4 ), dtype="int32" ) # remember col #2-4 is actual value * 100, I use integer here.
 *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->data), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "MACS2/IO/cScoreTrack.pyx":540
 *         if not self.data.has_key(chrom):
 *             #self.data[chrom] = np.zeros( ( chrom_max_len, 4 ), dtype="int32" ) # remember col #2-4 is actual value * 100, I use integer here.
 *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos             # <<<<<<<<<<<<<<
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # pileup at each interval, in float format
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float format
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__int32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":541
 *             #self.data[chrom] = np.zeros( ( chrom_max_len, 4 ), dtype="int32" ) # remember col #2-4 is actual value * 100, I use integer here.
 *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # pileup at each interval, in float format             # <<<<<<<<<<<<<<
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float format
 *                                  np.zeros( chrom_max_len, dtype="float32" ) ] # score at each interval, in float format
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":542
 *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # pileup at each interval, in float format
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float format             # <<<<<<<<<<<<<<
 *                                  np.zeros( chrom_max_len, dtype="float32" ) ] # score at each interval, in float format
 *             self.datalength[chrom] = 0
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":543
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # pileup at each interval, in float format
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float format
 *                                  np.zeros( chrom_max_len, dtype="float32" ) ] # score at each interval, in float format             # <<<<<<<<<<<<<<
 *             self.datalength[chrom] = 0
 * 
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_3, 3, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":540
 *         if not self.data.has_key(chrom):
 *             #self.data[chrom] = np.zeros( ( chrom_max_len, 4 ), dtype="int32" ) # remember col #2-4 is actual value * 100, I use integer here.
 *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos             # <<<<<<<<<<<<<<
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # pileup at each interval, in float format
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float format
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":544
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float format
 *                                  np.zeros( chrom_max_len, dtype="float32" ) ] # score at each interval, in float format
 *             self.datalength[chrom] = 0             # <<<<<<<<<<<<<<
 * 
 *     cpdef add (self, str chromosome, int endpos, float chip, float control):
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_7add_chromosome(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_6add_chromosome[] = "\n        chrom: chromosome name\n        chrom_max_len: maximum number of data points in this chromosome\n        \n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_7add_chromosome(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_chrom_max_len;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_chromosome (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__chrom,&__pyx_n_s__chrom_max_len,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__chrom)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom_max_len)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_chromosome") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __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_chrom = ((PyObject*)values[0]);
    __pyx_v_chrom_max_len = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_chrom_max_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyString_Type), 1, "chrom", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_6add_chromosome(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_chrom, __pyx_v_chrom_max_len);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":532
 *         self.trackline = True
 * 
 *     cpdef add_chromosome ( self, str chrom, int chrom_max_len ):             # <<<<<<<<<<<<<<
 *         """
 *         chrom: chromosome name
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_6add_chromosome(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chrom, int __pyx_v_chrom_max_len) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_chromosome", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->add_chromosome(__pyx_v_self, __pyx_v_chrom, __pyx_v_chrom_max_len, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":546
 *             self.datalength[chrom] = 0
 * 
 *     cpdef add (self, str chromosome, int endpos, float chip, float control):             # <<<<<<<<<<<<<<
 *         """Add a chr-endpos-sample-control block into data
 *         dictionary.
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_9add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_add(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_v_endpos, float __pyx_v_chip, float __pyx_v_control, int __pyx_skip_dispatch) {
  int __pyx_v_i;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_9add)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_endpos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_chip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_control); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_chromosome));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chromosome));
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":558
 *         """
 *         cdef int i
 *         i = self.datalength[chromosome]             # <<<<<<<<<<<<<<
 *         c = self.data[chromosome]
 *         c[0][ i ] = endpos
 */
  if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_i = __pyx_t_6;

  /* "MACS2/IO/cScoreTrack.pyx":559
 *         cdef int i
 *         i = self.datalength[chromosome]
 *         c = self.data[chromosome]             # <<<<<<<<<<<<<<
 *         c[0][ i ] = endpos
 *         c[1][ i ] = chip
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":560
 *         i = self.datalength[chromosome]
 *         c = self.data[chromosome]
 *         c[0][ i ] = endpos             # <<<<<<<<<<<<<<
 *         c[1][ i ] = chip
 *         c[2][ i ] = control
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_endpos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_c, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemInt(__pyx_t_4, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":561
 *         c = self.data[chromosome]
 *         c[0][ i ] = endpos
 *         c[1][ i ] = chip             # <<<<<<<<<<<<<<
 *         c[2][ i ] = control
 *         self.datalength[chromosome] += 1
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_chip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_c, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemInt(__pyx_t_4, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":562
 *         c[0][ i ] = endpos
 *         c[1][ i ] = chip
 *         c[2][ i ] = control             # <<<<<<<<<<<<<<
 *         self.datalength[chromosome] += 1
 * 
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_control); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_c, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemInt(__pyx_t_4, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":563
 *         c[1][ i ] = chip
 *         c[2][ i ] = control
 *         self.datalength[chromosome] += 1             # <<<<<<<<<<<<<<
 * 
 *     cpdef finalize ( self ):
 */
  if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self->datalength));
  __pyx_t_7 = __pyx_v_self->datalength;
  __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
  __pyx_t_8 = __pyx_v_chromosome;
  if (unlikely(((PyObject *)__pyx_t_7) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_8)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(((PyObject *)__pyx_t_7) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (PyDict_SetItem(((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_8), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
  __Pyx_XDECREF(((PyObject *)__pyx_t_8));
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_9add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_8add[] = "Add a chr-endpos-sample-control block into data\n        dictionary.\n\n        chromosome: chromosome name in string\n        endpos    : end position of each interval in integer\n        chip      : ChIP pileup value of each interval in float\n        control   : Control pileup value of each interval in float\n\n        *Warning* Need to add regions continuously.\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_9add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_chromosome = 0;
  int __pyx_v_endpos;
  float __pyx_v_chip;
  float __pyx_v_control;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__chromosome,&__pyx_n_s__endpos,&__pyx_n_s__chip,&__pyx_n_s__control,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chromosome)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__endpos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chip)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__control)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_chromosome = ((PyObject*)values[0]);
    __pyx_v_endpos = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_endpos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_chip = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_chip == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_control = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_control == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chromosome), (&PyString_Type), 1, "chromosome", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_8add(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_chromosome, __pyx_v_endpos, __pyx_v_chip, __pyx_v_control);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":546
 *             self.datalength[chrom] = 0
 * 
 *     cpdef add (self, str chromosome, int endpos, float chip, float control):             # <<<<<<<<<<<<<<
 *         """Add a chr-endpos-sample-control block into data
 *         dictionary.
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_8add(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_v_endpos, float __pyx_v_chip, float __pyx_v_control) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->add(__pyx_v_self, __pyx_v_chromosome, __pyx_v_endpos, __pyx_v_chip, __pyx_v_control, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":565
 *         self.datalength[chromosome] += 1
 * 
 *     cpdef finalize ( self ):             # <<<<<<<<<<<<<<
 *         """
 *         Adjust array size of each chromosome.
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_11finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_finalize(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_l;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("finalize", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__finalize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_11finalize)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":574
 *             int l
 * 
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             d = self.data[chrom]
 *             l = self.datalength[chrom]
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":575
 * 
 *         for chrom in self.data.keys():
 *             d = self.data[chrom]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             d[0].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_d);
    __pyx_v_d = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":576
 *         for chrom in self.data.keys():
 *             d = self.data[chrom]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             d[0].resize( l, refcheck = False )
 *             d[1].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_l = __pyx_t_5;

    /* "MACS2/IO/cScoreTrack.pyx":577
 *             d = self.data[chrom]
 *             l = self.datalength[chrom]
 *             d[0].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             d[1].resize( l, refcheck = False )
 *             d[2].resize( l, refcheck = False )
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_d, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__resize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":578
 *             l = self.datalength[chrom]
 *             d[0].resize( l, refcheck = False )
 *             d[1].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             d[2].resize( l, refcheck = False )
 *             d[3].resize( l, refcheck = False )
 */
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_d, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":579
 *             d[0].resize( l, refcheck = False )
 *             d[1].resize( l, refcheck = False )
 *             d[2].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             d[3].resize( l, refcheck = False )
 *         return
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_d, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__resize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":580
 *             d[1].resize( l, refcheck = False )
 *             d[2].resize( l, refcheck = False )
 *             d[3].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_d, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__resize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":581
 *             d[2].resize( l, refcheck = False )
 *             d[3].resize( l, refcheck = False )
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # cpdef sort ( self, int column = 1 ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_11finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_10finalize[] = "\n        Adjust array size of each chromosome.\n\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_11finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_10finalize(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":565
 *         self.datalength[chromosome] += 1
 * 
 *     cpdef finalize ( self ):             # <<<<<<<<<<<<<<
 *         """
 *         Adjust array size of each chromosome.
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_10finalize(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("finalize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->finalize(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":599
 *     #     return
 * 
 *     cpdef get_data_by_chr (self, str chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_13get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_get_data_by_chr(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data_by_chr", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_13get_data_by_chr)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chromosome));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chromosome));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":605
 *         ([end pos],[value])
 *         """
 *         if self.data.has_key(chromosome):             # <<<<<<<<<<<<<<
 *             return self.data[chromosome]
 *         else:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->data), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_chromosome));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chromosome));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":606
 *         """
 *         if self.data.has_key(chromosome):
 *             return self.data[chromosome]             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":608
 *             return self.data[chromosome]
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_chr_names (self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_13get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_12get_data_by_chr[] = "Return array of counts by chromosome.\n\n        The return value is a tuple:\n        ([end pos],[value])\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_13get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data_by_chr (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chromosome), (&PyString_Type), 1, "chromosome", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_12get_data_by_chr(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), ((PyObject*)__pyx_v_chromosome));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":599
 *     #     return
 * 
 *     cpdef get_data_by_chr (self, str chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_12get_data_by_chr(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data_by_chr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->get_data_by_chr(__pyx_v_self, __pyx_v_chromosome, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":610
 *             return None
 * 
 *     cpdef get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_get_chr_names(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_chr_names", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15get_chr_names)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":614
 * 
 *         """
 *         l = set(self.data.keys())             # <<<<<<<<<<<<<<
 *         return l
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":615
 *         """
 *         l = set(self.data.keys())
 *         return l             # <<<<<<<<<<<<<<
 * 
 *     cpdef change_normalization_method ( self, char normalization_method ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_l));
  __pyx_r = ((PyObject *)__pyx_v_l);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_14get_chr_names[] = "Return all the chromosome names stored.\n        \n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_chr_names (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_14get_chr_names(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":610
 *             return None
 * 
 *     cpdef get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_14get_chr_names(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_chr_names", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":617
 *         return l
 * 
 *     cpdef change_normalization_method ( self, char normalization_method ):             # <<<<<<<<<<<<<<
 *         """Change/set normalization method. However, I do not
 *         recommend change this back and forward, since some precision
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_17change_normalization_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_normalization_method); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_change_normalization_method(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_normalization_method, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_normalization_method", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_17change_normalization_method)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_normalization_method); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":627
 *                               N: not set/ raw pileup
 *         """
 *         if normalization_method == 'T':             # <<<<<<<<<<<<<<
 *             if self.normalization_method == 'T': # do nothing
 *                 pass
 */
  __pyx_t_4 = (__pyx_v_normalization_method == 'T');
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":628
 *         """
 *         if normalization_method == 'T':
 *             if self.normalization_method == 'T': # do nothing             # <<<<<<<<<<<<<<
 *                 pass
 *             elif self.normalization_method == 'C':
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'T');
    if (__pyx_t_4) {
      goto __pyx_L4;
    }

    /* "MACS2/IO/cScoreTrack.pyx":630
 *             if self.normalization_method == 'T': # do nothing
 *                 pass
 *             elif self.normalization_method == 'C':             # <<<<<<<<<<<<<<
 *                 self.normalize( self.treat_edm/self.ctrl_edm, self.treat_edm/self.ctrl_edm )
 *             elif  self.normalization_method == 'M':
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'C');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":631
 *                 pass
 *             elif self.normalization_method == 'C':
 *                 self.normalize( self.treat_edm/self.ctrl_edm, self.treat_edm/self.ctrl_edm )             # <<<<<<<<<<<<<<
 *             elif  self.normalization_method == 'M':
 *                 self.normalize( self.treat_edm, self.treat_edm )
 */
      if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (__pyx_v_self->treat_edm / __pyx_v_self->ctrl_edm), (__pyx_v_self->treat_edm / __pyx_v_self->ctrl_edm)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4;
    }

    /* "MACS2/IO/cScoreTrack.pyx":632
 *             elif self.normalization_method == 'C':
 *                 self.normalize( self.treat_edm/self.ctrl_edm, self.treat_edm/self.ctrl_edm )
 *             elif  self.normalization_method == 'M':             # <<<<<<<<<<<<<<
 *                 self.normalize( self.treat_edm, self.treat_edm )
 *             elif self.normalization_method == 'N':
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'M');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":633
 *                 self.normalize( self.treat_edm/self.ctrl_edm, self.treat_edm/self.ctrl_edm )
 *             elif  self.normalization_method == 'M':
 *                 self.normalize( self.treat_edm, self.treat_edm )             # <<<<<<<<<<<<<<
 *             elif self.normalization_method == 'N':
 *                 self.normalize( 1, self.treat_edm/self.ctrl_edm )
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, __pyx_v_self->treat_edm, __pyx_v_self->treat_edm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4;
    }

    /* "MACS2/IO/cScoreTrack.pyx":634
 *             elif  self.normalization_method == 'M':
 *                 self.normalize( self.treat_edm, self.treat_edm )
 *             elif self.normalization_method == 'N':             # <<<<<<<<<<<<<<
 *                 self.normalize( 1, self.treat_edm/self.ctrl_edm )
 *             else:
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'N');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":635
 *                 self.normalize( self.treat_edm, self.treat_edm )
 *             elif self.normalization_method == 'N':
 *                 self.normalize( 1, self.treat_edm/self.ctrl_edm )             # <<<<<<<<<<<<<<
 *             else:
 *                 raise NotImplemented
 */
      if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, 1.0, (__pyx_v_self->treat_edm / __pyx_v_self->ctrl_edm)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "MACS2/IO/cScoreTrack.pyx":637
 *                 self.normalize( 1, self.treat_edm/self.ctrl_edm )
 *             else:
 *                 raise NotImplemented             # <<<<<<<<<<<<<<
 *             self.normalization_method = 'T'
 *         elif normalization_method == 'C':
 */
      __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L4:;

    /* "MACS2/IO/cScoreTrack.pyx":638
 *             else:
 *                 raise NotImplemented
 *             self.normalization_method = 'T'             # <<<<<<<<<<<<<<
 *         elif normalization_method == 'C':
 *             if self.normalization_method == 'T':
 */
    __pyx_v_self->normalization_method = 'T';
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":639
 *                 raise NotImplemented
 *             self.normalization_method = 'T'
 *         elif normalization_method == 'C':             # <<<<<<<<<<<<<<
 *             if self.normalization_method == 'T':
 *                 self.normalize( self.ctrl_edm/self.treat_edm, self.ctrl_edm/self.treat_edm )
 */
  __pyx_t_4 = (__pyx_v_normalization_method == 'C');
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":640
 *             self.normalization_method = 'T'
 *         elif normalization_method == 'C':
 *             if self.normalization_method == 'T':             # <<<<<<<<<<<<<<
 *                 self.normalize( self.ctrl_edm/self.treat_edm, self.ctrl_edm/self.treat_edm )
 *             elif self.normalization_method == 'C': # do nothing
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'T');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":641
 *         elif normalization_method == 'C':
 *             if self.normalization_method == 'T':
 *                 self.normalize( self.ctrl_edm/self.treat_edm, self.ctrl_edm/self.treat_edm )             # <<<<<<<<<<<<<<
 *             elif self.normalization_method == 'C': # do nothing
 *                 pass
 */
      if (unlikely(__pyx_v_self->treat_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (unlikely(__pyx_v_self->treat_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (__pyx_v_self->ctrl_edm / __pyx_v_self->treat_edm), (__pyx_v_self->ctrl_edm / __pyx_v_self->treat_edm)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }

    /* "MACS2/IO/cScoreTrack.pyx":642
 *             if self.normalization_method == 'T':
 *                 self.normalize( self.ctrl_edm/self.treat_edm, self.ctrl_edm/self.treat_edm )
 *             elif self.normalization_method == 'C': # do nothing             # <<<<<<<<<<<<<<
 *                 pass
 *             elif  self.normalization_method == 'M':
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'C');
    if (__pyx_t_4) {
      goto __pyx_L5;
    }

    /* "MACS2/IO/cScoreTrack.pyx":644
 *             elif self.normalization_method == 'C': # do nothing
 *                 pass
 *             elif  self.normalization_method == 'M':             # <<<<<<<<<<<<<<
 *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
 *             elif self.normalization_method == 'N':
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'M');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":645
 *                 pass
 *             elif  self.normalization_method == 'M':
 *                 self.normalize( self.ctrl_edm, self.ctrl_edm )             # <<<<<<<<<<<<<<
 *             elif self.normalization_method == 'N':
 *                 self.normalize( self.ctrl_edm/self.treat_edm, 1 )
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, __pyx_v_self->ctrl_edm, __pyx_v_self->ctrl_edm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }

    /* "MACS2/IO/cScoreTrack.pyx":646
 *             elif  self.normalization_method == 'M':
 *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
 *             elif self.normalization_method == 'N':             # <<<<<<<<<<<<<<
 *                 self.normalize( self.ctrl_edm/self.treat_edm, 1 )
 *             else:
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'N');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":647
 *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
 *             elif self.normalization_method == 'N':
 *                 self.normalize( self.ctrl_edm/self.treat_edm, 1 )             # <<<<<<<<<<<<<<
 *             else:
 *                 raise NotImplemented
 */
      if (unlikely(__pyx_v_self->treat_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (__pyx_v_self->ctrl_edm / __pyx_v_self->treat_edm), 1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "MACS2/IO/cScoreTrack.pyx":649
 *                 self.normalize( self.ctrl_edm/self.treat_edm, 1 )
 *             else:
 *                 raise NotImplemented             # <<<<<<<<<<<<<<
 *             self.normalization_method = 'C'
 *         elif normalization_method == 'M':
 */
      __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L5:;

    /* "MACS2/IO/cScoreTrack.pyx":650
 *             else:
 *                 raise NotImplemented
 *             self.normalization_method = 'C'             # <<<<<<<<<<<<<<
 *         elif normalization_method == 'M':
 *             if self.normalization_method == 'T':
 */
    __pyx_v_self->normalization_method = 'C';
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":651
 *                 raise NotImplemented
 *             self.normalization_method = 'C'
 *         elif normalization_method == 'M':             # <<<<<<<<<<<<<<
 *             if self.normalization_method == 'T':
 *                 self.normalize( 1/self.treat_edm, 1/self.treat_edm )
 */
  __pyx_t_4 = (__pyx_v_normalization_method == 'M');
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":652
 *             self.normalization_method = 'C'
 *         elif normalization_method == 'M':
 *             if self.normalization_method == 'T':             # <<<<<<<<<<<<<<
 *                 self.normalize( 1/self.treat_edm, 1/self.treat_edm )
 *             elif self.normalization_method == 'C':
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'T');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":653
 *         elif normalization_method == 'M':
 *             if self.normalization_method == 'T':
 *                 self.normalize( 1/self.treat_edm, 1/self.treat_edm )             # <<<<<<<<<<<<<<
 *             elif self.normalization_method == 'C':
 *                 self.normalize( 1/self.ctrl_edm, 1/self.ctrl_edm )
 */
      if (unlikely(__pyx_v_self->treat_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (unlikely(__pyx_v_self->treat_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (1.0 / __pyx_v_self->treat_edm), (1.0 / __pyx_v_self->treat_edm)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L6;
    }

    /* "MACS2/IO/cScoreTrack.pyx":654
 *             if self.normalization_method == 'T':
 *                 self.normalize( 1/self.treat_edm, 1/self.treat_edm )
 *             elif self.normalization_method == 'C':             # <<<<<<<<<<<<<<
 *                 self.normalize( 1/self.ctrl_edm, 1/self.ctrl_edm )
 *             elif  self.normalization_method == 'M': # do nothing
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'C');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":655
 *                 self.normalize( 1/self.treat_edm, 1/self.treat_edm )
 *             elif self.normalization_method == 'C':
 *                 self.normalize( 1/self.ctrl_edm, 1/self.ctrl_edm )             # <<<<<<<<<<<<<<
 *             elif  self.normalization_method == 'M': # do nothing
 *                 pass
 */
      if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (1.0 / __pyx_v_self->ctrl_edm), (1.0 / __pyx_v_self->ctrl_edm)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L6;
    }

    /* "MACS2/IO/cScoreTrack.pyx":656
 *             elif self.normalization_method == 'C':
 *                 self.normalize( 1/self.ctrl_edm, 1/self.ctrl_edm )
 *             elif  self.normalization_method == 'M': # do nothing             # <<<<<<<<<<<<<<
 *                 pass
 *             elif self.normalization_method == 'N':
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'M');
    if (__pyx_t_4) {
      goto __pyx_L6;
    }

    /* "MACS2/IO/cScoreTrack.pyx":658
 *             elif  self.normalization_method == 'M': # do nothing
 *                 pass
 *             elif self.normalization_method == 'N':             # <<<<<<<<<<<<<<
 *                 self.normalize( 1/self.treat_edm, 1/self.ctrl_edm )
 *             else:
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'N');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":659
 *                 pass
 *             elif self.normalization_method == 'N':
 *                 self.normalize( 1/self.treat_edm, 1/self.ctrl_edm )             # <<<<<<<<<<<<<<
 *             else:
 *                 raise NotImplemented
 */
      if (unlikely(__pyx_v_self->treat_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (1.0 / __pyx_v_self->treat_edm), (1.0 / __pyx_v_self->ctrl_edm)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "MACS2/IO/cScoreTrack.pyx":661
 *                 self.normalize( 1/self.treat_edm, 1/self.ctrl_edm )
 *             else:
 *                 raise NotImplemented             # <<<<<<<<<<<<<<
 *             self.normalization_method = 'M'
 *         elif normalization_method == 'N':
 */
      __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;

    /* "MACS2/IO/cScoreTrack.pyx":662
 *             else:
 *                 raise NotImplemented
 *             self.normalization_method = 'M'             # <<<<<<<<<<<<<<
 *         elif normalization_method == 'N':
 *             if self.normalization_method == 'T':
 */
    __pyx_v_self->normalization_method = 'M';
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":663
 *                 raise NotImplemented
 *             self.normalization_method = 'M'
 *         elif normalization_method == 'N':             # <<<<<<<<<<<<<<
 *             if self.normalization_method == 'T':
 *                 self.normalize( self.treat_edm, self.treat_edm )
 */
  __pyx_t_4 = (__pyx_v_normalization_method == 'N');
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":664
 *             self.normalization_method = 'M'
 *         elif normalization_method == 'N':
 *             if self.normalization_method == 'T':             # <<<<<<<<<<<<<<
 *                 self.normalize( self.treat_edm, self.treat_edm )
 *             elif self.normalization_method == 'C':
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'T');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":665
 *         elif normalization_method == 'N':
 *             if self.normalization_method == 'T':
 *                 self.normalize( self.treat_edm, self.treat_edm )             # <<<<<<<<<<<<<<
 *             elif self.normalization_method == 'C':
 *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, __pyx_v_self->treat_edm, __pyx_v_self->treat_edm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L7;
    }

    /* "MACS2/IO/cScoreTrack.pyx":666
 *             if self.normalization_method == 'T':
 *                 self.normalize( self.treat_edm, self.treat_edm )
 *             elif self.normalization_method == 'C':             # <<<<<<<<<<<<<<
 *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
 *             elif  self.normalization_method == 'M':
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'C');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":667
 *                 self.normalize( self.treat_edm, self.treat_edm )
 *             elif self.normalization_method == 'C':
 *                 self.normalize( self.ctrl_edm, self.ctrl_edm )             # <<<<<<<<<<<<<<
 *             elif  self.normalization_method == 'M':
 *                 self.normalize( self.treat_edm, self.ctrl_edm )
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, __pyx_v_self->ctrl_edm, __pyx_v_self->ctrl_edm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L7;
    }

    /* "MACS2/IO/cScoreTrack.pyx":668
 *             elif self.normalization_method == 'C':
 *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
 *             elif  self.normalization_method == 'M':             # <<<<<<<<<<<<<<
 *                 self.normalize( self.treat_edm, self.ctrl_edm )
 *             elif self.normalization_method == 'N': # do nothing
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'M');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":669
 *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
 *             elif  self.normalization_method == 'M':
 *                 self.normalize( self.treat_edm, self.ctrl_edm )             # <<<<<<<<<<<<<<
 *             elif self.normalization_method == 'N': # do nothing
 *                 pass
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, __pyx_v_self->treat_edm, __pyx_v_self->ctrl_edm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L7;
    }

    /* "MACS2/IO/cScoreTrack.pyx":670
 *             elif  self.normalization_method == 'M':
 *                 self.normalize( self.treat_edm, self.ctrl_edm )
 *             elif self.normalization_method == 'N': # do nothing             # <<<<<<<<<<<<<<
 *                 pass
 *             else:
 */
    __pyx_t_4 = (__pyx_v_self->normalization_method == 'N');
    if (__pyx_t_4) {
      goto __pyx_L7;
    }
    /*else*/ {

      /* "MACS2/IO/cScoreTrack.pyx":673
 *                 pass
 *             else:
 *                 raise NotImplemented             # <<<<<<<<<<<<<<
 *             self.normalization_method = 'N'
 * 
 */
      __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L7:;

    /* "MACS2/IO/cScoreTrack.pyx":674
 *             else:
 *                 raise NotImplemented
 *             self.normalization_method = 'N'             # <<<<<<<<<<<<<<
 * 
 *     cdef normalize ( self, double treat_scale, double control_scale ):
 */
    __pyx_v_self->normalization_method = 'N';
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.change_normalization_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_17change_normalization_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_normalization_method); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_16change_normalization_method[] = "Change/set normalization method. However, I do not\n        recommend change this back and forward, since some precision\n        issue will happen -- I only keep two digits.\n        \n        normalization_method: T: scale to depth of treatment;\n                              C: scale to depth of control;\n                              M: scale to depth of 1 million;\n                              N: not set/ raw pileup        \n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_17change_normalization_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_normalization_method) {
  char __pyx_v_normalization_method;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("change_normalization_method (wrapper)", 0);
  assert(__pyx_arg_normalization_method); {
    __pyx_v_normalization_method = __Pyx_PyInt_AsChar(__pyx_arg_normalization_method); if (unlikely((__pyx_v_normalization_method == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.change_normalization_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_16change_normalization_method(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), ((char)__pyx_v_normalization_method));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":617
 *         return l
 * 
 *     cpdef change_normalization_method ( self, char normalization_method ):             # <<<<<<<<<<<<<<
 *         """Change/set normalization method. However, I do not
 *         recommend change this back and forward, since some precision
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_16change_normalization_method(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_normalization_method) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_normalization_method", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->change_normalization_method(__pyx_v_self, __pyx_v_normalization_method, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.change_normalization_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":676
 *             self.normalization_method = 'N'
 * 
 *     cdef normalize ( self, double treat_scale, double control_scale ):             # <<<<<<<<<<<<<<
 *         cdef:
 *             np.ndarray p, c
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_normalize(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, double __pyx_v_treat_scale, double __pyx_v_control_scale) {
  PyArrayObject *__pyx_v_p = 0;
  PyArrayObject *__pyx_v_c = 0;
  long __pyx_v_l;
  long __pyx_v_i;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  long __pyx_t_6;
  long __pyx_t_7;
  long __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("normalize", 0);

  /* "MACS2/IO/cScoreTrack.pyx":681
 *             long l, i
 * 
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":682
 * 
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
 *             c = self.data[chrom][2]
 *             l = self.datalength[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_p));
    __pyx_v_p = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":683
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             for i in range(l):
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_c));
    __pyx_v_c = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":684
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 p[ i ] *= treat_scale
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_l = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":685
 *             c = self.data[chrom][2]
 *             l = self.datalength[chrom]
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 p[ i ] *= treat_scale
 *                 c[ i ] *= control_scale
 */
    __pyx_t_6 = __pyx_v_l;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "MACS2/IO/cScoreTrack.pyx":686
 *             l = self.datalength[chrom]
 *             for i in range(l):
 *                 p[ i ] *= treat_scale             # <<<<<<<<<<<<<<
 *                 c[ i ] *= control_scale
 *         return
 */
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_p), __pyx_t_8, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_treat_scale); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_p), __pyx_t_8, __pyx_t_9, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":687
 *             for i in range(l):
 *                 p[ i ] *= treat_scale
 *                 c[ i ] *= control_scale             # <<<<<<<<<<<<<<
 *         return
 * 
 */
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_9 = __Pyx_GetItemInt(((PyObject *)__pyx_v_c), __pyx_t_8, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_control_scale); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyNumber_InPlaceMultiply(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_c), __pyx_t_8, __pyx_t_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":688
 *                 p[ i ] *= treat_scale
 *                 c[ i ] *= control_scale
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cpdef change_score_method (self, char scoring_method):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.normalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_p);
  __Pyx_XDECREF((PyObject *)__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":690
 *         return
 * 
 *     cpdef change_score_method (self, char scoring_method):             # <<<<<<<<<<<<<<
 *         """
 *         scoring_method:  p: -log10 pvalue;
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_19change_score_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_scoring_method); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_change_score_method(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_scoring_method, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_score_method", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__change_score_method); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_19change_score_method)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_scoring_method); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":700
 *                          m: fragment pileup per million reads
 *         """
 *         if scoring_method == 'p':             # <<<<<<<<<<<<<<
 *             self.compute_pvalue()
 *         elif scoring_method == 'q':
 */
  __pyx_t_4 = (__pyx_v_scoring_method == 'p');
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":701
 *         """
 *         if scoring_method == 'p':
 *             self.compute_pvalue()             # <<<<<<<<<<<<<<
 *         elif scoring_method == 'q':
 *             #if not already calculated p, compute pvalue first
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_pvalue(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":702
 *         if scoring_method == 'p':
 *             self.compute_pvalue()
 *         elif scoring_method == 'q':             # <<<<<<<<<<<<<<
 *             #if not already calculated p, compute pvalue first
 *             if self.scoring_method != 'p':
 */
  __pyx_t_4 = (__pyx_v_scoring_method == 'q');
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":704
 *         elif scoring_method == 'q':
 *             #if not already calculated p, compute pvalue first
 *             if self.scoring_method != 'p':             # <<<<<<<<<<<<<<
 *                 self.compute_pvalue()
 *             self.compute_qvalue()
 */
    __pyx_t_4 = (__pyx_v_self->scoring_method != 'p');
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":705
 *             #if not already calculated p, compute pvalue first
 *             if self.scoring_method != 'p':
 *                 self.compute_pvalue()             # <<<<<<<<<<<<<<
 *             self.compute_qvalue()
 *         elif scoring_method == 'l':
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_pvalue(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "MACS2/IO/cScoreTrack.pyx":706
 *             if self.scoring_method != 'p':
 *                 self.compute_pvalue()
 *             self.compute_qvalue()             # <<<<<<<<<<<<<<
 *         elif scoring_method == 'l':
 *             self.compute_likelihood()
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_qvalue(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":707
 *                 self.compute_pvalue()
 *             self.compute_qvalue()
 *         elif scoring_method == 'l':             # <<<<<<<<<<<<<<
 *             self.compute_likelihood()
 *         elif scoring_method == 'f':
 */
  __pyx_t_4 = (__pyx_v_scoring_method == 'l');
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":708
 *             self.compute_qvalue()
 *         elif scoring_method == 'l':
 *             self.compute_likelihood()             # <<<<<<<<<<<<<<
 *         elif scoring_method == 'f':
 *             self.compute_logFE()
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_likelihood(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":709
 *         elif scoring_method == 'l':
 *             self.compute_likelihood()
 *         elif scoring_method == 'f':             # <<<<<<<<<<<<<<
 *             self.compute_logFE()
 *         elif scoring_method == 'F':
 */
  __pyx_t_4 = (__pyx_v_scoring_method == 'f');
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":710
 *             self.compute_likelihood()
 *         elif scoring_method == 'f':
 *             self.compute_logFE()             # <<<<<<<<<<<<<<
 *         elif scoring_method == 'F':
 *             self.compute_foldenrichment()
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_logFE(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":711
 *         elif scoring_method == 'f':
 *             self.compute_logFE()
 *         elif scoring_method == 'F':             # <<<<<<<<<<<<<<
 *             self.compute_foldenrichment()
 *         elif scoring_method == 'd':
 */
  __pyx_t_4 = (__pyx_v_scoring_method == 'F');
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":712
 *             self.compute_logFE()
 *         elif scoring_method == 'F':
 *             self.compute_foldenrichment()             # <<<<<<<<<<<<<<
 *         elif scoring_method == 'd':
 *             self.compute_subtraction()
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_foldenrichment(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":713
 *         elif scoring_method == 'F':
 *             self.compute_foldenrichment()
 *         elif scoring_method == 'd':             # <<<<<<<<<<<<<<
 *             self.compute_subtraction()
 *         elif scoring_method == 'm':
 */
  __pyx_t_4 = (__pyx_v_scoring_method == 'd');
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":714
 *             self.compute_foldenrichment()
 *         elif scoring_method == 'd':
 *             self.compute_subtraction()             # <<<<<<<<<<<<<<
 *         elif scoring_method == 'm':
 *             self.compute_SPMR()
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_subtraction(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":715
 *         elif scoring_method == 'd':
 *             self.compute_subtraction()
 *         elif scoring_method == 'm':             # <<<<<<<<<<<<<<
 *             self.compute_SPMR()
 *         else:
 */
  __pyx_t_4 = (__pyx_v_scoring_method == 'm');
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":716
 *             self.compute_subtraction()
 *         elif scoring_method == 'm':
 *             self.compute_SPMR()             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplemented
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_SPMR(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":718
 *             self.compute_SPMR()
 *         else:
 *             raise NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     cdef compute_pvalue ( self ):
 */
    __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.change_score_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_19change_score_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_scoring_method); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_18change_score_method[] = "\n        scoring_method:  p: -log10 pvalue;\n                         q: -log10 qvalue;\n                         l: log10 likelihood ratio ( minus for depletion )\n                         f: log10 fold enrichment\n                         F: linear fold enrichment\n                         d: subtraction\n                         m: fragment pileup per million reads\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_19change_score_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_scoring_method) {
  char __pyx_v_scoring_method;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("change_score_method (wrapper)", 0);
  assert(__pyx_arg_scoring_method); {
    __pyx_v_scoring_method = __Pyx_PyInt_AsChar(__pyx_arg_scoring_method); if (unlikely((__pyx_v_scoring_method == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.change_score_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_18change_score_method(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), ((char)__pyx_v_scoring_method));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":690
 *         return
 * 
 *     cpdef change_score_method (self, char scoring_method):             # <<<<<<<<<<<<<<
 *         """
 *         scoring_method:  p: -log10 pvalue;
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_18change_score_method(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_scoring_method) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_score_method", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->change_score_method(__pyx_v_self, __pyx_v_scoring_method, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.change_score_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":720
 *             raise NotImplemented
 * 
 *     cdef compute_pvalue ( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(pvalue)
 *         """
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_pvalue(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  PyArrayObject *__pyx_v_p = 0;
  PyArrayObject *__pyx_v_c = 0;
  PyArrayObject *__pyx_v_v = 0;
  PyArrayObject *__pyx_v_pos = 0;
  long __pyx_v_l;
  long __pyx_v_i;
  long __pyx_v_prev_pos;
  PyObject *__pyx_v_chrom = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_c;
  __Pyx_Buffer __pyx_pybuffer_c;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_p;
  __Pyx_Buffer __pyx_pybuffer_p;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
  __Pyx_Buffer __pyx_pybuffer_pos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
  __Pyx_Buffer __pyx_pybuffer_v;
  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;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  long __pyx_t_12;
  long __pyx_t_13;
  long __pyx_t_14;
  long __pyx_t_15;
  long __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  long __pyx_t_18;
  long __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  long __pyx_t_22;
  long __pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  long __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_pvalue", 0);
  __pyx_pybuffer_p.pybuffer.buf = NULL;
  __pyx_pybuffer_p.refcount = 0;
  __pyx_pybuffernd_p.data = NULL;
  __pyx_pybuffernd_p.rcbuffer = &__pyx_pybuffer_p;
  __pyx_pybuffer_c.pybuffer.buf = NULL;
  __pyx_pybuffer_c.refcount = 0;
  __pyx_pybuffernd_c.data = NULL;
  __pyx_pybuffernd_c.rcbuffer = &__pyx_pybuffer_c;
  __pyx_pybuffer_v.pybuffer.buf = NULL;
  __pyx_pybuffer_v.refcount = 0;
  __pyx_pybuffernd_v.data = NULL;
  __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
  __pyx_pybuffer_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_pos.refcount = 0;
  __pyx_pybuffernd_pos.data = NULL;
  __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;

  /* "MACS2/IO/cScoreTrack.pyx":729
 *             str chrom
 * 
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             prev_pos = 0
 *             pos = self.data[chrom][0]
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":730
 * 
 *         for chrom in self.data.keys():
 *             prev_pos = 0             # <<<<<<<<<<<<<<
 *             pos = self.data[chrom][0]
 *             p = self.data[chrom][1]
 */
    __pyx_v_prev_pos = 0;

    /* "MACS2/IO/cScoreTrack.pyx":731
 *         for chrom in self.data.keys():
 *             prev_pos = 0
 *             pos = self.data[chrom][0]             # <<<<<<<<<<<<<<
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        }
      }
      __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":732
 *             prev_pos = 0
 *             pos = self.data[chrom][0]
 *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_v_p, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_p.diminfo[0].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p.diminfo[0].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_p));
    __pyx_v_p = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":733
 *             pos = self.data[chrom][0]
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]             # <<<<<<<<<<<<<<
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c.rcbuffer->pybuffer, (PyObject*)__pyx_v_c, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        }
      }
      __pyx_pybuffernd_c.diminfo[0].strides = __pyx_pybuffernd_c.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c.diminfo[0].shape = __pyx_pybuffernd_c.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_c));
    __pyx_v_c = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":734
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             for i in range(l):
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":735
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 v[ i ] =  get_pscore( int(p[ i ]) , c[ i ] )
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_12 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_l = __pyx_t_12;

    /* "MACS2/IO/cScoreTrack.pyx":736
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 v[ i ] =  get_pscore( int(p[ i ]) , c[ i ] )
 *                 try:
 */
    __pyx_t_12 = __pyx_v_l;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "MACS2/IO/cScoreTrack.pyx":737
 *             l = self.datalength[chrom]
 *             for i in range(l):
 *                 v[ i ] =  get_pscore( int(p[ i ]) , c[ i ] )             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_p.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_p.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_c.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_c.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_f_5MACS2_2IO_11cScoreTrack_get_pscore(((int)(*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_p.diminfo[0].strides))), (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_c.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_c.diminfo[0].strides)));

      /* "MACS2/IO/cScoreTrack.pyx":738
 *             for i in range(l):
 *                 v[ i ] =  get_pscore( int(p[ i ]) , c[ i ] )
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos
 *                 except:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "MACS2/IO/cScoreTrack.pyx":739
 *                 v[ i ] =  get_pscore( int(p[ i ]) , c[ i ] )
 *                 try:
 *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.pvalue_stat[v[ i ]] = pos[ i ] - prev_pos
 */
          if (unlikely(((PyObject *)__pyx_v_self->pvalue_stat) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_self->pvalue_stat));
          __pyx_t_17 = __pyx_v_self->pvalue_stat;
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_18 < 0) {
            __pyx_t_18 += __pyx_pybuffernd_v.diminfo[0].shape;
            if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_v.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely(((PyObject *)__pyx_t_17) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_17), __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_19 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          __pyx_t_20 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_21 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_20); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_21);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          if (unlikely(((PyObject *)__pyx_t_17) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          if (PyDict_SetItem(((PyObject *)__pyx_t_17), __pyx_t_1, __pyx_t_21) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":740
 *                 try:
 *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.pvalue_stat[v[ i ]] = pos[ i ] - prev_pos
 *                 prev_pos = pos[ i ]
 */
        /*except:*/ {
          __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.compute_pvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_21, &__pyx_t_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_21);
          __Pyx_GOTREF(__pyx_t_20);

          /* "MACS2/IO/cScoreTrack.pyx":741
 *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos
 *                 except:
 *                     self.pvalue_stat[v[ i ]] = pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
 *                 prev_pos = pos[ i ]
 * 
 */
          __pyx_t_22 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          }
          __pyx_t_5 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_5);
          if (unlikely(((PyObject *)__pyx_v_self->pvalue_stat) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          }
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_v.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          }
          __pyx_t_24 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_v.diminfo[0].strides))); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_24);
          if (PyDict_SetItem(((PyObject *)__pyx_v_self->pvalue_stat), __pyx_t_24, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L14_try_end:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":742
 *                 except:
 *                     self.pvalue_stat[v[ i ]] = pos[ i ] - prev_pos
 *                 prev_pos = pos[ i ]             # <<<<<<<<<<<<<<
 * 
 *         self.scoring_method = 'p'
 */
      __pyx_t_25 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_pybuffernd_pos.diminfo[0].shape;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_pos.diminfo[0].strides));
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":744
 *                 prev_pos = pos[ i ]
 * 
 *         self.scoring_method = 'p'             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_v_self->scoring_method = 'p';

  /* "MACS2/IO/cScoreTrack.pyx":745
 * 
 *         self.scoring_method = 'p'
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cdef compute_qvalue ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(((PyObject *)__pyx_t_17));
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_24);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.compute_pvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_p);
  __Pyx_XDECREF((PyObject *)__pyx_v_c);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":747
 *         return
 * 
 *     cdef compute_qvalue ( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(qvalue)
 *         """
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_qvalue(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  PyObject *__pyx_v_pqtable = 0;
  long __pyx_v_i;
  long __pyx_v_l;
  double __pyx_v_k;
  PyObject *__pyx_v_chrom = 0;
  PyArrayObject *__pyx_v_v = 0;
  PyObject *__pyx_v_s_p2q = NULL;
  PyObject *__pyx_v_g = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  double __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  long __pyx_t_9;
  long __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_qvalue", 0);

  /* "MACS2/IO/cScoreTrack.pyx":758
 * 
 *         # pvalue should be computed first!
 *         assert self.scoring_method == 'p'             # <<<<<<<<<<<<<<
 *         # make pqtable
 *         pqtable = self.make_pq_table()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_self->scoring_method == 'p'))) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":760
 *         assert self.scoring_method == 'p'
 *         # make pqtable
 *         pqtable = self.make_pq_table()             # <<<<<<<<<<<<<<
 * 
 *         # convert p to q
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->make_pq_table(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pqtable = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":766
 *         # convert pvalue2qvalue to a simple dict based on khash
 *         # khash has big advantage while checking keys for millions of times.
 *         s_p2q = Float64HashTable()             # <<<<<<<<<<<<<<
 *         for k in pqtable.keys():
 *             s_p2q.set_item(k,pqtable[k])
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Float64HashTable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_s_p2q = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":767
 *         # khash has big advantage while checking keys for millions of times.
 *         s_p2q = Float64HashTable()
 *         for k in pqtable.keys():             # <<<<<<<<<<<<<<
 *             s_p2q.set_item(k,pqtable[k])
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_pqtable) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyDict_Keys(__pyx_v_pqtable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __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 = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __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 = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_k = __pyx_t_5;

    /* "MACS2/IO/cScoreTrack.pyx":768
 *         s_p2q = Float64HashTable()
 *         for k in pqtable.keys():
 *             s_p2q.set_item(k,pqtable[k])             # <<<<<<<<<<<<<<
 * 
 *         g = s_p2q.get_item
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_s_p2q, __pyx_n_s__set_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyFloat_FromDouble(__pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(((PyObject *)__pyx_v_pqtable) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = PyFloat_FromDouble(__pyx_v_k); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pqtable), __pyx_t_7); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_6 = 0;
    __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":770
 *             s_p2q.set_item(k,pqtable[k])
 * 
 *         g = s_p2q.get_item             # <<<<<<<<<<<<<<
 * 
 *         for chrom in self.data.keys():
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_s_p2q, __pyx_n_s__get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_g = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":772
 *         g = s_p2q.get_item
 * 
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = Py_TYPE(__pyx_t_8)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_8)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_8)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_8)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_8);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":773
 * 
 *         for chrom in self.data.keys():
 *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             for i in range(l):
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((PyArrayObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":774
 *         for chrom in self.data.keys():
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 v[ i ] =  g( v[ i ])
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_7); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_l = __pyx_t_9;

    /* "MACS2/IO/cScoreTrack.pyx":775
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 v[ i ] =  g( v[ i ])
 * 
 */
    __pyx_t_9 = __pyx_v_l;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
      __pyx_v_i = __pyx_t_10;

      /* "MACS2/IO/cScoreTrack.pyx":776
 *             l = self.datalength[chrom]
 *             for i in range(l):
 *                 v[ i ] =  g( v[ i ])             # <<<<<<<<<<<<<<
 * 
 *         self.scoring_method = 'q'
 */
      __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_v_g, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_7, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":778
 *                 v[ i ] =  g( v[ i ])
 * 
 *         self.scoring_method = 'q'             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_v_self->scoring_method = 'q';

  /* "MACS2/IO/cScoreTrack.pyx":779
 * 
 *         self.scoring_method = 'q'
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cpdef dict make_pq_table ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.compute_qvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pqtable);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_s_p2q);
  __Pyx_XDECREF(__pyx_v_g);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":781
 *         return
 * 
 *     cpdef dict make_pq_table ( self ):             # <<<<<<<<<<<<<<
 *         """Make pvalue-qvalue table.
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_21make_pq_table(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_make_pq_table(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch) {
  CYTHON_UNUSED long __pyx_v_pre_l;
  long __pyx_v_l;
  long __pyx_v_i;
  CYTHON_UNUSED double __pyx_v_pre_v;
  double __pyx_v_v;
  double __pyx_v_q;
  double __pyx_v_pre_q;
  long __pyx_v_N;
  long __pyx_v_k;
  double __pyx_v_f;
  PyObject *__pyx_v_pvalue2qvalue = 0;
  PyObject *__pyx_v_value_dict = 0;
  PyObject *__pyx_v_unique_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  double __pyx_t_6;
  long __pyx_t_7;
  double __pyx_t_8;
  double __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_pq_table", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__make_pq_table); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_21make_pq_table)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":801
 *             list unique_values
 * 
 *         assert self.scoring_method == 'p'             # <<<<<<<<<<<<<<
 * 
 *         value_dict = self.pvalue_stat
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_self->scoring_method == 'p'))) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":803
 *         assert self.scoring_method == 'p'
 * 
 *         value_dict = self.pvalue_stat             # <<<<<<<<<<<<<<
 * 
 *         #for p in sorted(self.pvalue_stat.keys()):
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->pvalue_stat);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_value_dict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":809
 * 
 *         #logging.info("####test#### 2")
 *         N = sum(value_dict.values())             # <<<<<<<<<<<<<<
 *         #for i in range(len(unique_values)):
 *             #N += value_dict.get_item(unique_values[i])
 */
  if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Values(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_3;

  /* "MACS2/IO/cScoreTrack.pyx":812
 *         #for i in range(len(unique_values)):
 *             #N += value_dict.get_item(unique_values[i])
 *         k = 1                           # rank             # <<<<<<<<<<<<<<
 *         f = -log10(N)
 *         pre_v = -2147483647
 */
  __pyx_v_k = 1;

  /* "MACS2/IO/cScoreTrack.pyx":813
 *             #N += value_dict.get_item(unique_values[i])
 *         k = 1                           # rank
 *         f = -log10(N)             # <<<<<<<<<<<<<<
 *         pre_v = -2147483647
 *         pre_l = 0
 */
  __pyx_v_f = (-log10(__pyx_v_N));

  /* "MACS2/IO/cScoreTrack.pyx":814
 *         k = 1                           # rank
 *         f = -log10(N)
 *         pre_v = -2147483647             # <<<<<<<<<<<<<<
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 */
  __pyx_v_pre_v = -2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":815
 *         f = -log10(N)
 *         pre_v = -2147483647
 *         pre_l = 0             # <<<<<<<<<<<<<<
 *         pre_q = 2147483647              # save the previous q-value
 * 
 */
  __pyx_v_pre_l = 0;

  /* "MACS2/IO/cScoreTrack.pyx":816
 *         pre_v = -2147483647
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value             # <<<<<<<<<<<<<<
 * 
 *         pvalue2qvalue = {}#Float64HashTable()
 */
  __pyx_v_pre_q = 2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":818
 *         pre_q = 2147483647              # save the previous q-value
 * 
 *         pvalue2qvalue = {}#Float64HashTable()             # <<<<<<<<<<<<<<
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_pvalue2qvalue = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":819
 * 
 *         pvalue2qvalue = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)             # <<<<<<<<<<<<<<
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]
 */
  if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__reverse), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_unique_values = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":820
 *         pvalue2qvalue = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):             # <<<<<<<<<<<<<<
 *             v = unique_values[i]
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_unique_values)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "MACS2/IO/cScoreTrack.pyx":821
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]             # <<<<<<<<<<<<<<
 * 
 *             l = value_dict[v]
 */
    if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_unique_values), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_v = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":823
 *             v = unique_values[i]
 * 
 *             l = value_dict[v]             # <<<<<<<<<<<<<<
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 */
    if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_4); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_l = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":824
 * 
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)             # <<<<<<<<<<<<<<
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 * 
 */
    __pyx_v_q = (__pyx_v_v + (log10(__pyx_v_k) + __pyx_v_f));

    /* "MACS2/IO/cScoreTrack.pyx":825
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic             # <<<<<<<<<<<<<<
 * 
 *             pvalue2qvalue[ v ] = q
 */
    __pyx_t_6 = __pyx_v_q;
    __pyx_t_8 = __pyx_v_pre_q;
    if ((__pyx_t_6 < __pyx_t_8)) {
      __pyx_t_9 = __pyx_t_6;
    } else {
      __pyx_t_9 = __pyx_t_8;
    }
    __pyx_t_6 = __pyx_t_9;
    __pyx_t_7 = 0;
    if ((__pyx_t_6 > __pyx_t_7)) {
      __pyx_t_9 = __pyx_t_6;
    } else {
      __pyx_t_9 = __pyx_t_7;
    }
    __pyx_v_q = __pyx_t_9;

    /* "MACS2/IO/cScoreTrack.pyx":827
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 * 
 *             pvalue2qvalue[ v ] = q             # <<<<<<<<<<<<<<
 * 
 *             pre_v = v
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(((PyObject *)__pyx_v_pvalue2qvalue), __pyx_t_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":829
 *             pvalue2qvalue[ v ] = q
 * 
 *             pre_v = v             # <<<<<<<<<<<<<<
 *             pre_q = q
 *             k+=l
 */
    __pyx_v_pre_v = __pyx_v_v;

    /* "MACS2/IO/cScoreTrack.pyx":830
 * 
 *             pre_v = v
 *             pre_q = q             # <<<<<<<<<<<<<<
 *             k+=l
 *         return pvalue2qvalue
 */
    __pyx_v_pre_q = __pyx_v_q;

    /* "MACS2/IO/cScoreTrack.pyx":831
 *             pre_v = v
 *             pre_q = q
 *             k+=l             # <<<<<<<<<<<<<<
 *         return pvalue2qvalue
 * 
 */
    __pyx_v_k = (__pyx_v_k + __pyx_v_l);
  }

  /* "MACS2/IO/cScoreTrack.pyx":832
 *             pre_q = q
 *             k+=l
 *         return pvalue2qvalue             # <<<<<<<<<<<<<<
 * 
 *     cdef compute_likelihood ( self ):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_pvalue2qvalue));
  __pyx_r = __pyx_v_pvalue2qvalue;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.make_pq_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pvalue2qvalue);
  __Pyx_XDECREF(__pyx_v_value_dict);
  __Pyx_XDECREF(__pyx_v_unique_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_21make_pq_table(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_20make_pq_table[] = "Make pvalue-qvalue table.\n\n        Step1: get all pvalue and length of block with this pvalue\n        Step2: Sort them\n        Step3: Apply AFDR method to adjust pvalue and get qvalue for each pvalue\n\n        Return a dictionary of {-log10pvalue:(-log10qvalue,rank,basepairs)} relationships.\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_21make_pq_table(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_pq_table (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_20make_pq_table(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":781
 *         return
 * 
 *     cpdef dict make_pq_table ( self ):             # <<<<<<<<<<<<<<
 *         """Make pvalue-qvalue table.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_20make_pq_table(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_pq_table", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->make_pq_table(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.make_pq_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":834
 *         return pvalue2qvalue
 * 
 *     cdef compute_likelihood ( self ):             # <<<<<<<<<<<<<<
 *         """Calculate log10 likelihood.
 * 
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_likelihood(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  long __pyx_v_l;
  long __pyx_v_i;
  PyObject *__pyx_v_chrom = 0;
  float __pyx_v_v1;
  float __pyx_v_v2;
  float __pyx_v_pseudocount;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  long __pyx_t_7;
  long __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_likelihood", 0);

  /* "MACS2/IO/cScoreTrack.pyx":845
 *             float pseudocount
 * 
 *         pseudocount = self.pseudocount             # <<<<<<<<<<<<<<
 * 
 *         for chrom in self.data.keys():
 */
  __pyx_t_1 = __pyx_v_self->pseudocount;
  __pyx_v_pseudocount = __pyx_t_1;

  /* "MACS2/IO/cScoreTrack.pyx":847
 *         pseudocount = self.pseudocount
 * 
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             p = self.data[chrom][ 1 ].flat.next
 *             c = self.data[chrom][ 2 ].flat.next
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __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 = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __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 = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __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 str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":848
 * 
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][ 1 ].flat.next             # <<<<<<<<<<<<<<
 *             c = self.data[chrom][ 2 ].flat.next
 *             v = self.data[chrom][ 3 ]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__flat); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__next); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_p);
    __pyx_v_p = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":849
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][ 1 ].flat.next
 *             c = self.data[chrom][ 2 ].flat.next             # <<<<<<<<<<<<<<
 *             v = self.data[chrom][ 3 ]
 *             l = self.datalength[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__flat); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_v_c);
    __pyx_v_c = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":850
 *             p = self.data[chrom][ 1 ].flat.next
 *             c = self.data[chrom][ 2 ].flat.next
 *             v = self.data[chrom][ 3 ]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             v1 = 2
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":851
 *             c = self.data[chrom][ 2 ].flat.next
 *             v = self.data[chrom][ 3 ]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             v1 = 2
 *             v2 = 1
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_6); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_l = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":852
 *             v = self.data[chrom][ 3 ]
 *             l = self.datalength[chrom]
 *             v1 = 2             # <<<<<<<<<<<<<<
 *             v2 = 1
 *             for i in range(l):
 */
    __pyx_v_v1 = 2.0;

    /* "MACS2/IO/cScoreTrack.pyx":853
 *             l = self.datalength[chrom]
 *             v1 = 2
 *             v2 = 1             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 v1 = p()
 */
    __pyx_v_v2 = 1.0;

    /* "MACS2/IO/cScoreTrack.pyx":854
 *             v1 = 2
 *             v2 = 1
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 v1 = p()
 *                 v2 = c()
 */
    __pyx_t_7 = __pyx_v_l;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":855
 *             v2 = 1
 *             for i in range(l):
 *                 v1 = p()             # <<<<<<<<<<<<<<
 *                 v2 = c()
 *                 v[ i ] =  logLR( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )
 */
      __pyx_t_6 = PyObject_Call(__pyx_v_p, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_v1 = __pyx_t_1;

      /* "MACS2/IO/cScoreTrack.pyx":856
 *             for i in range(l):
 *                 v1 = p()
 *                 v2 = c()             # <<<<<<<<<<<<<<
 *                 v[ i ] =  logLR( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )
 *         self.scoring_method = 'l'
 */
      __pyx_t_6 = PyObject_Call(__pyx_v_c, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_v2 = __pyx_t_1;

      /* "MACS2/IO/cScoreTrack.pyx":857
 *                 v1 = p()
 *                 v2 = c()
 *                 v[ i ] =  logLR( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )             # <<<<<<<<<<<<<<
 *         self.scoring_method = 'l'
 *         return
 */
      __pyx_t_6 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_11cScoreTrack_logLR((__pyx_v_v1 + __pyx_v_pseudocount), (__pyx_v_v2 + __pyx_v_pseudocount))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemInt(__pyx_v_v, __pyx_v_i, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":858
 *                 v2 = c()
 *                 v[ i ] =  logLR( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )
 *         self.scoring_method = 'l'             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_v_self->scoring_method = 'l';

  /* "MACS2/IO/cScoreTrack.pyx":859
 *                 v[ i ] =  logLR( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )
 *         self.scoring_method = 'l'
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cdef compute_logFE ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.compute_likelihood", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":861
 *         return
 * 
 *     cdef compute_logFE ( self ):             # <<<<<<<<<<<<<<
 *         """Calculate log10 fold enrichment ( with 1 pseudocount ).
 * 
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_logFE(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  PyArrayObject *__pyx_v_p = 0;
  PyArrayObject *__pyx_v_c = 0;
  PyArrayObject *__pyx_v_v = 0;
  long __pyx_v_l;
  long __pyx_v_i;
  float __pyx_v_pseudocount;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  long __pyx_t_7;
  long __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  float __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_logFE", 0);

  /* "MACS2/IO/cScoreTrack.pyx":870
 *             float pseudocount
 * 
 *         pseudocount = self.pseudocount             # <<<<<<<<<<<<<<
 * 
 *         for chrom in self.data.keys():
 */
  __pyx_t_1 = __pyx_v_self->pseudocount;
  __pyx_v_pseudocount = __pyx_t_1;

  /* "MACS2/IO/cScoreTrack.pyx":872
 *         pseudocount = self.pseudocount
 * 
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __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 = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __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 = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":873
 * 
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_p));
    __pyx_v_p = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":874
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]             # <<<<<<<<<<<<<<
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_c));
    __pyx_v_c = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":875
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             for i in range(l):
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":876
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 v[ i ] = get_logFE ( p[ i ] + pseudocount, c[ i ] + pseudocount)
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), __pyx_v_chrom); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_6); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_l = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":877
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 v[ i ] = get_logFE ( p[ i ] + pseudocount, c[ i ] + pseudocount)
 *         self.scoring_method = 'f'
 */
    __pyx_t_7 = __pyx_v_l;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":878
 *             l = self.datalength[chrom]
 *             for i in range(l):
 *                 v[ i ] = get_logFE ( p[ i ] + pseudocount, c[ i ] + pseudocount)             # <<<<<<<<<<<<<<
 *         self.scoring_method = 'f'
 *         return
 */
      __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_p), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_GetItemInt(((PyObject *)__pyx_v_c), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_11cScoreTrack_get_logFE(__pyx_t_1, __pyx_t_10)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":879
 *             for i in range(l):
 *                 v[ i ] = get_logFE ( p[ i ] + pseudocount, c[ i ] + pseudocount)
 *         self.scoring_method = 'f'             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_v_self->scoring_method = 'f';

  /* "MACS2/IO/cScoreTrack.pyx":880
 *                 v[ i ] = get_logFE ( p[ i ] + pseudocount, c[ i ] + pseudocount)
 *         self.scoring_method = 'f'
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cdef compute_foldenrichment ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.compute_logFE", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_p);
  __Pyx_XDECREF((PyObject *)__pyx_v_c);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":882
 *         return
 * 
 *     cdef compute_foldenrichment ( self ):             # <<<<<<<<<<<<<<
 *         """Calculate linear scale fold enrichment ( with 1 pseudocount ).
 * 
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_foldenrichment(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  PyArrayObject *__pyx_v_p = 0;
  PyArrayObject *__pyx_v_c = 0;
  PyArrayObject *__pyx_v_v = 0;
  long __pyx_v_l;
  long __pyx_v_i;
  float __pyx_v_pseudocount;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  long __pyx_t_7;
  long __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_foldenrichment", 0);

  /* "MACS2/IO/cScoreTrack.pyx":891
 *             float pseudocount
 * 
 *         pseudocount = self.pseudocount             # <<<<<<<<<<<<<<
 * 
 *         for chrom in self.data.keys():
 */
  __pyx_t_1 = __pyx_v_self->pseudocount;
  __pyx_v_pseudocount = __pyx_t_1;

  /* "MACS2/IO/cScoreTrack.pyx":893
 *         pseudocount = self.pseudocount
 * 
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __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 = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __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 = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":894
 * 
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_p));
    __pyx_v_p = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":895
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]             # <<<<<<<<<<<<<<
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_c));
    __pyx_v_c = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":896
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             for i in range(l):
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":897
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 v[ i ] =  ( p[ i ] + pseudocount )/( c[ i ] + pseudocount )
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), __pyx_v_chrom); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_6); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_l = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":898
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 v[ i ] =  ( p[ i ] + pseudocount )/( c[ i ] + pseudocount )
 *         self.scoring_method = 'F'
 */
    __pyx_t_7 = __pyx_v_l;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":899
 *             l = self.datalength[chrom]
 *             for i in range(l):
 *                 v[ i ] =  ( p[ i ] + pseudocount )/( c[ i ] + pseudocount )             # <<<<<<<<<<<<<<
 *         self.scoring_method = 'F'
 *         return
 */
      __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_p), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_c), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":900
 *             for i in range(l):
 *                 v[ i ] =  ( p[ i ] + pseudocount )/( c[ i ] + pseudocount )
 *         self.scoring_method = 'F'             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_v_self->scoring_method = 'F';

  /* "MACS2/IO/cScoreTrack.pyx":901
 *                 v[ i ] =  ( p[ i ] + pseudocount )/( c[ i ] + pseudocount )
 *         self.scoring_method = 'F'
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cdef compute_subtraction ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.compute_foldenrichment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_p);
  __Pyx_XDECREF((PyObject *)__pyx_v_c);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":903
 *         return
 * 
 *     cdef compute_subtraction ( self ):             # <<<<<<<<<<<<<<
 *         cdef:
 *             np.ndarray p, c, v
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_subtraction(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  PyArrayObject *__pyx_v_p = 0;
  PyArrayObject *__pyx_v_c = 0;
  PyArrayObject *__pyx_v_v = 0;
  long __pyx_v_l;
  long __pyx_v_i;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  long __pyx_t_6;
  long __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_subtraction", 0);

  /* "MACS2/IO/cScoreTrack.pyx":908
 *             long l, i
 * 
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":909
 * 
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_p));
    __pyx_v_p = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":910
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]             # <<<<<<<<<<<<<<
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_c));
    __pyx_v_c = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":911
 *             p = self.data[chrom][1]
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             for i in range(l):
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":912
 *             c = self.data[chrom][2]
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 v[ i ] = p[ i ] - c[ i ]
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_AsLong(__pyx_t_5); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_l = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":913
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 v[ i ] = p[ i ] - c[ i ]
 *         self.scoring_method = 'd'
 */
    __pyx_t_6 = __pyx_v_l;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "MACS2/IO/cScoreTrack.pyx":914
 *             l = self.datalength[chrom]
 *             for i in range(l):
 *                 v[ i ] = p[ i ] - c[ i ]             # <<<<<<<<<<<<<<
 *         self.scoring_method = 'd'
 *         return
 */
      __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_p), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_c), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_8, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":915
 *             for i in range(l):
 *                 v[ i ] = p[ i ] - c[ i ]
 *         self.scoring_method = 'd'             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_v_self->scoring_method = 'd';

  /* "MACS2/IO/cScoreTrack.pyx":916
 *                 v[ i ] = p[ i ] - c[ i ]
 *         self.scoring_method = 'd'
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cdef compute_SPMR ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.compute_subtraction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_p);
  __Pyx_XDECREF((PyObject *)__pyx_v_c);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":918
 *         return
 * 
 *     cdef compute_SPMR ( self ):             # <<<<<<<<<<<<<<
 *         cdef:
 *             np.ndarray p, v
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_SPMR(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  PyArrayObject *__pyx_v_p = 0;
  PyArrayObject *__pyx_v_v = 0;
  long __pyx_v_l;
  long __pyx_v_i;
  float __pyx_v_scale;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  double __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  long __pyx_t_10;
  long __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_SPMR", 0);

  /* "MACS2/IO/cScoreTrack.pyx":923
 *             long l, i
 *             float scale
 *         if self.normalization_method == 'T' or self.normalization_method == 'N':             # <<<<<<<<<<<<<<
 *             scale = self.treat_edm
 *         elif self.normalization_method == 'C':
 */
  __pyx_t_1 = (__pyx_v_self->normalization_method == 'T');
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_self->normalization_method == 'N');
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "MACS2/IO/cScoreTrack.pyx":924
 *             float scale
 *         if self.normalization_method == 'T' or self.normalization_method == 'N':
 *             scale = self.treat_edm             # <<<<<<<<<<<<<<
 *         elif self.normalization_method == 'C':
 *             scale = self.ctrl_edm
 */
    __pyx_t_4 = __pyx_v_self->treat_edm;
    __pyx_v_scale = __pyx_t_4;
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":925
 *         if self.normalization_method == 'T' or self.normalization_method == 'N':
 *             scale = self.treat_edm
 *         elif self.normalization_method == 'C':             # <<<<<<<<<<<<<<
 *             scale = self.ctrl_edm
 *         elif self.normalization_method == 'M':
 */
  __pyx_t_3 = (__pyx_v_self->normalization_method == 'C');
  if (__pyx_t_3) {

    /* "MACS2/IO/cScoreTrack.pyx":926
 *             scale = self.treat_edm
 *         elif self.normalization_method == 'C':
 *             scale = self.ctrl_edm             # <<<<<<<<<<<<<<
 *         elif self.normalization_method == 'M':
 *             scale = 1
 */
    __pyx_t_4 = __pyx_v_self->ctrl_edm;
    __pyx_v_scale = __pyx_t_4;
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":927
 *         elif self.normalization_method == 'C':
 *             scale = self.ctrl_edm
 *         elif self.normalization_method == 'M':             # <<<<<<<<<<<<<<
 *             scale = 1
 * 
 */
  __pyx_t_3 = (__pyx_v_self->normalization_method == 'M');
  if (__pyx_t_3) {

    /* "MACS2/IO/cScoreTrack.pyx":928
 *             scale = self.ctrl_edm
 *         elif self.normalization_method == 'M':
 *             scale = 1             # <<<<<<<<<<<<<<
 * 
 *         for chrom in self.data.keys():
 */
    __pyx_v_scale = 1.0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "MACS2/IO/cScoreTrack.pyx":930
 *             scale = 1
 * 
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             p = self.data[chrom][1]
 *             v = self.data[chrom][3]
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_6)) {
      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) {
      if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_8(__pyx_t_6);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":931
 * 
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_p));
    __pyx_v_p = ((PyArrayObject *)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":932
 *         for chrom in self.data.keys():
 *             p = self.data[chrom][1]
 *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             for i in range(l):
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_9, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":933
 *             p = self.data[chrom][1]
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 v[ i ] =  p[ i ] / scale # two digit precision may not be enough...
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_t_5); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_l = __pyx_t_10;

    /* "MACS2/IO/cScoreTrack.pyx":934
 *             v = self.data[chrom][3]
 *             l = self.datalength[chrom]
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 v[ i ] =  p[ i ] / scale # two digit precision may not be enough...
 *         self.scoring_method = 'm'
 */
    __pyx_t_10 = __pyx_v_l;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "MACS2/IO/cScoreTrack.pyx":935
 *             l = self.datalength[chrom]
 *             for i in range(l):
 *                 v[ i ] =  p[ i ] / scale # two digit precision may not be enough...             # <<<<<<<<<<<<<<
 *         self.scoring_method = 'm'
 *         return
 */
      __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_p), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = PyFloat_FromDouble(__pyx_v_scale); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_12 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_12, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":936
 *             for i in range(l):
 *                 v[ i ] =  p[ i ] / scale # two digit precision may not be enough...
 *         self.scoring_method = 'm'             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_v_self->scoring_method = 'm';

  /* "MACS2/IO/cScoreTrack.pyx":937
 *                 v[ i ] =  p[ i ] / scale # two digit precision may not be enough...
 *         self.scoring_method = 'm'
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.compute_SPMR", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_p);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":939
 *         return
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in bedGraph Format.
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_23write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_write_bedGraph(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_write_bedGraph *__pyx_optional_args) {
  short __pyx_v_column = ((short)3);
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_l;
  int __pyx_v_pre;
  int __pyx_v_i;
  int __pyx_v_p;
  float __pyx_v_pre_v;
  float __pyx_v_v;
  PyObject *__pyx_v_chrs = 0;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_value = 0;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  float __pyx_t_7;
  int __pyx_t_8;
  long __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_bedGraph", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_column = __pyx_optional_args->column;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_bedGraph); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_23write_bedGraph)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_column); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_fhd);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fhd);
      __Pyx_GIVEREF(__pyx_v_fhd);
      __Pyx_INCREF(((PyObject *)__pyx_v_name));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_name));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_name));
      __Pyx_INCREF(((PyObject *)__pyx_v_description));
      PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_description));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_description));
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":956
 *             np.ndarray pos, value
 * 
 *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."             # <<<<<<<<<<<<<<
 * 
 *         write = fhd.write
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyInt_FromLong(__pyx_v_column); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_12));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":958
 *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."
 * 
 *         write = fhd.write             # <<<<<<<<<<<<<<
 * 
 *         if self.trackline:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_fhd, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_write = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":960
 *         write = fhd.write
 * 
 *         if self.trackline:             # <<<<<<<<<<<<<<
 *             # this line is REQUIRED by the wiggle format for UCSC browser
 *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name, description ) )
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->trackline)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":962
 *         if self.trackline:
 *             # this line is REQUIRED by the wiggle format for UCSC browser
 *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name, description ) )             # <<<<<<<<<<<<<<
 * 
 *         chrs = self.get_chr_names()
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_name));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_name));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_name));
    __Pyx_INCREF(((PyObject *)__pyx_v_description));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_description));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_description));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "MACS2/IO/cScoreTrack.pyx":964
 *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name, description ) )
 * 
 *         chrs = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected set, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_chrs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":965
 * 
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]
 */
  __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_chrs)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
  for (;;) {
    {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __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 str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":966
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]             # <<<<<<<<<<<<<<
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":967
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]             # <<<<<<<<<<<<<<
 *             l = self.datalength[ chrom ]
 *             pre = 0
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_column, sizeof(short), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_value));
    __pyx_v_value = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":968
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]             # <<<<<<<<<<<<<<
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_l = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":969
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]
 *             pre = 0             # <<<<<<<<<<<<<<
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             pre_v = value[ 0 ]
 */
    __pyx_v_pre = 0;

    /* "MACS2/IO/cScoreTrack.pyx":970
 *             l = self.datalength[ chrom ]
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data             # <<<<<<<<<<<<<<
 *             pre_v = value[ 0 ]
 *             for i in range( 1, l ):
 */
    __pyx_t_4 = ((__pyx_v_pos->dimensions[0]) == 0);
    if (__pyx_t_4) {
      goto __pyx_L4_continue;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "MACS2/IO/cScoreTrack.pyx":971
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             pre_v = value[ 0 ]             # <<<<<<<<<<<<<<
 *             for i in range( 1, l ):
 *                 v = value[ i ]
 */
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_pre_v = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":972
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             pre_v = value[ 0 ]
 *             for i in range( 1, l ):             # <<<<<<<<<<<<<<
 *                 v = value[ i ]
 *                 p = pos[ i-1 ]
 */
    __pyx_t_6 = __pyx_v_l;
    for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_6; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":973
 *             pre_v = value[ 0 ]
 *             for i in range( 1, l ):
 *                 v = value[ i ]             # <<<<<<<<<<<<<<
 *                 p = pos[ i-1 ]
 *                 #if ('%.5f' % pre_v) != ('%.5f' % v):
 */
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_v = __pyx_t_7;

      /* "MACS2/IO/cScoreTrack.pyx":974
 *             for i in range( 1, l ):
 *                 v = value[ i ]
 *                 p = pos[ i-1 ]             # <<<<<<<<<<<<<<
 *                 #if ('%.5f' % pre_v) != ('%.5f' % v):
 *                 if abs(pre_v - v) > 1e-5: # precision is 5 digits
 */
      __pyx_t_9 = (__pyx_v_i - 1);
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), __pyx_t_9, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_p = __pyx_t_10;

      /* "MACS2/IO/cScoreTrack.pyx":976
 *                 p = pos[ i-1 ]
 *                 #if ('%.5f' % pre_v) != ('%.5f' % v):
 *                 if abs(pre_v - v) > 1e-5: # precision is 5 digits             # <<<<<<<<<<<<<<
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 *                     pre_v = v
 */
      __pyx_t_4 = (fabsf((__pyx_v_pre_v - __pyx_v_v)) > 1e-5);
      if (__pyx_t_4) {

        /* "MACS2/IO/cScoreTrack.pyx":977
 *                 #if ('%.5f' % pre_v) != ('%.5f' % v):
 *                 if abs(pre_v - v) > 1e-5: # precision is 5 digits
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )             # <<<<<<<<<<<<<<
 *                     pre_v = v
 *                     pre = p
 */
        __pyx_t_2 = PyInt_FromLong(__pyx_v_pre); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyInt_FromLong(__pyx_v_p); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_11 = PyFloat_FromDouble(__pyx_v_pre_v); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_chrom));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_11 = 0;
        __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_11));
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_11));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
        __pyx_t_11 = 0;
        __pyx_t_11 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":978
 *                 if abs(pre_v - v) > 1e-5: # precision is 5 digits
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 *                     pre_v = v             # <<<<<<<<<<<<<<
 *                     pre = p
 *             p = pos[ -1 ]
 */
        __pyx_v_pre_v = __pyx_v_v;

        /* "MACS2/IO/cScoreTrack.pyx":979
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 *                     pre_v = v
 *                     pre = p             # <<<<<<<<<<<<<<
 *             p = pos[ -1 ]
 *             # last one
 */
        __pyx_v_pre = __pyx_v_p;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":980
 *                     pre_v = v
 *                     pre = p
 *             p = pos[ -1 ]             # <<<<<<<<<<<<<<
 *             # last one
 *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 */
    __pyx_t_11 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_11); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_v_p = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":982
 *             p = pos[ -1 ]
 *             # last one
 *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
    __pyx_t_11 = PyInt_FromLong(__pyx_v_pre); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = PyInt_FromLong(__pyx_v_p); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pre_v); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chrom));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_11 = 0;
    __pyx_t_12 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_L4_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":984
 *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_23write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_22write_bedGraph[] = "Write all data to fhd in bedGraph Format.\n\n        fhd: a filehandler to save bedGraph.\n\n        name/description: the name and description in track line.\n\n        colname: can be 1: chip, 2: control, 3: score\n\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_23write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fhd = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_description = 0;
  short __pyx_v_column;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_bedGraph (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fhd,&__pyx_n_s__name,&__pyx_n_s__description,&__pyx_n_s__column,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fhd)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__description)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__column);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bedGraph") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fhd = values[0];
    __pyx_v_name = ((PyObject*)values[1]);
    __pyx_v_description = ((PyObject*)values[2]);
    if (values[3]) {
      __pyx_v_column = __Pyx_PyInt_AsShort(values[3]); if (unlikely((__pyx_v_column == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_column = ((short)3);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_description), (&PyString_Type), 1, "description", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_22write_bedGraph(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_v_column);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":939
 *         return
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in bedGraph Format.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_22write_bedGraph(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_write_bedGraph __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_bedGraph", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.column = __pyx_v_column;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->write_bedGraph(__pyx_v_self, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":987
 * 
 *     @cython.boundscheck(False)
 *     cpdef reassign_peaks ( self, peaks ):             # <<<<<<<<<<<<<<
 *         """Re-assign values of score, pileup, pscore, qscore, fold
 *         change to predefined peaks.
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_25reassign_peaks(PyObject *__pyx_v_self, PyObject *__pyx_v_peaks); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_reassign_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_peaks, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_chrs = 0;
  int __pyx_v_i;
  int __pyx_v_t_index;
  int __pyx_v_tmp_summit;
  int __pyx_v_l;
  float __pyx_v_cutoff;
  PyObject *__pyx_v_ret_peaks = NULL;
  PyObject *__pyx_v_cpeaks = NULL;
  PyObject *__pyx_v_npeaks = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_sample = NULL;
  PyObject *__pyx_v_control = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_thispeak = NULL;
  PyObject *__pyx_v_tmppeak = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reassign_peaks", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reassign_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_25reassign_peaks)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_peaks);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_peaks);
      __Pyx_GIVEREF(__pyx_v_peaks);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1003
 *             float cutoff
 * 
 *         assert isinstance( peaks, PeakIO ), "peaks must be a PeakIO object!"             # <<<<<<<<<<<<<<
 * 
 *         ret_peaks = PeakIO()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PeakIO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_peaks, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_4)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_14));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":1005
 *         assert isinstance( peaks, PeakIO ), "peaks must be a PeakIO object!"
 * 
 *         ret_peaks = PeakIO()             # <<<<<<<<<<<<<<
 * 
 *         peaks.sort()
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PeakIO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ret_peaks = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1007
 *         ret_peaks = PeakIO()
 * 
 *         peaks.sort()             # <<<<<<<<<<<<<<
 * 
 *         chrs = self.get_chr_names()
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__sort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1009
 *         peaks.sort()
 * 
 *         chrs = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         for chrom in chrs:
 *             cpeaks = peaks.peaks[chrom]
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected set, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_chrs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1010
 * 
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             cpeaks = peaks.peaks[chrom]
 *             ret_peaks.peaks[chrom] = []
 */
  __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_chrs)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
  for (;;) {
    {
      __pyx_t_3 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1011
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:
 *             cpeaks = peaks.peaks[chrom]             # <<<<<<<<<<<<<<
 *             ret_peaks.peaks[chrom] = []
 *             npeaks = ret_peaks.peaks[chrom]
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__peaks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_cpeaks);
    __pyx_v_cpeaks = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1012
 *         for chrom in chrs:
 *             cpeaks = peaks.peaks[chrom]
 *             ret_peaks.peaks[chrom] = []             # <<<<<<<<<<<<<<
 *             npeaks = ret_peaks.peaks[chrom]
 * 
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_ret_peaks, __pyx_n_s__peaks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_v_chrom), ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1013
 *             cpeaks = peaks.peaks[chrom]
 *             ret_peaks.peaks[chrom] = []
 *             npeaks = ret_peaks.peaks[chrom]             # <<<<<<<<<<<<<<
 * 
 *             pos = self.data[chrom][ 0 ]
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_ret_peaks, __pyx_n_s__peaks); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_npeaks);
    __pyx_v_npeaks = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1015
 *             npeaks = ret_peaks.peaks[chrom]
 * 
 *             pos = self.data[chrom][ 0 ]             # <<<<<<<<<<<<<<
 *             sample = self.data[chrom][ 1 ]
 *             control = self.data[chrom][ 2 ]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_pos);
    __pyx_v_pos = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1016
 * 
 *             pos = self.data[chrom][ 0 ]
 *             sample = self.data[chrom][ 1 ]             # <<<<<<<<<<<<<<
 *             control = self.data[chrom][ 2 ]
 *             value = self.data[chrom][ 3 ]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_sample);
    __pyx_v_sample = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1017
 *             pos = self.data[chrom][ 0 ]
 *             sample = self.data[chrom][ 1 ]
 *             control = self.data[chrom][ 2 ]             # <<<<<<<<<<<<<<
 *             value = self.data[chrom][ 3 ]
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_control);
    __pyx_v_control = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1018
 *             sample = self.data[chrom][ 1 ]
 *             control = self.data[chrom][ 2 ]
 *             value = self.data[chrom][ 3 ]             # <<<<<<<<<<<<<<
 * 
 *             l = pos.shape[0]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_value);
    __pyx_v_value = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1020
 *             value = self.data[chrom][ 3 ]
 * 
 *             l = pos.shape[0]             # <<<<<<<<<<<<<<
 * 
 *             t_index = 0
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_pos, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_l = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":1022
 *             l = pos.shape[0]
 * 
 *             t_index = 0             # <<<<<<<<<<<<<<
 * 
 *             for i in range(len(cpeaks)):
 */
    __pyx_v_t_index = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1024
 *             t_index = 0
 * 
 *             for i in range(len(cpeaks)):             # <<<<<<<<<<<<<<
 *                 thispeak = cpeaks[i]
 *                 # we need to assign values for each peak -- actuall peak summit
 */
    __pyx_t_7 = PyObject_Length(__pyx_v_cpeaks); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "MACS2/IO/cScoreTrack.pyx":1025
 * 
 *             for i in range(len(cpeaks)):
 *                 thispeak = cpeaks[i]             # <<<<<<<<<<<<<<
 *                 # we need to assign values for each peak -- actuall peak summit
 *                 tmp_summit = thispeak["summit"]
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cpeaks, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_v_thispeak);
      __pyx_v_thispeak = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1027
 *                 thispeak = cpeaks[i]
 *                 # we need to assign values for each peak -- actuall peak summit
 *                 tmp_summit = thispeak["summit"]             # <<<<<<<<<<<<<<
 *                 while t_index < l and pos[t_index] < tmp_summit:
 *                     t_index += 1
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_thispeak, ((PyObject *)__pyx_n_s__summit)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_tmp_summit = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":1028
 *                 # we need to assign values for each peak -- actuall peak summit
 *                 tmp_summit = thispeak["summit"]
 *                 while t_index < l and pos[t_index] < tmp_summit:             # <<<<<<<<<<<<<<
 *                     t_index += 1
 *                 # find the summit
 */
      while (1) {
        __pyx_t_4 = (__pyx_v_t_index < __pyx_v_l);
        if (__pyx_t_4) {
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, __pyx_v_t_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = PyInt_FromLong(__pyx_v_tmp_summit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_11 = __pyx_t_10;
        } else {
          __pyx_t_11 = __pyx_t_4;
        }
        if (!__pyx_t_11) break;

        /* "MACS2/IO/cScoreTrack.pyx":1029
 *                 tmp_summit = thispeak["summit"]
 *                 while t_index < l and pos[t_index] < tmp_summit:
 *                     t_index += 1             # <<<<<<<<<<<<<<
 *                 # find the summit
 *                 if value[t_index] >= cutoff:
 */
        __pyx_v_t_index = (__pyx_v_t_index + 1);
      }

      /* "MACS2/IO/cScoreTrack.pyx":1031
 *                     t_index += 1
 *                 # find the summit
 *                 if value[t_index] >= cutoff:             # <<<<<<<<<<<<<<
 *                     tmppeak = copy(thispeak)
 *                     tmppeak["score"] = value[t_index]
 */
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_t_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_9, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_11) {

        /* "MACS2/IO/cScoreTrack.pyx":1032
 *                 # find the summit
 *                 if value[t_index] >= cutoff:
 *                     tmppeak = copy(thispeak)             # <<<<<<<<<<<<<<
 *                     tmppeak["score"] = value[t_index]
 *                     tmppeak["pileup"]= sample[t_index]
 */
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_thispeak);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_thispeak);
        __Pyx_GIVEREF(__pyx_v_thispeak);
        __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_v_tmppeak);
        __pyx_v_tmppeak = __pyx_t_9;
        __pyx_t_9 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1033
 *                 if value[t_index] >= cutoff:
 *                     tmppeak = copy(thispeak)
 *                     tmppeak["score"] = value[t_index]             # <<<<<<<<<<<<<<
 *                     tmppeak["pileup"]= sample[t_index]
 *                     tmppeak["pscore"]= get_pscore(sample[ t_index ], control[ t_index ])
 */
        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_t_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        if (PyObject_SetItem(__pyx_v_tmppeak, ((PyObject *)__pyx_n_s__score), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1034
 *                     tmppeak = copy(thispeak)
 *                     tmppeak["score"] = value[t_index]
 *                     tmppeak["pileup"]= sample[t_index]             # <<<<<<<<<<<<<<
 *                     tmppeak["pscore"]= get_pscore(sample[ t_index ], control[ t_index ])
 *                     if self.scoring_method == 'q':
 */
        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_sample, __pyx_v_t_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        if (PyObject_SetItem(__pyx_v_tmppeak, ((PyObject *)__pyx_n_s__pileup), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1035
 *                     tmppeak["score"] = value[t_index]
 *                     tmppeak["pileup"]= sample[t_index]
 *                     tmppeak["pscore"]= get_pscore(sample[ t_index ], control[ t_index ])             # <<<<<<<<<<<<<<
 *                     if self.scoring_method == 'q':
 *                         tmppeak["qscore"]= value[ t_index ]
 */
        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_sample, __pyx_v_t_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_control, __pyx_v_t_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_11cScoreTrack_get_pscore(__pyx_t_8, __pyx_t_12)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        if (PyObject_SetItem(__pyx_v_tmppeak, ((PyObject *)__pyx_n_s__pscore), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1036
 *                     tmppeak["pileup"]= sample[t_index]
 *                     tmppeak["pscore"]= get_pscore(sample[ t_index ], control[ t_index ])
 *                     if self.scoring_method == 'q':             # <<<<<<<<<<<<<<
 *                         tmppeak["qscore"]= value[ t_index ]
 *                     else:
 */
        __pyx_t_11 = (__pyx_v_self->scoring_method == 'q');
        if (__pyx_t_11) {

          /* "MACS2/IO/cScoreTrack.pyx":1037
 *                     tmppeak["pscore"]= get_pscore(sample[ t_index ], control[ t_index ])
 *                     if self.scoring_method == 'q':
 *                         tmppeak["qscore"]= value[ t_index ]             # <<<<<<<<<<<<<<
 *                     else:
 *                         tmppeak["qscore"]= -1
 */
          __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_t_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          if (PyObject_SetItem(__pyx_v_tmppeak, ((PyObject *)__pyx_n_s__qscore), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "MACS2/IO/cScoreTrack.pyx":1039
 *                         tmppeak["qscore"]= value[ t_index ]
 *                     else:
 *                         tmppeak["qscore"]= -1             # <<<<<<<<<<<<<<
 *                     tmppeak["fc"] = float ( sample[ t_index ] + self.pseudocount ) / ( control[ t_index ] + self.pseudocount )
 *                     npeaks.append(tmppeak)
 */
          if (PyObject_SetItem(__pyx_v_tmppeak, ((PyObject *)__pyx_n_s__qscore), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_L10:;

        /* "MACS2/IO/cScoreTrack.pyx":1040
 *                     else:
 *                         tmppeak["qscore"]= -1
 *                     tmppeak["fc"] = float ( sample[ t_index ] + self.pseudocount ) / ( control[ t_index ] + self.pseudocount )             # <<<<<<<<<<<<<<
 *                     npeaks.append(tmppeak)
 * 
 */
        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_sample, __pyx_v_t_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = PyNumber_Add(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_12 = __Pyx_PyObject_AsDouble(__pyx_t_2); if (unlikely(__pyx_t_12 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyFloat_FromDouble(__pyx_t_12); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_control, __pyx_v_t_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_13 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_13); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (PyObject_SetItem(__pyx_v_tmppeak, ((PyObject *)__pyx_n_s__fc), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1041
 *                         tmppeak["qscore"]= -1
 *                     tmppeak["fc"] = float ( sample[ t_index ] + self.pseudocount ) / ( control[ t_index ] + self.pseudocount )
 *                     npeaks.append(tmppeak)             # <<<<<<<<<<<<<<
 * 
 *         return ret_peaks
 */
        __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_npeaks, __pyx_v_tmppeak); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1043
 *                     npeaks.append(tmppeak)
 * 
 *         return ret_peaks             # <<<<<<<<<<<<<<
 * 
 *     cpdef call_peaks (self, float cutoff=5.0, int min_length=200, int max_gap=50, bool call_summits=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret_peaks);
  __pyx_r = __pyx_v_ret_peaks;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.reassign_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF(__pyx_v_ret_peaks);
  __Pyx_XDECREF(__pyx_v_cpeaks);
  __Pyx_XDECREF(__pyx_v_npeaks);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_sample);
  __Pyx_XDECREF(__pyx_v_control);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_thispeak);
  __Pyx_XDECREF(__pyx_v_tmppeak);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_25reassign_peaks(PyObject *__pyx_v_self, PyObject *__pyx_v_peaks); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_24reassign_peaks[] = "Re-assign values of score, pileup, pscore, qscore, fold\n        change to predefined peaks.\n\n        peaks should be a PeakIO object.\n\n        *Note* assume positions in scoreTrackIII object are sorted\n         from small to large.\n\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_25reassign_peaks(PyObject *__pyx_v_self, PyObject *__pyx_v_peaks) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reassign_peaks (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_24reassign_peaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), ((PyObject *)__pyx_v_peaks));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":987
 * 
 *     @cython.boundscheck(False)
 *     cpdef reassign_peaks ( self, peaks ):             # <<<<<<<<<<<<<<
 *         """Re-assign values of score, pileup, pscore, qscore, fold
 *         change to predefined peaks.
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_24reassign_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_peaks) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reassign_peaks", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->reassign_peaks(__pyx_v_self, __pyx_v_peaks, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.reassign_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1045
 *         return ret_peaks
 * 
 *     cpdef call_peaks (self, float cutoff=5.0, int min_length=200, int max_gap=50, bool call_summits=False):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_27call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_peaks *__pyx_optional_args) {
  float __pyx_v_cutoff = ((float)5.0);
  int __pyx_v_min_length = ((int)200);
  int __pyx_v_max_gap = ((int)50);
  PyBoolObject *__pyx_v_call_summits = __pyx_k_15;
  int __pyx_v_i;
  PyObject *__pyx_v_chrom = 0;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_sample = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_control = 0;
  PyArrayObject *__pyx_v_value = 0;
  PyArrayObject *__pyx_v_above_cutoff = 0;
  PyArrayObject *__pyx_v_above_cutoff_v = 0;
  PyArrayObject *__pyx_v_above_cutoff_endpos = 0;
  PyArrayObject *__pyx_v_above_cutoff_startpos = 0;
  PyArrayObject *__pyx_v_above_cutoff_sv = 0;
  PyObject *__pyx_v_peak_content = 0;
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_v_peaks = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  long __pyx_t_12;
  int __pyx_t_13;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak2 __pyx_t_14;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call_peaks", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cutoff = __pyx_optional_args->cutoff;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_min_length = __pyx_optional_args->min_length;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_max_gap = __pyx_optional_args->max_gap;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_call_summits = __pyx_optional_args->call_summits;
          }
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__call_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_27call_peaks)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyInt_FromLong(__pyx_v_max_gap); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_INCREF(((PyObject *)__pyx_v_call_summits));
      PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_call_summits));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_call_summits));
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1066
 *             list peak_content
 * 
 *         chrs  = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         peaks = PeakIO()                      # dictionary to save peaks
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1067
 * 
 *         chrs  = self.get_chr_names()
 *         peaks = PeakIO()                      # dictionary to save peaks             # <<<<<<<<<<<<<<
 * 
 *         self.cutoff = cutoff
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PeakIO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_peaks = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1069
 *         peaks = PeakIO()                      # dictionary to save peaks
 * 
 *         self.cutoff = cutoff             # <<<<<<<<<<<<<<
 *         for chrom in chrs:
 *             peak_content = []           # to store points above cutoff
 */
  __pyx_v_self->cutoff = __pyx_v_cutoff;

  /* "MACS2/IO/cScoreTrack.pyx":1070
 * 
 *         self.cutoff = cutoff
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             peak_content = []           # to store points above cutoff
 * 
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_4 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_4)) {
      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_4)) {
      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_4);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1071
 *         self.cutoff = cutoff
 *         for chrom in chrs:
 *             peak_content = []           # to store points above cutoff             # <<<<<<<<<<<<<<
 * 
 *             pos = self.data[chrom][ 0 ]
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(((PyObject *)__pyx_v_peak_content));
    __pyx_v_peak_content = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1073
 *             peak_content = []           # to store points above cutoff
 * 
 *             pos = self.data[chrom][ 0 ]             # <<<<<<<<<<<<<<
 *             sample = self.data[chrom][ 1 ]
 *             control = self.data[chrom][ 2 ]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1074
 * 
 *             pos = self.data[chrom][ 0 ]
 *             sample = self.data[chrom][ 1 ]             # <<<<<<<<<<<<<<
 *             control = self.data[chrom][ 2 ]
 *             value = self.data[chrom][ 3 ]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_sample));
    __pyx_v_sample = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1075
 *             pos = self.data[chrom][ 0 ]
 *             sample = self.data[chrom][ 1 ]
 *             control = self.data[chrom][ 2 ]             # <<<<<<<<<<<<<<
 *             value = self.data[chrom][ 3 ]
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_control));
    __pyx_v_control = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1076
 *             sample = self.data[chrom][ 1 ]
 *             control = self.data[chrom][ 2 ]
 *             value = self.data[chrom][ 3 ]             # <<<<<<<<<<<<<<
 * 
 *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_value));
    __pyx_v_value = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1078
 *             value = self.data[chrom][ 3 ]
 * 
 *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff             # <<<<<<<<<<<<<<
 *             above_cutoff_v = value[above_cutoff] # scores where score is above cutoff
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__nonzero); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_v_value), __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_above_cutoff));
    __pyx_v_above_cutoff = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1079
 * 
 *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff
 *             above_cutoff_v = value[above_cutoff] # scores where score is above cutoff             # <<<<<<<<<<<<<<
 * 
 *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff
 */
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_value), ((PyObject *)__pyx_v_above_cutoff)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_above_cutoff_v));
    __pyx_v_above_cutoff_v = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1081
 *             above_cutoff_v = value[above_cutoff] # scores where score is above cutoff
 * 
 *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 *             above_cutoff_startpos = pos[above_cutoff-1] # start positions of regions where score is above cutoff
 *             above_cutoff_sv= sample[above_cutoff] # sample pileup height where score is above cutoff
 */
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_pos), ((PyObject *)__pyx_v_above_cutoff)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_above_cutoff_endpos));
    __pyx_v_above_cutoff_endpos = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1082
 * 
 *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff
 *             above_cutoff_startpos = pos[above_cutoff-1] # start positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 *             above_cutoff_sv= sample[above_cutoff] # sample pileup height where score is above cutoff
 * 
 */
    __pyx_t_1 = PyNumber_Subtract(((PyObject *)__pyx_v_above_cutoff), __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_above_cutoff_startpos));
    __pyx_v_above_cutoff_startpos = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1083
 *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff
 *             above_cutoff_startpos = pos[above_cutoff-1] # start positions of regions where score is above cutoff
 *             above_cutoff_sv= sample[above_cutoff] # sample pileup height where score is above cutoff             # <<<<<<<<<<<<<<
 * 
 *             if above_cutoff_v.size == 0:
 */
    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_sample), ((PyObject *)__pyx_v_above_cutoff)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_above_cutoff_sv));
    __pyx_v_above_cutoff_sv = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1085
 *             above_cutoff_sv= sample[above_cutoff] # sample pileup height where score is above cutoff
 * 
 *             if above_cutoff_v.size == 0:             # <<<<<<<<<<<<<<
 *                 # nothing above cutoff
 *                 continue
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_above_cutoff_v), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "MACS2/IO/cScoreTrack.pyx":1087
 *             if above_cutoff_v.size == 0:
 *                 # nothing above cutoff
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if above_cutoff[0] == 0:
 */
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "MACS2/IO/cScoreTrack.pyx":1089
 *                 continue
 * 
 *             if above_cutoff[0] == 0:             # <<<<<<<<<<<<<<
 *                 # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
 *                 above_cutoff_startpos[0] = 0
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_8) {

      /* "MACS2/IO/cScoreTrack.pyx":1091
 *             if above_cutoff[0] == 0:
 *                 # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
 *                 above_cutoff_startpos[0] = 0             # <<<<<<<<<<<<<<
 * 
 *             # first bit of region above cutoff
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_above_cutoff_startpos), 0, __pyx_int_0, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "MACS2/IO/cScoreTrack.pyx":1094
 * 
 *             # first bit of region above cutoff
 *             peak_content.append( (above_cutoff_startpos[0], above_cutoff_endpos[0], above_cutoff_v[0], above_cutoff_sv[0], above_cutoff[0]) )             # <<<<<<<<<<<<<<
 *             for i in range( 1,above_cutoff_startpos.size ):
 *                 if above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 */
    __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_startpos), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_v), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_sv), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = 0;
    __pyx_t_9 = 0;
    __pyx_t_11 = PyList_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_10)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1095
 *             # first bit of region above cutoff
 *             peak_content.append( (above_cutoff_startpos[0], above_cutoff_endpos[0], above_cutoff_v[0], above_cutoff_sv[0], above_cutoff[0]) )
 *             for i in range( 1,above_cutoff_startpos.size ):             # <<<<<<<<<<<<<<
 *                 if above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 *                     # append
 */
    __pyx_t_10 = PyObject_GetAttr(((PyObject *)__pyx_v_above_cutoff_startpos), __pyx_n_s__size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = __Pyx_PyInt_AsLong(__pyx_t_10); if (unlikely((__pyx_t_12 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    for (__pyx_t_13 = 1; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "MACS2/IO/cScoreTrack.pyx":1096
 *             peak_content.append( (above_cutoff_startpos[0], above_cutoff_endpos[0], above_cutoff_v[0], above_cutoff_sv[0], above_cutoff[0]) )
 *             for i in range( 1,above_cutoff_startpos.size ):
 *                 if above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:             # <<<<<<<<<<<<<<
 *                     # append
 *                     peak_content.append( (above_cutoff_startpos[i], above_cutoff_endpos[i], above_cutoff_v[i], above_cutoff_sv[i], above_cutoff[i]) )
 */
      __pyx_t_10 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_startpos), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyNumber_Subtract(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromLong(__pyx_v_max_gap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_9, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_8) {

        /* "MACS2/IO/cScoreTrack.pyx":1098
 *                 if above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 *                     # append
 *                     peak_content.append( (above_cutoff_startpos[i], above_cutoff_endpos[i], above_cutoff_v[i], above_cutoff_sv[i], above_cutoff[i]) )             # <<<<<<<<<<<<<<
 *                 else:
 *                     # close
 */
        __pyx_t_10 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_startpos), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_v), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_sv), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_10 = 0;
        __pyx_t_2 = 0;
        __pyx_t_9 = 0;
        __pyx_t_5 = 0;
        __pyx_t_1 = 0;
        __pyx_t_11 = PyList_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        goto __pyx_L9;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":1101
 *                 else:
 *                     # close
 *                     if call_summits:             # <<<<<<<<<<<<<<
 *                         self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap/2 )
 *                     else:
 */
        __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_call_summits)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_8) {

          /* "MACS2/IO/cScoreTrack.pyx":1102
 *                     # close
 *                     if call_summits:
 *                         self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap/2 )             # <<<<<<<<<<<<<<
 *                     else:
 *                         self.__close_peak(peak_content, peaks, min_length, chrom, max_gap/2 )
 */
          __pyx_t_14.__pyx_n = 1;
          __pyx_t_14.smoothlen = __Pyx_div_long(__pyx_v_max_gap, 2);
          __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak2(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "MACS2/IO/cScoreTrack.pyx":1104
 *                         self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap/2 )
 *                     else:
 *                         self.__close_peak(peak_content, peaks, min_length, chrom, max_gap/2 )             # <<<<<<<<<<<<<<
 *                     peak_content = [(above_cutoff_startpos[i], above_cutoff_endpos[i], above_cutoff_v[i], above_cutoff_sv[i], above_cutoff[i]),]
 * 
 */
          __pyx_t_15.__pyx_n = 1;
          __pyx_t_15.smoothlen = __Pyx_div_long(__pyx_v_max_gap, 2);
          __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, &__pyx_t_15)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_L10:;

        /* "MACS2/IO/cScoreTrack.pyx":1105
 *                     else:
 *                         self.__close_peak(peak_content, peaks, min_length, chrom, max_gap/2 )
 *                     peak_content = [(above_cutoff_startpos[i], above_cutoff_endpos[i], above_cutoff_v[i], above_cutoff_sv[i], above_cutoff[i]),]             # <<<<<<<<<<<<<<
 * 
 *             # save the last peak
 */
        __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_startpos), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_v), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_sv), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_3 = 0;
        __pyx_t_1 = 0;
        __pyx_t_5 = 0;
        __pyx_t_9 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_10));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
        __pyx_t_10 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_v_peak_content));
        __pyx_v_peak_content = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
      }
      __pyx_L9:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":1108
 * 
 *             # save the last peak
 *             if not peak_content:             # <<<<<<<<<<<<<<
 *                 continue
 *             else:
 */
    __pyx_t_8 = (((PyObject *)__pyx_v_peak_content) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_peak_content)) != 0);
    __pyx_t_16 = (!__pyx_t_8);
    if (__pyx_t_16) {

      /* "MACS2/IO/cScoreTrack.pyx":1109
 *             # save the last peak
 *             if not peak_content:
 *                 continue             # <<<<<<<<<<<<<<
 *             else:
 *                 if call_summits:
 */
      goto __pyx_L3_continue;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "MACS2/IO/cScoreTrack.pyx":1111
 *                 continue
 *             else:
 *                 if call_summits:             # <<<<<<<<<<<<<<
 *                     self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap/2 )
 *                 else:
 */
      __pyx_t_16 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_call_summits)); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_16) {

        /* "MACS2/IO/cScoreTrack.pyx":1112
 *             else:
 *                 if call_summits:
 *                     self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap/2 )             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.__close_peak(peak_content, peaks, min_length, chrom, max_gap/2 )
 */
        __pyx_t_14.__pyx_n = 1;
        __pyx_t_14.smoothlen = __Pyx_div_long(__pyx_v_max_gap, 2);
        __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak2(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, &__pyx_t_14)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":1114
 *                     self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap/2 )
 *                 else:
 *                     self.__close_peak(peak_content, peaks, min_length, chrom, max_gap/2 )             # <<<<<<<<<<<<<<
 * 
 *         return peaks
 */
        __pyx_t_15.__pyx_n = 1;
        __pyx_t_15.smoothlen = __Pyx_div_long(__pyx_v_max_gap, 2);
        __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, &__pyx_t_15)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L12:;
    }
    __pyx_L11:;
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1116
 *                     self.__close_peak(peak_content, peaks, min_length, chrom, max_gap/2 )
 * 
 *         return peaks             # <<<<<<<<<<<<<<
 * 
 *     cdef bool __close_peak (self, list peak_content, peaks, int min_length,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_peaks);
  __pyx_r = __pyx_v_peaks;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_sample);
  __Pyx_XDECREF((PyObject *)__pyx_v_control);
  __Pyx_XDECREF((PyObject *)__pyx_v_value);
  __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff);
  __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff_v);
  __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff_endpos);
  __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff_startpos);
  __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff_sv);
  __Pyx_XDECREF(__pyx_v_peak_content);
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF(__pyx_v_peaks);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_27call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_26call_peaks[] = "This function try to find regions within which, scores\n        are continuously higher than a given cutoff.\n\n        This function is NOT using sliding-windows. Instead, any\n        regions in bedGraph above certain cutoff will be detected,\n        then merged if the gap between nearby two regions are below\n        max_gap. After this, peak is reported if its length is above\n        min_length.\n\n        cutoff:  cutoff of value, default 5. For -log10pvalue, it means 10^-5.\n        min_length :  minimum peak length, default 200.\n        gap   :  maximum gap to merge nearby peaks, default 50.\n        ptrack:  an optional track for pileup heights. If it's not None, use it to find summits. Otherwise, use self/scoreTrack.\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_27call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_cutoff;
  int __pyx_v_min_length;
  int __pyx_v_max_gap;
  PyBoolObject *__pyx_v_call_summits = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_peaks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cutoff,&__pyx_n_s__min_length,&__pyx_n_s__max_gap,&__pyx_n_s__call_summits,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)__pyx_k_15;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cutoff);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_length);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_gap);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__call_summits);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "call_peaks") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_cutoff = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_cutoff == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "MACS2/IO/cScoreTrack.pyx":1045
 *         return ret_peaks
 * 
 *     cpdef call_peaks (self, float cutoff=5.0, int min_length=200, int max_gap=50, bool call_summits=False):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
      __pyx_v_cutoff = ((float)5.0);
    }
    if (values[1]) {
      __pyx_v_min_length = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_min_length == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_length = ((int)200);
    }
    if (values[2]) {
      __pyx_v_max_gap = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_max_gap == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_max_gap = ((int)50);
    }
    __pyx_v_call_summits = ((PyBoolObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_peaks", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_call_summits), __pyx_ptype_7cpython_4bool_bool, 1, "call_summits", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_26call_peaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_min_length, __pyx_v_max_gap, __pyx_v_call_summits);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_26call_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, float __pyx_v_cutoff, int __pyx_v_min_length, int __pyx_v_max_gap, PyBoolObject *__pyx_v_call_summits) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_peaks __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call_peaks", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.cutoff = __pyx_v_cutoff;
  __pyx_t_2.min_length = __pyx_v_min_length;
  __pyx_t_2.max_gap = __pyx_v_max_gap;
  __pyx_t_2.call_summits = __pyx_v_call_summits;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->call_peaks(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1118
 *         return peaks
 * 
 *     cdef bool __close_peak (self, list peak_content, peaks, int min_length,             # <<<<<<<<<<<<<<
 *                             str chrom, int smoothlen=0):
 *         """Close the peak region, output peak boundaries, peak summit
 */

static PyBoolObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_peak_content, PyObject *__pyx_v_peaks, int __pyx_v_min_length, PyObject *__pyx_v_chrom, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak *__pyx_optional_args) {
  int __pyx_v_summit_pos;
  int __pyx_v_tstart;
  int __pyx_v_tend;
  int __pyx_v_summit_index;
  int __pyx_v_i;
  int __pyx_v_midindex;
  double __pyx_v_summit_value;
  CYTHON_UNUSED double __pyx_v_tvalue;
  double __pyx_v_tsummitvalue;
  PyObject *__pyx_v_peak_length = NULL;
  PyObject *__pyx_v_tsummit = NULL;
  PyObject *__pyx_v_tindex = NULL;
  PyObject *__pyx_v_tsummit_index = NULL;
  PyObject *__pyx_v_qscore = NULL;
  PyBoolObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_t_13;
  double __pyx_t_14;
  double __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__close_peak", 0);
  if (__pyx_optional_args) {
  }

  /* "MACS2/IO/cScoreTrack.pyx":1130
 *             double summit_value, tvalue, tsummitvalue
 * 
 *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *         if peak_length >= min_length: # if the peak is too small, reject it
 *             tsummit = []
 */
  if (unlikely(((PyObject *)__pyx_v_peak_content) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(((PyObject *)__pyx_v_peak_content) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_peak_length = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1131
 * 
 *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *         if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *             tsummit = []
 *             summit_pos   = 0
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":1132
 *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *         if peak_length >= min_length: # if the peak is too small, reject it
 *             tsummit = []             # <<<<<<<<<<<<<<
 *             summit_pos   = 0
 *             summit_value = 0
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_tsummit = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1133
 *         if peak_length >= min_length: # if the peak is too small, reject it
 *             tsummit = []
 *             summit_pos   = 0             # <<<<<<<<<<<<<<
 *             summit_value = 0
 *             for i in range(len(peak_content)):
 */
    __pyx_v_summit_pos = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1134
 *             tsummit = []
 *             summit_pos   = 0
 *             summit_value = 0             # <<<<<<<<<<<<<<
 *             for i in range(len(peak_content)):
 *                 (tstart,tend,tvalue,tsummitvalue, tindex) = peak_content[i]
 */
    __pyx_v_summit_value = 0.0;

    /* "MACS2/IO/cScoreTrack.pyx":1135
 *             summit_pos   = 0
 *             summit_value = 0
 *             for i in range(len(peak_content)):             # <<<<<<<<<<<<<<
 *                 (tstart,tend,tvalue,tsummitvalue, tindex) = peak_content[i]
 *                 #for (tstart,tend,tvalue,tsummitvalue, tindex) in peak_content:
 */
    if (unlikely(((PyObject *)__pyx_v_peak_content) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_peak_content)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "MACS2/IO/cScoreTrack.pyx":1136
 *             summit_value = 0
 *             for i in range(len(peak_content)):
 *                 (tstart,tend,tvalue,tsummitvalue, tindex) = peak_content[i]             # <<<<<<<<<<<<<<
 *                 #for (tstart,tend,tvalue,tsummitvalue, tindex) in peak_content:
 *                 if not summit_value or summit_value < tsummitvalue:
 */
      if (unlikely(((PyObject *)__pyx_v_peak_content) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 5)) {
          if (size > 5) __Pyx_RaiseTooManyValuesError(5);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4); 
        } else {
          __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 3); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 4); 
        }
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        #else
        Py_ssize_t i;
        PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
        for (i=0; i < 5; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      {
        Py_ssize_t index = -1;
        PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
        __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
        for (index=0; index < 5; index++) {
          PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L6_unpacking_failed;
          __Pyx_GOTREF(item);
          *(temps[index]) = item;
        }
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L7_unpacking_done:;
      }
      __pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_tstart = __pyx_t_12;
      __pyx_v_tend = __pyx_t_13;
      __pyx_v_tvalue = __pyx_t_14;
      __pyx_v_tsummitvalue = __pyx_t_15;
      __Pyx_XDECREF(__pyx_v_tindex);
      __pyx_v_tindex = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1138
 *                 (tstart,tend,tvalue,tsummitvalue, tindex) = peak_content[i]
 *                 #for (tstart,tend,tvalue,tsummitvalue, tindex) in peak_content:
 *                 if not summit_value or summit_value < tsummitvalue:             # <<<<<<<<<<<<<<
 *                     tsummit = [(tend + tstart) / 2, ]
 *                     tsummit_index = [ tindex, ]
 */
      __pyx_t_4 = (!(__pyx_v_summit_value != 0));
      if (!__pyx_t_4) {
        __pyx_t_16 = (__pyx_v_summit_value < __pyx_v_tsummitvalue);
        __pyx_t_17 = __pyx_t_16;
      } else {
        __pyx_t_17 = __pyx_t_4;
      }
      if (__pyx_t_17) {

        /* "MACS2/IO/cScoreTrack.pyx":1139
 *                 #for (tstart,tend,tvalue,tsummitvalue, tindex) in peak_content:
 *                 if not summit_value or summit_value < tsummitvalue:
 *                     tsummit = [(tend + tstart) / 2, ]             # <<<<<<<<<<<<<<
 *                     tsummit_index = [ tindex, ]
 *                     summit_value = tsummitvalue
 */
        __pyx_t_3 = PyInt_FromLong(__Pyx_div_long((__pyx_v_tend + __pyx_v_tstart), 2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_v_tsummit));
        __pyx_v_tsummit = ((PyObject*)__pyx_t_9);
        __pyx_t_9 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1140
 *                 if not summit_value or summit_value < tsummitvalue:
 *                     tsummit = [(tend + tstart) / 2, ]
 *                     tsummit_index = [ tindex, ]             # <<<<<<<<<<<<<<
 *                     summit_value = tsummitvalue
 *                 elif summit_value == tsummitvalue:
 */
        __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_v_tindex);
        PyList_SET_ITEM(__pyx_t_9, 0, __pyx_v_tindex);
        __Pyx_GIVEREF(__pyx_v_tindex);
        __Pyx_XDECREF(((PyObject *)__pyx_v_tsummit_index));
        __pyx_v_tsummit_index = ((PyObject*)__pyx_t_9);
        __pyx_t_9 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1141
 *                     tsummit = [(tend + tstart) / 2, ]
 *                     tsummit_index = [ tindex, ]
 *                     summit_value = tsummitvalue             # <<<<<<<<<<<<<<
 *                 elif summit_value == tsummitvalue:
 *                     # remember continuous summit values
 */
        __pyx_v_summit_value = __pyx_v_tsummitvalue;
        goto __pyx_L8;
      }

      /* "MACS2/IO/cScoreTrack.pyx":1142
 *                     tsummit_index = [ tindex, ]
 *                     summit_value = tsummitvalue
 *                 elif summit_value == tsummitvalue:             # <<<<<<<<<<<<<<
 *                     # remember continuous summit values
 *                     tsummit.append(int((tend + tstart) / 2))
 */
      __pyx_t_17 = (__pyx_v_summit_value == __pyx_v_tsummitvalue);
      if (__pyx_t_17) {

        /* "MACS2/IO/cScoreTrack.pyx":1144
 *                 elif summit_value == tsummitvalue:
 *                     # remember continuous summit values
 *                     tsummit.append(int((tend + tstart) / 2))             # <<<<<<<<<<<<<<
 *                     tsummit_index.append( tindex )
 *             # the middle of all highest points in peak region is defined as summit
 */
        __pyx_t_9 = PyInt_FromLong(__Pyx_div_long((__pyx_v_tend + __pyx_v_tstart), 2)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_18 = PyList_Append(__pyx_v_tsummit, __pyx_t_9); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1145
 *                     # remember continuous summit values
 *                     tsummit.append(int((tend + tstart) / 2))
 *                     tsummit_index.append( tindex )             # <<<<<<<<<<<<<<
 *             # the middle of all highest points in peak region is defined as summit
 *             midindex = int((len(tsummit) + 1) / 2) - 1
 */
        if (unlikely(!__pyx_v_tsummit_index)) { __Pyx_RaiseUnboundLocalError("tsummit_index"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        __pyx_t_18 = PyList_Append(__pyx_v_tsummit_index, __pyx_v_tindex); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L8;
      }
      __pyx_L8:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":1147
 *                     tsummit_index.append( tindex )
 *             # the middle of all highest points in peak region is defined as summit
 *             midindex = int((len(tsummit) + 1) / 2) - 1             # <<<<<<<<<<<<<<
 *             summit_pos    = tsummit[ midindex ]
 *             summit_index  = tsummit_index[ midindex ]
 */
    __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_tsummit)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = PyInt_FromSsize_t(__Pyx_div_Py_ssize_t((__pyx_t_5 + 1), 2)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_9, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_midindex = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":1148
 *             # the middle of all highest points in peak region is defined as summit
 *             midindex = int((len(tsummit) + 1) / 2) - 1
 *             summit_pos    = tsummit[ midindex ]             # <<<<<<<<<<<<<<
 *             summit_index  = tsummit_index[ midindex ]
 *             if self.scoring_method == 'q':
 */
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_tsummit), __pyx_v_midindex, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_summit_pos = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":1149
 *             midindex = int((len(tsummit) + 1) / 2) - 1
 *             summit_pos    = tsummit[ midindex ]
 *             summit_index  = tsummit_index[ midindex ]             # <<<<<<<<<<<<<<
 *             if self.scoring_method == 'q':
 *                 qscore = self.data[chrom][3][ summit_index ]
 */
    if (unlikely(!__pyx_v_tsummit_index)) { __Pyx_RaiseUnboundLocalError("tsummit_index"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_tsummit_index), __pyx_v_midindex, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_summit_index = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":1150
 *             summit_pos    = tsummit[ midindex ]
 *             summit_index  = tsummit_index[ midindex ]
 *             if self.scoring_method == 'q':             # <<<<<<<<<<<<<<
 *                 qscore = self.data[chrom][3][ summit_index ]
 *             else:
 */
    __pyx_t_17 = (__pyx_v_self->scoring_method == 'q');
    if (__pyx_t_17) {

      /* "MACS2/IO/cScoreTrack.pyx":1151
 *             summit_index  = tsummit_index[ midindex ]
 *             if self.scoring_method == 'q':
 *                 qscore = self.data[chrom][3][ summit_index ]             # <<<<<<<<<<<<<<
 *             else:
 *                 # if q value is not computed, use -1
 */
      if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_9, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_qscore = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "MACS2/IO/cScoreTrack.pyx":1154
 *             else:
 *                 # if q value is not computed, use -1
 *                 qscore = -1             # <<<<<<<<<<<<<<
 * 
 *             peaks.add( chrom,
 */
      __Pyx_INCREF(__pyx_int_neg_1);
      __pyx_v_qscore = __pyx_int_neg_1;
    }
    __pyx_L9:;

    /* "MACS2/IO/cScoreTrack.pyx":1156
 *                 qscore = -1
 * 
 *             peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                        peak_content[0][0],
 *                        peak_content[-1][1],
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);

    /* "MACS2/IO/cScoreTrack.pyx":1157
 * 
 *             peaks.add( chrom,
 *                        peak_content[0][0],             # <<<<<<<<<<<<<<
 *                        peak_content[-1][1],
 *                        summit      = summit_pos,
 */
    if (unlikely(((PyObject *)__pyx_v_peak_content) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1158
 *             peaks.add( chrom,
 *                        peak_content[0][0],
 *                        peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                        summit      = summit_pos,
 *                        peak_score  = self.data[chrom][ 3 ][ summit_index ],
 */
    if (unlikely(((PyObject *)__pyx_v_peak_content) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __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 = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_chrom));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_8 = 0;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1156
 *                 qscore = -1
 * 
 *             peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                        peak_content[0][0],
 *                        peak_content[-1][1],
 */
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));

    /* "MACS2/IO/cScoreTrack.pyx":1159
 *                        peak_content[0][0],
 *                        peak_content[-1][1],
 *                        summit      = summit_pos,             # <<<<<<<<<<<<<<
 *                        peak_score  = self.data[chrom][ 3 ][ summit_index ],
 *                        pileup      = self.data[chrom][ 1 ][ summit_index ], # should be the same as summit_value
 */
    __pyx_t_8 = PyInt_FromLong(__pyx_v_summit_pos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__summit), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1160
 *                        peak_content[-1][1],
 *                        summit      = summit_pos,
 *                        peak_score  = self.data[chrom][ 3 ][ summit_index ],             # <<<<<<<<<<<<<<
 *                        pileup      = self.data[chrom][ 1 ][ summit_index ], # should be the same as summit_value
 *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__peak_score), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1161
 *                        summit      = summit_pos,
 *                        peak_score  = self.data[chrom][ 3 ][ summit_index ],
 *                        pileup      = self.data[chrom][ 1 ][ summit_index ], # should be the same as summit_value             # <<<<<<<<<<<<<<
 *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
 *                        fold_change = float ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__pileup), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1162
 *                        peak_score  = self.data[chrom][ 3 ][ summit_index ],
 *                        pileup      = self.data[chrom][ 1 ][ summit_index ], # should be the same as summit_value
 *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),             # <<<<<<<<<<<<<<
 *                        fold_change = float ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
 *                        qscore      = qscore,
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_11cScoreTrack_get_pscore(__pyx_t_6, __pyx_t_15)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__pscore), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1163
 *                        pileup      = self.data[chrom][ 1 ][ summit_index ], # should be the same as summit_value
 *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
 *                        fold_change = float ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),             # <<<<<<<<<<<<<<
 *                        qscore      = qscore,
 *                        )
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_15 = __Pyx_PyObject_AsDouble(__pyx_t_1); if (unlikely(__pyx_t_15 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyFloat_FromDouble(__pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__fold_change), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1164
 *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
 *                        fold_change = float ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
 *                        qscore      = qscore,             # <<<<<<<<<<<<<<
 *                        )
 *             # start a new peak
 */
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__qscore), __pyx_v_qscore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1167
 *                        )
 *             # start a new peak
 *             return True             # <<<<<<<<<<<<<<
 * 
 *     cdef bool __close_peak2 (self, list peak_content, peaks, int min_length,
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((PyBoolObject *)__pyx_t_8);
    __pyx_t_8 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = ((PyBoolObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.__close_peak", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_peak_length);
  __Pyx_XDECREF(__pyx_v_tsummit);
  __Pyx_XDECREF(__pyx_v_tindex);
  __Pyx_XDECREF(__pyx_v_tsummit_index);
  __Pyx_XDECREF(__pyx_v_qscore);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1169
 *             return True
 * 
 *     cdef bool __close_peak2 (self, list peak_content, peaks, int min_length,             # <<<<<<<<<<<<<<
 *                              str chrom, int smoothlen=51,
 *                              float min_valley = 0.9):
 */

static PyBoolObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak2(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_peak_content, PyObject *__pyx_v_peaks, int __pyx_v_min_length, PyObject *__pyx_v_chrom, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak2 *__pyx_optional_args) {
  int __pyx_v_smoothlen = ((int)51);
  int __pyx_v_tstart;
  int __pyx_v_tend;
  int __pyx_v_tmpindex;
  int __pyx_v_summit_index;
  int __pyx_v_summit_offset;
  int __pyx_v_start;
  int __pyx_v_end;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_start_boundary;
  CYTHON_UNUSED double __pyx_v_tvalue;
  PyArrayObject *__pyx_v_peakdata = 0;
  PyArrayObject *__pyx_v_peakindices = 0;
  PyArrayObject *__pyx_v_summit_offsets = 0;
  PyObject *__pyx_v_peak_length = NULL;
  PyObject *__pyx_v_tsvalue = NULL;
  PyObject *__pyx_v_summit_indices = NULL;
  PyObject *__pyx_v_peak_scores = NULL;
  PyObject *__pyx_v_qscore = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_peakdata;
  __Pyx_Buffer __pyx_pybuffer_peakdata;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_peakindices;
  __Pyx_Buffer __pyx_pybuffer_peakindices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_summit_offsets;
  __Pyx_Buffer __pyx_pybuffer_summit_offsets;
  PyBoolObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *(*__pyx_t_17)(PyObject *);
  int __pyx_t_18;
  double __pyx_t_19;
  int __pyx_t_20;
  int __pyx_t_21;
  PyObject *(*__pyx_t_22)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__close_peak2", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_smoothlen = __pyx_optional_args->smoothlen;
    }
  }
  __pyx_pybuffer_peakdata.pybuffer.buf = NULL;
  __pyx_pybuffer_peakdata.refcount = 0;
  __pyx_pybuffernd_peakdata.data = NULL;
  __pyx_pybuffernd_peakdata.rcbuffer = &__pyx_pybuffer_peakdata;
  __pyx_pybuffer_peakindices.pybuffer.buf = NULL;
  __pyx_pybuffer_peakindices.refcount = 0;
  __pyx_pybuffernd_peakindices.data = NULL;
  __pyx_pybuffernd_peakindices.rcbuffer = &__pyx_pybuffer_peakindices;
  __pyx_pybuffer_summit_offsets.pybuffer.buf = NULL;
  __pyx_pybuffer_summit_offsets.refcount = 0;
  __pyx_pybuffernd_summit_offsets.data = NULL;
  __pyx_pybuffernd_summit_offsets.rcbuffer = &__pyx_pybuffer_summit_offsets;

  /* "MACS2/IO/cScoreTrack.pyx":1181
 * 
 *         # Add 10 bp padding to peak region so that we can get true minima
 *         end = peak_content[ -1 ][ 1 ] + 10             # <<<<<<<<<<<<<<
 *         start = peak_content[ 0 ][ 0 ] - 10
 *         if start < 0:
 */
  if (unlikely(((PyObject *)__pyx_v_peak_content) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_end = __pyx_t_3;

  /* "MACS2/IO/cScoreTrack.pyx":1182
 *         # Add 10 bp padding to peak region so that we can get true minima
 *         end = peak_content[ -1 ][ 1 ] + 10
 *         start = peak_content[ 0 ][ 0 ] - 10             # <<<<<<<<<<<<<<
 *         if start < 0:
 *             start_boundary = 10 + start
 */
  if (unlikely(((PyObject *)__pyx_v_peak_content) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_int_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_start = __pyx_t_3;

  /* "MACS2/IO/cScoreTrack.pyx":1183
 *         end = peak_content[ -1 ][ 1 ] + 10
 *         start = peak_content[ 0 ][ 0 ] - 10
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start_boundary = 10 + start
 *             start = 0
 */
  __pyx_t_4 = (__pyx_v_start < 0);
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":1184
 *         start = peak_content[ 0 ][ 0 ] - 10
 *         if start < 0:
 *             start_boundary = 10 + start             # <<<<<<<<<<<<<<
 *             start = 0
 *         else:
 */
    __pyx_v_start_boundary = (10 + __pyx_v_start);

    /* "MACS2/IO/cScoreTrack.pyx":1185
 *         if start < 0:
 *             start_boundary = 10 + start
 *             start = 0             # <<<<<<<<<<<<<<
 *         else:
 *             start_boundary = 10
 */
    __pyx_v_start = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":1187
 *             start = 0
 *         else:
 *             start_boundary = 10             # <<<<<<<<<<<<<<
 *         peak_length = end - start
 *         if end - start < min_length: return # if the region is too small, reject it
 */
    __pyx_v_start_boundary = 10;
  }
  __pyx_L3:;

  /* "MACS2/IO/cScoreTrack.pyx":1188
 *         else:
 *             start_boundary = 10
 *         peak_length = end - start             # <<<<<<<<<<<<<<
 *         if end - start < min_length: return # if the region is too small, reject it
 * 
 */
  __pyx_t_1 = PyInt_FromLong((__pyx_v_end - __pyx_v_start)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_peak_length = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1189
 *             start_boundary = 10
 *         peak_length = end - start
 *         if end - start < min_length: return # if the region is too small, reject it             # <<<<<<<<<<<<<<
 * 
 *         peakdata = np.zeros(end - start, dtype='float32')
 */
  __pyx_t_4 = ((__pyx_v_end - __pyx_v_start) < __pyx_v_min_length);
  if (__pyx_t_4) {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((PyBoolObject *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "MACS2/IO/cScoreTrack.pyx":1191
 *         if end - start < min_length: return # if the region is too small, reject it
 * 
 *         peakdata = np.zeros(end - start, dtype='float32')             # <<<<<<<<<<<<<<
 *         peakindices = np.zeros(end - start, dtype='int32')
 *         for (tstart,tend,tvalue,tsvalue, tmpindex) in peak_content:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromLong((__pyx_v_end - __pyx_v_start)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakdata.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peakdata.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peakdata.rcbuffer->pybuffer, (PyObject*)__pyx_v_peakdata, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_peakdata.diminfo[0].strides = __pyx_pybuffernd_peakdata.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_peakdata.diminfo[0].shape = __pyx_pybuffernd_peakdata.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_peakdata = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1192
 * 
 *         peakdata = np.zeros(end - start, dtype='float32')
 *         peakindices = np.zeros(end - start, dtype='int32')             # <<<<<<<<<<<<<<
 *         for (tstart,tend,tvalue,tsvalue, tmpindex) in peak_content:
 *             i = tstart - start + start_boundary
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromLong((__pyx_v_end - __pyx_v_start)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__int32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakindices.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peakindices.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peakindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_peakindices, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_pybuffernd_peakindices.diminfo[0].strides = __pyx_pybuffernd_peakindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_peakindices.diminfo[0].shape = __pyx_pybuffernd_peakindices.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_peakindices = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1193
 *         peakdata = np.zeros(end - start, dtype='float32')
 *         peakindices = np.zeros(end - start, dtype='int32')
 *         for (tstart,tend,tvalue,tsvalue, tmpindex) in peak_content:             # <<<<<<<<<<<<<<
 *             i = tstart - start + start_boundary
 *             j = tend - start + start_boundary
 */
  if (unlikely(((PyObject *)__pyx_v_peak_content) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = ((PyObject *)__pyx_v_peak_content); __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0;
  for (;;) {
    if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 5)) {
        if (size > 5) __Pyx_RaiseTooManyValuesError(5);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_13 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_14 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 4); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_13 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_14 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_15 = PyList_GET_ITEM(sequence, 4); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_15);
      #else
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_5,&__pyx_t_1,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15};
      for (i=0; i < 5; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    {
      Py_ssize_t index = -1;
      PyObject** temps[5] = {&__pyx_t_5,&__pyx_t_1,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15};
      __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext;
      for (index=0; index < 5; index++) {
        PyObject* item = __pyx_t_17(__pyx_t_16); if (unlikely(!item)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_17 = NULL;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_17 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L8_unpacking_done:;
    }
    __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_19 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_15); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_v_tstart = __pyx_t_3;
    __pyx_v_tend = __pyx_t_18;
    __pyx_v_tvalue = __pyx_t_19;
    __Pyx_XDECREF(__pyx_v_tsvalue);
    __pyx_v_tsvalue = __pyx_t_14;
    __pyx_t_14 = 0;
    __pyx_v_tmpindex = __pyx_t_20;

    /* "MACS2/IO/cScoreTrack.pyx":1194
 *         peakindices = np.zeros(end - start, dtype='int32')
 *         for (tstart,tend,tvalue,tsvalue, tmpindex) in peak_content:
 *             i = tstart - start + start_boundary             # <<<<<<<<<<<<<<
 *             j = tend - start + start_boundary
 *             peakdata[i:j] = tsvalue
 */
    __pyx_v_i = ((__pyx_v_tstart - __pyx_v_start) + __pyx_v_start_boundary);

    /* "MACS2/IO/cScoreTrack.pyx":1195
 *         for (tstart,tend,tvalue,tsvalue, tmpindex) in peak_content:
 *             i = tstart - start + start_boundary
 *             j = tend - start + start_boundary             # <<<<<<<<<<<<<<
 *             peakdata[i:j] = tsvalue
 *             peakindices[i:j] = tmpindex
 */
    __pyx_v_j = ((__pyx_v_tend - __pyx_v_start) + __pyx_v_start_boundary);

    /* "MACS2/IO/cScoreTrack.pyx":1196
 *             i = tstart - start + start_boundary
 *             j = tend - start + start_boundary
 *             peakdata[i:j] = tsvalue             # <<<<<<<<<<<<<<
 *             peakindices[i:j] = tmpindex
 *         # apply smoothing window of smoothlen
 */
    if (__Pyx_PySequence_SetSlice(((PyObject *)__pyx_v_peakdata), __pyx_v_i, __pyx_v_j, __pyx_v_tsvalue) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "MACS2/IO/cScoreTrack.pyx":1197
 *             j = tend - start + start_boundary
 *             peakdata[i:j] = tsvalue
 *             peakindices[i:j] = tmpindex             # <<<<<<<<<<<<<<
 *         # apply smoothing window of smoothlen
 * #        w = np.ones(smoothlen, dtype='float32') / smoothlen
 */
    __pyx_t_6 = PyInt_FromLong(__pyx_v_tmpindex); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_PySequence_SetSlice(((PyObject *)__pyx_v_peakindices), __pyx_v_i, __pyx_v_j, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1204
 * #        else:
 * #            smoothdata = peakdata.copy()
 *         summit_offsets = maxima(peakdata, smoothlen)             # <<<<<<<<<<<<<<
 *         if summit_offsets.shape[0] == 0:
 *             # **failsafe** if no summits, fall back on old approach #
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__maxima); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyInt_FromLong(__pyx_v_smoothlen); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_INCREF(((PyObject *)__pyx_v_peakdata));
  PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_peakdata));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_peakdata));
  PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
    __pyx_t_20 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_20 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_v_summit_offsets, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_summit_offsets.diminfo[0].strides = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_summit_offsets.diminfo[0].shape = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_summit_offsets = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1205
 * #            smoothdata = peakdata.copy()
 *         summit_offsets = maxima(peakdata, smoothlen)
 *         if summit_offsets.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             # **failsafe** if no summits, fall back on old approach #
 *             return self.__close_peak(peak_content, peaks, min_length, chrom)
 */
  __pyx_t_4 = ((__pyx_v_summit_offsets->dimensions[0]) == 0);
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":1207
 *         if summit_offsets.shape[0] == 0:
 *             # **failsafe** if no summits, fall back on old approach #
 *             return self.__close_peak(peak_content, peaks, min_length, chrom)             # <<<<<<<<<<<<<<
 *         else:
 *             # remove maxima that occurred in padding
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, NULL)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = ((PyBoolObject *)__pyx_t_6);
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L9;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":1210
 *         else:
 *             # remove maxima that occurred in padding
 *             i = np.searchsorted(summit_offsets, start_boundary)             # <<<<<<<<<<<<<<
 *             j = np.searchsorted(summit_offsets, peak_length + start_boundary, 'right')
 *             summit_offsets = summit_offsets[i:j]
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_15 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyInt_FromLong(__pyx_v_start_boundary); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_summit_offsets));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_summit_offsets));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_summit_offsets));
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_i = __pyx_t_20;

    /* "MACS2/IO/cScoreTrack.pyx":1211
 *             # remove maxima that occurred in padding
 *             i = np.searchsorted(summit_offsets, start_boundary)
 *             j = np.searchsorted(summit_offsets, peak_length + start_boundary, 'right')             # <<<<<<<<<<<<<<
 *             summit_offsets = summit_offsets[i:j]
 * 
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyInt_FromLong(__pyx_v_start_boundary); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_15 = PyNumber_Add(__pyx_v_peak_length, __pyx_t_6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_v_summit_offsets));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_summit_offsets));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_summit_offsets));
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_15);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__right));
    PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_n_s__right));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__right));
    __pyx_t_15 = 0;
    __pyx_t_15 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_15); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_v_j = __pyx_t_20;

    /* "MACS2/IO/cScoreTrack.pyx":1212
 *             i = np.searchsorted(summit_offsets, start_boundary)
 *             j = np.searchsorted(summit_offsets, peak_length + start_boundary, 'right')
 *             summit_offsets = summit_offsets[i:j]             # <<<<<<<<<<<<<<
 * 
 *         summit_offsets = enforce_peakyness(peakdata, summit_offsets)
 */
    __pyx_t_15 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_summit_offsets), __pyx_v_i, __pyx_v_j); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = ((PyArrayObject *)__pyx_t_15);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
      __pyx_t_20 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_20 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_v_summit_offsets, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_summit_offsets.diminfo[0].strides = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_summit_offsets.diminfo[0].shape = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_summit_offsets));
    __pyx_v_summit_offsets = ((PyArrayObject *)__pyx_t_15);
    __pyx_t_15 = 0;
  }
  __pyx_L9:;

  /* "MACS2/IO/cScoreTrack.pyx":1214
 *             summit_offsets = summit_offsets[i:j]
 * 
 *         summit_offsets = enforce_peakyness(peakdata, summit_offsets)             # <<<<<<<<<<<<<<
 *         if summit_offsets.shape[0] == 0:
 *             # **failsafe** if no summits, fall back on old approach #
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__enforce_peakyness); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_peakdata));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_peakdata));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_peakdata));
  __Pyx_INCREF(((PyObject *)__pyx_v_summit_offsets));
  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_summit_offsets));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_summit_offsets));
  __pyx_t_2 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
    __pyx_t_20 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_20 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_v_summit_offsets, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_summit_offsets.diminfo[0].strides = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_summit_offsets.diminfo[0].shape = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_summit_offsets));
  __pyx_v_summit_offsets = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1215
 * 
 *         summit_offsets = enforce_peakyness(peakdata, summit_offsets)
 *         if summit_offsets.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             # **failsafe** if no summits, fall back on old approach #
 *             return self.__close_peak(peak_content, peaks, min_length, chrom)
 */
  __pyx_t_4 = ((__pyx_v_summit_offsets->dimensions[0]) == 0);
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":1217
 *         if summit_offsets.shape[0] == 0:
 *             # **failsafe** if no summits, fall back on old approach #
 *             return self.__close_peak(peak_content, peaks, min_length, chrom)             # <<<<<<<<<<<<<<
 * 
 * #        summit_offsets = enforce_valleys(peakdata, summit_offsets, min_valley = min_valley)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, NULL)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyBoolObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "MACS2/IO/cScoreTrack.pyx":1220
 * 
 * #        summit_offsets = enforce_valleys(peakdata, summit_offsets, min_valley = min_valley)
 *         summit_indices = peakindices[summit_offsets]             # <<<<<<<<<<<<<<
 *         summit_offsets -= start_boundary
 * 
 */
  __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_peakindices), ((PyObject *)__pyx_v_summit_offsets)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_summit_indices = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1221
 * #        summit_offsets = enforce_valleys(peakdata, summit_offsets, min_valley = min_valley)
 *         summit_indices = peakindices[summit_offsets]
 *         summit_offsets -= start_boundary             # <<<<<<<<<<<<<<
 * 
 *         peak_scores  = self.data[chrom][3][ summit_indices ]
 */
  __pyx_t_2 = PyInt_FromLong(__pyx_v_start_boundary); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_summit_offsets), __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
    __pyx_t_20 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_20 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_v_summit_offsets, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_pybuffernd_summit_offsets.diminfo[0].strides = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_summit_offsets.diminfo[0].shape = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_summit_offsets));
  __pyx_v_summit_offsets = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1223
 *         summit_offsets -= start_boundary
 * 
 *         peak_scores  = self.data[chrom][3][ summit_indices ]             # <<<<<<<<<<<<<<
 *         if not (peak_scores > self.cutoff).all():
 *             return self.__close_peak(peak_content, peaks, min_length, chrom)
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_GetItem(__pyx_t_2, __pyx_v_summit_indices); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_peak_scores = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1224
 * 
 *         peak_scores  = self.data[chrom][3][ summit_indices ]
 *         if not (peak_scores > self.cutoff).all():             # <<<<<<<<<<<<<<
 *             return self.__close_peak(peak_content, peaks, min_length, chrom)
 *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):
 */
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_peak_scores, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__all); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_21 = (!__pyx_t_4);
  if (__pyx_t_21) {

    /* "MACS2/IO/cScoreTrack.pyx":1225
 *         peak_scores  = self.data[chrom][3][ summit_indices ]
 *         if not (peak_scores > self.cutoff).all():
 *             return self.__close_peak(peak_content, peaks, min_length, chrom)             # <<<<<<<<<<<<<<
 *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):
 *             if self.scoring_method == 'q':
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, NULL)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyBoolObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "MACS2/IO/cScoreTrack.pyx":1226
 *         if not (peak_scores > self.cutoff).all():
 *             return self.__close_peak(peak_content, peaks, min_length, chrom)
 *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):             # <<<<<<<<<<<<<<
 *             if self.scoring_method == 'q':
 *                 qscore = self.data[chrom][3][ summit_index ]
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_summit_offsets));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_summit_offsets));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_summit_offsets));
  __Pyx_INCREF(__pyx_v_summit_indices);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_summit_indices);
  __Pyx_GIVEREF(__pyx_v_summit_indices);
  __pyx_t_6 = PyObject_Call(__pyx_builtin_zip, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0;
    __pyx_t_22 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_22 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_6 = __pyx_t_22(__pyx_t_2);
      if (unlikely(!__pyx_t_6)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_15 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_14 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_14);
      #else
      __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_13 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_17 = Py_TYPE(__pyx_t_13)->tp_iternext;
      index = 0; __pyx_t_15 = __pyx_t_17(__pyx_t_13); if (unlikely(!__pyx_t_15)) goto __pyx_L14_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_15);
      index = 1; __pyx_t_14 = __pyx_t_17(__pyx_t_13); if (unlikely(!__pyx_t_14)) goto __pyx_L14_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_14);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_17 = NULL;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L15_unpacking_done;
      __pyx_L14_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_17 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L15_unpacking_done:;
    }
    __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_15); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_t_14); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_v_summit_offset = __pyx_t_20;
    __pyx_v_summit_index = __pyx_t_18;

    /* "MACS2/IO/cScoreTrack.pyx":1227
 *             return self.__close_peak(peak_content, peaks, min_length, chrom)
 *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):
 *             if self.scoring_method == 'q':             # <<<<<<<<<<<<<<
 *                 qscore = self.data[chrom][3][ summit_index ]
 *             else:
 */
    __pyx_t_21 = (__pyx_v_self->scoring_method == 'q');
    if (__pyx_t_21) {

      /* "MACS2/IO/cScoreTrack.pyx":1228
 *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):
 *             if self.scoring_method == 'q':
 *                 qscore = self.data[chrom][3][ summit_index ]             # <<<<<<<<<<<<<<
 *             else:
 *                 # if q value is not computed, use -1
 */
      if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_6, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_14, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_v_qscore);
      __pyx_v_qscore = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "MACS2/IO/cScoreTrack.pyx":1231
 *             else:
 *                 # if q value is not computed, use -1
 *                 qscore = -1             # <<<<<<<<<<<<<<
 *             peaks.add( chrom,
 *                        start,
 */
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_XDECREF(__pyx_v_qscore);
      __pyx_v_qscore = __pyx_int_neg_1;
    }
    __pyx_L16:;

    /* "MACS2/IO/cScoreTrack.pyx":1232
 *                 # if q value is not computed, use -1
 *                 qscore = -1
 *             peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                        start,
 *                        end,
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);

    /* "MACS2/IO/cScoreTrack.pyx":1233
 *                 qscore = -1
 *             peaks.add( chrom,
 *                        start,             # <<<<<<<<<<<<<<
 *                        end,
 *                        summit      = start + summit_offset,
 */
    __pyx_t_14 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);

    /* "MACS2/IO/cScoreTrack.pyx":1234
 *             peaks.add( chrom,
 *                        start,
 *                        end,             # <<<<<<<<<<<<<<
 *                        summit      = start + summit_offset,
 *                        peak_score  = self.data[chrom][3][ summit_index ],
 */
    __pyx_t_15 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_chrom));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14);
    __Pyx_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_15);
    __pyx_t_14 = 0;
    __pyx_t_15 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1232
 *                 # if q value is not computed, use -1
 *                 qscore = -1
 *             peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                        start,
 *                        end,
 */
    __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_15));

    /* "MACS2/IO/cScoreTrack.pyx":1235
 *                        start,
 *                        end,
 *                        summit      = start + summit_offset,             # <<<<<<<<<<<<<<
 *                        peak_score  = self.data[chrom][3][ summit_index ],
 *                        pileup      = self.data[chrom][1][ summit_index ], # should be the same as summit_value
 */
    __pyx_t_14 = PyInt_FromLong((__pyx_v_start + __pyx_v_summit_offset)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__summit), __pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1236
 *                        end,
 *                        summit      = start + summit_offset,
 *                        peak_score  = self.data[chrom][3][ summit_index ],             # <<<<<<<<<<<<<<
 *                        pileup      = self.data[chrom][1][ summit_index ], # should be the same as summit_value
 *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_14, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__peak_score), __pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1237
 *                        summit      = start + summit_offset,
 *                        peak_score  = self.data[chrom][3][ summit_index ],
 *                        pileup      = self.data[chrom][1][ summit_index ], # should be the same as summit_value             # <<<<<<<<<<<<<<
 *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
 *                        fold_change = float ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_14, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__pileup), __pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1238
 *                        peak_score  = self.data[chrom][3][ summit_index ],
 *                        pileup      = self.data[chrom][1][ summit_index ], # should be the same as summit_value
 *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),             # <<<<<<<<<<<<<<
 *                        fold_change = float ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
 *                        qscore      = qscore,
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_14, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_t_14); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_14, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_14); if (unlikely((__pyx_t_19 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_11cScoreTrack_get_pscore(__pyx_t_18, __pyx_t_19)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__pscore), __pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1239
 *                        pileup      = self.data[chrom][1][ summit_index ], # should be the same as summit_value
 *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
 *                        fold_change = float ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),             # <<<<<<<<<<<<<<
 *                        qscore      = qscore,
 *                        )
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_14, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_19 = __Pyx_PyObject_AsDouble(__pyx_t_5); if (unlikely(__pyx_t_19 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyFloat_FromDouble(__pyx_t_19); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_14, __pyx_v_summit_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_16 = PyNumber_Add(__pyx_t_1, __pyx_t_14); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_16); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__fold_change), __pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1240
 *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
 *                        fold_change = float ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
 *                        qscore      = qscore,             # <<<<<<<<<<<<<<
 *                        )
 *         # start a new peak
 */
    if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__qscore), __pyx_v_qscore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_13), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1243
 *                        )
 *         # start a new peak
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     cdef long total ( self ):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = ((PyBoolObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = ((PyBoolObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakdata.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakindices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.__close_peak2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakdata.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakindices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_peakdata);
  __Pyx_XDECREF((PyObject *)__pyx_v_peakindices);
  __Pyx_XDECREF((PyObject *)__pyx_v_summit_offsets);
  __Pyx_XDECREF(__pyx_v_peak_length);
  __Pyx_XDECREF(__pyx_v_tsvalue);
  __Pyx_XDECREF(__pyx_v_summit_indices);
  __Pyx_XDECREF(__pyx_v_peak_scores);
  __Pyx_XDECREF(__pyx_v_qscore);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1245
 *         return True
 * 
 *     cdef long total ( self ):             # <<<<<<<<<<<<<<
 *         """Return the number of regions in this object.
 * 
 */

static long __pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_total(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self) {
  long __pyx_v_t;
  PyObject *__pyx_v_chrom = 0;
  long __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  long __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("total", 0);

  /* "MACS2/IO/cScoreTrack.pyx":1253
 *             str chrom
 * 
 *         t = 0             # <<<<<<<<<<<<<<
 *         for chrom in self.data.keys():
 *             t += self.datalength[chrom]
 */
  __pyx_v_t = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1254
 * 
 *         t = 0
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             t += self.datalength[chrom]
 *         return t
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1255
 *         t = 0
 *         for chrom in self.data.keys():
 *             t += self.datalength[chrom]             # <<<<<<<<<<<<<<
 *         return t
 * 
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_6); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_t = __pyx_t_7;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1256
 *         for chrom in self.data.keys():
 *             t += self.datalength[chrom]
 *         return t             # <<<<<<<<<<<<<<
 * 
 *     cpdef tuple call_broadpeaks (self, float lvl1_cutoff=5.0, float lvl2_cutoff=1.0, int min_length=200, int lvl1_max_gap=50, int lvl2_max_gap=400):
 */
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("MACS2.IO.cScoreTrack.scoreTrackII.total", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1258
 *         return t
 * 
 *     cpdef tuple call_broadpeaks (self, float lvl1_cutoff=5.0, float lvl2_cutoff=1.0, int min_length=200, int lvl1_max_gap=50, int lvl2_max_gap=400):             # <<<<<<<<<<<<<<
 *         """This function try to find enriched regions within which,
 *         scores are continuously higher than a given cutoff for level
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_29call_broadpeaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_broadpeaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_broadpeaks *__pyx_optional_args) {
  float __pyx_v_lvl1_cutoff = ((float)5.0);
  float __pyx_v_lvl2_cutoff = ((float)1.0);
  int __pyx_v_min_length = ((int)200);
  int __pyx_v_lvl1_max_gap = ((int)50);
  int __pyx_v_lvl2_max_gap = ((int)400);
  int __pyx_v_i;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_lvl1_peaks = NULL;
  PyObject *__pyx_v_lvl2_peaks = NULL;
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_v_broadpeaks = NULL;
  PyObject *__pyx_v_lvl1peakschrom = NULL;
  PyObject *__pyx_v_lvl2peakschrom = NULL;
  PyObject *__pyx_v_lvl1peakschrom_next = NULL;
  PyObject *__pyx_v_tmppeakset = NULL;
  PyObject *__pyx_v_lvl1 = NULL;
  PyObject *__pyx_v_lvl2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call_broadpeaks", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_lvl1_cutoff = __pyx_optional_args->lvl1_cutoff;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_lvl2_cutoff = __pyx_optional_args->lvl2_cutoff;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_min_length = __pyx_optional_args->min_length;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_lvl1_max_gap = __pyx_optional_args->lvl1_max_gap;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_lvl2_max_gap = __pyx_optional_args->lvl2_max_gap;
            }
          }
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__call_broadpeaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_29call_broadpeaks)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_lvl1_cutoff); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_lvl2_cutoff); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyInt_FromLong(__pyx_v_lvl1_max_gap); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyInt_FromLong(__pyx_v_lvl2_max_gap); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1277
 *             str chrom
 * 
 *         assert lvl1_cutoff > lvl2_cutoff, "level 1 cutoff should be larger than level 2."             # <<<<<<<<<<<<<<
 *         assert lvl1_max_gap < lvl2_max_gap, "level 2 maximum gap should be larger than level 1."
 *         lvl1_peaks = self.call_peaks(cutoff=lvl1_cutoff, min_length=min_length, max_gap=lvl1_max_gap)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_lvl1_cutoff > __pyx_v_lvl2_cutoff))) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_16));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":1278
 * 
 *         assert lvl1_cutoff > lvl2_cutoff, "level 1 cutoff should be larger than level 2."
 *         assert lvl1_max_gap < lvl2_max_gap, "level 2 maximum gap should be larger than level 1."             # <<<<<<<<<<<<<<
 *         lvl1_peaks = self.call_peaks(cutoff=lvl1_cutoff, min_length=min_length, max_gap=lvl1_max_gap)
 *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_lvl1_max_gap < __pyx_v_lvl2_max_gap))) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_17));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":1279
 *         assert lvl1_cutoff > lvl2_cutoff, "level 1 cutoff should be larger than level 2."
 *         assert lvl1_max_gap < lvl2_max_gap, "level 2 maximum gap should be larger than level 1."
 *         lvl1_peaks = self.call_peaks(cutoff=lvl1_cutoff, min_length=min_length, max_gap=lvl1_max_gap)             # <<<<<<<<<<<<<<
 *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap)
 *         chrs = lvl1_peaks.peaks.keys()
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__call_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_lvl1_cutoff); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__cutoff), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__min_length), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyInt_FromLong(__pyx_v_lvl1_max_gap); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__max_gap), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_v_lvl1_peaks = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1280
 *         assert lvl1_max_gap < lvl2_max_gap, "level 2 maximum gap should be larger than level 1."
 *         lvl1_peaks = self.call_peaks(cutoff=lvl1_cutoff, min_length=min_length, max_gap=lvl1_max_gap)
 *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap)             # <<<<<<<<<<<<<<
 *         chrs = lvl1_peaks.peaks.keys()
 *         broadpeaks = BroadPeakIO()
 */
  __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__call_peaks); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_lvl2_cutoff); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__cutoff), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__min_length), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromLong(__pyx_v_lvl2_max_gap); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__max_gap), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_v_lvl2_peaks = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1281
 *         lvl1_peaks = self.call_peaks(cutoff=lvl1_cutoff, min_length=min_length, max_gap=lvl1_max_gap)
 *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap)
 *         chrs = lvl1_peaks.peaks.keys()             # <<<<<<<<<<<<<<
 *         broadpeaks = BroadPeakIO()
 *         # use lvl2_peaks as linking regions between lvl1_peaks
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_lvl1_peaks, __pyx_n_s__peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__keys); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1282
 *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap)
 *         chrs = lvl1_peaks.peaks.keys()
 *         broadpeaks = BroadPeakIO()             # <<<<<<<<<<<<<<
 *         # use lvl2_peaks as linking regions between lvl1_peaks
 *         for chrom in chrs:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__BroadPeakIO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_broadpeaks = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1284
 *         broadpeaks = BroadPeakIO()
 *         # use lvl2_peaks as linking regions between lvl1_peaks
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             lvl1peakschrom = lvl1_peaks.peaks[chrom]
 *             lvl2peakschrom = lvl2_peaks.peaks[chrom]
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_6 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_6)) {
      if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_6)) {
      if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_9(__pyx_t_6);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1285
 *         # use lvl2_peaks as linking regions between lvl1_peaks
 *         for chrom in chrs:
 *             lvl1peakschrom = lvl1_peaks.peaks[chrom]             # <<<<<<<<<<<<<<
 *             lvl2peakschrom = lvl2_peaks.peaks[chrom]
 *             lvl1peakschrom_next = iter(lvl1peakschrom).next
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_lvl1_peaks, __pyx_n_s__peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyObject_GetItem(__pyx_t_1, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_lvl1peakschrom);
    __pyx_v_lvl1peakschrom = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1286
 *         for chrom in chrs:
 *             lvl1peakschrom = lvl1_peaks.peaks[chrom]
 *             lvl2peakschrom = lvl2_peaks.peaks[chrom]             # <<<<<<<<<<<<<<
 *             lvl1peakschrom_next = iter(lvl1peakschrom).next
 *             tmppeakset = []             # to temporarily store lvl1 region inside a lvl2 region
 */
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_lvl2_peaks, __pyx_n_s__peaks); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyObject_GetItem(__pyx_t_7, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_lvl2peakschrom);
    __pyx_v_lvl2peakschrom = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1287
 *             lvl1peakschrom = lvl1_peaks.peaks[chrom]
 *             lvl2peakschrom = lvl2_peaks.peaks[chrom]
 *             lvl1peakschrom_next = iter(lvl1peakschrom).next             # <<<<<<<<<<<<<<
 *             tmppeakset = []             # to temporarily store lvl1 region inside a lvl2 region
 *             # our assumption is lvl1 regions should be included in lvl2 regions
 */
    __pyx_t_1 = PyObject_GetIter(__pyx_v_lvl1peakschrom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_lvl1peakschrom_next);
    __pyx_v_lvl1peakschrom_next = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1288
 *             lvl2peakschrom = lvl2_peaks.peaks[chrom]
 *             lvl1peakschrom_next = iter(lvl1peakschrom).next
 *             tmppeakset = []             # to temporarily store lvl1 region inside a lvl2 region             # <<<<<<<<<<<<<<
 *             # our assumption is lvl1 regions should be included in lvl2 regions
 *             try:
 */
    __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF(((PyObject *)__pyx_v_tmppeakset));
    __pyx_v_tmppeakset = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1290
 *             tmppeakset = []             # to temporarily store lvl1 region inside a lvl2 region
 *             # our assumption is lvl1 regions should be included in lvl2 regions
 *             try:             # <<<<<<<<<<<<<<
 *                 lvl1 = lvl1peakschrom_next()
 *             except StopIteration:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "MACS2/IO/cScoreTrack.pyx":1291
 *             # our assumption is lvl1 regions should be included in lvl2 regions
 *             try:
 *                 lvl1 = lvl1peakschrom_next()             # <<<<<<<<<<<<<<
 *             except StopIteration:
 *                 break
 */
        __pyx_t_7 = PyObject_Call(__pyx_v_lvl1peakschrom_next, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_XDECREF(__pyx_v_lvl1);
        __pyx_v_lvl1 = __pyx_t_7;
        __pyx_t_7 = 0;
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1292
 *             try:
 *                 lvl1 = lvl1peakschrom_next()
 *             except StopIteration:             # <<<<<<<<<<<<<<
 *                 break
 *             for i in range( len(lvl2peakschrom) ):
 */
      __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
      if (__pyx_t_13) {
        __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_5);

        /* "MACS2/IO/cScoreTrack.pyx":1293
 *                 lvl1 = lvl1peakschrom_next()
 *             except StopIteration:
 *                 break             # <<<<<<<<<<<<<<
 *             for i in range( len(lvl2peakschrom) ):
 *                 # for each lvl2 peak, find all lvl1 peaks inside
 */
        goto __pyx_L13_except_break;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L6_exception_handled;
        __pyx_L13_except_break:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L10_try_break;
      }
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L10_try_break:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L4_break;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      __pyx_L12_try_end:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":1294
 *             except StopIteration:
 *                 break
 *             for i in range( len(lvl2peakschrom) ):             # <<<<<<<<<<<<<<
 *                 # for each lvl2 peak, find all lvl1 peaks inside
 *                 lvl2 = lvl2peakschrom[i]
 */
    __pyx_t_14 = PyObject_Length(__pyx_v_lvl2peakschrom); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "MACS2/IO/cScoreTrack.pyx":1296
 *             for i in range( len(lvl2peakschrom) ):
 *                 # for each lvl2 peak, find all lvl1 peaks inside
 *                 lvl2 = lvl2peakschrom[i]             # <<<<<<<<<<<<<<
 *                 try:
 *                     while True:
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_lvl2peakschrom, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_v_lvl2);
      __pyx_v_lvl2 = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1297
 *                 # for each lvl2 peak, find all lvl1 peaks inside
 *                 lvl2 = lvl2peakschrom[i]
 *                 try:             # <<<<<<<<<<<<<<
 *                     while True:
 *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "MACS2/IO/cScoreTrack.pyx":1298
 *                 lvl2 = lvl2peakschrom[i]
 *                 try:
 *                     while True:             # <<<<<<<<<<<<<<
 *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:
 *                             tmppeakset.append(lvl1)
 */
          while (1) {
            if (!1) break;

            /* "MACS2/IO/cScoreTrack.pyx":1299
 *                 try:
 *                     while True:
 *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:             # <<<<<<<<<<<<<<
 *                             tmppeakset.append(lvl1)
 *                         else:
 */
            __pyx_t_5 = PyObject_GetItem(__pyx_v_lvl2, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_1 = PyObject_GetItem(__pyx_v_lvl1, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (__pyx_t_15) {
              __pyx_t_7 = PyObject_GetItem(__pyx_v_lvl1, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_1 = PyObject_GetItem(__pyx_v_lvl2, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __pyx_t_17 = __pyx_t_16;
            } else {
              __pyx_t_17 = __pyx_t_15;
            }
            if (__pyx_t_17) {

              /* "MACS2/IO/cScoreTrack.pyx":1300
 *                     while True:
 *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:
 *                             tmppeakset.append(lvl1)             # <<<<<<<<<<<<<<
 *                         else:
 *                             if tmppeakset:
 */
              __pyx_t_18 = PyList_Append(__pyx_v_tmppeakset, __pyx_v_lvl1); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              goto __pyx_L27;
            }
            /*else*/ {

              /* "MACS2/IO/cScoreTrack.pyx":1302
 *                             tmppeakset.append(lvl1)
 *                         else:
 *                             if tmppeakset:             # <<<<<<<<<<<<<<
 *                                 self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 *                             tmppeakset = []
 */
              __pyx_t_17 = (((PyObject *)__pyx_v_tmppeakset) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_tmppeakset)) != 0);
              if (__pyx_t_17) {

                /* "MACS2/IO/cScoreTrack.pyx":1303
 *                         else:
 *                             if tmppeakset:
 *                                 self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)             # <<<<<<<<<<<<<<
 *                             tmppeakset = []
 *                             break
 */
                __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s____add_broadpeak); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_INCREF(__pyx_v_broadpeaks);
                PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_broadpeaks);
                __Pyx_GIVEREF(__pyx_v_broadpeaks);
                __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
                PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_chrom));
                __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
                __Pyx_INCREF(__pyx_v_lvl2);
                PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_lvl2);
                __Pyx_GIVEREF(__pyx_v_lvl2);
                __Pyx_INCREF(((PyObject *)__pyx_v_tmppeakset));
                PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_tmppeakset));
                __Pyx_GIVEREF(((PyObject *)__pyx_v_tmppeakset));
                __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_7);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                goto __pyx_L28;
              }
              __pyx_L28:;

              /* "MACS2/IO/cScoreTrack.pyx":1304
 *                             if tmppeakset:
 *                                 self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 *                             tmppeakset = []             # <<<<<<<<<<<<<<
 *                             break
 *                         lvl1 = lvl1peakschrom_next()
 */
              __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(((PyObject *)__pyx_v_tmppeakset));
              __pyx_v_tmppeakset = ((PyObject*)__pyx_t_7);
              __pyx_t_7 = 0;

              /* "MACS2/IO/cScoreTrack.pyx":1305
 *                                 self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 *                             tmppeakset = []
 *                             break             # <<<<<<<<<<<<<<
 *                         lvl1 = lvl1peakschrom_next()
 *                 except StopIteration:
 */
              goto __pyx_L26_break;
            }
            __pyx_L27:;

            /* "MACS2/IO/cScoreTrack.pyx":1306
 *                             tmppeakset = []
 *                             break
 *                         lvl1 = lvl1peakschrom_next()             # <<<<<<<<<<<<<<
 *                 except StopIteration:
 *                     if tmppeakset:
 */
            __pyx_t_7 = PyObject_Call(__pyx_v_lvl1peakschrom_next, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_v_lvl1);
            __pyx_v_lvl1 = __pyx_t_7;
            __pyx_t_7 = 0;
          }
          __pyx_L26_break:;
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L24_try_end;
        __pyx_L17_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1307
 *                             break
 *                         lvl1 = lvl1peakschrom_next()
 *                 except StopIteration:             # <<<<<<<<<<<<<<
 *                     if tmppeakset:
 *                         self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 */
        __pyx_t_19 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
        if (__pyx_t_19) {
          __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_5);

          /* "MACS2/IO/cScoreTrack.pyx":1308
 *                         lvl1 = lvl1peakschrom_next()
 *                 except StopIteration:
 *                     if tmppeakset:             # <<<<<<<<<<<<<<
 *                         self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 *                     break
 */
          __pyx_t_17 = (((PyObject *)__pyx_v_tmppeakset) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_tmppeakset)) != 0);
          if (__pyx_t_17) {

            /* "MACS2/IO/cScoreTrack.pyx":1309
 *                 except StopIteration:
 *                     if tmppeakset:
 *                         self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)             # <<<<<<<<<<<<<<
 *                     break
 *         return lvl1_peaks, broadpeaks
 */
            __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s____add_broadpeak); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_v_broadpeaks);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_broadpeaks);
            __Pyx_GIVEREF(__pyx_v_broadpeaks);
            __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_chrom));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
            __Pyx_INCREF(__pyx_v_lvl2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_lvl2);
            __Pyx_GIVEREF(__pyx_v_lvl2);
            __Pyx_INCREF(((PyObject *)__pyx_v_tmppeakset));
            PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_tmppeakset));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_tmppeakset));
            __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            goto __pyx_L31;
          }
          __pyx_L31:;

          /* "MACS2/IO/cScoreTrack.pyx":1310
 *                     if tmppeakset:
 *                         self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 *                     break             # <<<<<<<<<<<<<<
 *         return lvl1_peaks, broadpeaks
 * 
 */
          goto __pyx_L29_except_break;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L18_exception_handled;
          __pyx_L29_except_break:;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L22_try_break;
        }
        __pyx_L19_except_error:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L22_try_break:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        goto __pyx_L16_break;
        __pyx_L18_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        __pyx_L24_try_end:;
      }
    }
    __pyx_L16_break:;
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1311
 *                         self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 *                     break
 *         return lvl1_peaks, broadpeaks             # <<<<<<<<<<<<<<
 * 
 *     def __add_broadpeak (self, bpeaks, str chrom, dict lvl2peak, list lvl1peakset):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_lvl1_peaks);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_lvl1_peaks);
  __Pyx_GIVEREF(__pyx_v_lvl1_peaks);
  __Pyx_INCREF(__pyx_v_broadpeaks);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_broadpeaks);
  __Pyx_GIVEREF(__pyx_v_broadpeaks);
  __pyx_r = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_lvl1_peaks);
  __Pyx_XDECREF(__pyx_v_lvl2_peaks);
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF(__pyx_v_broadpeaks);
  __Pyx_XDECREF(__pyx_v_lvl1peakschrom);
  __Pyx_XDECREF(__pyx_v_lvl2peakschrom);
  __Pyx_XDECREF(__pyx_v_lvl1peakschrom_next);
  __Pyx_XDECREF(__pyx_v_tmppeakset);
  __Pyx_XDECREF(__pyx_v_lvl1);
  __Pyx_XDECREF(__pyx_v_lvl2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_29call_broadpeaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_28call_broadpeaks[] = "This function try to find enriched regions within which,\n        scores are continuously higher than a given cutoff for level\n        1, and link them using the gap above level 2 cutoff with a\n        maximum length of lvl2_max_gap.\n\n        lvl1_cutoff:  cutoff of value at enriched regions, default 5.0.\n        lvl2_cutoff:  cutoff of value at linkage regions, default 1.0.        \n        min_length :  minimum peak length, default 200.\n        lvl1_max_gap   :  maximum gap to merge nearby enriched peaks, default 50.\n        lvl2_max_gap   :  maximum length of linkage regions, default 400.        \n\n        Return both general PeakIO object for highly enriched regions\n        and gapped broad regions in BroadPeakIO.\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_29call_broadpeaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_lvl1_cutoff;
  float __pyx_v_lvl2_cutoff;
  int __pyx_v_min_length;
  int __pyx_v_lvl1_max_gap;
  int __pyx_v_lvl2_max_gap;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_broadpeaks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lvl1_cutoff,&__pyx_n_s__lvl2_cutoff,&__pyx_n_s__min_length,&__pyx_n_s__lvl1_max_gap,&__pyx_n_s__lvl2_max_gap,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl1_cutoff);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl2_cutoff);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_length);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl1_max_gap);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl2_max_gap);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "call_broadpeaks") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_lvl1_cutoff = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_lvl1_cutoff == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "MACS2/IO/cScoreTrack.pyx":1258
 *         return t
 * 
 *     cpdef tuple call_broadpeaks (self, float lvl1_cutoff=5.0, float lvl2_cutoff=1.0, int min_length=200, int lvl1_max_gap=50, int lvl2_max_gap=400):             # <<<<<<<<<<<<<<
 *         """This function try to find enriched regions within which,
 *         scores are continuously higher than a given cutoff for level
 */
      __pyx_v_lvl1_cutoff = ((float)5.0);
    }
    if (values[1]) {
      __pyx_v_lvl2_cutoff = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_lvl2_cutoff == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_lvl2_cutoff = ((float)1.0);
    }
    if (values[2]) {
      __pyx_v_min_length = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_min_length == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_length = ((int)200);
    }
    if (values[3]) {
      __pyx_v_lvl1_max_gap = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_lvl1_max_gap == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_lvl1_max_gap = ((int)50);
    }
    if (values[4]) {
      __pyx_v_lvl2_max_gap = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_lvl2_max_gap == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_lvl2_max_gap = ((int)400);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_broadpeaks", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_28call_broadpeaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_lvl1_cutoff, __pyx_v_lvl2_cutoff, __pyx_v_min_length, __pyx_v_lvl1_max_gap, __pyx_v_lvl2_max_gap);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_28call_broadpeaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, float __pyx_v_lvl1_cutoff, float __pyx_v_lvl2_cutoff, int __pyx_v_min_length, int __pyx_v_lvl1_max_gap, int __pyx_v_lvl2_max_gap) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_broadpeaks __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call_broadpeaks", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 5;
  __pyx_t_2.lvl1_cutoff = __pyx_v_lvl1_cutoff;
  __pyx_t_2.lvl2_cutoff = __pyx_v_lvl2_cutoff;
  __pyx_t_2.min_length = __pyx_v_min_length;
  __pyx_t_2.lvl1_max_gap = __pyx_v_lvl1_max_gap;
  __pyx_t_2.lvl2_max_gap = __pyx_v_lvl2_max_gap;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->call_broadpeaks(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_31__add_broadpeak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_30__add_broadpeak[] = "Internal function to create broad peak.\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_31__add_broadpeak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bpeaks = 0;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_lvl2peak = 0;
  PyObject *__pyx_v_lvl1peakset = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_broadpeak (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__bpeaks,&__pyx_n_s__chrom,&__pyx_n_s__lvl2peak,&__pyx_n_s__lvl1peakset,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bpeaks)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl2peak)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl1peakset)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__add_broadpeak") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_bpeaks = values[0];
    __pyx_v_chrom = ((PyObject*)values[1]);
    __pyx_v_lvl2peak = ((PyObject*)values[2]);
    __pyx_v_lvl1peakset = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.__add_broadpeak", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyString_Type), 1, "chrom", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lvl2peak), (&PyDict_Type), 1, "lvl2peak", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lvl1peakset), (&PyList_Type), 1, "lvl1peakset", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_30__add_broadpeak(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_bpeaks, __pyx_v_chrom, __pyx_v_lvl2peak, __pyx_v_lvl1peakset);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15__add_broadpeak_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15__add_broadpeak_lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15__add_broadpeak_lambda1, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15__add_broadpeak_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_x));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1326
 *         thickEnd   = lvl1peakset[-1]["end"]
 *         blockNum   = int(len(lvl1peakset))
 *         blockSizes = ",".join( map(lambda x:str(x["length"]),lvl1peakset) )             # <<<<<<<<<<<<<<
 *         blockStarts = ",".join( map(lambda x:str(x["start"]-start),lvl1peakset) )
 *         if lvl2peak["start"] != thickStart:
 */

static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda1", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetItem(__pyx_v_x, ((PyObject *)__pyx_n_s__length)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.__add_broadpeak.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15__add_broadpeak_1lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15__add_broadpeak_1lambda2 = {__Pyx_NAMESTR("lambda2"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15__add_broadpeak_1lambda2, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15__add_broadpeak_1lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, ((PyObject *)__pyx_v_x));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1327
 *         blockNum   = int(len(lvl1peakset))
 *         blockSizes = ",".join( map(lambda x:str(x["length"]),lvl1peakset) )
 *         blockStarts = ",".join( map(lambda x:str(x["start"]-start),lvl1peakset) )             # <<<<<<<<<<<<<<
 *         if lvl2peak["start"] != thickStart:
 *             # add 1bp mark for the start of lvl2 peak
 */

static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak *__pyx_cur_scope;
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda2", 0);
  __pyx_outer_scope = (struct __pyx_obj_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetItem(__pyx_v_x, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.__add_broadpeak.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1313
 *         return lvl1_peaks, broadpeaks
 * 
 *     def __add_broadpeak (self, bpeaks, str chrom, dict lvl2peak, list lvl1peakset):             # <<<<<<<<<<<<<<
 *         """Internal function to create broad peak.
 *         """
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_12scoreTrackII_30__add_broadpeak(CYTHON_UNUSED struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_bpeaks, PyObject *__pyx_v_chrom, PyObject *__pyx_v_lvl2peak, PyObject *__pyx_v_lvl1peakset) {
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak *__pyx_cur_scope;
  int __pyx_v_blockNum;
  int __pyx_v_thickStart;
  int __pyx_v_thickEnd;
  int __pyx_v_end;
  PyObject *__pyx_v_blockSizes = 0;
  PyObject *__pyx_v_blockStarts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__add_broadpeak", 0);
  __pyx_cur_scope = (struct __pyx_obj_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak *)__pyx_ptype_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak->tp_new(__pyx_ptype_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);

  /* "MACS2/IO/cScoreTrack.pyx":1321
 *             str blockSizes, blockStarts
 * 
 *         start      = lvl2peak["start"]             # <<<<<<<<<<<<<<
 *         end        = lvl2peak["end"]
 *         thickStart = lvl1peakset[0]["start"]
 */
  if (unlikely(((PyObject *)__pyx_v_lvl2peak) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_lvl2peak), ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_cur_scope->__pyx_v_start = __pyx_t_2;

  /* "MACS2/IO/cScoreTrack.pyx":1322
 * 
 *         start      = lvl2peak["start"]
 *         end        = lvl2peak["end"]             # <<<<<<<<<<<<<<
 *         thickStart = lvl1peakset[0]["start"]
 *         thickEnd   = lvl1peakset[-1]["end"]
 */
  if (unlikely(((PyObject *)__pyx_v_lvl2peak) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_lvl2peak), ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_end = __pyx_t_2;

  /* "MACS2/IO/cScoreTrack.pyx":1323
 *         start      = lvl2peak["start"]
 *         end        = lvl2peak["end"]
 *         thickStart = lvl1peakset[0]["start"]             # <<<<<<<<<<<<<<
 *         thickEnd   = lvl1peakset[-1]["end"]
 *         blockNum   = int(len(lvl1peakset))
 */
  if (unlikely(((PyObject *)__pyx_v_lvl1peakset) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_lvl1peakset), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_thickStart = __pyx_t_2;

  /* "MACS2/IO/cScoreTrack.pyx":1324
 *         end        = lvl2peak["end"]
 *         thickStart = lvl1peakset[0]["start"]
 *         thickEnd   = lvl1peakset[-1]["end"]             # <<<<<<<<<<<<<<
 *         blockNum   = int(len(lvl1peakset))
 *         blockSizes = ",".join( map(lambda x:str(x["length"]),lvl1peakset) )
 */
  if (unlikely(((PyObject *)__pyx_v_lvl1peakset) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_lvl1peakset), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_thickEnd = __pyx_t_2;

  /* "MACS2/IO/cScoreTrack.pyx":1325
 *         thickStart = lvl1peakset[0]["start"]
 *         thickEnd   = lvl1peakset[-1]["end"]
 *         blockNum   = int(len(lvl1peakset))             # <<<<<<<<<<<<<<
 *         blockSizes = ",".join( map(lambda x:str(x["length"]),lvl1peakset) )
 *         blockStarts = ",".join( map(lambda x:str(x["start"]-start),lvl1peakset) )
 */
  if (unlikely(((PyObject *)__pyx_v_lvl1peakset) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = PyList_GET_SIZE(((PyObject *)__pyx_v_lvl1peakset)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_blockNum = ((int)__pyx_t_4);

  /* "MACS2/IO/cScoreTrack.pyx":1326
 *         thickEnd   = lvl1peakset[-1]["end"]
 *         blockNum   = int(len(lvl1peakset))
 *         blockSizes = ",".join( map(lambda x:str(x["length"]),lvl1peakset) )             # <<<<<<<<<<<<<<
 *         blockStarts = ",".join( map(lambda x:str(x["start"]-start),lvl1peakset) )
 *         if lvl2peak["start"] != thickStart:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_18), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15__add_broadpeak_lambda1, 0, __pyx_n_s_19, NULL, __pyx_n_s_20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_lvl1peakset));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_lvl1peakset));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lvl1peakset));
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_blockSizes = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1327
 *         blockNum   = int(len(lvl1peakset))
 *         blockSizes = ",".join( map(lambda x:str(x["length"]),lvl1peakset) )
 *         blockStarts = ",".join( map(lambda x:str(x["start"]-start),lvl1peakset) )             # <<<<<<<<<<<<<<
 *         if lvl2peak["start"] != thickStart:
 *             # add 1bp mark for the start of lvl2 peak
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_18), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15__add_broadpeak_1lambda2, 0, __pyx_n_s_19, ((PyObject*)__pyx_cur_scope), __pyx_n_s_20, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_lvl1peakset));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_lvl1peakset));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lvl1peakset));
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_blockStarts = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1328
 *         blockSizes = ",".join( map(lambda x:str(x["length"]),lvl1peakset) )
 *         blockStarts = ",".join( map(lambda x:str(x["start"]-start),lvl1peakset) )
 *         if lvl2peak["start"] != thickStart:             # <<<<<<<<<<<<<<
 *             # add 1bp mark for the start of lvl2 peak
 *             blockNum += 1
 */
  if (unlikely(((PyObject *)__pyx_v_lvl2peak) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_lvl2peak), ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_thickStart); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "MACS2/IO/cScoreTrack.pyx":1330
 *         if lvl2peak["start"] != thickStart:
 *             # add 1bp mark for the start of lvl2 peak
 *             blockNum += 1             # <<<<<<<<<<<<<<
 *             blockSizes = "1,"+blockSizes
 *             blockStarts = "0,"+blockStarts
 */
    __pyx_v_blockNum = (__pyx_v_blockNum + 1);

    /* "MACS2/IO/cScoreTrack.pyx":1331
 *             # add 1bp mark for the start of lvl2 peak
 *             blockNum += 1
 *             blockSizes = "1,"+blockSizes             # <<<<<<<<<<<<<<
 *             blockStarts = "0,"+blockStarts
 *         if lvl2peak["end"] != thickEnd:
 */
    __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_21), ((PyObject *)__pyx_v_blockSizes)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(((PyObject *)__pyx_v_blockSizes));
    __pyx_v_blockSizes = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1332
 *             blockNum += 1
 *             blockSizes = "1,"+blockSizes
 *             blockStarts = "0,"+blockStarts             # <<<<<<<<<<<<<<
 *         if lvl2peak["end"] != thickEnd:
 *             # add 1bp mark for the end of lvl2 peak
 */
    __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_22), ((PyObject *)__pyx_v_blockStarts)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(((PyObject *)__pyx_v_blockStarts));
    __pyx_v_blockStarts = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "MACS2/IO/cScoreTrack.pyx":1333
 *             blockSizes = "1,"+blockSizes
 *             blockStarts = "0,"+blockStarts
 *         if lvl2peak["end"] != thickEnd:             # <<<<<<<<<<<<<<
 *             # add 1bp mark for the end of lvl2 peak
 *             blockNum += 1
 */
  if (unlikely(((PyObject *)__pyx_v_lvl2peak) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_lvl2peak), ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_thickEnd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {

    /* "MACS2/IO/cScoreTrack.pyx":1335
 *         if lvl2peak["end"] != thickEnd:
 *             # add 1bp mark for the end of lvl2 peak
 *             blockNum += 1             # <<<<<<<<<<<<<<
 *             blockSizes = blockSizes+",1"
 *             blockStarts = blockStarts+","+str(end-start-1)
 */
    __pyx_v_blockNum = (__pyx_v_blockNum + 1);

    /* "MACS2/IO/cScoreTrack.pyx":1336
 *             # add 1bp mark for the end of lvl2 peak
 *             blockNum += 1
 *             blockSizes = blockSizes+",1"             # <<<<<<<<<<<<<<
 *             blockStarts = blockStarts+","+str(end-start-1)
 * 
 */
    __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_v_blockSizes), ((PyObject *)__pyx_kp_s_23)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__pyx_v_blockSizes));
    __pyx_v_blockSizes = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1337
 *             blockNum += 1
 *             blockSizes = blockSizes+",1"
 *             blockStarts = blockStarts+","+str(end-start-1)             # <<<<<<<<<<<<<<
 * 
 *         bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=thickStart, thickEnd=thickEnd,
 */
    __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_v_blockStarts), ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_1 = PyInt_FromLong(((__pyx_v_end - __pyx_cur_scope->__pyx_v_start) - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_t_5), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_blockStarts));
    __pyx_v_blockStarts = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "MACS2/IO/cScoreTrack.pyx":1339
 *             blockStarts = blockStarts+","+str(end-start-1)
 * 
 *         bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=thickStart, thickEnd=thickEnd,             # <<<<<<<<<<<<<<
 *                    blockNum = blockNum, blockSizes = blockSizes, blockStarts = blockStarts)
 *         return bpeaks
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_bpeaks, __pyx_n_s__add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (unlikely(((PyObject *)__pyx_v_lvl2peak) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_lvl2peak), ((PyObject *)__pyx_n_s__score)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__score), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromLong(__pyx_v_thickStart); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__thickStart), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromLong(__pyx_v_thickEnd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__thickEnd), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1340
 * 
 *         bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=thickStart, thickEnd=thickEnd,
 *                    blockNum = blockNum, blockSizes = blockSizes, blockStarts = blockStarts)             # <<<<<<<<<<<<<<
 *         return bpeaks
 * 
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_blockNum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__blockNum), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__blockSizes), ((PyObject *)__pyx_v_blockSizes)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__blockStarts), ((PyObject *)__pyx_v_blockStarts)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1341
 *         bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=thickStart, thickEnd=thickEnd,
 *                    blockNum = blockNum, blockSizes = blockSizes, blockStarts = blockStarts)
 *         return bpeaks             # <<<<<<<<<<<<<<
 * 
 * cdef class TwoConditionScores:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_bpeaks);
  __pyx_r = __pyx_v_bpeaks;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.scoreTrackII.__add_broadpeak", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_blockSizes);
  __Pyx_XDECREF(__pyx_v_blockStarts);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_t1bdg = 0;
  PyObject *__pyx_v_c1bdg = 0;
  PyObject *__pyx_v_t2bdg = 0;
  PyObject *__pyx_v_c2bdg = 0;
  float __pyx_v_cond1_depth;
  float __pyx_v_cond2_depth;
  float __pyx_v_pseudocount;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__t1bdg,&__pyx_n_s__c1bdg,&__pyx_n_s__t2bdg,&__pyx_n_s__c2bdg,&__pyx_n_s__cond1_depth,&__pyx_n_s__cond2_depth,&__pyx_n_s__pseudocount,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__t1bdg)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__c1bdg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__t2bdg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__c2bdg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond1_depth);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond2_depth);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pseudocount);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_t1bdg = values[0];
    __pyx_v_c1bdg = values[1];
    __pyx_v_t2bdg = values[2];
    __pyx_v_c2bdg = values[3];
    if (values[4]) {
      __pyx_v_cond1_depth = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_cond1_depth == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "MACS2/IO/cScoreTrack.pyx":1354
 *         dict pvalue_stat1, pvalue_stat2, pvalue_stat3
 * 
 *     def __init__ (self, t1bdg, c1bdg, t2bdg, c2bdg, float cond1_depth = 1.0, float cond2_depth = 1.0, float pseudocount = 0.01 ):             # <<<<<<<<<<<<<<
 *         self.data = {}           # for each chromosome, there is a l*4
 *                                  # matrix. First column: end position
 */
      __pyx_v_cond1_depth = ((float)1.0);
    }
    if (values[5]) {
      __pyx_v_cond2_depth = __pyx_PyFloat_AsFloat(values[5]); if (unlikely((__pyx_v_cond2_depth == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_cond2_depth = ((float)1.0);
    }
    if (values[6]) {
      __pyx_v_pseudocount = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_pseudocount == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_pseudocount = ((float)0.01);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores___init__(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self), __pyx_v_t1bdg, __pyx_v_c1bdg, __pyx_v_t2bdg, __pyx_v_c2bdg, __pyx_v_cond1_depth, __pyx_v_cond2_depth, __pyx_v_pseudocount);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores___init__(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_t1bdg, PyObject *__pyx_v_c1bdg, PyObject *__pyx_v_t2bdg, PyObject *__pyx_v_c2bdg, float __pyx_v_cond1_depth, float __pyx_v_cond2_depth, float __pyx_v_pseudocount) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "MACS2/IO/cScoreTrack.pyx":1355
 * 
 *     def __init__ (self, t1bdg, c1bdg, t2bdg, c2bdg, float cond1_depth = 1.0, float cond2_depth = 1.0, float pseudocount = 0.01 ):
 *         self.data = {}           # for each chromosome, there is a l*4             # <<<<<<<<<<<<<<
 *                                  # matrix. First column: end position
 *                                  # of a region; Second: treatment
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->data);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->data));
  __pyx_v_self->data = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1363
 *                                  # ratio/fold-enrichment/subtraction
 *                                  # depending on -c setting)
 *         self.datalength = {}             # <<<<<<<<<<<<<<
 *         self.cond1_depth = cond1_depth
 *         self.cond2_depth = cond2_depth
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->datalength);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->datalength));
  __pyx_v_self->datalength = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1364
 *                                  # depending on -c setting)
 *         self.datalength = {}
 *         self.cond1_depth = cond1_depth             # <<<<<<<<<<<<<<
 *         self.cond2_depth = cond2_depth
 *         self.pseudocount = pseudocount
 */
  __pyx_v_self->cond1_depth = __pyx_v_cond1_depth;

  /* "MACS2/IO/cScoreTrack.pyx":1365
 *         self.datalength = {}
 *         self.cond1_depth = cond1_depth
 *         self.cond2_depth = cond2_depth             # <<<<<<<<<<<<<<
 *         self.pseudocount = pseudocount
 *         self.pvalue_stat1 = {}
 */
  __pyx_v_self->cond2_depth = __pyx_v_cond2_depth;

  /* "MACS2/IO/cScoreTrack.pyx":1366
 *         self.cond1_depth = cond1_depth
 *         self.cond2_depth = cond2_depth
 *         self.pseudocount = pseudocount             # <<<<<<<<<<<<<<
 *         self.pvalue_stat1 = {}
 *         self.pvalue_stat2 = {}
 */
  __pyx_v_self->pseudocount = __pyx_v_pseudocount;

  /* "MACS2/IO/cScoreTrack.pyx":1367
 *         self.cond2_depth = cond2_depth
 *         self.pseudocount = pseudocount
 *         self.pvalue_stat1 = {}             # <<<<<<<<<<<<<<
 *         self.pvalue_stat2 = {}
 *         self.t1bdg = t1bdg
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->pvalue_stat1);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->pvalue_stat1));
  __pyx_v_self->pvalue_stat1 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1368
 *         self.pseudocount = pseudocount
 *         self.pvalue_stat1 = {}
 *         self.pvalue_stat2 = {}             # <<<<<<<<<<<<<<
 *         self.t1bdg = t1bdg
 *         self.c1bdg = c1bdg
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->pvalue_stat2);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->pvalue_stat2));
  __pyx_v_self->pvalue_stat2 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1369
 *         self.pvalue_stat1 = {}
 *         self.pvalue_stat2 = {}
 *         self.t1bdg = t1bdg             # <<<<<<<<<<<<<<
 *         self.c1bdg = c1bdg
 *         self.t2bdg = t2bdg
 */
  __Pyx_INCREF(__pyx_v_t1bdg);
  __Pyx_GIVEREF(__pyx_v_t1bdg);
  __Pyx_GOTREF(__pyx_v_self->t1bdg);
  __Pyx_DECREF(__pyx_v_self->t1bdg);
  __pyx_v_self->t1bdg = __pyx_v_t1bdg;

  /* "MACS2/IO/cScoreTrack.pyx":1370
 *         self.pvalue_stat2 = {}
 *         self.t1bdg = t1bdg
 *         self.c1bdg = c1bdg             # <<<<<<<<<<<<<<
 *         self.t2bdg = t2bdg
 *         self.c2bdg = c2bdg
 */
  __Pyx_INCREF(__pyx_v_c1bdg);
  __Pyx_GIVEREF(__pyx_v_c1bdg);
  __Pyx_GOTREF(__pyx_v_self->c1bdg);
  __Pyx_DECREF(__pyx_v_self->c1bdg);
  __pyx_v_self->c1bdg = __pyx_v_c1bdg;

  /* "MACS2/IO/cScoreTrack.pyx":1371
 *         self.t1bdg = t1bdg
 *         self.c1bdg = c1bdg
 *         self.t2bdg = t2bdg             # <<<<<<<<<<<<<<
 *         self.c2bdg = c2bdg
 * 
 */
  __Pyx_INCREF(__pyx_v_t2bdg);
  __Pyx_GIVEREF(__pyx_v_t2bdg);
  __Pyx_GOTREF(__pyx_v_self->t2bdg);
  __Pyx_DECREF(__pyx_v_self->t2bdg);
  __pyx_v_self->t2bdg = __pyx_v_t2bdg;

  /* "MACS2/IO/cScoreTrack.pyx":1372
 *         self.c1bdg = c1bdg
 *         self.t2bdg = t2bdg
 *         self.c2bdg = c2bdg             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_pseudocount( self, float pseudocount ):
 */
  __Pyx_INCREF(__pyx_v_c2bdg);
  __Pyx_GIVEREF(__pyx_v_c2bdg);
  __Pyx_GOTREF(__pyx_v_self->c2bdg);
  __Pyx_DECREF(__pyx_v_self->c2bdg);
  __pyx_v_self->c2bdg = __pyx_v_c2bdg;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1374
 *         self.c2bdg = c2bdg
 * 
 *     cpdef set_pseudocount( self, float pseudocount ):             # <<<<<<<<<<<<<<
 *         self.pseudocount = pseudocount
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_set_pseudocount(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, float __pyx_v_pseudocount, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_pseudocount", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_pseudocount); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_3set_pseudocount)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1375
 * 
 *     cpdef set_pseudocount( self, float pseudocount ):
 *         self.pseudocount = pseudocount             # <<<<<<<<<<<<<<
 * 
 *     cpdef build ( self ):
 */
  __pyx_v_self->pseudocount = __pyx_v_pseudocount;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount); /*proto*/
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount) {
  float __pyx_v_pseudocount;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_pseudocount (wrapper)", 0);
  assert(__pyx_arg_pseudocount); {
    __pyx_v_pseudocount = __pyx_PyFloat_AsFloat(__pyx_arg_pseudocount); if (unlikely((__pyx_v_pseudocount == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_2set_pseudocount(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self), ((float)__pyx_v_pseudocount));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1374
 *         self.c2bdg = c2bdg
 * 
 *     cpdef set_pseudocount( self, float pseudocount ):             # <<<<<<<<<<<<<<
 *         self.pseudocount = pseudocount
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, float __pyx_v_pseudocount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_pseudocount", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->set_pseudocount(__pyx_v_self, __pyx_v_pseudocount, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1377
 *         self.pseudocount = pseudocount
 * 
 *     cpdef build ( self ):             # <<<<<<<<<<<<<<
 *         cdef:
 *             set common_chrs
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_5build(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_build(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_common_chrs = 0;
  PyObject *__pyx_v_chrname = 0;
  PyObject *__pyx_v_cond1_treat_ps = NULL;
  PyObject *__pyx_v_cond1_treat_vs = NULL;
  PyObject *__pyx_v_cond1_control_ps = NULL;
  PyObject *__pyx_v_cond1_control_vs = NULL;
  PyObject *__pyx_v_cond2_treat_ps = NULL;
  PyObject *__pyx_v_cond2_treat_vs = NULL;
  PyObject *__pyx_v_cond2_control_ps = NULL;
  PyObject *__pyx_v_cond2_control_vs = NULL;
  PyObject *__pyx_v_chrom_max_len = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_5build)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1382
 *             str chrname
 *         # common chromosome names
 *         common_chrs = self.get_common_chrs()             # <<<<<<<<<<<<<<
 *         for chrname in common_chrs:
 *             (cond1_treat_ps, cond1_treat_vs) = self.t1bdg.get_data_by_chr(chrname)
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_common_chrs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PySet_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected set, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_common_chrs = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1383
 *         # common chromosome names
 *         common_chrs = self.get_common_chrs()
 *         for chrname in common_chrs:             # <<<<<<<<<<<<<<
 *             (cond1_treat_ps, cond1_treat_vs) = self.t1bdg.get_data_by_chr(chrname)
 *             (cond1_control_ps, cond1_control_vs) = self.c1bdg.get_data_by_chr(chrname)
 */
  __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_common_chrs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = Py_TYPE(__pyx_t_2)->tp_iternext;
  for (;;) {
    {
      __pyx_t_1 = __pyx_t_3(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrname));
    __pyx_v_chrname = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1384
 *         common_chrs = self.get_common_chrs()
 *         for chrname in common_chrs:
 *             (cond1_treat_ps, cond1_treat_vs) = self.t1bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
 *             (cond1_control_ps, cond1_control_vs) = self.c1bdg.get_data_by_chr(chrname)
 *             (cond2_treat_ps, cond2_treat_vs) = self.t2bdg.get_data_by_chr(chrname)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->t1bdg, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrname));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_chrname));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrname));
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_cond1_treat_ps);
    __pyx_v_cond1_treat_ps = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_cond1_treat_vs);
    __pyx_v_cond1_treat_vs = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1385
 *         for chrname in common_chrs:
 *             (cond1_treat_ps, cond1_treat_vs) = self.t1bdg.get_data_by_chr(chrname)
 *             (cond1_control_ps, cond1_control_vs) = self.c1bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
 *             (cond2_treat_ps, cond2_treat_vs) = self.t2bdg.get_data_by_chr(chrname)
 *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self->c1bdg, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrname));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chrname));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrname));
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_cond1_control_ps);
    __pyx_v_cond1_control_ps = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_cond1_control_vs);
    __pyx_v_cond1_control_vs = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1386
 *             (cond1_treat_ps, cond1_treat_vs) = self.t1bdg.get_data_by_chr(chrname)
 *             (cond1_control_ps, cond1_control_vs) = self.c1bdg.get_data_by_chr(chrname)
 *             (cond2_treat_ps, cond2_treat_vs) = self.t2bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
 *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)
 *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->t2bdg, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrname));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_chrname));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrname));
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L10_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_cond2_treat_ps);
    __pyx_v_cond2_treat_ps = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_cond2_treat_vs);
    __pyx_v_cond2_treat_vs = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1387
 *             (cond1_control_ps, cond1_control_vs) = self.c1bdg.get_data_by_chr(chrname)
 *             (cond2_treat_ps, cond2_treat_vs) = self.t2bdg.get_data_by_chr(chrname)
 *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
 *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
 *                             len(cond2_treat_ps) + len(cond2_control_ps)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->c2bdg, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrname));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_chrname));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrname));
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L12_unpacking_done;
      __pyx_L11_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L12_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_cond2_control_ps);
    __pyx_v_cond2_control_ps = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_cond2_control_vs);
    __pyx_v_cond2_control_vs = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1388
 *             (cond2_treat_ps, cond2_treat_vs) = self.t2bdg.get_data_by_chr(chrname)
 *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)
 *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\             # <<<<<<<<<<<<<<
 *                             len(cond2_treat_ps) + len(cond2_control_ps)
 *             self.add_chromosome( chrname, chrom_max_len )
 */
    __pyx_t_8 = PyObject_Length(__pyx_v_cond1_treat_ps); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = PyObject_Length(__pyx_v_cond1_control_ps); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "MACS2/IO/cScoreTrack.pyx":1389
 *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)
 *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
 *                             len(cond2_treat_ps) + len(cond2_control_ps)             # <<<<<<<<<<<<<<
 *             self.add_chromosome( chrname, chrom_max_len )
 *             self.build_chromosome( chrname,
 */
    __pyx_t_10 = PyObject_Length(__pyx_v_cond2_treat_ps); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = PyObject_Length(__pyx_v_cond2_control_ps); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyInt_FromSsize_t((((__pyx_t_8 + __pyx_t_9) + __pyx_t_10) + __pyx_t_11)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_chrom_max_len);
    __pyx_v_chrom_max_len = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1390
 *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
 *                             len(cond2_treat_ps) + len(cond2_control_ps)
 *             self.add_chromosome( chrname, chrom_max_len )             # <<<<<<<<<<<<<<
 *             self.build_chromosome( chrname,
 *                                    cond1_treat_ps, cond1_control_ps,
 */
    __pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_v_chrom_max_len); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->add_chromosome(__pyx_v_self, __pyx_v_chrname, __pyx_t_12); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1395
 *                                    cond2_treat_ps, cond2_control_ps,
 *                                    cond1_treat_vs, cond1_control_vs,
 *                                    cond2_treat_vs, cond2_control_vs )             # <<<<<<<<<<<<<<
 * 
 *     cdef build_chromosome( self, chrname,
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->build_chromosome(__pyx_v_self, ((PyObject *)__pyx_v_chrname), __pyx_v_cond1_treat_ps, __pyx_v_cond1_control_ps, __pyx_v_cond2_treat_ps, __pyx_v_cond2_control_ps, __pyx_v_cond1_treat_vs, __pyx_v_cond1_control_vs, __pyx_v_cond2_treat_vs, __pyx_v_cond2_control_vs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.build", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_common_chrs);
  __Pyx_XDECREF(__pyx_v_chrname);
  __Pyx_XDECREF(__pyx_v_cond1_treat_ps);
  __Pyx_XDECREF(__pyx_v_cond1_treat_vs);
  __Pyx_XDECREF(__pyx_v_cond1_control_ps);
  __Pyx_XDECREF(__pyx_v_cond1_control_vs);
  __Pyx_XDECREF(__pyx_v_cond2_treat_ps);
  __Pyx_XDECREF(__pyx_v_cond2_treat_vs);
  __Pyx_XDECREF(__pyx_v_cond2_control_ps);
  __Pyx_XDECREF(__pyx_v_cond2_control_vs);
  __Pyx_XDECREF(__pyx_v_chrom_max_len);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_5build(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_5build(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_4build(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1377
 *         self.pseudocount = pseudocount
 * 
 *     cpdef build ( self ):             # <<<<<<<<<<<<<<
 *         cdef:
 *             set common_chrs
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_4build(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->build(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.build", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1397
 *                                    cond2_treat_vs, cond2_control_vs )
 * 
 *     cdef build_chromosome( self, chrname,             # <<<<<<<<<<<<<<
 *                            cond1_treat_ps, cond1_control_ps,
 *                            cond2_treat_ps, cond2_control_ps,
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_build_chromosome(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chrname, PyObject *__pyx_v_cond1_treat_ps, PyObject *__pyx_v_cond1_control_ps, PyObject *__pyx_v_cond2_treat_ps, PyObject *__pyx_v_cond2_control_ps, PyObject *__pyx_v_cond1_treat_vs, PyObject *__pyx_v_cond1_control_vs, PyObject *__pyx_v_cond2_treat_vs, PyObject *__pyx_v_cond2_control_vs) {
  PyObject *__pyx_v_c1tpn = NULL;
  PyObject *__pyx_v_c1cpn = NULL;
  PyObject *__pyx_v_c2tpn = NULL;
  PyObject *__pyx_v_c2cpn = NULL;
  PyObject *__pyx_v_c1tvn = NULL;
  PyObject *__pyx_v_c1cvn = NULL;
  PyObject *__pyx_v_c2tvn = NULL;
  PyObject *__pyx_v_c2cvn = NULL;
  PyObject *__pyx_v_pre_p = NULL;
  PyObject *__pyx_v_c1tp = NULL;
  PyObject *__pyx_v_c1tv = NULL;
  PyObject *__pyx_v_c1cp = NULL;
  PyObject *__pyx_v_c1cv = NULL;
  PyObject *__pyx_v_c2tp = NULL;
  PyObject *__pyx_v_c2tv = NULL;
  PyObject *__pyx_v_c2cp = NULL;
  PyObject *__pyx_v_c2cv = NULL;
  PyObject *__pyx_v_minp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  float __pyx_t_12;
  float __pyx_t_13;
  float __pyx_t_14;
  float __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_chromosome", 0);

  /* "MACS2/IO/cScoreTrack.pyx":1404
 * 
 * 
 *         c1tpn = iter(cond1_treat_ps).next             # <<<<<<<<<<<<<<
 *         c1cpn = iter(cond1_control_ps).next
 *         c2tpn = iter(cond2_treat_ps).next
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_cond1_treat_ps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c1tpn = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1405
 * 
 *         c1tpn = iter(cond1_treat_ps).next
 *         c1cpn = iter(cond1_control_ps).next             # <<<<<<<<<<<<<<
 *         c2tpn = iter(cond2_treat_ps).next
 *         c2cpn = iter(cond2_control_ps).next
 */
  __pyx_t_2 = PyObject_GetIter(__pyx_v_cond1_control_ps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c1cpn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1406
 *         c1tpn = iter(cond1_treat_ps).next
 *         c1cpn = iter(cond1_control_ps).next
 *         c2tpn = iter(cond2_treat_ps).next             # <<<<<<<<<<<<<<
 *         c2cpn = iter(cond2_control_ps).next
 *         c1tvn = iter(cond1_treat_vs).next
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_cond2_treat_ps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c2tpn = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1407
 *         c1cpn = iter(cond1_control_ps).next
 *         c2tpn = iter(cond2_treat_ps).next
 *         c2cpn = iter(cond2_control_ps).next             # <<<<<<<<<<<<<<
 *         c1tvn = iter(cond1_treat_vs).next
 *         c1cvn = iter(cond1_control_vs).next
 */
  __pyx_t_2 = PyObject_GetIter(__pyx_v_cond2_control_ps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c2cpn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1408
 *         c2tpn = iter(cond2_treat_ps).next
 *         c2cpn = iter(cond2_control_ps).next
 *         c1tvn = iter(cond1_treat_vs).next             # <<<<<<<<<<<<<<
 *         c1cvn = iter(cond1_control_vs).next
 *         c2tvn = iter(cond2_treat_vs).next
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_cond1_treat_vs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c1tvn = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1409
 *         c2cpn = iter(cond2_control_ps).next
 *         c1tvn = iter(cond1_treat_vs).next
 *         c1cvn = iter(cond1_control_vs).next             # <<<<<<<<<<<<<<
 *         c2tvn = iter(cond2_treat_vs).next
 *         c2cvn = iter(cond2_control_vs).next
 */
  __pyx_t_2 = PyObject_GetIter(__pyx_v_cond1_control_vs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c1cvn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1410
 *         c1tvn = iter(cond1_treat_vs).next
 *         c1cvn = iter(cond1_control_vs).next
 *         c2tvn = iter(cond2_treat_vs).next             # <<<<<<<<<<<<<<
 *         c2cvn = iter(cond2_control_vs).next
 * 
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_cond2_treat_vs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c2tvn = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1411
 *         c1cvn = iter(cond1_control_vs).next
 *         c2tvn = iter(cond2_treat_vs).next
 *         c2cvn = iter(cond2_control_vs).next             # <<<<<<<<<<<<<<
 * 
 *         pre_p = 0
 */
  __pyx_t_2 = PyObject_GetIter(__pyx_v_cond2_control_vs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c2cvn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1413
 *         c2cvn = iter(cond2_control_vs).next
 * 
 *         pre_p = 0             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_pre_p = __pyx_int_0;

  /* "MACS2/IO/cScoreTrack.pyx":1415
 *         pre_p = 0
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             c1tp = c1tpn()
 *             c1tv = c1tvn()
 */
  {
    __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:*/ {

      /* "MACS2/IO/cScoreTrack.pyx":1416
 * 
 *         try:
 *             c1tp = c1tpn()             # <<<<<<<<<<<<<<
 *             c1tv = c1tvn()
 * 
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c1tpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c1tp = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1417
 *         try:
 *             c1tp = c1tpn()
 *             c1tv = c1tvn()             # <<<<<<<<<<<<<<
 * 
 *             c1cp = c1cpn()
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c1tvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c1tv = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1419
 *             c1tv = c1tvn()
 * 
 *             c1cp = c1cpn()             # <<<<<<<<<<<<<<
 *             c1cv = c1cvn()
 * 
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c1cpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c1cp = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1420
 * 
 *             c1cp = c1cpn()
 *             c1cv = c1cvn()             # <<<<<<<<<<<<<<
 * 
 *             c2tp = c2tpn()
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c1cvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c1cv = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1422
 *             c1cv = c1cvn()
 * 
 *             c2tp = c2tpn()             # <<<<<<<<<<<<<<
 *             c2tv = c2tvn()
 * 
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c2tpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c2tp = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1423
 * 
 *             c2tp = c2tpn()
 *             c2tv = c2tvn()             # <<<<<<<<<<<<<<
 * 
 *             c2cp = c2cpn()
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c2tvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c2tv = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1425
 *             c2tv = c2tvn()
 * 
 *             c2cp = c2cpn()             # <<<<<<<<<<<<<<
 *             c2cv = c2cvn()
 * 
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c2cpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c2cp = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1426
 * 
 *             c2cp = c2cpn()
 *             c2cv = c2cvn()             # <<<<<<<<<<<<<<
 * 
 *             while True:
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c2cvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c2cv = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1428
 *             c2cv = c2cvn()
 * 
 *             while True:             # <<<<<<<<<<<<<<
 *                 minp = min(c1tp, c1cp, c2tp, c2cp)
 *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
 */
      while (1) {
        if (!1) break;

        /* "MACS2/IO/cScoreTrack.pyx":1429
 * 
 *             while True:
 *                 minp = min(c1tp, c1cp, c2tp, c2cp)             # <<<<<<<<<<<<<<
 *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
 *                 pre_p = minp
 */
        __Pyx_INCREF(__pyx_v_c1cp);
        __pyx_t_1 = __pyx_v_c1cp;
        __Pyx_INCREF(__pyx_v_c2tp);
        __pyx_t_2 = __pyx_v_c2tp;
        __Pyx_INCREF(__pyx_v_c2cp);
        __pyx_t_6 = __pyx_v_c2cp;
        __Pyx_INCREF(__pyx_v_c1tp);
        __pyx_t_7 = __pyx_v_c1tp;
        __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_8 = __pyx_t_1;
        } else {
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_8 = __pyx_t_7;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_7 = __pyx_t_8;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_8 = __pyx_t_2;
        } else {
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_8 = __pyx_t_7;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_7 = __pyx_t_8;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_8 = __pyx_t_6;
        } else {
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_8 = __pyx_t_7;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __pyx_t_8;
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_v_minp);
        __pyx_v_minp = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1430
 *             while True:
 *                 minp = min(c1tp, c1cp, c2tp, c2cp)
 *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )             # <<<<<<<<<<<<<<
 *                 pre_p = minp
 *                 if c1tp == minp:
 */
        if (!(likely(PyString_CheckExact(__pyx_v_chrname))||((__pyx_v_chrname) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_v_chrname)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_pre_p); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_v_c1tv); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_v_c1cv); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_v_c2tv); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_15 = __pyx_PyFloat_AsFloat(__pyx_v_c2cv); if (unlikely((__pyx_t_15 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->add(__pyx_v_self, ((PyObject*)__pyx_v_chrname), __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1431
 *                 minp = min(c1tp, c1cp, c2tp, c2cp)
 *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
 *                 pre_p = minp             # <<<<<<<<<<<<<<
 *                 if c1tp == minp:
 *                     c1tp = c1tpn()
 */
        __Pyx_INCREF(__pyx_v_minp);
        __Pyx_DECREF(__pyx_v_pre_p);
        __pyx_v_pre_p = __pyx_v_minp;

        /* "MACS2/IO/cScoreTrack.pyx":1432
 *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
 *                 pre_p = minp
 *                 if c1tp == minp:             # <<<<<<<<<<<<<<
 *                     c1tp = c1tpn()
 *                     c1tv = c1tvn()
 */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_c1tp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_10) {

          /* "MACS2/IO/cScoreTrack.pyx":1433
 *                 pre_p = minp
 *                 if c1tp == minp:
 *                     c1tp = c1tpn()             # <<<<<<<<<<<<<<
 *                     c1tv = c1tvn()
 *                 if c1cp == minp:
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c1tpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c1tp);
          __pyx_v_c1tp = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":1434
 *                 if c1tp == minp:
 *                     c1tp = c1tpn()
 *                     c1tv = c1tvn()             # <<<<<<<<<<<<<<
 *                 if c1cp == minp:
 *                     c1cp = c1cpn()
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c1tvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c1tv);
          __pyx_v_c1tv = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L13;
        }
        __pyx_L13:;

        /* "MACS2/IO/cScoreTrack.pyx":1435
 *                     c1tp = c1tpn()
 *                     c1tv = c1tvn()
 *                 if c1cp == minp:             # <<<<<<<<<<<<<<
 *                     c1cp = c1cpn()
 *                     c1cv = c1cvn()
 */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_c1cp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_10) {

          /* "MACS2/IO/cScoreTrack.pyx":1436
 *                     c1tv = c1tvn()
 *                 if c1cp == minp:
 *                     c1cp = c1cpn()             # <<<<<<<<<<<<<<
 *                     c1cv = c1cvn()
 *                 if c2tp == minp:
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c1cpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c1cp);
          __pyx_v_c1cp = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":1437
 *                 if c1cp == minp:
 *                     c1cp = c1cpn()
 *                     c1cv = c1cvn()             # <<<<<<<<<<<<<<
 *                 if c2tp == minp:
 *                     c2tp = c2tpn()
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c1cvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c1cv);
          __pyx_v_c1cv = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "MACS2/IO/cScoreTrack.pyx":1438
 *                     c1cp = c1cpn()
 *                     c1cv = c1cvn()
 *                 if c2tp == minp:             # <<<<<<<<<<<<<<
 *                     c2tp = c2tpn()
 *                     c2tv = c2tvn()
 */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_c2tp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_10) {

          /* "MACS2/IO/cScoreTrack.pyx":1439
 *                     c1cv = c1cvn()
 *                 if c2tp == minp:
 *                     c2tp = c2tpn()             # <<<<<<<<<<<<<<
 *                     c2tv = c2tvn()
 *                 if c2cp == minp:
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c2tpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c2tp);
          __pyx_v_c2tp = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":1440
 *                 if c2tp == minp:
 *                     c2tp = c2tpn()
 *                     c2tv = c2tvn()             # <<<<<<<<<<<<<<
 *                 if c2cp == minp:
 *                     c2cp = c2cpn()
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c2tvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c2tv);
          __pyx_v_c2tv = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L15;
        }
        __pyx_L15:;

        /* "MACS2/IO/cScoreTrack.pyx":1441
 *                     c2tp = c2tpn()
 *                     c2tv = c2tvn()
 *                 if c2cp == minp:             # <<<<<<<<<<<<<<
 *                     c2cp = c2cpn()
 *                     c2cv = c2cvn()
 */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_c2cp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_10) {

          /* "MACS2/IO/cScoreTrack.pyx":1442
 *                     c2tv = c2tvn()
 *                 if c2cp == minp:
 *                     c2cp = c2cpn()             # <<<<<<<<<<<<<<
 *                     c2cv = c2cvn()
 *         except StopIteration:
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c2cpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c2cp);
          __pyx_v_c2cp = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":1443
 *                 if c2cp == minp:
 *                     c2cp = c2cpn()
 *                     c2cv = c2cvn()             # <<<<<<<<<<<<<<
 *         except StopIteration:
 *             # meet the end of either bedGraphTrackI, simply exit
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c2cvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c2cv);
          __pyx_v_c2cv = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L16;
        }
        __pyx_L16:;
      }
    }
    __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_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1444
 *                     c2cp = c2cpn()
 *                     c2cv = c2cvn()
 *         except StopIteration:             # <<<<<<<<<<<<<<
 *             # meet the end of either bedGraphTrackI, simply exit
 *             pass
 */
    __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
    if (__pyx_t_11) {
      PyErr_Restore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    __pyx_L10_try_end:;
  }

  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.build_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c1tpn);
  __Pyx_XDECREF(__pyx_v_c1cpn);
  __Pyx_XDECREF(__pyx_v_c2tpn);
  __Pyx_XDECREF(__pyx_v_c2cpn);
  __Pyx_XDECREF(__pyx_v_c1tvn);
  __Pyx_XDECREF(__pyx_v_c1cvn);
  __Pyx_XDECREF(__pyx_v_c2tvn);
  __Pyx_XDECREF(__pyx_v_c2cvn);
  __Pyx_XDECREF(__pyx_v_pre_p);
  __Pyx_XDECREF(__pyx_v_c1tp);
  __Pyx_XDECREF(__pyx_v_c1tv);
  __Pyx_XDECREF(__pyx_v_c1cp);
  __Pyx_XDECREF(__pyx_v_c1cv);
  __Pyx_XDECREF(__pyx_v_c2tp);
  __Pyx_XDECREF(__pyx_v_c2tv);
  __Pyx_XDECREF(__pyx_v_c2cp);
  __Pyx_XDECREF(__pyx_v_c2cv);
  __Pyx_XDECREF(__pyx_v_minp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_7get_common_chrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_7get_common_chrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_common_chrs (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_6get_common_chrs(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_15get_common_chrs_lambda3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_15get_common_chrs_lambda3 = {__Pyx_NAMESTR("lambda3"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_15get_common_chrs_lambda3, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_15get_common_chrs_lambda3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,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__x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda3", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda3") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __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_x = values[0];
    __pyx_v_y = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda3", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.get_common_chrs.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self, __pyx_v_x, __pyx_v_y);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1453
 *         t2chrs = self.t2bdg.get_chr_names()
 *         c2chrs = self.c2bdg.get_chr_names()
 *         common = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))             # <<<<<<<<<<<<<<
 *         return common
 * 
 */

static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda3", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__intersection); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.get_common_chrs.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1448
 *             pass
 * 
 *     def get_common_chrs ( self ):             # <<<<<<<<<<<<<<
 *         t1chrs = self.t1bdg.get_chr_names()
 *         c1chrs = self.c1bdg.get_chr_names()
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_6get_common_chrs(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self) {
  PyObject *__pyx_v_t1chrs = NULL;
  PyObject *__pyx_v_c1chrs = NULL;
  PyObject *__pyx_v_t2chrs = NULL;
  PyObject *__pyx_v_c2chrs = NULL;
  PyObject *__pyx_v_common = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_common_chrs", 0);

  /* "MACS2/IO/cScoreTrack.pyx":1449
 * 
 *     def get_common_chrs ( self ):
 *         t1chrs = self.t1bdg.get_chr_names()             # <<<<<<<<<<<<<<
 *         c1chrs = self.c1bdg.get_chr_names()
 *         t2chrs = self.t2bdg.get_chr_names()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->t1bdg, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_t1chrs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1450
 *     def get_common_chrs ( self ):
 *         t1chrs = self.t1bdg.get_chr_names()
 *         c1chrs = self.c1bdg.get_chr_names()             # <<<<<<<<<<<<<<
 *         t2chrs = self.t2bdg.get_chr_names()
 *         c2chrs = self.c2bdg.get_chr_names()
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->c1bdg, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c1chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1451
 *         t1chrs = self.t1bdg.get_chr_names()
 *         c1chrs = self.c1bdg.get_chr_names()
 *         t2chrs = self.t2bdg.get_chr_names()             # <<<<<<<<<<<<<<
 *         c2chrs = self.c2bdg.get_chr_names()
 *         common = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->t2bdg, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_t2chrs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1452
 *         c1chrs = self.c1bdg.get_chr_names()
 *         t2chrs = self.t2bdg.get_chr_names()
 *         c2chrs = self.c2bdg.get_chr_names()             # <<<<<<<<<<<<<<
 *         common = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))
 *         return common
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->c2bdg, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c2chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1453
 *         t2chrs = self.t2bdg.get_chr_names()
 *         c2chrs = self.c2bdg.get_chr_names()
 *         common = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))             # <<<<<<<<<<<<<<
 *         return common
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_15get_common_chrs_lambda3, 0, __pyx_n_s_24, NULL, __pyx_n_s_20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_t1chrs);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_t1chrs);
  __Pyx_GIVEREF(__pyx_v_t1chrs);
  __Pyx_INCREF(__pyx_v_c1chrs);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_c1chrs);
  __Pyx_GIVEREF(__pyx_v_c1chrs);
  __Pyx_INCREF(__pyx_v_t2chrs);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_t2chrs);
  __Pyx_GIVEREF(__pyx_v_t2chrs);
  __Pyx_INCREF(__pyx_v_c2chrs);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_c2chrs);
  __Pyx_GIVEREF(__pyx_v_c2chrs);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_reduce, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_common = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1454
 *         c2chrs = self.c2bdg.get_chr_names()
 *         common = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))
 *         return common             # <<<<<<<<<<<<<<
 * 
 *     cdef add_chromosome ( self, str chrom, int chrom_max_len ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_common);
  __pyx_r = __pyx_v_common;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.get_common_chrs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_t1chrs);
  __Pyx_XDECREF(__pyx_v_c1chrs);
  __Pyx_XDECREF(__pyx_v_t2chrs);
  __Pyx_XDECREF(__pyx_v_c2chrs);
  __Pyx_XDECREF(__pyx_v_common);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1456
 *         return common
 * 
 *     cdef add_chromosome ( self, str chrom, int chrom_max_len ):             # <<<<<<<<<<<<<<
 *         """
 *         chrom: chromosome name
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_add_chromosome(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chrom, int __pyx_v_chrom_max_len) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_chromosome", 0);

  /* "MACS2/IO/cScoreTrack.pyx":1462
 * 
 *         """
 *         if not self.data.has_key(chrom):             # <<<<<<<<<<<<<<
 *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->data), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "MACS2/IO/cScoreTrack.pyx":1463
 *         """
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos             # <<<<<<<<<<<<<<
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t2 vs c2
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__int32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1464
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1             # <<<<<<<<<<<<<<
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t2 vs c2
 *                                  np.zeros( chrom_max_len, dtype="float32" )] # LLR t1 vs t2
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1465
 *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t2 vs c2             # <<<<<<<<<<<<<<
 *                                  np.zeros( chrom_max_len, dtype="float32" )] # LLR t1 vs t2
 *                                  #np.zeros( chrom_max_len, dtype="float32" )] # LLR t2 vs t1
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1466
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t2 vs c2
 *                                  np.zeros( chrom_max_len, dtype="float32" )] # LLR t1 vs t2             # <<<<<<<<<<<<<<
 *                                  #np.zeros( chrom_max_len, dtype="float32" )] # LLR t2 vs t1
 *             self.datalength[chrom] = 0
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_3, 3, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1463
 *         """
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos             # <<<<<<<<<<<<<<
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1
 *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t2 vs c2
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1468
 *                                  np.zeros( chrom_max_len, dtype="float32" )] # LLR t1 vs t2
 *                                  #np.zeros( chrom_max_len, dtype="float32" )] # LLR t2 vs t1
 *             self.datalength[chrom] = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef add (self, str chromosome, int endpos, float t1, float c1, float t2, float c2):
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1470
 *             self.datalength[chrom] = 0
 * 
 *     cdef add (self, str chromosome, int endpos, float t1, float c1, float t2, float c2):             # <<<<<<<<<<<<<<
 *         """Add a chr-endpos-sample-control block into data
 *         dictionary.
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_add(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_v_endpos, float __pyx_v_t1, float __pyx_v_c1, float __pyx_v_t2, float __pyx_v_c2) {
  int __pyx_v_i;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 0);

  /* "MACS2/IO/cScoreTrack.pyx":1482
 *         """
 *         cdef int i
 *         i = self.datalength[chromosome]             # <<<<<<<<<<<<<<
 *         c = self.data[chromosome]
 *         c[0][ i ] = endpos
 */
  if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_i = __pyx_t_2;

  /* "MACS2/IO/cScoreTrack.pyx":1483
 *         cdef int i
 *         i = self.datalength[chromosome]
 *         c = self.data[chromosome]             # <<<<<<<<<<<<<<
 *         c[0][ i ] = endpos
 *         c[1][ i ] = logLR( (t1+self.pseudocount)*self.cond1_depth, (c1+self.pseudocount)*self.cond1_depth )
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1484
 *         i = self.datalength[chromosome]
 *         c = self.data[chromosome]
 *         c[0][ i ] = endpos             # <<<<<<<<<<<<<<
 *         c[1][ i ] = logLR( (t1+self.pseudocount)*self.cond1_depth, (c1+self.pseudocount)*self.cond1_depth )
 *         c[2][ i ] = logLR( (t2+self.pseudocount)*self.cond2_depth, (c2+self.pseudocount)*self.cond2_depth )
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_endpos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1485
 *         c = self.data[chromosome]
 *         c[0][ i ] = endpos
 *         c[1][ i ] = logLR( (t1+self.pseudocount)*self.cond1_depth, (c1+self.pseudocount)*self.cond1_depth )             # <<<<<<<<<<<<<<
 *         c[2][ i ] = logLR( (t2+self.pseudocount)*self.cond2_depth, (c2+self.pseudocount)*self.cond2_depth )
 *         c[3][ i ] = logLR( (t1+self.pseudocount)*self.cond1_depth, (t2+self.pseudocount)*self.cond2_depth )
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_11cScoreTrack_logLR(((__pyx_v_t1 + __pyx_v_self->pseudocount) * __pyx_v_self->cond1_depth), ((__pyx_v_c1 + __pyx_v_self->pseudocount) * __pyx_v_self->cond1_depth))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1486
 *         c[0][ i ] = endpos
 *         c[1][ i ] = logLR( (t1+self.pseudocount)*self.cond1_depth, (c1+self.pseudocount)*self.cond1_depth )
 *         c[2][ i ] = logLR( (t2+self.pseudocount)*self.cond2_depth, (c2+self.pseudocount)*self.cond2_depth )             # <<<<<<<<<<<<<<
 *         c[3][ i ] = logLR( (t1+self.pseudocount)*self.cond1_depth, (t2+self.pseudocount)*self.cond2_depth )
 *         #c[4][ i ] = logLR( t2+self.pseudocount, t1+self.pseudocount )
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_11cScoreTrack_logLR(((__pyx_v_t2 + __pyx_v_self->pseudocount) * __pyx_v_self->cond2_depth), ((__pyx_v_c2 + __pyx_v_self->pseudocount) * __pyx_v_self->cond2_depth))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1487
 *         c[1][ i ] = logLR( (t1+self.pseudocount)*self.cond1_depth, (c1+self.pseudocount)*self.cond1_depth )
 *         c[2][ i ] = logLR( (t2+self.pseudocount)*self.cond2_depth, (c2+self.pseudocount)*self.cond2_depth )
 *         c[3][ i ] = logLR( (t1+self.pseudocount)*self.cond1_depth, (t2+self.pseudocount)*self.cond2_depth )             # <<<<<<<<<<<<<<
 *         #c[4][ i ] = logLR( t2+self.pseudocount, t1+self.pseudocount )
 *         self.datalength[chromosome] += 1
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_11cScoreTrack_logLR(((__pyx_v_t1 + __pyx_v_self->pseudocount) * __pyx_v_self->cond1_depth), ((__pyx_v_t2 + __pyx_v_self->pseudocount) * __pyx_v_self->cond2_depth))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1489
 *         c[3][ i ] = logLR( (t1+self.pseudocount)*self.cond1_depth, (t2+self.pseudocount)*self.cond2_depth )
 *         #c[4][ i ] = logLR( t2+self.pseudocount, t1+self.pseudocount )
 *         self.datalength[chromosome] += 1             # <<<<<<<<<<<<<<
 * 
 *     cpdef finalize ( self ):
 */
  if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self->datalength));
  __pyx_t_4 = __pyx_v_self->datalength;
  __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
  __pyx_t_5 = __pyx_v_chromosome;
  if (unlikely(((PyObject *)__pyx_t_4) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(((PyObject *)__pyx_t_4) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (PyDict_SetItem(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(((PyObject *)__pyx_t_4));
  __Pyx_XDECREF(((PyObject *)__pyx_t_5));
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1491
 *         self.datalength[chromosome] += 1
 * 
 *     cpdef finalize ( self ):             # <<<<<<<<<<<<<<
 *         """
 *         Adjust array size of each chromosome.
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_9finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_finalize(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_l;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("finalize", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__finalize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_9finalize)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1500
 *             int l
 * 
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             d = self.data[chrom]
 *             l = self.datalength[chrom]
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1501
 * 
 *         for chrom in self.data.keys():
 *             d = self.data[chrom]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             d[0].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_d);
    __pyx_v_d = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1502
 *         for chrom in self.data.keys():
 *             d = self.data[chrom]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             d[0].resize( l, refcheck = False )
 *             d[1].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_l = __pyx_t_5;

    /* "MACS2/IO/cScoreTrack.pyx":1503
 *             d = self.data[chrom]
 *             l = self.datalength[chrom]
 *             d[0].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             d[1].resize( l, refcheck = False )
 *             d[2].resize( l, refcheck = False )
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_d, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__resize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1504
 *             l = self.datalength[chrom]
 *             d[0].resize( l, refcheck = False )
 *             d[1].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             d[2].resize( l, refcheck = False )
 *             d[3].resize( l, refcheck = False )
 */
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_d, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1505
 *             d[0].resize( l, refcheck = False )
 *             d[1].resize( l, refcheck = False )
 *             d[2].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             d[3].resize( l, refcheck = False )
 *         return
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_d, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__resize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1506
 *             d[1].resize( l, refcheck = False )
 *             d[2].resize( l, refcheck = False )
 *             d[3].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_d, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__resize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1507
 *             d[2].resize( l, refcheck = False )
 *             d[3].resize( l, refcheck = False )
 *         return             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_9finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_8finalize[] = "\n        Adjust array size of each chromosome.\n\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_9finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_8finalize(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1491
 *         self.datalength[chromosome] += 1
 * 
 *     cpdef finalize ( self ):             # <<<<<<<<<<<<<<
 *         """
 *         Adjust array size of each chromosome.
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_8finalize(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("finalize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->finalize(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1510
 * 
 * 
 *     cpdef compute_all_pvalues( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(pvalue)
 *         """
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_11compute_all_pvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_compute_all_pvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_v_v1 = 0;
  PyArrayObject *__pyx_v_v2 = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_v3 = 0;
  PyArrayObject *__pyx_v_pos = 0;
  long __pyx_v_l;
  long __pyx_v_i;
  long __pyx_v_prev_pos;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_v_sf = NULL;
  PyObject *__pyx_v_log10 = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
  __Pyx_Buffer __pyx_pybuffer_pos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
  __Pyx_Buffer __pyx_pybuffer_v1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v2;
  __Pyx_Buffer __pyx_pybuffer_v2;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v3;
  __Pyx_Buffer __pyx_pybuffer_v3;
  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;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  long __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  long __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  long __pyx_t_16;
  long __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  long __pyx_t_19;
  long __pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  long __pyx_t_22;
  long __pyx_t_23;
  long __pyx_t_24;
  long __pyx_t_25;
  long __pyx_t_26;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_all_pvalues", 0);
  __pyx_pybuffer_v1.pybuffer.buf = NULL;
  __pyx_pybuffer_v1.refcount = 0;
  __pyx_pybuffernd_v1.data = NULL;
  __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
  __pyx_pybuffer_v2.pybuffer.buf = NULL;
  __pyx_pybuffer_v2.refcount = 0;
  __pyx_pybuffernd_v2.data = NULL;
  __pyx_pybuffernd_v2.rcbuffer = &__pyx_pybuffer_v2;
  __pyx_pybuffer_v3.pybuffer.buf = NULL;
  __pyx_pybuffer_v3.refcount = 0;
  __pyx_pybuffernd_v3.data = NULL;
  __pyx_pybuffernd_v3.rcbuffer = &__pyx_pybuffer_v3;
  __pyx_pybuffer_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_pos.refcount = 0;
  __pyx_pybuffernd_pos.data = NULL;
  __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__compute_all_pvalues); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_11compute_all_pvalues)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1518
 *             long l, i, prev_pos
 *             str chrom
 *         rv = chi2(1) # a chi-squared distribution with one degree of freedom             # <<<<<<<<<<<<<<
 *         sf = rv.sf
 *         log10 = np.log10
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__chi2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rv = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1519
 *             str chrom
 *         rv = chi2(1) # a chi-squared distribution with one degree of freedom
 *         sf = rv.sf             # <<<<<<<<<<<<<<
 *         log10 = np.log10
 *         for chrom in self.data.keys():
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_rv, __pyx_n_s__sf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_sf = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1520
 *         rv = chi2(1) # a chi-squared distribution with one degree of freedom
 *         sf = rv.sf
 *         log10 = np.log10             # <<<<<<<<<<<<<<
 *         for chrom in self.data.keys():
 *             prev_pos = 0
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__log10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_log10 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1521
 *         sf = rv.sf
 *         log10 = np.log10
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             prev_pos = 0
 *             pos = self.data[chrom][0]
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1522
 *         log10 = np.log10
 *         for chrom in self.data.keys():
 *             prev_pos = 0             # <<<<<<<<<<<<<<
 *             pos = self.data[chrom][0]
 *             l = self.datalength[chrom]
 */
    __pyx_v_prev_pos = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1523
 *         for chrom in self.data.keys():
 *             prev_pos = 0
 *             pos = self.data[chrom][0]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             self.data[chrom][1] = -log10(sf(2 * self.data[chrom][1] / LOG10_E)).astype('float32')
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        }
      }
      __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1524
 *             prev_pos = 0
 *             pos = self.data[chrom][0]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             self.data[chrom][1] = -log10(sf(2 * self.data[chrom][1] / LOG10_E)).astype('float32')
 *             self.data[chrom][2] = -log10(sf(2 * self.data[chrom][2] / LOG10_E)).astype('float32')
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = __Pyx_PyInt_AsLong(__pyx_t_5); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_l = __pyx_t_11;

    /* "MACS2/IO/cScoreTrack.pyx":1525
 *             pos = self.data[chrom][0]
 *             l = self.datalength[chrom]
 *             self.data[chrom][1] = -log10(sf(2 * self.data[chrom][1] / LOG10_E)).astype('float32')             # <<<<<<<<<<<<<<
 *             self.data[chrom][2] = -log10(sf(2 * self.data[chrom][2] / LOG10_E)).astype('float32')
 *             self.data[chrom][3] = -log10(sf(2 * np.abs(self.data[chrom][3]) / LOG10_E)).astype('float32')
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Multiply(__pyx_int_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__LOG10_E); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_Call(__pyx_v_sf, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_Call(__pyx_v_log10, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Negative(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    if (__Pyx_SetItemInt(__pyx_t_12, 1, __pyx_t_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1526
 *             l = self.datalength[chrom]
 *             self.data[chrom][1] = -log10(sf(2 * self.data[chrom][1] / LOG10_E)).astype('float32')
 *             self.data[chrom][2] = -log10(sf(2 * self.data[chrom][2] / LOG10_E)).astype('float32')             # <<<<<<<<<<<<<<
 *             self.data[chrom][3] = -log10(sf(2 * np.abs(self.data[chrom][3]) / LOG10_E)).astype('float32')
 *             v1 = self.data[chrom][1]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_int_2, __pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__LOG10_E); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_v_sf, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_v_log10, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__astype); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_SetItemInt(__pyx_t_5, 2, __pyx_t_12, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1527
 *             self.data[chrom][1] = -log10(sf(2 * self.data[chrom][1] / LOG10_E)).astype('float32')
 *             self.data[chrom][2] = -log10(sf(2 * self.data[chrom][2] / LOG10_E)).astype('float32')
 *             self.data[chrom][3] = -log10(sf(2 * np.abs(self.data[chrom][3]) / LOG10_E)).astype('float32')             # <<<<<<<<<<<<<<
 *             v1 = self.data[chrom][1]
 *             v2 = self.data[chrom][2]
 */
    __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__abs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_12, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Multiply(__pyx_int_2, __pyx_t_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__LOG10_E); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_v_sf, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_v_log10, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_28), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_SetItemInt(__pyx_t_5, 3, __pyx_t_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1528
 *             self.data[chrom][2] = -log10(sf(2 * self.data[chrom][2] / LOG10_E)).astype('float32')
 *             self.data[chrom][3] = -log10(sf(2 * np.abs(self.data[chrom][3]) / LOG10_E)).astype('float32')
 *             v1 = self.data[chrom][1]             # <<<<<<<<<<<<<<
 *             v2 = self.data[chrom][2]
 *             v3 = self.data[chrom][3]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_v1));
    __pyx_v_v1 = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1529
 *             self.data[chrom][3] = -log10(sf(2 * np.abs(self.data[chrom][3]) / LOG10_E)).astype('float32')
 *             v1 = self.data[chrom][1]
 *             v2 = self.data[chrom][2]             # <<<<<<<<<<<<<<
 *             v3 = self.data[chrom][3]
 *             for i in range(l):
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v2.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v2.rcbuffer->pybuffer, (PyObject*)__pyx_v_v2, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        }
      }
      __pyx_pybuffernd_v2.diminfo[0].strides = __pyx_pybuffernd_v2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v2.diminfo[0].shape = __pyx_pybuffernd_v2.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_v2));
    __pyx_v_v2 = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1530
 *             v1 = self.data[chrom][1]
 *             v2 = self.data[chrom][2]
 *             v3 = self.data[chrom][3]             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 try:
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v3.rcbuffer->pybuffer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v3.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v3.rcbuffer->pybuffer, (PyObject*)__pyx_v_v3, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_v3.diminfo[0].strides = __pyx_pybuffernd_v3.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v3.diminfo[0].shape = __pyx_pybuffernd_v3.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_v3));
    __pyx_v_v3 = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1531
 *             v2 = self.data[chrom][2]
 *             v3 = self.data[chrom][3]
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.pvalue_stat1[v1[ i ]] += pos[ i ] - prev_pos
 */
    __pyx_t_11 = __pyx_v_l;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "MACS2/IO/cScoreTrack.pyx":1532
 *             v3 = self.data[chrom][3]
 *             for i in range(l):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.pvalue_stat1[v1[ i ]] += pos[ i ] - prev_pos
 *                 except:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "MACS2/IO/cScoreTrack.pyx":1533
 *             for i in range(l):
 *                 try:
 *                     self.pvalue_stat1[v1[ i ]] += pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.pvalue_stat1[v1[ i ]] = pos[ i ] - prev_pos
 */
          if (unlikely(((PyObject *)__pyx_v_self->pvalue_stat1) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_self->pvalue_stat1));
          __pyx_t_15 = __pyx_v_self->pvalue_stat1;
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_16 < 0) {
            __pyx_t_16 += __pyx_pybuffernd_v1.diminfo[0].shape;
            if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v1.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_5);
          if (unlikely(((PyObject *)__pyx_t_15) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_15), __pyx_t_5); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_17 < 0) {
            __pyx_t_17 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          __pyx_t_12 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(((PyObject *)__pyx_t_15) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          if (PyDict_SetItem(((PyObject *)__pyx_t_15), __pyx_t_5, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1534
 *                 try:
 *                     self.pvalue_stat1[v1[ i ]] += pos[ i ] - prev_pos
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.pvalue_stat1[v1[ i ]] = pos[ i ] - prev_pos
 *                 try:
 */
        /*except:*/ {
          __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.compute_all_pvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_18, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GOTREF(__pyx_t_18);
          __Pyx_GOTREF(__pyx_t_12);

          /* "MACS2/IO/cScoreTrack.pyx":1535
 *                     self.pvalue_stat1[v1[ i ]] += pos[ i ] - prev_pos
 *                 except:
 *                     self.pvalue_stat1[v1[ i ]] = pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.pvalue_stat2[v2[ i ]] += pos[ i ] - prev_pos
 */
          __pyx_t_19 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          }
          __pyx_t_1 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely(((PyObject *)__pyx_v_self->pvalue_stat1) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          }
          __pyx_t_20 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_pybuffernd_v1.diminfo[0].shape;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          }
          __pyx_t_21 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_v1.diminfo[0].strides))); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_21);
          if (PyDict_SetItem(((PyObject *)__pyx_v_self->pvalue_stat1), __pyx_t_21, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L14_try_end:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":1536
 *                 except:
 *                     self.pvalue_stat1[v1[ i ]] = pos[ i ] - prev_pos
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.pvalue_stat2[v2[ i ]] += pos[ i ] - prev_pos
 *                 except:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "MACS2/IO/cScoreTrack.pyx":1537
 *                     self.pvalue_stat1[v1[ i ]] = pos[ i ] - prev_pos
 *                 try:
 *                     self.pvalue_stat2[v2[ i ]] += pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.pvalue_stat2[v2[ i ]] = pos[ i ] - prev_pos
 */
          if (unlikely(((PyObject *)__pyx_v_self->pvalue_stat2) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_self->pvalue_stat2));
          __pyx_t_15 = __pyx_v_self->pvalue_stat2;
          __pyx_t_22 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_pybuffernd_v2.diminfo[0].shape;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v2.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          }
          __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v2.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_v2.diminfo[0].strides))); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_12);
          if (unlikely(((PyObject *)__pyx_t_15) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          }
          __pyx_t_18 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_15), __pyx_t_12); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          }
          __pyx_t_5 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_18, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(((PyObject *)__pyx_t_15) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          }
          if (PyDict_SetItem(((PyObject *)__pyx_t_15), __pyx_t_12, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L24_try_end;
        __pyx_L17_error:;
        __Pyx_XDECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1538
 *                 try:
 *                     self.pvalue_stat2[v2[ i ]] += pos[ i ] - prev_pos
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.pvalue_stat2[v2[ i ]] = pos[ i ] - prev_pos
 *                 prev_pos = pos[ i ]
 */
        /*except:*/ {
          __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.compute_all_pvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_1, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_5);

          /* "MACS2/IO/cScoreTrack.pyx":1539
 *                     self.pvalue_stat2[v2[ i ]] += pos[ i ] - prev_pos
 *                 except:
 *                     self.pvalue_stat2[v2[ i ]] = pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
 *                 prev_pos = pos[ i ]
 * 
 */
          __pyx_t_24 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
          }
          __pyx_t_18 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
          __Pyx_GOTREF(__pyx_t_18);
          if (unlikely(((PyObject *)__pyx_v_self->pvalue_stat2) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
          }
          __pyx_t_25 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_pybuffernd_v2.diminfo[0].shape;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v2.diminfo[0].shape)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
          }
          __pyx_t_21 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v2.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_v2.diminfo[0].strides))); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
          __Pyx_GOTREF(__pyx_t_21);
          if (PyDict_SetItem(((PyObject *)__pyx_v_self->pvalue_stat2), __pyx_t_21, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L18_exception_handled;
        }
        __pyx_L19_except_error:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L18_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        __pyx_L24_try_end:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":1540
 *                 except:
 *                     self.pvalue_stat2[v2[ i ]] = pos[ i ] - prev_pos
 *                 prev_pos = pos[ i ]             # <<<<<<<<<<<<<<
 * 
 *     cpdef compute_track_qvalues ( self ):
 */
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_pybuffernd_pos.diminfo[0].shape;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_pos.diminfo[0].strides));
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(((PyObject *)__pyx_t_15));
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_21);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v3.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.compute_all_pvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v3.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_v1);
  __Pyx_XDECREF((PyObject *)__pyx_v_v2);
  __Pyx_XDECREF((PyObject *)__pyx_v_v3);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XDECREF(__pyx_v_sf);
  __Pyx_XDECREF(__pyx_v_log10);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_11compute_all_pvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_10compute_all_pvalues[] = "Compute -log_{10}(pvalue)\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_11compute_all_pvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_all_pvalues (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_10compute_all_pvalues(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1510
 * 
 * 
 *     cpdef compute_all_pvalues( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(pvalue)
 *         """
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_10compute_all_pvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_all_pvalues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->compute_all_pvalues(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.compute_all_pvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1542
 *                 prev_pos = pos[ i ]
 * 
 *     cpdef compute_track_qvalues ( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(qvalue)
 *         """
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_13compute_track_qvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_compute_track_qvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pqtable = 0;
  PyObject *__pyx_v_pqtables = 0;
  long __pyx_v_i;
  long __pyx_v_l;
  double __pyx_v_k;
  PyObject *__pyx_v_chrom = 0;
  PyArrayObject *__pyx_v_v = 0;
  PyObject *__pyx_v_table_index = NULL;
  PyObject *__pyx_v_s_p2q = NULL;
  PyObject *__pyx_v_g = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  double __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  long __pyx_t_12;
  long __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_track_qvalues", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_29); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_13compute_track_qvalues)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1556
 *         # not sure if we should pool all the p-values or treat each comparison
 *         # separately, but doing the latter for now
 *         pqtables = self.make_pq_tables()             # <<<<<<<<<<<<<<
 * 
 *         # convert p to q
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->make_pq_tables(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pqtables = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1562
 *         # convert pvalue2qvalue to a simple dict based on khash
 *         # khash has big advantage while checking keys for millions of times.
 *         for table_index in range(2):             # <<<<<<<<<<<<<<
 *             pqtable = pqtables[table_index]
 *             s_p2q = Float64HashTable()
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_k_tuple_30), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_table_index);
    __pyx_v_table_index = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1563
 *         # khash has big advantage while checking keys for millions of times.
 *         for table_index in range(2):
 *             pqtable = pqtables[table_index]             # <<<<<<<<<<<<<<
 *             s_p2q = Float64HashTable()
 *             for k in pqtable.keys():
 */
    if (unlikely(((PyObject *)__pyx_v_pqtables) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_pqtables), __pyx_v_table_index); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_pqtable));
    __pyx_v_pqtable = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1564
 *         for table_index in range(2):
 *             pqtable = pqtables[table_index]
 *             s_p2q = Float64HashTable()             # <<<<<<<<<<<<<<
 *             for k in pqtable.keys():
 *                 s_p2q.set_item(k,pqtable[k])
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Float64HashTable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_s_p2q);
    __pyx_v_s_p2q = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1565
 *             pqtable = pqtables[table_index]
 *             s_p2q = Float64HashTable()
 *             for k in pqtable.keys():             # <<<<<<<<<<<<<<
 *                 s_p2q.set_item(k,pqtable[k])
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_pqtable) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyDict_Keys(__pyx_v_pqtable); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_5 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_k = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":1566
 *             s_p2q = Float64HashTable()
 *             for k in pqtable.keys():
 *                 s_p2q.set_item(k,pqtable[k])             # <<<<<<<<<<<<<<
 * 
 *             g = s_p2q.get_item
 */
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_s_p2q, __pyx_n_s__set_item); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = PyFloat_FromDouble(__pyx_v_k); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(((PyObject *)__pyx_v_pqtable) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_10 = PyFloat_FromDouble(__pyx_v_k); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pqtable), __pyx_t_10); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      __pyx_t_9 = 0;
      __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1568
 *                 s_p2q.set_item(k,pqtable[k])
 * 
 *             g = s_p2q.get_item             # <<<<<<<<<<<<<<
 * 
 *             for chrom in self.data.keys():
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_s_p2q, __pyx_n_s__get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_g);
    __pyx_v_g = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1570
 *             g = s_p2q.get_item
 * 
 *             for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *                 v = self.data[chrom][table_index + 1]
 *                 l = self.datalength[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_7 = Py_TYPE(__pyx_t_11)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_11)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_11)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_11)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_11);
        if (unlikely(!__pyx_t_1)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
      __pyx_v_chrom = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1571
 * 
 *             for chrom in self.data.keys():
 *                 v = self.data[chrom][table_index + 1]             # <<<<<<<<<<<<<<
 *                 l = self.datalength[chrom]
 *                 for i in range(l):
 */
      if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = PyNumber_Add(__pyx_v_table_index, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_t_10); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_v));
      __pyx_v_v = ((PyArrayObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1572
 *             for chrom in self.data.keys():
 *                 v = self.data[chrom][table_index + 1]
 *                 l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *                 for i in range(l):
 *                     v[ i ] =  g( v[ i ])
 */
      if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_12 = __Pyx_PyInt_AsLong(__pyx_t_5); if (unlikely((__pyx_t_12 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_l = __pyx_t_12;

      /* "MACS2/IO/cScoreTrack.pyx":1573
 *                 v = self.data[chrom][table_index + 1]
 *                 l = self.datalength[chrom]
 *                 for i in range(l):             # <<<<<<<<<<<<<<
 *                     v[ i ] =  g( v[ i ])
 * 
 */
      __pyx_t_12 = __pyx_v_l;
      for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
        __pyx_v_i = __pyx_t_13;

        /* "MACS2/IO/cScoreTrack.pyx":1574
 *                 l = self.datalength[chrom]
 *                 for i in range(l):
 *                     v[ i ] =  g( v[ i ])             # <<<<<<<<<<<<<<
 * 
 *         return
 */
        __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_v_g, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_5, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1576
 *                     v[ i ] =  g( v[ i ])
 * 
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cpdef compute_category_qvalues ( self, dict category ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.compute_track_qvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pqtable);
  __Pyx_XDECREF(__pyx_v_pqtables);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_table_index);
  __Pyx_XDECREF(__pyx_v_s_p2q);
  __Pyx_XDECREF(__pyx_v_g);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_13compute_track_qvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_12compute_track_qvalues[] = "Compute -log_{10}(qvalue)\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_13compute_track_qvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_track_qvalues (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_12compute_track_qvalues(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1542
 *                 prev_pos = pos[ i ]
 * 
 *     cpdef compute_track_qvalues ( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(qvalue)
 *         """
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_12compute_track_qvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_track_qvalues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->compute_track_qvalues(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.compute_track_qvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1578
 *         return
 * 
 *     cpdef compute_category_qvalues ( self, dict category ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(qvalue)
 *         """
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_15compute_category_qvalues(PyObject *__pyx_v_self, PyObject *__pyx_v_category); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_compute_category_qvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_category, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_value_dict = 0;
  PyObject *__pyx_v_pqtable = 0;
  PyObject *__pyx_v_unique_values = 0;
  long __pyx_v_i;
  long __pyx_v_l;
  long __pyx_v_j;
  PyArrayObject *__pyx_v_v = 0;
  PyArrayObject *__pyx_v_data = 0;
  CYTHON_UNUSED long __pyx_v_pre_l;
  CYTHON_UNUSED double __pyx_v_pre_v;
  double __pyx_v_unique_v;
  double __pyx_v_q;
  double __pyx_v_pre_q;
  long __pyx_v_N;
  long __pyx_v_k;
  double __pyx_v_f;
  double __pyx_v_pvalue;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_s_p2q = NULL;
  PyObject *__pyx_v_g = NULL;
  PyObject *__pyx_v_qvalues = 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;
  long __pyx_t_7;
  long __pyx_t_8;
  long __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  double __pyx_t_19;
  double __pyx_t_20;
  double __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_category_qvalues", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_31); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_15compute_category_qvalues)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_category));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_category));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_category));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1592
 * 
 *         # make pqtable for category
 *         value_dict = {}             # <<<<<<<<<<<<<<
 *         for chrom in self.data.keys():
 *             if category[chrom].size == 0: continue
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_value_dict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1593
 *         # make pqtable for category
 *         value_dict = {}
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             if category[chrom].size == 0: continue
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1594
 *         value_dict = {}
 *         for chrom in self.data.keys():
 *             if category[chrom].size == 0: continue             # <<<<<<<<<<<<<<
 * 
 *             pos = self.data[chrom][0]
 */
    if (unlikely(((PyObject *)__pyx_v_category) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_category), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "MACS2/IO/cScoreTrack.pyx":1596
 *             if category[chrom].size == 0: continue
 * 
 *             pos = self.data[chrom][0]             # <<<<<<<<<<<<<<
 *             data = self.data[chrom][3]
 *             for j in range(category[chrom].size):
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_pos);
    __pyx_v_pos = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1597
 * 
 *             pos = self.data[chrom][0]
 *             data = self.data[chrom][3]             # <<<<<<<<<<<<<<
 *             for j in range(category[chrom].size):
 *                 i = category[chrom][j]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_data));
    __pyx_v_data = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1598
 *             pos = self.data[chrom][0]
 *             data = self.data[chrom][3]
 *             for j in range(category[chrom].size):             # <<<<<<<<<<<<<<
 *                 i = category[chrom][j]
 *                 try:
 */
    if (unlikely(((PyObject *)__pyx_v_category) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_category), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_j = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":1599
 *             data = self.data[chrom][3]
 *             for j in range(category[chrom].size):
 *                 i = category[chrom][j]             # <<<<<<<<<<<<<<
 *                 try:
 *                     value_dict[data[i]] += pos[i + 1] - pos[i]
 */
      if (unlikely(((PyObject *)__pyx_v_category) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_category), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_j, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_i = __pyx_t_9;

      /* "MACS2/IO/cScoreTrack.pyx":1600
 *             for j in range(category[chrom].size):
 *                 i = category[chrom][j]
 *                 try:             # <<<<<<<<<<<<<<
 *                     value_dict[data[i]] += pos[i + 1] - pos[i]
 *                 except IndexError:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {

          /* "MACS2/IO/cScoreTrack.pyx":1601
 *                 i = category[chrom][j]
 *                 try:
 *                     value_dict[data[i]] += pos[i + 1] - pos[i]             # <<<<<<<<<<<<<<
 *                 except IndexError:
 *                     if not value_dict.has_key(data[i]):
 */
          __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_data), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_9 = (__pyx_v_i + 1);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_pos, __pyx_t_9, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_pos, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = PyNumber_Subtract(__pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PyDict_SetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_1, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1602
 *                 try:
 *                     value_dict[data[i]] += pos[i + 1] - pos[i]
 *                 except IndexError:             # <<<<<<<<<<<<<<
 *                     if not value_dict.has_key(data[i]):
 *                         value_dict[data[i]] = 0
 */
        __pyx_t_16 = PyErr_ExceptionMatches(__pyx_builtin_IndexError);
        if (__pyx_t_16) {
          __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.compute_category_qvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_14, &__pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GOTREF(__pyx_t_15);

          /* "MACS2/IO/cScoreTrack.pyx":1603
 *                     value_dict[data[i]] += pos[i + 1] - pos[i]
 *                 except IndexError:
 *                     if not value_dict.has_key(data[i]):             # <<<<<<<<<<<<<<
 *                         value_dict[data[i]] = 0
 *                 except KeyError:
 */
          __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_value_dict), __pyx_n_s__has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_GetItemInt(((PyObject *)__pyx_v_data), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_17);
          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_13 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_18 = (!__pyx_t_6);
          if (__pyx_t_18) {

            /* "MACS2/IO/cScoreTrack.pyx":1604
 *                 except IndexError:
 *                     if not value_dict.has_key(data[i]):
 *                         value_dict[data[i]] = 0             # <<<<<<<<<<<<<<
 *                 except KeyError:
 *                     value_dict[data[i]] = pos[i + 1] - pos[i]
 */
            __pyx_t_13 = __Pyx_GetItemInt(((PyObject *)__pyx_v_data), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_13);
            if (PyDict_SetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_13, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            goto __pyx_L18;
          }
          __pyx_L18:;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          goto __pyx_L9_exception_handled;
        }

        /* "MACS2/IO/cScoreTrack.pyx":1605
 *                     if not value_dict.has_key(data[i]):
 *                         value_dict[data[i]] = 0
 *                 except KeyError:             # <<<<<<<<<<<<<<
 *                     value_dict[data[i]] = pos[i + 1] - pos[i]
 * 
 */
        __pyx_t_16 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
        if (__pyx_t_16) {
          __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.compute_category_qvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_14, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GOTREF(__pyx_t_1);

          /* "MACS2/IO/cScoreTrack.pyx":1606
 *                         value_dict[data[i]] = 0
 *                 except KeyError:
 *                     value_dict[data[i]] = pos[i + 1] - pos[i]             # <<<<<<<<<<<<<<
 * 
 *         N = sum(value_dict.values())
 */
          __pyx_t_9 = (__pyx_v_i + 1);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_pos, __pyx_t_9, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_pos, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_2 = PyNumber_Subtract(__pyx_t_13, __pyx_t_17); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_17 = __Pyx_GetItemInt(((PyObject *)__pyx_v_data), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_17);
          if (PyDict_SetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_17, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L9_exception_handled;
        }
        __pyx_L10_except_error:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L1_error;
        __pyx_L9_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        __pyx_L15_try_end:;
      }
    }
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1608
 *                     value_dict[data[i]] = pos[i + 1] - pos[i]
 * 
 *         N = sum(value_dict.values())             # <<<<<<<<<<<<<<
 *         k = 1                           # rank
 *         f = -log10(N)
 */
  __pyx_t_3 = PyDict_Values(__pyx_v_value_dict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_N = __pyx_t_7;

  /* "MACS2/IO/cScoreTrack.pyx":1609
 * 
 *         N = sum(value_dict.values())
 *         k = 1                           # rank             # <<<<<<<<<<<<<<
 *         f = -log10(N)
 *         pre_v = -2147483647
 */
  __pyx_v_k = 1;

  /* "MACS2/IO/cScoreTrack.pyx":1610
 *         N = sum(value_dict.values())
 *         k = 1                           # rank
 *         f = -log10(N)             # <<<<<<<<<<<<<<
 *         pre_v = -2147483647
 *         pre_l = 0
 */
  __pyx_v_f = (-log10(__pyx_v_N));

  /* "MACS2/IO/cScoreTrack.pyx":1611
 *         k = 1                           # rank
 *         f = -log10(N)
 *         pre_v = -2147483647             # <<<<<<<<<<<<<<
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 */
  __pyx_v_pre_v = -2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":1612
 *         f = -log10(N)
 *         pre_v = -2147483647
 *         pre_l = 0             # <<<<<<<<<<<<<<
 *         pre_q = 2147483647              # save the previous q-value
 *         pqtable = {}#Float64HashTable()
 */
  __pyx_v_pre_l = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1613
 *         pre_v = -2147483647
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value             # <<<<<<<<<<<<<<
 *         pqtable = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 */
  __pyx_v_pre_q = 2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":1614
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 *         pqtable = {}#Float64HashTable()             # <<<<<<<<<<<<<<
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_pqtable = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1615
 *         pre_q = 2147483647              # save the previous q-value
 *         pqtable = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)             # <<<<<<<<<<<<<<
 *         for i in range(len(unique_values)):
 *             unique_v = unique_values[i]
 */
  __pyx_t_3 = PyDict_Keys(__pyx_v_value_dict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_14 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__reverse), __pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_14)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_unique_values = ((PyObject*)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1616
 *         pqtable = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):             # <<<<<<<<<<<<<<
 *             unique_v = unique_values[i]
 *             l = value_dict[unique_v]
 */
  if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = PyList_GET_SIZE(((PyObject *)__pyx_v_unique_values)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_4; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":1617
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 *             unique_v = unique_values[i]             # <<<<<<<<<<<<<<
 *             l = value_dict[unique_v]
 *             q = unique_v + (log10(k) + f)
 */
    if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_unique_values), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_14); if (unlikely((__pyx_t_19 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_v_unique_v = __pyx_t_19;

    /* "MACS2/IO/cScoreTrack.pyx":1618
 *         for i in range(len(unique_values)):
 *             unique_v = unique_values[i]
 *             l = value_dict[unique_v]             # <<<<<<<<<<<<<<
 *             q = unique_v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 */
    __pyx_t_14 = PyFloat_FromDouble(__pyx_v_unique_v); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_14); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_8 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_l = __pyx_t_8;

    /* "MACS2/IO/cScoreTrack.pyx":1619
 *             unique_v = unique_values[i]
 *             l = value_dict[unique_v]
 *             q = unique_v + (log10(k) + f)             # <<<<<<<<<<<<<<
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pqtable[ unique_v ] = q
 */
    __pyx_v_q = (__pyx_v_unique_v + (log10(__pyx_v_k) + __pyx_v_f));

    /* "MACS2/IO/cScoreTrack.pyx":1620
 *             l = value_dict[unique_v]
 *             q = unique_v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic             # <<<<<<<<<<<<<<
 *             pqtable[ unique_v ] = q
 *             pre_v = unique_v
 */
    __pyx_t_19 = __pyx_v_q;
    __pyx_t_20 = __pyx_v_pre_q;
    if ((__pyx_t_19 < __pyx_t_20)) {
      __pyx_t_21 = __pyx_t_19;
    } else {
      __pyx_t_21 = __pyx_t_20;
    }
    __pyx_t_19 = __pyx_t_21;
    __pyx_t_8 = 0;
    if ((__pyx_t_19 > __pyx_t_8)) {
      __pyx_t_21 = __pyx_t_19;
    } else {
      __pyx_t_21 = __pyx_t_8;
    }
    __pyx_v_q = __pyx_t_21;

    /* "MACS2/IO/cScoreTrack.pyx":1621
 *             q = unique_v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pqtable[ unique_v ] = q             # <<<<<<<<<<<<<<
 *             pre_v = unique_v
 *             pre_q = q
 */
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_14 = PyFloat_FromDouble(__pyx_v_unique_v); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    if (PyDict_SetItem(((PyObject *)__pyx_v_pqtable), __pyx_t_14, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1622
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pqtable[ unique_v ] = q
 *             pre_v = unique_v             # <<<<<<<<<<<<<<
 *             pre_q = q
 *             k+=l
 */
    __pyx_v_pre_v = __pyx_v_unique_v;

    /* "MACS2/IO/cScoreTrack.pyx":1623
 *             pqtable[ unique_v ] = q
 *             pre_v = unique_v
 *             pre_q = q             # <<<<<<<<<<<<<<
 *             k+=l
 * 
 */
    __pyx_v_pre_q = __pyx_v_q;

    /* "MACS2/IO/cScoreTrack.pyx":1624
 *             pre_v = unique_v
 *             pre_q = q
 *             k+=l             # <<<<<<<<<<<<<<
 * 
 *         # convert p to q
 */
    __pyx_v_k = (__pyx_v_k + __pyx_v_l);
  }

  /* "MACS2/IO/cScoreTrack.pyx":1630
 *         # convert pvalue2qvalue to a simple dict based on khash
 *         # khash has big advantage while checking keys for millions of times.
 *         s_p2q = Float64HashTable()             # <<<<<<<<<<<<<<
 *         for pvalue in pqtable.keys():
 *             s_p2q.set_item(pvalue,pqtable[pvalue])
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__Float64HashTable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_14 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_s_p2q = __pyx_t_14;
  __pyx_t_14 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1631
 *         # khash has big advantage while checking keys for millions of times.
 *         s_p2q = Float64HashTable()
 *         for pvalue in pqtable.keys():             # <<<<<<<<<<<<<<
 *             s_p2q.set_item(pvalue,pqtable[pvalue])
 * 
 */
  __pyx_t_14 = PyDict_Keys(__pyx_v_pqtable); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  if (PyList_CheckExact(__pyx_t_14) || PyTuple_CheckExact(__pyx_t_14)) {
    __pyx_t_3 = __pyx_t_14; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_14 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_14); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_14); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_14 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_14)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_14);
    }
    __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_14); if (unlikely((__pyx_t_21 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_v_pvalue = __pyx_t_21;

    /* "MACS2/IO/cScoreTrack.pyx":1632
 *         s_p2q = Float64HashTable()
 *         for pvalue in pqtable.keys():
 *             s_p2q.set_item(pvalue,pqtable[pvalue])             # <<<<<<<<<<<<<<
 * 
 *         g = s_p2q.get_item
 */
    __pyx_t_14 = PyObject_GetAttr(__pyx_v_s_p2q, __pyx_n_s__set_item); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_pvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_15 = PyFloat_FromDouble(__pyx_v_pvalue); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pqtable), __pyx_t_15); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1634
 *             s_p2q.set_item(pvalue,pqtable[pvalue])
 * 
 *         g = s_p2q.get_item             # <<<<<<<<<<<<<<
 * 
 *         qvalues = {}
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_s_p2q, __pyx_n_s__get_item); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_g = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1636
 *         g = s_p2q.get_item
 * 
 *         qvalues = {}             # <<<<<<<<<<<<<<
 *         for chrom in self.data.keys():
 *             v = self.data[chrom][3][category[chrom]]
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_qvalues = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1637
 * 
 *         qvalues = {}
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             v = self.data[chrom][3][category[chrom]]
 *             qvalues[chrom] = v.copy()
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1638
 *         qvalues = {}
 *         for chrom in self.data.keys():
 *             v = self.data[chrom][3][category[chrom]]             # <<<<<<<<<<<<<<
 *             qvalues[chrom] = v.copy()
 *             for i in range(v.size):
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), __pyx_v_chrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_category) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_category), __pyx_v_chrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_14 = PyObject_GetItem(__pyx_t_15, __pyx_t_3); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((PyArrayObject *)__pyx_t_14);
    __pyx_t_14 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1639
 *         for chrom in self.data.keys():
 *             v = self.data[chrom][3][category[chrom]]
 *             qvalues[chrom] = v.copy()             # <<<<<<<<<<<<<<
 *             for i in range(v.size):
 *                 qvalues[chrom][ i ] =  g( v[ i ])
 */
    __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_v), __pyx_n_s__copy); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_3 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (PyDict_SetItem(((PyObject *)__pyx_v_qvalues), __pyx_v_chrom, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1640
 *             v = self.data[chrom][3][category[chrom]]
 *             qvalues[chrom] = v.copy()
 *             for i in range(v.size):             # <<<<<<<<<<<<<<
 *                 qvalues[chrom][ i ] =  g( v[ i ])
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_v), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":1641
 *             qvalues[chrom] = v.copy()
 *             for i in range(v.size):
 *                 qvalues[chrom][ i ] =  g( v[ i ])             # <<<<<<<<<<<<<<
 * 
 *         return qvalues
 */
      __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_v_g, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_qvalues), __pyx_v_chrom); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      if (__Pyx_SetItemInt(__pyx_t_14, __pyx_v_i, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1643
 *                 qvalues[chrom][ i ] =  g( v[ i ])
 * 
 *         return qvalues             # <<<<<<<<<<<<<<
 * 
 *     # borrowed from CombinedTwoTrack
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_qvalues));
  __pyx_r = ((PyObject *)__pyx_v_qvalues);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.compute_category_qvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value_dict);
  __Pyx_XDECREF(__pyx_v_pqtable);
  __Pyx_XDECREF(__pyx_v_unique_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF((PyObject *)__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_s_p2q);
  __Pyx_XDECREF(__pyx_v_g);
  __Pyx_XDECREF(__pyx_v_qvalues);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_15compute_category_qvalues(PyObject *__pyx_v_self, PyObject *__pyx_v_category); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_14compute_category_qvalues[] = "Compute -log_{10}(qvalue)\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_15compute_category_qvalues(PyObject *__pyx_v_self, PyObject *__pyx_v_category) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_category_qvalues (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_category), (&PyDict_Type), 1, "category", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_14compute_category_qvalues(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self), ((PyObject*)__pyx_v_category));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1578
 *         return
 * 
 *     cpdef compute_category_qvalues ( self, dict category ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(qvalue)
 *         """
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_14compute_category_qvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_category) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_category_qvalues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->compute_category_qvalues(__pyx_v_self, __pyx_v_category, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.compute_category_qvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1646
 * 
 *     # borrowed from CombinedTwoTrack
 *     cdef tuple make_pq_tables ( self ):             # <<<<<<<<<<<<<<
 *         """Make pvalue-qvalue table.
 * 
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_make_pq_tables(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self) {
  CYTHON_UNUSED long __pyx_v_pre_l;
  long __pyx_v_l;
  long __pyx_v_i;
  CYTHON_UNUSED double __pyx_v_pre_v;
  double __pyx_v_v;
  double __pyx_v_q;
  double __pyx_v_pre_q;
  long __pyx_v_N;
  long __pyx_v_k;
  double __pyx_v_f;
  PyObject *__pyx_v_pvalue2qvalue1 = 0;
  PyObject *__pyx_v_pvalue2qvalue2 = 0;
  PyObject *__pyx_v_value_dict = 0;
  PyObject *__pyx_v_unique_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  double __pyx_t_6;
  long __pyx_t_7;
  double __pyx_t_8;
  double __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_pq_tables", 0);

  /* "MACS2/IO/cScoreTrack.pyx":1665
 *             list unique_values
 * 
 *         value_dict = self.pvalue_stat1             # <<<<<<<<<<<<<<
 *         N = sum(value_dict.values())
 *         k = 1                           # rank
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->pvalue_stat1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_value_dict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1666
 * 
 *         value_dict = self.pvalue_stat1
 *         N = sum(value_dict.values())             # <<<<<<<<<<<<<<
 *         k = 1                           # rank
 *         f = -log10(N)
 */
  if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Values(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_3;

  /* "MACS2/IO/cScoreTrack.pyx":1667
 *         value_dict = self.pvalue_stat1
 *         N = sum(value_dict.values())
 *         k = 1                           # rank             # <<<<<<<<<<<<<<
 *         f = -log10(N)
 *         pre_v = -2147483647
 */
  __pyx_v_k = 1;

  /* "MACS2/IO/cScoreTrack.pyx":1668
 *         N = sum(value_dict.values())
 *         k = 1                           # rank
 *         f = -log10(N)             # <<<<<<<<<<<<<<
 *         pre_v = -2147483647
 *         pre_l = 0
 */
  __pyx_v_f = (-log10(__pyx_v_N));

  /* "MACS2/IO/cScoreTrack.pyx":1669
 *         k = 1                           # rank
 *         f = -log10(N)
 *         pre_v = -2147483647             # <<<<<<<<<<<<<<
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 */
  __pyx_v_pre_v = -2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":1670
 *         f = -log10(N)
 *         pre_v = -2147483647
 *         pre_l = 0             # <<<<<<<<<<<<<<
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue1 = {}#Float64HashTable()
 */
  __pyx_v_pre_l = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1671
 *         pre_v = -2147483647
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value             # <<<<<<<<<<<<<<
 *         pvalue2qvalue1 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 */
  __pyx_v_pre_q = 2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":1672
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue1 = {}#Float64HashTable()             # <<<<<<<<<<<<<<
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_pvalue2qvalue1 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1673
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue1 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)             # <<<<<<<<<<<<<<
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]
 */
  if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__reverse), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_unique_values = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1674
 *         pvalue2qvalue1 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):             # <<<<<<<<<<<<<<
 *             v = unique_values[i]
 *             l = value_dict[v]
 */
  if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_unique_values)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "MACS2/IO/cScoreTrack.pyx":1675
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]             # <<<<<<<<<<<<<<
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)
 */
    if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_unique_values), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_v = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":1676
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]
 *             l = value_dict[v]             # <<<<<<<<<<<<<<
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 */
    if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_4); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_l = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":1677
 *             v = unique_values[i]
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)             # <<<<<<<<<<<<<<
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue1[ v ] = q
 */
    __pyx_v_q = (__pyx_v_v + (log10(__pyx_v_k) + __pyx_v_f));

    /* "MACS2/IO/cScoreTrack.pyx":1678
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic             # <<<<<<<<<<<<<<
 *             pvalue2qvalue1[ v ] = q
 *             pre_v = v
 */
    __pyx_t_6 = __pyx_v_q;
    __pyx_t_8 = __pyx_v_pre_q;
    if ((__pyx_t_6 < __pyx_t_8)) {
      __pyx_t_9 = __pyx_t_6;
    } else {
      __pyx_t_9 = __pyx_t_8;
    }
    __pyx_t_6 = __pyx_t_9;
    __pyx_t_7 = 0;
    if ((__pyx_t_6 > __pyx_t_7)) {
      __pyx_t_9 = __pyx_t_6;
    } else {
      __pyx_t_9 = __pyx_t_7;
    }
    __pyx_v_q = __pyx_t_9;

    /* "MACS2/IO/cScoreTrack.pyx":1679
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue1[ v ] = q             # <<<<<<<<<<<<<<
 *             pre_v = v
 *             pre_q = q
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(((PyObject *)__pyx_v_pvalue2qvalue1), __pyx_t_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1680
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue1[ v ] = q
 *             pre_v = v             # <<<<<<<<<<<<<<
 *             pre_q = q
 *             k+=l
 */
    __pyx_v_pre_v = __pyx_v_v;

    /* "MACS2/IO/cScoreTrack.pyx":1681
 *             pvalue2qvalue1[ v ] = q
 *             pre_v = v
 *             pre_q = q             # <<<<<<<<<<<<<<
 *             k+=l
 * 
 */
    __pyx_v_pre_q = __pyx_v_q;

    /* "MACS2/IO/cScoreTrack.pyx":1682
 *             pre_v = v
 *             pre_q = q
 *             k+=l             # <<<<<<<<<<<<<<
 * 
 *         value_dict = self.pvalue_stat2
 */
    __pyx_v_k = (__pyx_v_k + __pyx_v_l);
  }

  /* "MACS2/IO/cScoreTrack.pyx":1684
 *             k+=l
 * 
 *         value_dict = self.pvalue_stat2             # <<<<<<<<<<<<<<
 *         N = sum(value_dict.values())
 *         k = 1                           # rank
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->pvalue_stat2);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_v_value_dict));
  __pyx_v_value_dict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1685
 * 
 *         value_dict = self.pvalue_stat2
 *         N = sum(value_dict.values())             # <<<<<<<<<<<<<<
 *         k = 1                           # rank
 *         f = -log10(N)
 */
  if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Values(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_3;

  /* "MACS2/IO/cScoreTrack.pyx":1686
 *         value_dict = self.pvalue_stat2
 *         N = sum(value_dict.values())
 *         k = 1                           # rank             # <<<<<<<<<<<<<<
 *         f = -log10(N)
 *         pre_v = -2147483647
 */
  __pyx_v_k = 1;

  /* "MACS2/IO/cScoreTrack.pyx":1687
 *         N = sum(value_dict.values())
 *         k = 1                           # rank
 *         f = -log10(N)             # <<<<<<<<<<<<<<
 *         pre_v = -2147483647
 *         pre_l = 0
 */
  __pyx_v_f = (-log10(__pyx_v_N));

  /* "MACS2/IO/cScoreTrack.pyx":1688
 *         k = 1                           # rank
 *         f = -log10(N)
 *         pre_v = -2147483647             # <<<<<<<<<<<<<<
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 */
  __pyx_v_pre_v = -2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":1689
 *         f = -log10(N)
 *         pre_v = -2147483647
 *         pre_l = 0             # <<<<<<<<<<<<<<
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue2 = {}#Float64HashTable()
 */
  __pyx_v_pre_l = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1690
 *         pre_v = -2147483647
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value             # <<<<<<<<<<<<<<
 *         pvalue2qvalue2 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 */
  __pyx_v_pre_q = 2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":1691
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue2 = {}#Float64HashTable()             # <<<<<<<<<<<<<<
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_pvalue2qvalue2 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1692
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue2 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)             # <<<<<<<<<<<<<<
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]
 */
  if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__reverse), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_v_unique_values));
  __pyx_v_unique_values = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1693
 *         pvalue2qvalue2 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):             # <<<<<<<<<<<<<<
 *             v = unique_values[i]
 *             l = value_dict[v]
 */
  if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_unique_values)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "MACS2/IO/cScoreTrack.pyx":1694
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]             # <<<<<<<<<<<<<<
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)
 */
    if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_unique_values), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_v = __pyx_t_9;

    /* "MACS2/IO/cScoreTrack.pyx":1695
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]
 *             l = value_dict[v]             # <<<<<<<<<<<<<<
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 */
    if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_2); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_l = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":1696
 *             v = unique_values[i]
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)             # <<<<<<<<<<<<<<
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue2[ v ] = q
 */
    __pyx_v_q = (__pyx_v_v + (log10(__pyx_v_k) + __pyx_v_f));

    /* "MACS2/IO/cScoreTrack.pyx":1697
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic             # <<<<<<<<<<<<<<
 *             pvalue2qvalue2[ v ] = q
 *             pre_v = v
 */
    __pyx_t_9 = __pyx_v_q;
    __pyx_t_6 = __pyx_v_pre_q;
    if ((__pyx_t_9 < __pyx_t_6)) {
      __pyx_t_8 = __pyx_t_9;
    } else {
      __pyx_t_8 = __pyx_t_6;
    }
    __pyx_t_9 = __pyx_t_8;
    __pyx_t_7 = 0;
    if ((__pyx_t_9 > __pyx_t_7)) {
      __pyx_t_8 = __pyx_t_9;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    __pyx_v_q = __pyx_t_8;

    /* "MACS2/IO/cScoreTrack.pyx":1698
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue2[ v ] = q             # <<<<<<<<<<<<<<
 *             pre_v = v
 *             pre_q = q
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(((PyObject *)__pyx_v_pvalue2qvalue2), __pyx_t_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1699
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue2[ v ] = q
 *             pre_v = v             # <<<<<<<<<<<<<<
 *             pre_q = q
 *             k+=l
 */
    __pyx_v_pre_v = __pyx_v_v;

    /* "MACS2/IO/cScoreTrack.pyx":1700
 *             pvalue2qvalue2[ v ] = q
 *             pre_v = v
 *             pre_q = q             # <<<<<<<<<<<<<<
 *             k+=l
 * 
 */
    __pyx_v_pre_q = __pyx_v_q;

    /* "MACS2/IO/cScoreTrack.pyx":1701
 *             pre_v = v
 *             pre_q = q
 *             k+=l             # <<<<<<<<<<<<<<
 * 
 *         return (pvalue2qvalue1, pvalue2qvalue2)
 */
    __pyx_v_k = (__pyx_v_k + __pyx_v_l);
  }

  /* "MACS2/IO/cScoreTrack.pyx":1703
 *             k+=l
 * 
 *         return (pvalue2qvalue1, pvalue2qvalue2)             # <<<<<<<<<<<<<<
 * 
 *     # cpdef sort ( self, int column = 1 ):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_pvalue2qvalue1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_pvalue2qvalue1));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_pvalue2qvalue1));
  __Pyx_INCREF(((PyObject *)__pyx_v_pvalue2qvalue2));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_pvalue2qvalue2));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_pvalue2qvalue2));
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.make_pq_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pvalue2qvalue1);
  __Pyx_XDECREF(__pyx_v_pvalue2qvalue2);
  __Pyx_XDECREF(__pyx_v_value_dict);
  __Pyx_XDECREF(__pyx_v_unique_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1721
 *     #     return
 * 
 *     cpdef get_data_by_chr (self, str chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_17get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_get_data_by_chr(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data_by_chr", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_17get_data_by_chr)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chromosome));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chromosome));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1727
 *         ([end pos],[value])
 *         """
 *         if self.data.has_key(chromosome):             # <<<<<<<<<<<<<<
 *             return self.data[chromosome]
 *         else:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->data), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_chromosome));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chromosome));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":1728
 *         """
 *         if self.data.has_key(chromosome):
 *             return self.data[chromosome]             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":1730
 *             return self.data[chromosome]
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_chr_names (self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_17get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_16get_data_by_chr[] = "Return array of counts by chromosome.\n\n        The return value is a tuple:\n        ([end pos],[value])\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_17get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data_by_chr (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chromosome), (&PyString_Type), 1, "chromosome", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_16get_data_by_chr(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self), ((PyObject*)__pyx_v_chromosome));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1721
 *     #     return
 * 
 *     cpdef get_data_by_chr (self, str chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_16get_data_by_chr(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chromosome) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data_by_chr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->get_data_by_chr(__pyx_v_self, __pyx_v_chromosome, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1732
 *             return None
 * 
 *     cpdef get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_19get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_get_chr_names(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_chr_names", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_19get_chr_names)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1736
 * 
 *         """
 *         l = set(self.data.keys())             # <<<<<<<<<<<<<<
 *         return l
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1737
 *         """
 *         l = set(self.data.keys())
 *         return l             # <<<<<<<<<<<<<<
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_l));
  __pyx_r = ((PyObject *)__pyx_v_l);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_19get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_18get_chr_names[] = "Return all the chromosome names stored.\n        \n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_19get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_chr_names (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_18get_chr_names(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1732
 *             return None
 * 
 *     cpdef get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_18get_chr_names(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_chr_names", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1739
 *         return l
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in bedGraph Format.
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_21write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_bedGraph(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_bedGraph *__pyx_optional_args) {
  short __pyx_v_column = ((short)3);
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_l;
  int __pyx_v_pre;
  int __pyx_v_i;
  int __pyx_v_p;
  float __pyx_v_pre_v;
  float __pyx_v_v;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_value = 0;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  float __pyx_t_8;
  int __pyx_t_9;
  long __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_bedGraph", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_column = __pyx_optional_args->column;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_bedGraph); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_21write_bedGraph)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_column); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_fhd);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fhd);
      __Pyx_GIVEREF(__pyx_v_fhd);
      __Pyx_INCREF(((PyObject *)__pyx_v_name));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_name));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_name));
      __Pyx_INCREF(((PyObject *)__pyx_v_description));
      PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_description));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_description));
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1755
 *             np.ndarray pos, value
 * 
 *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."             # <<<<<<<<<<<<<<
 * 
 *         write = fhd.write
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyInt_FromLong(__pyx_v_column); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_k_tuple_32), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_12));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":1757
 *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."
 * 
 *         write = fhd.write             # <<<<<<<<<<<<<<
 * 
 *         if self.trackline:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_fhd, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_write = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1759
 *         write = fhd.write
 * 
 *         if self.trackline:             # <<<<<<<<<<<<<<
 *             # this line is REQUIRED by the wiggle format for UCSC browser
 *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name, description ) )
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__trackline); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":1761
 *         if self.trackline:
 *             # this line is REQUIRED by the wiggle format for UCSC browser
 *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name, description ) )             # <<<<<<<<<<<<<<
 * 
 *         chrs = self.get_chr_names()
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_name));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_name));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_name));
    __Pyx_INCREF(((PyObject *)__pyx_v_description));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_description));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_description));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "MACS2/IO/cScoreTrack.pyx":1763
 *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name, description ) )
 * 
 *         chrs = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1764
 * 
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_1 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_6(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __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 str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1765
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]             # <<<<<<<<<<<<<<
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1766
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]             # <<<<<<<<<<<<<<
 *             l = self.datalength[ chrom ]
 *             pre = 0
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_column, sizeof(short), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_value));
    __pyx_v_value = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1767
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]             # <<<<<<<<<<<<<<
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_l = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":1768
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]
 *             pre = 0             # <<<<<<<<<<<<<<
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             pre_v = value[ 0 ]
 */
    __pyx_v_pre = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1769
 *             l = self.datalength[ chrom ]
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data             # <<<<<<<<<<<<<<
 *             pre_v = value[ 0 ]
 *             for i in range( 1, l ):
 */
    __pyx_t_4 = ((__pyx_v_pos->dimensions[0]) == 0);
    if (__pyx_t_4) {
      goto __pyx_L4_continue;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "MACS2/IO/cScoreTrack.pyx":1770
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             pre_v = value[ 0 ]             # <<<<<<<<<<<<<<
 *             for i in range( 1, l ):
 *                 v = value[ i ]
 */
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_pre_v = __pyx_t_8;

    /* "MACS2/IO/cScoreTrack.pyx":1771
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             pre_v = value[ 0 ]
 *             for i in range( 1, l ):             # <<<<<<<<<<<<<<
 *                 v = value[ i ]
 *                 p = pos[ i-1 ]
 */
    __pyx_t_7 = __pyx_v_l;
    for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_7; __pyx_t_9+=1) {
      __pyx_v_i = __pyx_t_9;

      /* "MACS2/IO/cScoreTrack.pyx":1772
 *             pre_v = value[ 0 ]
 *             for i in range( 1, l ):
 *                 v = value[ i ]             # <<<<<<<<<<<<<<
 *                 p = pos[ i-1 ]
 *                 if abs(pre_v - v)>=1e-6:
 */
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_v = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":1773
 *             for i in range( 1, l ):
 *                 v = value[ i ]
 *                 p = pos[ i-1 ]             # <<<<<<<<<<<<<<
 *                 if abs(pre_v - v)>=1e-6:
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 */
      __pyx_t_10 = (__pyx_v_i - 1);
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), __pyx_t_10, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_p = __pyx_t_11;

      /* "MACS2/IO/cScoreTrack.pyx":1774
 *                 v = value[ i ]
 *                 p = pos[ i-1 ]
 *                 if abs(pre_v - v)>=1e-6:             # <<<<<<<<<<<<<<
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 *                     pre_v = v
 */
      __pyx_t_4 = (fabsf((__pyx_v_pre_v - __pyx_v_v)) >= 1e-6);
      if (__pyx_t_4) {

        /* "MACS2/IO/cScoreTrack.pyx":1775
 *                 p = pos[ i-1 ]
 *                 if abs(pre_v - v)>=1e-6:
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )             # <<<<<<<<<<<<<<
 *                     pre_v = v
 *                     pre = p
 */
        __pyx_t_2 = PyInt_FromLong(__pyx_v_pre); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyInt_FromLong(__pyx_v_p); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_12 = PyFloat_FromDouble(__pyx_v_pre_v); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_chrom));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_12);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_12));
        __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
        __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_12));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_12));
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":1776
 *                 if abs(pre_v - v)>=1e-6:
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 *                     pre_v = v             # <<<<<<<<<<<<<<
 *                     pre = p
 *             p = pos[ -1 ]
 */
        __pyx_v_pre_v = __pyx_v_v;

        /* "MACS2/IO/cScoreTrack.pyx":1777
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 *                     pre_v = v
 *                     pre = p             # <<<<<<<<<<<<<<
 *             p = pos[ -1 ]
 *             # last one
 */
        __pyx_v_pre = __pyx_v_p;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":1778
 *                     pre_v = v
 *                     pre = p
 *             p = pos[ -1 ]             # <<<<<<<<<<<<<<
 *             # last one
 *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 */
    __pyx_t_12 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_12); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_v_p = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":1780
 *             p = pos[ -1 ]
 *             # last one
 *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
    __pyx_t_12 = PyInt_FromLong(__pyx_v_pre); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = PyInt_FromLong(__pyx_v_p); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pre_v); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chrom));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_12 = 0;
    __pyx_t_13 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_L4_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1782
 *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     cpdef write_matrix ( self, fhd, str name, str description, short column = 3 ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_21write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_20write_bedGraph[] = "Write all data to fhd in bedGraph Format.\n\n        fhd: a filehandler to save bedGraph.\n\n        name/description: the name and description in track line.\n\n        colname: can be 1: chip, 2: control, 3: score\n\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_21write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fhd = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_description = 0;
  short __pyx_v_column;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_bedGraph (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fhd,&__pyx_n_s__name,&__pyx_n_s__description,&__pyx_n_s__column,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fhd)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__description)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__column);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bedGraph") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fhd = values[0];
    __pyx_v_name = ((PyObject*)values[1]);
    __pyx_v_description = ((PyObject*)values[2]);
    if (values[3]) {
      __pyx_v_column = __Pyx_PyInt_AsShort(values[3]); if (unlikely((__pyx_v_column == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_column = ((short)3);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_description), (&PyString_Type), 1, "description", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_20write_bedGraph(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self), __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_v_column);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1739
 *         return l
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in bedGraph Format.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_20write_bedGraph(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_bedGraph __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_bedGraph", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.column = __pyx_v_column;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->write_bedGraph(__pyx_v_self, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1784
 *         return True
 * 
 *     cpdef write_matrix ( self, fhd, str name, str description, short column = 3 ):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd into five columns Format:
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_23write_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_matrix(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_description, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_matrix *__pyx_optional_args) {
  short __pyx_v_column = ((short)3);
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_l;
  int __pyx_v_pre;
  int __pyx_v_i;
  int __pyx_v_p;
  float __pyx_v_v1;
  float __pyx_v_v2;
  float __pyx_v_v3;
  float __pyx_v_v4;
  PyArrayObject *__pyx_v_pos = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_value = 0;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_chrs = 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;
  int __pyx_t_8;
  float __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_matrix", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_column = __pyx_optional_args->column;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_23write_matrix)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_column); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_fhd);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fhd);
      __Pyx_GIVEREF(__pyx_v_fhd);
      __Pyx_INCREF(((PyObject *)__pyx_v_name));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_name));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_name));
      __Pyx_INCREF(((PyObject *)__pyx_v_description));
      PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_description));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_description));
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1802
 *             np.ndarray pos, value
 * 
 *         write = fhd.write             # <<<<<<<<<<<<<<
 * 
 *         chrs = self.get_chr_names()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_fhd, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1804
 *         write = fhd.write
 * 
 *         chrs = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1805
 * 
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_1 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __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 str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1806
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]             # <<<<<<<<<<<<<<
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1807
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]             # <<<<<<<<<<<<<<
 *             l = self.datalength[ chrom ]
 *             pre = 0
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_column, sizeof(short), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_value));
    __pyx_v_value = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1808
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]             # <<<<<<<<<<<<<<
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_l = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":1809
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]
 *             pre = 0             # <<<<<<<<<<<<<<
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             for i in range( 0, l ):
 */
    __pyx_v_pre = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1810
 *             l = self.datalength[ chrom ]
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data             # <<<<<<<<<<<<<<
 *             for i in range( 0, l ):
 *                 v1 = self.data[ i ][ 1 ]
 */
    __pyx_t_7 = ((__pyx_v_pos->dimensions[0]) == 0);
    if (__pyx_t_7) {
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "MACS2/IO/cScoreTrack.pyx":1811
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             for i in range( 0, l ):             # <<<<<<<<<<<<<<
 *                 v1 = self.data[ i ][ 1 ]
 *                 v2 = self.data[ i ][ 2 ]
 */
    __pyx_t_6 = __pyx_v_l;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_6; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":1812
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             for i in range( 0, l ):
 *                 v1 = self.data[ i ][ 1 ]             # <<<<<<<<<<<<<<
 *                 v2 = self.data[ i ][ 2 ]
 *                 v3 = self.data[ i ][ 3 ]
 */
      if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->data), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_v1 = __pyx_t_9;

      /* "MACS2/IO/cScoreTrack.pyx":1813
 *             for i in range( 0, l ):
 *                 v1 = self.data[ i ][ 1 ]
 *                 v2 = self.data[ i ][ 2 ]             # <<<<<<<<<<<<<<
 *                 v3 = self.data[ i ][ 3 ]
 *                 v4 = self.data[ i ][ 4 ]
 */
      if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->data), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_v2 = __pyx_t_9;

      /* "MACS2/IO/cScoreTrack.pyx":1814
 *                 v1 = self.data[ i ][ 1 ]
 *                 v2 = self.data[ i ][ 2 ]
 *                 v3 = self.data[ i ][ 3 ]             # <<<<<<<<<<<<<<
 *                 v4 = self.data[ i ][ 4 ]
 *                 p = pos[ i ]
 */
      if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->data), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_v3 = __pyx_t_9;

      /* "MACS2/IO/cScoreTrack.pyx":1815
 *                 v2 = self.data[ i ][ 2 ]
 *                 v3 = self.data[ i ][ 3 ]
 *                 v4 = self.data[ i ][ 4 ]             # <<<<<<<<<<<<<<
 *                 p = pos[ i ]
 *                 write( "%s:%d_%d\t%.5f\t%.5f\t%.5f\t%.5f\n" % ( chrom, pre, p, v1, v2, v3, v4 ) )
 */
      if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->data), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_v4 = __pyx_t_9;

      /* "MACS2/IO/cScoreTrack.pyx":1816
 *                 v3 = self.data[ i ][ 3 ]
 *                 v4 = self.data[ i ][ 4 ]
 *                 p = pos[ i ]             # <<<<<<<<<<<<<<
 *                 write( "%s:%d_%d\t%.5f\t%.5f\t%.5f\t%.5f\n" % ( chrom, pre, p, v1, v2, v3, v4 ) )
 *                 pre = p
 */
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_p = __pyx_t_10;

      /* "MACS2/IO/cScoreTrack.pyx":1817
 *                 v4 = self.data[ i ][ 4 ]
 *                 p = pos[ i ]
 *                 write( "%s:%d_%d\t%.5f\t%.5f\t%.5f\t%.5f\n" % ( chrom, pre, p, v1, v2, v3, v4 ) )             # <<<<<<<<<<<<<<
 *                 pre = p
 * 
 */
      __pyx_t_2 = PyInt_FromLong(__pyx_v_pre); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_p); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = PyFloat_FromDouble(__pyx_v_v1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = PyFloat_FromDouble(__pyx_v_v2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = PyFloat_FromDouble(__pyx_v_v3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = PyFloat_FromDouble(__pyx_v_v4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_15 = PyTuple_New(7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
      PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_chrom));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
      PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_15, 6, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_11 = 0;
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __pyx_t_14 = 0;
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_33), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
      __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1818
 *                 p = pos[ i ]
 *                 write( "%s:%d_%d\t%.5f\t%.5f\t%.5f\t%.5f\n" % ( chrom, pre, p, v1, v2, v3, v4 ) )
 *                 pre = p             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
      __pyx_v_pre = __pyx_v_p;
    }
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1820
 *                 pre = p
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     cpdef call_peaks (self, float cutoff=0.05, int min_length=200,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.write_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_23write_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_22write_matrix[] = "Write all data to fhd into five columns Format:\n\n        col1: chr_start_end\n        col2: t1 vs c1\n        col3: t2 vs c2\n        col4: t1 vs t2\n        col5: t2 vs t1\n\n        fhd: a filehandler to save the matrix.\n\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_23write_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fhd = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_description = 0;
  short __pyx_v_column;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_matrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fhd,&__pyx_n_s__name,&__pyx_n_s__description,&__pyx_n_s__column,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fhd)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_matrix", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__description)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_matrix", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__column);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_matrix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fhd = values[0];
    __pyx_v_name = ((PyObject*)values[1]);
    __pyx_v_description = ((PyObject*)values[2]);
    if (values[3]) {
      __pyx_v_column = __Pyx_PyInt_AsShort(values[3]); if (unlikely((__pyx_v_column == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_column = ((short)3);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_matrix", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.write_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_description), (&PyString_Type), 1, "description", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_22write_matrix(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self), __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_v_column);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1784
 *         return True
 * 
 *     cpdef write_matrix ( self, fhd, str name, str description, short column = 3 ):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd into five columns Format:
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_22write_matrix(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_matrix __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_matrix", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.column = __pyx_v_column;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->write_matrix(__pyx_v_self, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.write_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":1822
 *         return True
 * 
 *     cpdef call_peaks (self, float cutoff=0.05, int min_length=200,             # <<<<<<<<<<<<<<
 *                       bool call_summits=False):
 *         """This function try to find regions within which, scores
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_25call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_call_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_call_peaks *__pyx_optional_args) {
  float __pyx_v_cutoff = ((float)0.05);
  int __pyx_v_min_length = ((int)200);
  PyBoolObject *__pyx_v_call_summits = __pyx_k_34;
  int __pyx_v_i;
  PyObject *__pyx_v_chrom = 0;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_cat1_qvalues = 0;
  PyArrayObject *__pyx_v_cat2_qvalues = 0;
  PyArrayObject *__pyx_v_cat3_qvalues = 0;
  PyObject *__pyx_v_peak_content = 0;
  int __pyx_v_max_gap;
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_v_cat1_peaks = NULL;
  PyObject *__pyx_v_cat2_peaks = NULL;
  PyObject *__pyx_v_cat3_peaks = NULL;
  double __pyx_v_logcutoff;
  PyObject *__pyx_v_cat1 = NULL;
  PyObject *__pyx_v_cat2 = NULL;
  PyObject *__pyx_v_cat3 = NULL;
  PyObject *__pyx_v_cat1_qvalues_by_chrom = NULL;
  PyObject *__pyx_v_cat2_qvalues_by_chrom = NULL;
  PyObject *__pyx_v_cat3_qvalues_by_chrom = NULL;
  PyObject *__pyx_v_tvsc1 = NULL;
  PyObject *__pyx_v_tvsc2 = NULL;
  PyObject *__pyx_v_and_ = NULL;
  PyObject *__pyx_v_not_ = NULL;
  PyObject *__pyx_v_cond1_sig = NULL;
  PyObject *__pyx_v_cond2_sig = NULL;
  PyObject *__pyx_v_t1vst2 = NULL;
  PyObject *__pyx_v_where_cat1_above_cutoff = NULL;
  PyObject *__pyx_v_where_cat2_above_cutoff = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_where_cat3_above_cutoff = NULL;
  PyObject *__pyx_v_cat1_above_cutoff = NULL;
  PyObject *__pyx_v_cat2_above_cutoff = NULL;
  PyObject *__pyx_v_cat3_above_cutoff = NULL;
  PyObject *__pyx_v_cat1_above_cutoff_endpos = NULL;
  PyObject *__pyx_v_cat1_above_cutoff_startpos = NULL;
  PyObject *__pyx_v_cat2_above_cutoff_endpos = NULL;
  PyObject *__pyx_v_cat2_above_cutoff_startpos = NULL;
  PyObject *__pyx_v_cat3_above_cutoff_endpos = NULL;
  PyObject *__pyx_v_cat3_above_cutoff_startpos = NULL;
  PyObject *__pyx_v_qscores = NULL;
  PyObject *__pyx_v_best_qscore = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_cat1_qvalues;
  __Pyx_Buffer __pyx_pybuffer_cat1_qvalues;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_cat2_qvalues;
  __Pyx_Buffer __pyx_pybuffer_cat2_qvalues;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_cat3_qvalues;
  __Pyx_Buffer __pyx_pybuffer_cat3_qvalues;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  long __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call_peaks", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cutoff = __pyx_optional_args->cutoff;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_min_length = __pyx_optional_args->min_length;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_call_summits = __pyx_optional_args->call_summits;
        }
      }
    }
  }
  __pyx_pybuffer_cat1_qvalues.pybuffer.buf = NULL;
  __pyx_pybuffer_cat1_qvalues.refcount = 0;
  __pyx_pybuffernd_cat1_qvalues.data = NULL;
  __pyx_pybuffernd_cat1_qvalues.rcbuffer = &__pyx_pybuffer_cat1_qvalues;
  __pyx_pybuffer_cat2_qvalues.pybuffer.buf = NULL;
  __pyx_pybuffer_cat2_qvalues.refcount = 0;
  __pyx_pybuffernd_cat2_qvalues.data = NULL;
  __pyx_pybuffernd_cat2_qvalues.rcbuffer = &__pyx_pybuffer_cat2_qvalues;
  __pyx_pybuffer_cat3_qvalues.pybuffer.buf = NULL;
  __pyx_pybuffer_cat3_qvalues.refcount = 0;
  __pyx_pybuffernd_cat3_qvalues.data = NULL;
  __pyx_pybuffernd_cat3_qvalues.rcbuffer = &__pyx_pybuffer_cat3_qvalues;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__call_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_25call_peaks)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_call_summits));
      PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_call_summits));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_call_summits));
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":1847
 *             list peak_content
 *             int max_gap
 *         max_gap = min_length / 4             # <<<<<<<<<<<<<<
 *         chrs  = self.get_chr_names()
 *         cat1_peaks = PeakIO()       # dictionary to save peaks significant at condition 1
 */
  __pyx_v_max_gap = __Pyx_div_long(__pyx_v_min_length, 4);

  /* "MACS2/IO/cScoreTrack.pyx":1848
 *             int max_gap
 *         max_gap = min_length / 4
 *         chrs  = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         cat1_peaks = PeakIO()       # dictionary to save peaks significant at condition 1
 *         cat2_peaks = PeakIO()       # dictionary to save peaks significant at condition 2
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1849
 *         max_gap = min_length / 4
 *         chrs  = self.get_chr_names()
 *         cat1_peaks = PeakIO()       # dictionary to save peaks significant at condition 1             # <<<<<<<<<<<<<<
 *         cat2_peaks = PeakIO()       # dictionary to save peaks significant at condition 2
 *         cat3_peaks = PeakIO()       # dictionary to save peaks significant in both conditions
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PeakIO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cat1_peaks = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1850
 *         chrs  = self.get_chr_names()
 *         cat1_peaks = PeakIO()       # dictionary to save peaks significant at condition 1
 *         cat2_peaks = PeakIO()       # dictionary to save peaks significant at condition 2             # <<<<<<<<<<<<<<
 *         cat3_peaks = PeakIO()       # dictionary to save peaks significant in both conditions
 *         #cat4_peaks = PeakIO()       # dictionary to save peaks
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__PeakIO); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_cat2_peaks = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1851
 *         cat1_peaks = PeakIO()       # dictionary to save peaks significant at condition 1
 *         cat2_peaks = PeakIO()       # dictionary to save peaks significant at condition 2
 *         cat3_peaks = PeakIO()       # dictionary to save peaks significant in both conditions             # <<<<<<<<<<<<<<
 *         #cat4_peaks = PeakIO()       # dictionary to save peaks
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PeakIO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cat3_peaks = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1854
 *         #cat4_peaks = PeakIO()       # dictionary to save peaks
 * 
 *         self.cutoff = cutoff             # <<<<<<<<<<<<<<
 *         logcutoff = -log10(cutoff)
 *         cat1 = {}
 */
  __pyx_v_self->cutoff = __pyx_v_cutoff;

  /* "MACS2/IO/cScoreTrack.pyx":1855
 * 
 *         self.cutoff = cutoff
 *         logcutoff = -log10(cutoff)             # <<<<<<<<<<<<<<
 *         cat1 = {}
 *         cat2 = {}
 */
  __pyx_v_logcutoff = (-log10(__pyx_v_cutoff));

  /* "MACS2/IO/cScoreTrack.pyx":1856
 *         self.cutoff = cutoff
 *         logcutoff = -log10(cutoff)
 *         cat1 = {}             # <<<<<<<<<<<<<<
 *         cat2 = {}
 *         cat3 = {}
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_cat1 = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1857
 *         logcutoff = -log10(cutoff)
 *         cat1 = {}
 *         cat2 = {}             # <<<<<<<<<<<<<<
 *         cat3 = {}
 *         cat1_qvalues_by_chrom = {}
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_cat2 = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1858
 *         cat1 = {}
 *         cat2 = {}
 *         cat3 = {}             # <<<<<<<<<<<<<<
 *         cat1_qvalues_by_chrom = {}
 *         cat2_qvalues_by_chrom = {}
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_cat3 = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1859
 *         cat2 = {}
 *         cat3 = {}
 *         cat1_qvalues_by_chrom = {}             # <<<<<<<<<<<<<<
 *         cat2_qvalues_by_chrom = {}
 *         cat3_qvalues_by_chrom = {}
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_cat1_qvalues_by_chrom = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1860
 *         cat3 = {}
 *         cat1_qvalues_by_chrom = {}
 *         cat2_qvalues_by_chrom = {}             # <<<<<<<<<<<<<<
 *         cat3_qvalues_by_chrom = {}
 *         for chrom in chrs:
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_cat2_qvalues_by_chrom = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1861
 *         cat1_qvalues_by_chrom = {}
 *         cat2_qvalues_by_chrom = {}
 *         cat3_qvalues_by_chrom = {}             # <<<<<<<<<<<<<<
 *         for chrom in chrs:
 *             tvsc1 = self.data[chrom][ 1 ]
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_cat3_qvalues_by_chrom = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1862
 *         cat2_qvalues_by_chrom = {}
 *         cat3_qvalues_by_chrom = {}
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             tvsc1 = self.data[chrom][ 1 ]
 *             tvsc2 = self.data[chrom][ 2 ]
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_3 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1863
 *         cat3_qvalues_by_chrom = {}
 *         for chrom in chrs:
 *             tvsc1 = self.data[chrom][ 1 ]             # <<<<<<<<<<<<<<
 *             tvsc2 = self.data[chrom][ 2 ]
 *             and_ = np.logical_and
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_tvsc1);
    __pyx_v_tvsc1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1864
 *         for chrom in chrs:
 *             tvsc1 = self.data[chrom][ 1 ]
 *             tvsc2 = self.data[chrom][ 2 ]             # <<<<<<<<<<<<<<
 *             and_ = np.logical_and
 *             not_ = np.logical_not
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_tvsc2);
    __pyx_v_tvsc2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1865
 *             tvsc1 = self.data[chrom][ 1 ]
 *             tvsc2 = self.data[chrom][ 2 ]
 *             and_ = np.logical_and             # <<<<<<<<<<<<<<
 *             not_ = np.logical_not
 *             cond1_sig = tvsc1 >= logcutoff
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__logical_and); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_and_);
    __pyx_v_and_ = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1866
 *             tvsc2 = self.data[chrom][ 2 ]
 *             and_ = np.logical_and
 *             not_ = np.logical_not             # <<<<<<<<<<<<<<
 *             cond1_sig = tvsc1 >= logcutoff
 *             cond2_sig = tvsc2 >= logcutoff
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__logical_not); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_not_);
    __pyx_v_not_ = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1867
 *             and_ = np.logical_and
 *             not_ = np.logical_not
 *             cond1_sig = tvsc1 >= logcutoff             # <<<<<<<<<<<<<<
 *             cond2_sig = tvsc2 >= logcutoff
 *             # indices where score is above cutoff
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_logcutoff); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_tvsc1, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_cond1_sig);
    __pyx_v_cond1_sig = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1868
 *             not_ = np.logical_not
 *             cond1_sig = tvsc1 >= logcutoff
 *             cond2_sig = tvsc2 >= logcutoff             # <<<<<<<<<<<<<<
 *             # indices where score is above cutoff
 *             cat1[chrom] = np.where(and_(cond1_sig,       not_(cond2_sig)))[0]
 */
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_logcutoff); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_tvsc2, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_cond2_sig);
    __pyx_v_cond2_sig = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1870
 *             cond2_sig = tvsc2 >= logcutoff
 *             # indices where score is above cutoff
 *             cat1[chrom] = np.where(and_(cond1_sig,       not_(cond2_sig)))[0]             # <<<<<<<<<<<<<<
 *             cat2[chrom] = np.where(and_(not_(cond1_sig), cond2_sig))[0]
 *             cat3[chrom] = np.where(and_(cond1_sig,       cond2_sig))[0]
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__where); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_cond2_sig);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cond2_sig);
    __Pyx_GIVEREF(__pyx_v_cond2_sig);
    __pyx_t_2 = PyObject_Call(__pyx_v_not_, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_cond1_sig);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cond1_sig);
    __Pyx_GIVEREF(__pyx_v_cond1_sig);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_v_and_, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(((PyObject *)__pyx_v_cat1), ((PyObject *)__pyx_v_chrom), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1871
 *             # indices where score is above cutoff
 *             cat1[chrom] = np.where(and_(cond1_sig,       not_(cond2_sig)))[0]
 *             cat2[chrom] = np.where(and_(not_(cond1_sig), cond2_sig))[0]             # <<<<<<<<<<<<<<
 *             cat3[chrom] = np.where(and_(cond1_sig,       cond2_sig))[0]
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__where); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_cond1_sig);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cond1_sig);
    __Pyx_GIVEREF(__pyx_v_cond1_sig);
    __pyx_t_4 = PyObject_Call(__pyx_v_not_, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_cond2_sig);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_cond2_sig);
    __Pyx_GIVEREF(__pyx_v_cond2_sig);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_v_and_, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(((PyObject *)__pyx_v_cat2), ((PyObject *)__pyx_v_chrom), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1872
 *             cat1[chrom] = np.where(and_(cond1_sig,       not_(cond2_sig)))[0]
 *             cat2[chrom] = np.where(and_(not_(cond1_sig), cond2_sig))[0]
 *             cat3[chrom] = np.where(and_(cond1_sig,       cond2_sig))[0]             # <<<<<<<<<<<<<<
 * 
 *         # qvalue conversion for each category to improve statistical power
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__where); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_cond1_sig);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cond1_sig);
    __Pyx_GIVEREF(__pyx_v_cond1_sig);
    __Pyx_INCREF(__pyx_v_cond2_sig);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_cond2_sig);
    __Pyx_GIVEREF(__pyx_v_cond2_sig);
    __pyx_t_2 = PyObject_Call(__pyx_v_and_, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(((PyObject *)__pyx_v_cat3), ((PyObject *)__pyx_v_chrom), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1875
 * 
 *         # qvalue conversion for each category to improve statistical power
 *         cat1_qvalues_by_chrom = self.compute_category_qvalues(cat1)             # <<<<<<<<<<<<<<
 *         cat2_qvalues_by_chrom = self.compute_category_qvalues(cat2)
 *         cat3_qvalues_by_chrom = self.compute_category_qvalues(cat3)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->compute_category_qvalues(__pyx_v_self, __pyx_v_cat1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_v_cat1_qvalues_by_chrom);
  __pyx_v_cat1_qvalues_by_chrom = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1876
 *         # qvalue conversion for each category to improve statistical power
 *         cat1_qvalues_by_chrom = self.compute_category_qvalues(cat1)
 *         cat2_qvalues_by_chrom = self.compute_category_qvalues(cat2)             # <<<<<<<<<<<<<<
 *         cat3_qvalues_by_chrom = self.compute_category_qvalues(cat3)
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->compute_category_qvalues(__pyx_v_self, __pyx_v_cat2, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_v_cat2_qvalues_by_chrom);
  __pyx_v_cat2_qvalues_by_chrom = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1877
 *         cat1_qvalues_by_chrom = self.compute_category_qvalues(cat1)
 *         cat2_qvalues_by_chrom = self.compute_category_qvalues(cat2)
 *         cat3_qvalues_by_chrom = self.compute_category_qvalues(cat3)             # <<<<<<<<<<<<<<
 * 
 *         for chrom in chrs:
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->compute_category_qvalues(__pyx_v_self, __pyx_v_cat3, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_v_cat3_qvalues_by_chrom);
  __pyx_v_cat3_qvalues_by_chrom = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1879
 *         cat3_qvalues_by_chrom = self.compute_category_qvalues(cat3)
 * 
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             peak_content = []           # to store points above cutoff
 * 
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_3 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1880
 * 
 *         for chrom in chrs:
 *             peak_content = []           # to store points above cutoff             # <<<<<<<<<<<<<<
 * 
 *             pos = self.data[chrom][ 0 ]
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(((PyObject *)__pyx_v_peak_content));
    __pyx_v_peak_content = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1882
 *             peak_content = []           # to store points above cutoff
 * 
 *             pos = self.data[chrom][ 0 ]             # <<<<<<<<<<<<<<
 *             t1vst2 = self.data[chrom][ 3 ]
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1883
 * 
 *             pos = self.data[chrom][ 0 ]
 *             t1vst2 = self.data[chrom][ 3 ]             # <<<<<<<<<<<<<<
 * 
 *             cat1_qvalues = cat1_qvalues_by_chrom[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->data), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_t1vst2);
    __pyx_v_t1vst2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1885
 *             t1vst2 = self.data[chrom][ 3 ]
 * 
 *             cat1_qvalues = cat1_qvalues_by_chrom[chrom]             # <<<<<<<<<<<<<<
 *             cat2_qvalues = cat2_qvalues_by_chrom[chrom]
 *             cat3_qvalues = cat3_qvalues_by_chrom[chrom]
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_cat1_qvalues_by_chrom, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cat1_qvalues.rcbuffer->pybuffer);
      __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cat1_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_8 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cat1_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_v_cat1_qvalues, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        }
      }
      __pyx_pybuffernd_cat1_qvalues.diminfo[0].strides = __pyx_pybuffernd_cat1_qvalues.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cat1_qvalues.diminfo[0].shape = __pyx_pybuffernd_cat1_qvalues.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_cat1_qvalues));
    __pyx_v_cat1_qvalues = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1886
 * 
 *             cat1_qvalues = cat1_qvalues_by_chrom[chrom]
 *             cat2_qvalues = cat2_qvalues_by_chrom[chrom]             # <<<<<<<<<<<<<<
 *             cat3_qvalues = cat3_qvalues_by_chrom[chrom]
 * 
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_cat2_qvalues_by_chrom, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cat2_qvalues.rcbuffer->pybuffer);
      __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cat2_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_8 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cat2_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_v_cat2_qvalues, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        }
      }
      __pyx_pybuffernd_cat2_qvalues.diminfo[0].strides = __pyx_pybuffernd_cat2_qvalues.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cat2_qvalues.diminfo[0].shape = __pyx_pybuffernd_cat2_qvalues.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_cat2_qvalues));
    __pyx_v_cat2_qvalues = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1887
 *             cat1_qvalues = cat1_qvalues_by_chrom[chrom]
 *             cat2_qvalues = cat2_qvalues_by_chrom[chrom]
 *             cat3_qvalues = cat3_qvalues_by_chrom[chrom]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_cat3_qvalues_by_chrom, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cat3_qvalues.rcbuffer->pybuffer);
      __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cat3_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_8 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cat3_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_v_cat3_qvalues, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        }
      }
      __pyx_pybuffernd_cat3_qvalues.diminfo[0].strides = __pyx_pybuffernd_cat3_qvalues.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cat3_qvalues.diminfo[0].shape = __pyx_pybuffernd_cat3_qvalues.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_cat3_qvalues));
    __pyx_v_cat3_qvalues = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1890
 * 
 * 
 *             where_cat1_above_cutoff = cat1_qvalues >= logcutoff             # <<<<<<<<<<<<<<
 *             where_cat2_above_cutoff = cat2_qvalues >= logcutoff
 *             where_cat3_above_cutoff = cat3_qvalues >= logcutoff
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_logcutoff); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_cat1_qvalues), __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_where_cat1_above_cutoff);
    __pyx_v_where_cat1_above_cutoff = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1891
 * 
 *             where_cat1_above_cutoff = cat1_qvalues >= logcutoff
 *             where_cat2_above_cutoff = cat2_qvalues >= logcutoff             # <<<<<<<<<<<<<<
 *             where_cat3_above_cutoff = cat3_qvalues >= logcutoff
 *             cat1_above_cutoff = cat1[chrom][where_cat1_above_cutoff]
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_logcutoff); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_cat2_qvalues), __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_where_cat2_above_cutoff);
    __pyx_v_where_cat2_above_cutoff = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1892
 *             where_cat1_above_cutoff = cat1_qvalues >= logcutoff
 *             where_cat2_above_cutoff = cat2_qvalues >= logcutoff
 *             where_cat3_above_cutoff = cat3_qvalues >= logcutoff             # <<<<<<<<<<<<<<
 *             cat1_above_cutoff = cat1[chrom][where_cat1_above_cutoff]
 *             cat2_above_cutoff = cat2[chrom][where_cat2_above_cutoff]
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_logcutoff); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_cat3_qvalues), __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_where_cat3_above_cutoff);
    __pyx_v_where_cat3_above_cutoff = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1893
 *             where_cat2_above_cutoff = cat2_qvalues >= logcutoff
 *             where_cat3_above_cutoff = cat3_qvalues >= logcutoff
 *             cat1_above_cutoff = cat1[chrom][where_cat1_above_cutoff]             # <<<<<<<<<<<<<<
 *             cat2_above_cutoff = cat2[chrom][where_cat2_above_cutoff]
 *             cat3_above_cutoff = cat3[chrom][where_cat2_above_cutoff]
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_cat1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_where_cat1_above_cutoff); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_cat1_above_cutoff);
    __pyx_v_cat1_above_cutoff = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1894
 *             where_cat3_above_cutoff = cat3_qvalues >= logcutoff
 *             cat1_above_cutoff = cat1[chrom][where_cat1_above_cutoff]
 *             cat2_above_cutoff = cat2[chrom][where_cat2_above_cutoff]             # <<<<<<<<<<<<<<
 *             cat3_above_cutoff = cat3[chrom][where_cat2_above_cutoff]
 *             cat1_above_cutoff_endpos = pos[cat1_above_cutoff] # end positions of regions where score is above cutoff
 */
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_cat2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_where_cat2_above_cutoff); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_cat2_above_cutoff);
    __pyx_v_cat2_above_cutoff = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1895
 *             cat1_above_cutoff = cat1[chrom][where_cat1_above_cutoff]
 *             cat2_above_cutoff = cat2[chrom][where_cat2_above_cutoff]
 *             cat3_above_cutoff = cat3[chrom][where_cat2_above_cutoff]             # <<<<<<<<<<<<<<
 *             cat1_above_cutoff_endpos = pos[cat1_above_cutoff] # end positions of regions where score is above cutoff
 *             cat1_above_cutoff_startpos = pos[cat1_above_cutoff-1] # start positions of regions where score is above cutoff
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_cat3), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_where_cat2_above_cutoff); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_cat3_above_cutoff);
    __pyx_v_cat3_above_cutoff = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1896
 *             cat2_above_cutoff = cat2[chrom][where_cat2_above_cutoff]
 *             cat3_above_cutoff = cat3[chrom][where_cat2_above_cutoff]
 *             cat1_above_cutoff_endpos = pos[cat1_above_cutoff] # end positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 *             cat1_above_cutoff_startpos = pos[cat1_above_cutoff-1] # start positions of regions where score is above cutoff
 *             cat2_above_cutoff_endpos = pos[cat2_above_cutoff] # end positions of regions where score is above cutoff
 */
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_v_cat1_above_cutoff); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_cat1_above_cutoff_endpos);
    __pyx_v_cat1_above_cutoff_endpos = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1897
 *             cat3_above_cutoff = cat3[chrom][where_cat2_above_cutoff]
 *             cat1_above_cutoff_endpos = pos[cat1_above_cutoff] # end positions of regions where score is above cutoff
 *             cat1_above_cutoff_startpos = pos[cat1_above_cutoff-1] # start positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 *             cat2_above_cutoff_endpos = pos[cat2_above_cutoff] # end positions of regions where score is above cutoff
 *             cat2_above_cutoff_startpos = pos[cat2_above_cutoff-1] # start positions of regions where score is above cutoff
 */
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_cat1_above_cutoff, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_cat1_above_cutoff_startpos);
    __pyx_v_cat1_above_cutoff_startpos = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1898
 *             cat1_above_cutoff_endpos = pos[cat1_above_cutoff] # end positions of regions where score is above cutoff
 *             cat1_above_cutoff_startpos = pos[cat1_above_cutoff-1] # start positions of regions where score is above cutoff
 *             cat2_above_cutoff_endpos = pos[cat2_above_cutoff] # end positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 *             cat2_above_cutoff_startpos = pos[cat2_above_cutoff-1] # start positions of regions where score is above cutoff
 *             cat3_above_cutoff_endpos = pos[cat3_above_cutoff] # end positions of regions where score is above cutoff
 */
    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_v_cat2_above_cutoff); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_cat2_above_cutoff_endpos);
    __pyx_v_cat2_above_cutoff_endpos = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1899
 *             cat1_above_cutoff_startpos = pos[cat1_above_cutoff-1] # start positions of regions where score is above cutoff
 *             cat2_above_cutoff_endpos = pos[cat2_above_cutoff] # end positions of regions where score is above cutoff
 *             cat2_above_cutoff_startpos = pos[cat2_above_cutoff-1] # start positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 *             cat3_above_cutoff_endpos = pos[cat3_above_cutoff] # end positions of regions where score is above cutoff
 *             cat3_above_cutoff_startpos = pos[cat3_above_cutoff-1] # start positions of regions where score is above cutoff
 */
    __pyx_t_2 = PyNumber_Subtract(__pyx_v_cat2_above_cutoff, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_2); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_cat2_above_cutoff_startpos);
    __pyx_v_cat2_above_cutoff_startpos = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1900
 *             cat2_above_cutoff_endpos = pos[cat2_above_cutoff] # end positions of regions where score is above cutoff
 *             cat2_above_cutoff_startpos = pos[cat2_above_cutoff-1] # start positions of regions where score is above cutoff
 *             cat3_above_cutoff_endpos = pos[cat3_above_cutoff] # end positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 *             cat3_above_cutoff_startpos = pos[cat3_above_cutoff-1] # start positions of regions where score is above cutoff
 *             #cat4_above_cutoff_endpos = pos[cat4_above_cutoff] # end positions of regions where score is above cutoff
 */
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_v_cat3_above_cutoff); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_cat3_above_cutoff_endpos);
    __pyx_v_cat3_above_cutoff_endpos = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1901
 *             cat2_above_cutoff_startpos = pos[cat2_above_cutoff-1] # start positions of regions where score is above cutoff
 *             cat3_above_cutoff_endpos = pos[cat3_above_cutoff] # end positions of regions where score is above cutoff
 *             cat3_above_cutoff_startpos = pos[cat3_above_cutoff-1] # start positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 *             #cat4_above_cutoff_endpos = pos[cat4_above_cutoff] # end positions of regions where score is above cutoff
 *             #cat4_above_cutoff_startpos = pos[cat4_above_cutoff-1] # start positions of regions where score is above cutoff
 */
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_cat3_above_cutoff, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_cat3_above_cutoff_startpos);
    __pyx_v_cat3_above_cutoff_startpos = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":1907
 *             # should we actually save these statistics???
 * 
 *             if cat1_above_cutoff_startpos.size > 0:             # <<<<<<<<<<<<<<
 *                 qscores = t1vst2[cat1_above_cutoff]
 *                 peak_content = []
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_cat1_above_cutoff_startpos, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __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 = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_12) {

      /* "MACS2/IO/cScoreTrack.pyx":1908
 * 
 *             if cat1_above_cutoff_startpos.size > 0:
 *                 qscores = t1vst2[cat1_above_cutoff]             # <<<<<<<<<<<<<<
 *                 peak_content = []
 *                 # cat 1 is not empty
 */
      __pyx_t_1 = PyObject_GetItem(__pyx_v_t1vst2, __pyx_v_cat1_above_cutoff); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_v_qscores);
      __pyx_v_qscores = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1909
 *             if cat1_above_cutoff_startpos.size > 0:
 *                 qscores = t1vst2[cat1_above_cutoff]
 *                 peak_content = []             # <<<<<<<<<<<<<<
 *                 # cat 1 is not empty
 *                 if cat1_above_cutoff[0] == 0:
 */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_v_peak_content));
      __pyx_v_peak_content = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1911
 *                 peak_content = []
 *                 # cat 1 is not empty
 *                 if cat1_above_cutoff[0] == 0:             # <<<<<<<<<<<<<<
 *                     # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
 *                     cat1_above_cutoff_startpos[0] = 0
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cat1_above_cutoff, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1911; __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 = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_12) {

        /* "MACS2/IO/cScoreTrack.pyx":1913
 *                 if cat1_above_cutoff[0] == 0:
 *                     # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
 *                     cat1_above_cutoff_startpos[0] = 0             # <<<<<<<<<<<<<<
 *                 # first bit of region above cutoff
 *                 peak_content.append( (cat1_above_cutoff_startpos[0], cat1_above_cutoff_endpos[0], qscores[0]) )
 */
        if (__Pyx_SetItemInt(__pyx_v_cat1_above_cutoff_startpos, 0, __pyx_int_0, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "MACS2/IO/cScoreTrack.pyx":1915
 *                     cat1_above_cutoff_startpos[0] = 0
 *                 # first bit of region above cutoff
 *                 peak_content.append( (cat1_above_cutoff_startpos[0], cat1_above_cutoff_endpos[0], qscores[0]) )             # <<<<<<<<<<<<<<
 *                 for i in range( 1, cat1_above_cutoff_startpos.size ):
 *                     if cat1_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cat1_above_cutoff_startpos, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cat1_above_cutoff_endpos, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_qscores, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_2 = 0;
      __pyx_t_1 = 0;
      __pyx_t_4 = 0;
      __pyx_t_14 = PyList_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_13)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1916
 *                 # first bit of region above cutoff
 *                 peak_content.append( (cat1_above_cutoff_startpos[0], cat1_above_cutoff_endpos[0], qscores[0]) )
 *                 for i in range( 1, cat1_above_cutoff_startpos.size ):             # <<<<<<<<<<<<<<
 *                     if cat1_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 *                         # append
 */
      __pyx_t_13 = PyObject_GetAttr(__pyx_v_cat1_above_cutoff_startpos, __pyx_n_s__size); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_15 = __Pyx_PyInt_AsLong(__pyx_t_13); if (unlikely((__pyx_t_15 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_15; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;

        /* "MACS2/IO/cScoreTrack.pyx":1917
 *                 peak_content.append( (cat1_above_cutoff_startpos[0], cat1_above_cutoff_endpos[0], qscores[0]) )
 *                 for i in range( 1, cat1_above_cutoff_startpos.size ):
 *                     if cat1_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:             # <<<<<<<<<<<<<<
 *                         # append
 *                         peak_content.append( (cat1_above_cutoff_startpos[i], cat1_above_cutoff_endpos[i], qscores[i] ) )
 */
        __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_cat1_above_cutoff_startpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Subtract(__pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyInt_FromLong(__pyx_v_max_gap); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_13 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (__pyx_t_12) {

          /* "MACS2/IO/cScoreTrack.pyx":1919
 *                     if cat1_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 *                         # append
 *                         peak_content.append( (cat1_above_cutoff_startpos[i], cat1_above_cutoff_endpos[i], qscores[i] ) )             # <<<<<<<<<<<<<<
 *                     else:
 *                         # close
 */
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_cat1_above_cutoff_startpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cat1_above_cutoff_endpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_qscores, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          __pyx_t_13 = 0;
          __pyx_t_1 = 0;
          __pyx_t_4 = 0;
          __pyx_t_14 = PyList_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          goto __pyx_L11;
        }
        /*else*/ {

          /* "MACS2/IO/cScoreTrack.pyx":1922
 *                     else:
 *                         # close
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:             # <<<<<<<<<<<<<<
 *                             best_qscore = min(map(itemgetter(2), peak_content))
 *                             cat1_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 */
          __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_12) {

            /* "MACS2/IO/cScoreTrack.pyx":1923
 *                         # close
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                             best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                             cat1_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
            __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_INCREF(((PyObject *)__pyx_v_peak_content));
            PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_peak_content));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_peak_content));
            __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
            __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_v_best_qscore);
            __pyx_v_best_qscore = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":1924
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                             best_qscore = min(map(itemgetter(2), peak_content))
 *                             cat1_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                             fold_change = 0, qscore = best_qscore,
 */
            __pyx_t_1 = PyObject_GetAttr(__pyx_v_cat1_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_chrom));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_13);
            __Pyx_GIVEREF(__pyx_t_13);
            __pyx_t_2 = 0;
            __pyx_t_13 = 0;
            __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_13));
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__summit), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__peak_score), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

            /* "MACS2/IO/cScoreTrack.pyx":1926
 *                             cat1_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                             fold_change = 0, qscore = best_qscore,             # <<<<<<<<<<<<<<
 *                                             )
 *                         peak_content = [(cat1_above_cutoff_startpos[i], cat1_above_cutoff_endpos[i], qscores[i]),]
 */
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__qscore), __pyx_v_best_qscore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            goto __pyx_L12;
          }
          __pyx_L12:;

          /* "MACS2/IO/cScoreTrack.pyx":1928
 *                                             fold_change = 0, qscore = best_qscore,
 *                                             )
 *                         peak_content = [(cat1_above_cutoff_startpos[i], cat1_above_cutoff_endpos[i], qscores[i]),]             # <<<<<<<<<<<<<<
 *                 # save the last peak
 *                 if not peak_content:
 */
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cat1_above_cutoff_startpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_cat1_above_cutoff_endpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_qscores, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          __pyx_t_2 = 0;
          __pyx_t_13 = 0;
          __pyx_t_4 = 0;
          __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          __pyx_t_1 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_v_peak_content));
          __pyx_v_peak_content = ((PyObject*)__pyx_t_4);
          __pyx_t_4 = 0;
        }
        __pyx_L11:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":1930
 *                         peak_content = [(cat1_above_cutoff_startpos[i], cat1_above_cutoff_endpos[i], qscores[i]),]
 *                 # save the last peak
 *                 if not peak_content:             # <<<<<<<<<<<<<<
 *                     continue
 *                 else:
 */
      __pyx_t_12 = (((PyObject *)__pyx_v_peak_content) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_peak_content)) != 0);
      __pyx_t_16 = (!__pyx_t_12);
      if (__pyx_t_16) {

        /* "MACS2/IO/cScoreTrack.pyx":1931
 *                 # save the last peak
 *                 if not peak_content:
 *                     continue             # <<<<<<<<<<<<<<
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 */
        goto __pyx_L5_continue;
        goto __pyx_L13;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":1933
 *                     continue
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:             # <<<<<<<<<<<<<<
 *                         best_qscore = min(map(itemgetter(2), peak_content))
 *                         cat1_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 */
        __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_13); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_13, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_16) {

          /* "MACS2/IO/cScoreTrack.pyx":1934
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                         best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                         cat1_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
          __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_13 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_36), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __Pyx_INCREF(((PyObject *)__pyx_v_peak_content));
          PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_peak_content));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_peak_content));
          __pyx_t_13 = 0;
          __pyx_t_13 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_13 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_v_best_qscore);
          __pyx_v_best_qscore = __pyx_t_13;
          __pyx_t_13 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":1935
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                         best_qscore = min(map(itemgetter(2), peak_content))
 *                         cat1_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                         fold_change = 0, qscore = best_qscore,
 */
          __pyx_t_13 = PyObject_GetAttr(__pyx_v_cat1_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
          PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chrom));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_4 = 0;
          __pyx_t_2 = 0;
          __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_2));
          if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__summit), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__peak_score), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

          /* "MACS2/IO/cScoreTrack.pyx":1937
 *                         cat1_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                         fold_change = 0, qscore = best_qscore,             # <<<<<<<<<<<<<<
 *                                         )
 *             if cat2_above_cutoff_startpos.size > 0:
 */
          if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__qscore), __pyx_v_best_qscore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_4 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L14;
        }
        __pyx_L14:;
      }
      __pyx_L13:;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "MACS2/IO/cScoreTrack.pyx":1939
 *                                         fold_change = 0, qscore = best_qscore,
 *                                         )
 *             if cat2_above_cutoff_startpos.size > 0:             # <<<<<<<<<<<<<<
 *                 qscores = t1vst2[cat2_above_cutoff]
 *                 peak_content = []
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_cat2_above_cutoff_startpos, __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_16) {

      /* "MACS2/IO/cScoreTrack.pyx":1940
 *                                         )
 *             if cat2_above_cutoff_startpos.size > 0:
 *                 qscores = t1vst2[cat2_above_cutoff]             # <<<<<<<<<<<<<<
 *                 peak_content = []
 *                 # cat 1 is not empty
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_t1vst2, __pyx_v_cat2_above_cutoff); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_v_qscores);
      __pyx_v_qscores = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1941
 *             if cat2_above_cutoff_startpos.size > 0:
 *                 qscores = t1vst2[cat2_above_cutoff]
 *                 peak_content = []             # <<<<<<<<<<<<<<
 *                 # cat 1 is not empty
 *                 if cat2_above_cutoff[0] == 0:
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_v_peak_content));
      __pyx_v_peak_content = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1943
 *                 peak_content = []
 *                 # cat 1 is not empty
 *                 if cat2_above_cutoff[0] == 0:             # <<<<<<<<<<<<<<
 *                     # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
 *                     cat2_above_cutoff_startpos[0] = 0
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cat2_above_cutoff, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_16) {

        /* "MACS2/IO/cScoreTrack.pyx":1945
 *                 if cat2_above_cutoff[0] == 0:
 *                     # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
 *                     cat2_above_cutoff_startpos[0] = 0             # <<<<<<<<<<<<<<
 *                 # first bit of region above cutoff
 *                 peak_content.append( (cat2_above_cutoff_startpos[0], cat2_above_cutoff_endpos[0], qscores[0]) )
 */
        if (__Pyx_SetItemInt(__pyx_v_cat2_above_cutoff_startpos, 0, __pyx_int_0, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L16;
      }
      __pyx_L16:;

      /* "MACS2/IO/cScoreTrack.pyx":1947
 *                     cat2_above_cutoff_startpos[0] = 0
 *                 # first bit of region above cutoff
 *                 peak_content.append( (cat2_above_cutoff_startpos[0], cat2_above_cutoff_endpos[0], qscores[0]) )             # <<<<<<<<<<<<<<
 *                 for i in range( 1, cat2_above_cutoff_startpos.size ):
 *                     if cat2_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cat2_above_cutoff_startpos, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cat2_above_cutoff_endpos, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_qscores, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_4 = 0;
      __pyx_t_2 = 0;
      __pyx_t_1 = 0;
      __pyx_t_14 = PyList_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_13)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1948
 *                 # first bit of region above cutoff
 *                 peak_content.append( (cat2_above_cutoff_startpos[0], cat2_above_cutoff_endpos[0], qscores[0]) )
 *                 for i in range( 1, cat2_above_cutoff_startpos.size ):             # <<<<<<<<<<<<<<
 *                     if cat2_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 *                         # append
 */
      __pyx_t_13 = PyObject_GetAttr(__pyx_v_cat2_above_cutoff_startpos, __pyx_n_s__size); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_15 = __Pyx_PyInt_AsLong(__pyx_t_13); if (unlikely((__pyx_t_15 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_15; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;

        /* "MACS2/IO/cScoreTrack.pyx":1949
 *                 peak_content.append( (cat2_above_cutoff_startpos[0], cat2_above_cutoff_endpos[0], qscores[0]) )
 *                 for i in range( 1, cat2_above_cutoff_startpos.size ):
 *                     if cat2_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:             # <<<<<<<<<<<<<<
 *                         # append
 *                         peak_content.append( (cat2_above_cutoff_startpos[i], cat2_above_cutoff_endpos[i], qscores[i] ) )
 */
        __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_cat2_above_cutoff_startpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Subtract(__pyx_t_13, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyInt_FromLong(__pyx_v_max_gap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (__pyx_t_16) {

          /* "MACS2/IO/cScoreTrack.pyx":1951
 *                     if cat2_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 *                         # append
 *                         peak_content.append( (cat2_above_cutoff_startpos[i], cat2_above_cutoff_endpos[i], qscores[i] ) )             # <<<<<<<<<<<<<<
 *                     else:
 *                         # close
 */
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_cat2_above_cutoff_startpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cat2_above_cutoff_endpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_qscores, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_13 = 0;
          __pyx_t_2 = 0;
          __pyx_t_1 = 0;
          __pyx_t_14 = PyList_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "MACS2/IO/cScoreTrack.pyx":1954
 *                     else:
 *                         # close
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:             # <<<<<<<<<<<<<<
 *                             best_qscore = min(map(itemgetter(2), peak_content))
 *                             cat2_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 */
          __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_16) {

            /* "MACS2/IO/cScoreTrack.pyx":1955
 *                         # close
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                             best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                             cat2_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
            __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_INCREF(((PyObject *)__pyx_v_peak_content));
            PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_peak_content));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_peak_content));
            __pyx_t_2 = 0;
            __pyx_t_2 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
            __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            __pyx_t_2 = 0;
            __pyx_t_2 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_v_best_qscore);
            __pyx_v_best_qscore = __pyx_t_2;
            __pyx_t_2 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":1956
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                             best_qscore = min(map(itemgetter(2), peak_content))
 *                             cat2_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                             fold_change = 0, qscore = best_qscore,
 */
            __pyx_t_2 = PyObject_GetAttr(__pyx_v_cat2_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __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 = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chrom));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_13);
            __Pyx_GIVEREF(__pyx_t_13);
            __pyx_t_4 = 0;
            __pyx_t_13 = 0;
            __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_13));
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__summit), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__peak_score), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

            /* "MACS2/IO/cScoreTrack.pyx":1958
 *                             cat2_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                             fold_change = 0, qscore = best_qscore,             # <<<<<<<<<<<<<<
 *                                             )
 *                         peak_content = [(cat2_above_cutoff_startpos[i], cat2_above_cutoff_endpos[i], qscores[i]),]
 */
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__qscore), __pyx_v_best_qscore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L20;
          }
          __pyx_L20:;

          /* "MACS2/IO/cScoreTrack.pyx":1960
 *                                             fold_change = 0, qscore = best_qscore,
 *                                             )
 *                         peak_content = [(cat2_above_cutoff_startpos[i], cat2_above_cutoff_endpos[i], qscores[i]),]             # <<<<<<<<<<<<<<
 *                 # save the last peak
 *                 if not peak_content:
 */
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cat2_above_cutoff_startpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_cat2_above_cutoff_endpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_qscores, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_4 = 0;
          __pyx_t_13 = 0;
          __pyx_t_1 = 0;
          __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
          __pyx_t_2 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_v_peak_content));
          __pyx_v_peak_content = ((PyObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __pyx_L19:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":1962
 *                         peak_content = [(cat2_above_cutoff_startpos[i], cat2_above_cutoff_endpos[i], qscores[i]),]
 *                 # save the last peak
 *                 if not peak_content:             # <<<<<<<<<<<<<<
 *                     continue
 *                 else:
 */
      __pyx_t_16 = (((PyObject *)__pyx_v_peak_content) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_peak_content)) != 0);
      __pyx_t_12 = (!__pyx_t_16);
      if (__pyx_t_12) {

        /* "MACS2/IO/cScoreTrack.pyx":1963
 *                 # save the last peak
 *                 if not peak_content:
 *                     continue             # <<<<<<<<<<<<<<
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 */
        goto __pyx_L5_continue;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":1965
 *                     continue
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:             # <<<<<<<<<<<<<<
 *                         best_qscore = min(map(itemgetter(2), peak_content))
 *                         cat2_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 */
        __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_13, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_12) {

          /* "MACS2/IO/cScoreTrack.pyx":1966
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                         best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                         cat2_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
          __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_38), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __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 = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __Pyx_INCREF(((PyObject *)__pyx_v_peak_content));
          PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_peak_content));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_peak_content));
          __pyx_t_13 = 0;
          __pyx_t_13 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_13 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_v_best_qscore);
          __pyx_v_best_qscore = __pyx_t_13;
          __pyx_t_13 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":1967
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                         best_qscore = min(map(itemgetter(2), peak_content))
 *                         cat2_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                         fold_change = 0, qscore = best_qscore,
 */
          __pyx_t_13 = PyObject_GetAttr(__pyx_v_cat2_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
          PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chrom));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          __pyx_t_1 = 0;
          __pyx_t_4 = 0;
          __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_4));
          if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__summit), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__peak_score), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

          /* "MACS2/IO/cScoreTrack.pyx":1969
 *                         cat2_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                         fold_change = 0, qscore = best_qscore,             # <<<<<<<<<<<<<<
 *                                         )
 * 
 */
          if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__qscore), __pyx_v_best_qscore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_1 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L22;
        }
        __pyx_L22:;
      }
      __pyx_L21:;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "MACS2/IO/cScoreTrack.pyx":1972
 *                                         )
 * 
 *             if cat3_above_cutoff_startpos.size > 0:             # <<<<<<<<<<<<<<
 *                 qscores = t1vst2[cat3_above_cutoff]
 *                 peak_content = []
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_cat3_above_cutoff_startpos, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_12) {

      /* "MACS2/IO/cScoreTrack.pyx":1973
 * 
 *             if cat3_above_cutoff_startpos.size > 0:
 *                 qscores = t1vst2[cat3_above_cutoff]             # <<<<<<<<<<<<<<
 *                 peak_content = []
 *                 # cat 1 is not empty
 */
      __pyx_t_4 = PyObject_GetItem(__pyx_v_t1vst2, __pyx_v_cat3_above_cutoff); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_v_qscores);
      __pyx_v_qscores = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1974
 *             if cat3_above_cutoff_startpos.size > 0:
 *                 qscores = t1vst2[cat3_above_cutoff]
 *                 peak_content = []             # <<<<<<<<<<<<<<
 *                 # cat 1 is not empty
 *                 if cat3_above_cutoff[0] == 0:
 */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_v_peak_content));
      __pyx_v_peak_content = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1976
 *                 peak_content = []
 *                 # cat 1 is not empty
 *                 if cat3_above_cutoff[0] == 0:             # <<<<<<<<<<<<<<
 *                     # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
 *                     cat3_above_cutoff_startpos[0] = 0
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cat3_above_cutoff, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_12) {

        /* "MACS2/IO/cScoreTrack.pyx":1978
 *                 if cat3_above_cutoff[0] == 0:
 *                     # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
 *                     cat3_above_cutoff_startpos[0] = 0             # <<<<<<<<<<<<<<
 *                 # first bit of region above cutoff
 *                 peak_content.append( (cat3_above_cutoff_startpos[0], cat3_above_cutoff_endpos[0], qscores[0]) )
 */
        if (__Pyx_SetItemInt(__pyx_v_cat3_above_cutoff_startpos, 0, __pyx_int_0, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L24;
      }
      __pyx_L24:;

      /* "MACS2/IO/cScoreTrack.pyx":1980
 *                     cat3_above_cutoff_startpos[0] = 0
 *                 # first bit of region above cutoff
 *                 peak_content.append( (cat3_above_cutoff_startpos[0], cat3_above_cutoff_endpos[0], qscores[0]) )             # <<<<<<<<<<<<<<
 *                 for i in range( 1, cat3_above_cutoff_startpos.size ):
 *                     if cat3_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cat3_above_cutoff_startpos, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cat3_above_cutoff_endpos, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_qscores, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_4 = 0;
      __pyx_t_2 = 0;
      __pyx_t_14 = PyList_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_13)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":1981
 *                 # first bit of region above cutoff
 *                 peak_content.append( (cat3_above_cutoff_startpos[0], cat3_above_cutoff_endpos[0], qscores[0]) )
 *                 for i in range( 1, cat3_above_cutoff_startpos.size ):             # <<<<<<<<<<<<<<
 *                     if cat3_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 *                         # append
 */
      __pyx_t_13 = PyObject_GetAttr(__pyx_v_cat3_above_cutoff_startpos, __pyx_n_s__size); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_15 = __Pyx_PyInt_AsLong(__pyx_t_13); if (unlikely((__pyx_t_15 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_15; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;

        /* "MACS2/IO/cScoreTrack.pyx":1982
 *                 peak_content.append( (cat3_above_cutoff_startpos[0], cat3_above_cutoff_endpos[0], qscores[0]) )
 *                 for i in range( 1, cat3_above_cutoff_startpos.size ):
 *                     if cat3_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:             # <<<<<<<<<<<<<<
 *                         # append
 *                         peak_content.append( (cat3_above_cutoff_startpos[i], cat3_above_cutoff_endpos[i], qscores[i] ) )
 */
        __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_cat3_above_cutoff_startpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Subtract(__pyx_t_13, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyInt_FromLong(__pyx_v_max_gap); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_13 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (__pyx_t_12) {

          /* "MACS2/IO/cScoreTrack.pyx":1984
 *                     if cat3_above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 *                         # append
 *                         peak_content.append( (cat3_above_cutoff_startpos[i], cat3_above_cutoff_endpos[i], qscores[i] ) )             # <<<<<<<<<<<<<<
 *                     else:
 *                         # close
 */
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_cat3_above_cutoff_startpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cat3_above_cutoff_endpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_qscores, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_13 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = 0;
          __pyx_t_14 = PyList_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          goto __pyx_L27;
        }
        /*else*/ {

          /* "MACS2/IO/cScoreTrack.pyx":1987
 *                     else:
 *                         # close
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:             # <<<<<<<<<<<<<<
 *                             best_qscore = min(map(itemgetter(2), peak_content))
 *                             cat3_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 */
          __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_12) {

            /* "MACS2/IO/cScoreTrack.pyx":1988
 *                         # close
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                             best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                             cat3_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
            __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_39), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_INCREF(((PyObject *)__pyx_v_peak_content));
            PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_peak_content));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_peak_content));
            __pyx_t_4 = 0;
            __pyx_t_4 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
            __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_4 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_v_best_qscore);
            __pyx_v_best_qscore = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":1989
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                             best_qscore = min(map(itemgetter(2), peak_content))
 *                             cat3_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                             fold_change = 0, qscore = best_qscore,
 */
            __pyx_t_4 = PyObject_GetAttr(__pyx_v_cat3_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chrom));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_13);
            __Pyx_GIVEREF(__pyx_t_13);
            __pyx_t_1 = 0;
            __pyx_t_13 = 0;
            __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_13));
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__summit), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__peak_score), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

            /* "MACS2/IO/cScoreTrack.pyx":1991
 *                             cat3_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                             fold_change = 0, qscore = best_qscore,             # <<<<<<<<<<<<<<
 *                                             )
 *                         peak_content = [(cat3_above_cutoff_startpos[i], cat3_above_cutoff_endpos[i], qscores[i]),]
 */
            if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__qscore), __pyx_v_best_qscore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L28;
          }
          __pyx_L28:;

          /* "MACS2/IO/cScoreTrack.pyx":1993
 *                                             fold_change = 0, qscore = best_qscore,
 *                                             )
 *                         peak_content = [(cat3_above_cutoff_startpos[i], cat3_above_cutoff_endpos[i], qscores[i]),]             # <<<<<<<<<<<<<<
 *                 # save the last peak
 *                 if not peak_content:
 */
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cat3_above_cutoff_startpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_cat3_above_cutoff_endpos, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_qscores, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_1 = 0;
          __pyx_t_13 = 0;
          __pyx_t_2 = 0;
          __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
          __pyx_t_4 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_v_peak_content));
          __pyx_v_peak_content = ((PyObject*)__pyx_t_2);
          __pyx_t_2 = 0;
        }
        __pyx_L27:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":1995
 *                         peak_content = [(cat3_above_cutoff_startpos[i], cat3_above_cutoff_endpos[i], qscores[i]),]
 *                 # save the last peak
 *                 if not peak_content:             # <<<<<<<<<<<<<<
 *                     continue
 *                 else:
 */
      __pyx_t_12 = (((PyObject *)__pyx_v_peak_content) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_peak_content)) != 0);
      __pyx_t_16 = (!__pyx_t_12);
      if (__pyx_t_16) {

        /* "MACS2/IO/cScoreTrack.pyx":1996
 *                 # save the last peak
 *                 if not peak_content:
 *                     continue             # <<<<<<<<<<<<<<
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 */
        goto __pyx_L5_continue;
        goto __pyx_L29;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":1998
 *                     continue
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:             # <<<<<<<<<<<<<<
 *                         best_qscore = min(map(itemgetter(2), peak_content))
 *                         cat3_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 */
        __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_13); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_13, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_16) {

          /* "MACS2/IO/cScoreTrack.pyx":1999
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                         best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                         cat3_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
          __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_13 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __Pyx_INCREF(((PyObject *)__pyx_v_peak_content));
          PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_peak_content));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_peak_content));
          __pyx_t_13 = 0;
          __pyx_t_13 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_13 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_v_best_qscore);
          __pyx_v_best_qscore = __pyx_t_13;
          __pyx_t_13 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":2000
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                         best_qscore = min(map(itemgetter(2), peak_content))
 *                         cat3_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                         fold_change = 0, qscore = best_qscore,
 */
          __pyx_t_13 = PyObject_GetAttr(__pyx_v_cat3_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
          PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_chrom));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
          PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_2 = 0;
          __pyx_t_1 = 0;
          __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_1));
          if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__summit), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__peak_score), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

          /* "MACS2/IO/cScoreTrack.pyx":2002
 *                         cat3_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 *                                         fold_change = 0, qscore = best_qscore,             # <<<<<<<<<<<<<<
 *                                         )
 * 
 */
          if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__qscore), __pyx_v_best_qscore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_2 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L30;
        }
        __pyx_L30:;
      }
      __pyx_L29:;
      goto __pyx_L23;
    }
    __pyx_L23:;
    __pyx_L5_continue:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2005
 *                                         )
 * 
 *         return cat1_peaks, cat2_peaks, cat3_peaks             # <<<<<<<<<<<<<<
 * 
 *     cdef long total ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_cat1_peaks);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cat1_peaks);
  __Pyx_GIVEREF(__pyx_v_cat1_peaks);
  __Pyx_INCREF(__pyx_v_cat2_peaks);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_cat2_peaks);
  __Pyx_GIVEREF(__pyx_v_cat2_peaks);
  __Pyx_INCREF(__pyx_v_cat3_peaks);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_cat3_peaks);
  __Pyx_GIVEREF(__pyx_v_cat3_peaks);
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cat1_qvalues.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cat2_qvalues.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cat3_qvalues.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cat1_qvalues.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cat2_qvalues.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cat3_qvalues.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_cat1_qvalues);
  __Pyx_XDECREF((PyObject *)__pyx_v_cat2_qvalues);
  __Pyx_XDECREF((PyObject *)__pyx_v_cat3_qvalues);
  __Pyx_XDECREF(__pyx_v_peak_content);
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF(__pyx_v_cat1_peaks);
  __Pyx_XDECREF(__pyx_v_cat2_peaks);
  __Pyx_XDECREF(__pyx_v_cat3_peaks);
  __Pyx_XDECREF(__pyx_v_cat1);
  __Pyx_XDECREF(__pyx_v_cat2);
  __Pyx_XDECREF(__pyx_v_cat3);
  __Pyx_XDECREF(__pyx_v_cat1_qvalues_by_chrom);
  __Pyx_XDECREF(__pyx_v_cat2_qvalues_by_chrom);
  __Pyx_XDECREF(__pyx_v_cat3_qvalues_by_chrom);
  __Pyx_XDECREF(__pyx_v_tvsc1);
  __Pyx_XDECREF(__pyx_v_tvsc2);
  __Pyx_XDECREF(__pyx_v_and_);
  __Pyx_XDECREF(__pyx_v_not_);
  __Pyx_XDECREF(__pyx_v_cond1_sig);
  __Pyx_XDECREF(__pyx_v_cond2_sig);
  __Pyx_XDECREF(__pyx_v_t1vst2);
  __Pyx_XDECREF(__pyx_v_where_cat1_above_cutoff);
  __Pyx_XDECREF(__pyx_v_where_cat2_above_cutoff);
  __Pyx_XDECREF(__pyx_v_where_cat3_above_cutoff);
  __Pyx_XDECREF(__pyx_v_cat1_above_cutoff);
  __Pyx_XDECREF(__pyx_v_cat2_above_cutoff);
  __Pyx_XDECREF(__pyx_v_cat3_above_cutoff);
  __Pyx_XDECREF(__pyx_v_cat1_above_cutoff_endpos);
  __Pyx_XDECREF(__pyx_v_cat1_above_cutoff_startpos);
  __Pyx_XDECREF(__pyx_v_cat2_above_cutoff_endpos);
  __Pyx_XDECREF(__pyx_v_cat2_above_cutoff_startpos);
  __Pyx_XDECREF(__pyx_v_cat3_above_cutoff_endpos);
  __Pyx_XDECREF(__pyx_v_cat3_above_cutoff_startpos);
  __Pyx_XDECREF(__pyx_v_qscores);
  __Pyx_XDECREF(__pyx_v_best_qscore);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_25call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_24call_peaks[] = "This function try to find regions within which, scores\n        are continuously higher than a given cutoff.\n\n        This function is NOT using sliding-windows. Instead, any\n        regions in bedGraph above certain cutoff will be detected,\n        then merged if the gap between nearby two regions are below\n        max_gap. After this, peak is reported if its length is above\n        min_length.\n\n        cutoff:  cutoff of value, default 3. For log10 LR, it means 1000 or -1000.\n        min_length :  minimum peak length, default 200.\n        gap   :  maximum gap to merge nearby peaks, default 50.\n        ptrack:  an optional track for pileup heights. If it's not None, use it to find summits. Otherwise, use self/scoreTrack.\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_25call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_cutoff;
  int __pyx_v_min_length;
  PyBoolObject *__pyx_v_call_summits = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_peaks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cutoff,&__pyx_n_s__min_length,&__pyx_n_s__call_summits,0};
    PyObject* values[3] = {0,0,0};
    values[2] = (PyObject *)__pyx_k_34;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cutoff);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_length);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__call_summits);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "call_peaks") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_cutoff = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_cutoff == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "MACS2/IO/cScoreTrack.pyx":1822
 *         return True
 * 
 *     cpdef call_peaks (self, float cutoff=0.05, int min_length=200,             # <<<<<<<<<<<<<<
 *                       bool call_summits=False):
 *         """This function try to find regions within which, scores
 */
      __pyx_v_cutoff = ((float)0.05);
    }
    if (values[1]) {
      __pyx_v_min_length = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_min_length == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_length = ((int)200);
    }
    __pyx_v_call_summits = ((PyBoolObject *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_peaks", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_call_summits), __pyx_ptype_7cpython_4bool_bool, 1, "call_summits", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_24call_peaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_min_length, __pyx_v_call_summits);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_24call_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self, float __pyx_v_cutoff, int __pyx_v_min_length, PyBoolObject *__pyx_v_call_summits) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_call_peaks __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call_peaks", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.cutoff = __pyx_v_cutoff;
  __pyx_t_2.min_length = __pyx_v_min_length;
  __pyx_t_2.call_summits = __pyx_v_call_summits;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->call_peaks(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.TwoConditionScores.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2007
 *         return cat1_peaks, cat2_peaks, cat3_peaks
 * 
 *     cdef long total ( self ):             # <<<<<<<<<<<<<<
 *         """Return the number of regions in this object.
 * 
 */

static long __pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_total(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *__pyx_v_self) {
  long __pyx_v_t;
  PyObject *__pyx_v_chrom = 0;
  long __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  long __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("total", 0);

  /* "MACS2/IO/cScoreTrack.pyx":2015
 *             str chrom
 * 
 *         t = 0             # <<<<<<<<<<<<<<
 *         for chrom in self.data.keys():
 *             t += self.datalength[chrom]
 */
  __pyx_v_t = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2016
 * 
 *         t = 0
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             t += self.datalength[chrom]
 *         return t
 */
  if (unlikely(((PyObject *)__pyx_v_self->data) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2017
 *         t = 0
 *         for chrom in self.data.keys():
 *             t += self.datalength[chrom]             # <<<<<<<<<<<<<<
 *         return t
 * 
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_6); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_t = __pyx_t_7;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2018
 *         for chrom in self.data.keys():
 *             t += self.datalength[chrom]
 *         return t             # <<<<<<<<<<<<<<
 * 
 * cdef class DiffScoreTrackI:
 */
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("MACS2.IO.cScoreTrack.TwoConditionScores.total", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_t1bdg = 0;
  PyObject *__pyx_v_c1bdg = 0;
  PyObject *__pyx_v_t2bdg = 0;
  PyObject *__pyx_v_c2bdg = 0;
  float __pyx_v_cond1_depth;
  float __pyx_v_cond2_depth;
  int __pyx_v_pseudocount;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__t1bdg,&__pyx_n_s__c1bdg,&__pyx_n_s__t2bdg,&__pyx_n_s__c2bdg,&__pyx_n_s__cond1_depth,&__pyx_n_s__cond2_depth,&__pyx_n_s__pseudocount,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__t1bdg)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__c1bdg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__t2bdg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__c2bdg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond1_depth);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond2_depth);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pseudocount);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_t1bdg = values[0];
    __pyx_v_c1bdg = values[1];
    __pyx_v_t2bdg = values[2];
    __pyx_v_c2bdg = values[3];
    if (values[4]) {
      __pyx_v_cond1_depth = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_cond1_depth == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "MACS2/IO/cScoreTrack.pyx":2035
 *         str diff_scoring_method
 * 
 *     def __init__ (self, t1bdg, c1bdg, t2bdg, c2bdg, float cond1_depth = 1.0, float cond2_depth = 1.0, int pseudocount = 1 ):             # <<<<<<<<<<<<<<
 *         self.pos = {}
 *         self.t1 = {}
 */
      __pyx_v_cond1_depth = ((float)1.0);
    }
    if (values[5]) {
      __pyx_v_cond2_depth = __pyx_PyFloat_AsFloat(values[5]); if (unlikely((__pyx_v_cond2_depth == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_cond2_depth = ((float)1.0);
    }
    if (values[6]) {
      __pyx_v_pseudocount = __Pyx_PyInt_AsInt(values[6]); if (unlikely((__pyx_v_pseudocount == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_pseudocount = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI___init__(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), __pyx_v_t1bdg, __pyx_v_c1bdg, __pyx_v_t2bdg, __pyx_v_c2bdg, __pyx_v_cond1_depth, __pyx_v_cond2_depth, __pyx_v_pseudocount);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_8__init___lambda4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_8__init___lambda4 = {__Pyx_NAMESTR("lambda4"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_8__init___lambda4, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_8__init___lambda4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,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__x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda4", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda4") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __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_x = values[0];
    __pyx_v_y = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda4", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.__init__.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self, __pyx_v_x, __pyx_v_y);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2060
 *         t2chrs = t2bdg.get_chr_names()
 *         c2chrs = c2bdg.get_chr_names()
 *         common_chrs = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))             # <<<<<<<<<<<<<<
 * 
 *         for chrname in common_chrs:
 */

static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda4", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__intersection); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.__init__.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2035
 *         str diff_scoring_method
 * 
 *     def __init__ (self, t1bdg, c1bdg, t2bdg, c2bdg, float cond1_depth = 1.0, float cond2_depth = 1.0, int pseudocount = 1 ):             # <<<<<<<<<<<<<<
 *         self.pos = {}
 *         self.t1 = {}
 */

static int __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI___init__(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_t1bdg, PyObject *__pyx_v_c1bdg, PyObject *__pyx_v_t2bdg, PyObject *__pyx_v_c2bdg, float __pyx_v_cond1_depth, float __pyx_v_cond2_depth, int __pyx_v_pseudocount) {
  PyObject *__pyx_v_t1chrs = NULL;
  PyObject *__pyx_v_c1chrs = NULL;
  PyObject *__pyx_v_t2chrs = NULL;
  PyObject *__pyx_v_c2chrs = NULL;
  PyObject *__pyx_v_common_chrs = NULL;
  PyObject *__pyx_v_chrname = NULL;
  PyObject *__pyx_v_cond1_treat_ps = NULL;
  PyObject *__pyx_v_cond1_treat_vs = NULL;
  PyObject *__pyx_v_cond1_control_ps = NULL;
  PyObject *__pyx_v_cond1_control_vs = NULL;
  PyObject *__pyx_v_cond2_treat_ps = NULL;
  PyObject *__pyx_v_cond2_treat_vs = NULL;
  PyObject *__pyx_v_cond2_control_ps = NULL;
  PyObject *__pyx_v_cond2_control_vs = NULL;
  PyObject *__pyx_v_chrom_max_len = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "MACS2/IO/cScoreTrack.pyx":2036
 * 
 *     def __init__ (self, t1bdg, c1bdg, t2bdg, c2bdg, float cond1_depth = 1.0, float cond2_depth = 1.0, int pseudocount = 1 ):
 *         self.pos = {}             # <<<<<<<<<<<<<<
 *         self.t1 = {}
 *         self.c1 = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->pos);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->pos));
  __pyx_v_self->pos = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2037
 *     def __init__ (self, t1bdg, c1bdg, t2bdg, c2bdg, float cond1_depth = 1.0, float cond2_depth = 1.0, int pseudocount = 1 ):
 *         self.pos = {}
 *         self.t1 = {}             # <<<<<<<<<<<<<<
 *         self.c1 = {}
 *         self.tvsc1 = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->t1);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->t1));
  __pyx_v_self->t1 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2038
 *         self.pos = {}
 *         self.t1 = {}
 *         self.c1 = {}             # <<<<<<<<<<<<<<
 *         self.tvsc1 = {}
 *         self.t2 = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->c1);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->c1));
  __pyx_v_self->c1 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2039
 *         self.t1 = {}
 *         self.c1 = {}
 *         self.tvsc1 = {}             # <<<<<<<<<<<<<<
 *         self.t2 = {}
 *         self.c2 = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->tvsc1);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->tvsc1));
  __pyx_v_self->tvsc1 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2040
 *         self.c1 = {}
 *         self.tvsc1 = {}
 *         self.t2 = {}             # <<<<<<<<<<<<<<
 *         self.c2 = {}
 *         self.tvsc2 = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->t2);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->t2));
  __pyx_v_self->t2 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2041
 *         self.tvsc1 = {}
 *         self.t2 = {}
 *         self.c2 = {}             # <<<<<<<<<<<<<<
 *         self.tvsc2 = {}
 *         self.t1vs2 = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->c2);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->c2));
  __pyx_v_self->c2 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2042
 *         self.t2 = {}
 *         self.c2 = {}
 *         self.tvsc2 = {}             # <<<<<<<<<<<<<<
 *         self.t1vs2 = {}
 *         self.diff_qvalues = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->tvsc2);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->tvsc2));
  __pyx_v_self->tvsc2 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2043
 *         self.c2 = {}
 *         self.tvsc2 = {}
 *         self.t1vs2 = {}             # <<<<<<<<<<<<<<
 *         self.diff_qvalues = {}
 *         self.tlogLR = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->t1vs2);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->t1vs2));
  __pyx_v_self->t1vs2 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2044
 *         self.tvsc2 = {}
 *         self.t1vs2 = {}
 *         self.diff_qvalues = {}             # <<<<<<<<<<<<<<
 *         self.tlogLR = {}
 *         self.where_peaks = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->diff_qvalues);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->diff_qvalues));
  __pyx_v_self->diff_qvalues = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2045
 *         self.t1vs2 = {}
 *         self.diff_qvalues = {}
 *         self.tlogLR = {}             # <<<<<<<<<<<<<<
 *         self.where_peaks = {}
 *         self.which_peaks1 = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->tlogLR);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->tlogLR));
  __pyx_v_self->tlogLR = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2046
 *         self.diff_qvalues = {}
 *         self.tlogLR = {}
 *         self.where_peaks = {}             # <<<<<<<<<<<<<<
 *         self.which_peaks1 = {}
 *         self.which_peaks2 = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->where_peaks);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->where_peaks));
  __pyx_v_self->where_peaks = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2047
 *         self.tlogLR = {}
 *         self.where_peaks = {}
 *         self.which_peaks1 = {}             # <<<<<<<<<<<<<<
 *         self.which_peaks2 = {}
 *         self.diff_peaks = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->which_peaks1);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->which_peaks1));
  __pyx_v_self->which_peaks1 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2048
 *         self.where_peaks = {}
 *         self.which_peaks1 = {}
 *         self.which_peaks2 = {}             # <<<<<<<<<<<<<<
 *         self.diff_peaks = {}
 *         self.datalength = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->which_peaks2);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->which_peaks2));
  __pyx_v_self->which_peaks2 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2049
 *         self.which_peaks1 = {}
 *         self.which_peaks2 = {}
 *         self.diff_peaks = {}             # <<<<<<<<<<<<<<
 *         self.datalength = {}
 *         self.cond1_depth = cond1_depth
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->diff_peaks);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->diff_peaks));
  __pyx_v_self->diff_peaks = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2050
 *         self.which_peaks2 = {}
 *         self.diff_peaks = {}
 *         self.datalength = {}             # <<<<<<<<<<<<<<
 *         self.cond1_depth = cond1_depth
 *         self.cond2_depth = cond2_depth
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->datalength);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->datalength));
  __pyx_v_self->datalength = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2051
 *         self.diff_peaks = {}
 *         self.datalength = {}
 *         self.cond1_depth = cond1_depth             # <<<<<<<<<<<<<<
 *         self.cond2_depth = cond2_depth
 *         self.pseudocount = pseudocount
 */
  __pyx_v_self->cond1_depth = __pyx_v_cond1_depth;

  /* "MACS2/IO/cScoreTrack.pyx":2052
 *         self.datalength = {}
 *         self.cond1_depth = cond1_depth
 *         self.cond2_depth = cond2_depth             # <<<<<<<<<<<<<<
 *         self.pseudocount = pseudocount
 *         self.pvalue_stat1 = {}
 */
  __pyx_v_self->cond2_depth = __pyx_v_cond2_depth;

  /* "MACS2/IO/cScoreTrack.pyx":2053
 *         self.cond1_depth = cond1_depth
 *         self.cond2_depth = cond2_depth
 *         self.pseudocount = pseudocount             # <<<<<<<<<<<<<<
 *         self.pvalue_stat1 = {}
 *         self.pvalue_stat2 = {}
 */
  __pyx_v_self->pseudocount = __pyx_v_pseudocount;

  /* "MACS2/IO/cScoreTrack.pyx":2054
 *         self.cond2_depth = cond2_depth
 *         self.pseudocount = pseudocount
 *         self.pvalue_stat1 = {}             # <<<<<<<<<<<<<<
 *         self.pvalue_stat2 = {}
 *         t1chrs = t1bdg.get_chr_names()
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->pvalue_stat1);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->pvalue_stat1));
  __pyx_v_self->pvalue_stat1 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2055
 *         self.pseudocount = pseudocount
 *         self.pvalue_stat1 = {}
 *         self.pvalue_stat2 = {}             # <<<<<<<<<<<<<<
 *         t1chrs = t1bdg.get_chr_names()
 *         c1chrs = c1bdg.get_chr_names()
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->pvalue_stat2);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->pvalue_stat2));
  __pyx_v_self->pvalue_stat2 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2056
 *         self.pvalue_stat1 = {}
 *         self.pvalue_stat2 = {}
 *         t1chrs = t1bdg.get_chr_names()             # <<<<<<<<<<<<<<
 *         c1chrs = c1bdg.get_chr_names()
 *         t2chrs = t2bdg.get_chr_names()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_t1bdg, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_t1chrs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2057
 *         self.pvalue_stat2 = {}
 *         t1chrs = t1bdg.get_chr_names()
 *         c1chrs = c1bdg.get_chr_names()             # <<<<<<<<<<<<<<
 *         t2chrs = t2bdg.get_chr_names()
 *         c2chrs = c2bdg.get_chr_names()
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_c1bdg, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c1chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2058
 *         t1chrs = t1bdg.get_chr_names()
 *         c1chrs = c1bdg.get_chr_names()
 *         t2chrs = t2bdg.get_chr_names()             # <<<<<<<<<<<<<<
 *         c2chrs = c2bdg.get_chr_names()
 *         common_chrs = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_t2bdg, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_t2chrs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2059
 *         c1chrs = c1bdg.get_chr_names()
 *         t2chrs = t2bdg.get_chr_names()
 *         c2chrs = c2bdg.get_chr_names()             # <<<<<<<<<<<<<<
 *         common_chrs = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_c2bdg, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c2chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2060
 *         t2chrs = t2bdg.get_chr_names()
 *         c2chrs = c2bdg.get_chr_names()
 *         common_chrs = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))             # <<<<<<<<<<<<<<
 * 
 *         for chrname in common_chrs:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_8__init___lambda4, 0, __pyx_n_s_41, NULL, __pyx_n_s_20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_t1chrs);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_t1chrs);
  __Pyx_GIVEREF(__pyx_v_t1chrs);
  __Pyx_INCREF(__pyx_v_c1chrs);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_c1chrs);
  __Pyx_GIVEREF(__pyx_v_c1chrs);
  __Pyx_INCREF(__pyx_v_t2chrs);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_t2chrs);
  __Pyx_GIVEREF(__pyx_v_t2chrs);
  __Pyx_INCREF(__pyx_v_c2chrs);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_c2chrs);
  __Pyx_GIVEREF(__pyx_v_c2chrs);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_reduce, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_common_chrs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2062
 *         common_chrs = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))
 * 
 *         for chrname in common_chrs:             # <<<<<<<<<<<<<<
 *             (cond1_treat_ps, cond1_treat_vs) = t1bdg.get_data_by_chr(chrname)
 *             (cond1_control_ps, cond1_control_vs) = c1bdg.get_data_by_chr(chrname)
 */
  if (PyList_CheckExact(__pyx_v_common_chrs) || PyTuple_CheckExact(__pyx_v_common_chrs)) {
    __pyx_t_2 = __pyx_v_common_chrs; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_common_chrs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_v_chrname);
    __pyx_v_chrname = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2063
 * 
 *         for chrname in common_chrs:
 *             (cond1_treat_ps, cond1_treat_vs) = t1bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
 *             (cond1_control_ps, cond1_control_vs) = c1bdg.get_data_by_chr(chrname)
 *             (cond2_treat_ps, cond2_treat_vs) = t2bdg.get_data_by_chr(chrname)
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_t1bdg, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_chrname);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrname);
    __Pyx_GIVEREF(__pyx_v_chrname);
    __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_cond1_treat_ps);
    __pyx_v_cond1_treat_ps = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_cond1_treat_vs);
    __pyx_v_cond1_treat_vs = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2064
 *         for chrname in common_chrs:
 *             (cond1_treat_ps, cond1_treat_vs) = t1bdg.get_data_by_chr(chrname)
 *             (cond1_control_ps, cond1_control_vs) = c1bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
 *             (cond2_treat_ps, cond2_treat_vs) = t2bdg.get_data_by_chr(chrname)
 *             (cond2_control_ps, cond2_control_vs) = c2bdg.get_data_by_chr(chrname)
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_c1bdg, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_chrname);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrname);
    __Pyx_GIVEREF(__pyx_v_chrname);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_cond1_control_ps);
    __pyx_v_cond1_control_ps = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_cond1_control_vs);
    __pyx_v_cond1_control_vs = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2065
 *             (cond1_treat_ps, cond1_treat_vs) = t1bdg.get_data_by_chr(chrname)
 *             (cond1_control_ps, cond1_control_vs) = c1bdg.get_data_by_chr(chrname)
 *             (cond2_treat_ps, cond2_treat_vs) = t2bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
 *             (cond2_control_ps, cond2_control_vs) = c2bdg.get_data_by_chr(chrname)
 *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_t2bdg, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_chrname);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_chrname);
    __Pyx_GIVEREF(__pyx_v_chrname);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L10_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_cond2_treat_ps);
    __pyx_v_cond2_treat_ps = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_v_cond2_treat_vs);
    __pyx_v_cond2_treat_vs = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2066
 *             (cond1_control_ps, cond1_control_vs) = c1bdg.get_data_by_chr(chrname)
 *             (cond2_treat_ps, cond2_treat_vs) = t2bdg.get_data_by_chr(chrname)
 *             (cond2_control_ps, cond2_control_vs) = c2bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
 *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
 *                             len(cond2_treat_ps) + len(cond2_control_ps)
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_c2bdg, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_chrname);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrname);
    __Pyx_GIVEREF(__pyx_v_chrname);
    __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L12_unpacking_done;
      __pyx_L11_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L12_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_cond2_control_ps);
    __pyx_v_cond2_control_ps = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_cond2_control_vs);
    __pyx_v_cond2_control_vs = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2067
 *             (cond2_treat_ps, cond2_treat_vs) = t2bdg.get_data_by_chr(chrname)
 *             (cond2_control_ps, cond2_control_vs) = c2bdg.get_data_by_chr(chrname)
 *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\             # <<<<<<<<<<<<<<
 *                             len(cond2_treat_ps) + len(cond2_control_ps)
 *             self.add_chromosome( chrname, chrom_max_len )
 */
    __pyx_t_9 = PyObject_Length(__pyx_v_cond1_treat_ps); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = PyObject_Length(__pyx_v_cond1_control_ps); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "MACS2/IO/cScoreTrack.pyx":2068
 *             (cond2_control_ps, cond2_control_vs) = c2bdg.get_data_by_chr(chrname)
 *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
 *                             len(cond2_treat_ps) + len(cond2_control_ps)             # <<<<<<<<<<<<<<
 *             self.add_chromosome( chrname, chrom_max_len )
 *             self.build_chromosome( chrname,
 */
    __pyx_t_11 = PyObject_Length(__pyx_v_cond2_treat_ps); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = PyObject_Length(__pyx_v_cond2_control_ps); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyInt_FromSsize_t((((__pyx_t_9 + __pyx_t_10) + __pyx_t_11) + __pyx_t_12)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_max_len);
    __pyx_v_chrom_max_len = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2069
 *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
 *                             len(cond2_treat_ps) + len(cond2_control_ps)
 *             self.add_chromosome( chrname, chrom_max_len )             # <<<<<<<<<<<<<<
 *             self.build_chromosome( chrname,
 *                                    cond1_treat_ps, cond1_control_ps,
 */
    if (!(likely(PyString_CheckExact(__pyx_v_chrname))||((__pyx_v_chrname) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_v_chrname)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_v_chrom_max_len); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->add_chromosome(__pyx_v_self, ((PyObject*)__pyx_v_chrname), __pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2074
 *                                    cond2_treat_ps, cond2_control_ps,
 *                                    cond1_treat_vs, cond1_control_vs,
 *                                    cond2_treat_vs, cond2_control_vs )             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_pseudocount( self, int pseudocount ):
 */
    __pyx_t_6 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->build_chromosome(__pyx_v_self, __pyx_v_chrname, __pyx_v_cond1_treat_ps, __pyx_v_cond1_control_ps, __pyx_v_cond2_treat_ps, __pyx_v_cond2_control_ps, __pyx_v_cond1_treat_vs, __pyx_v_cond1_control_vs, __pyx_v_cond2_treat_vs, __pyx_v_cond2_control_vs); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_t1chrs);
  __Pyx_XDECREF(__pyx_v_c1chrs);
  __Pyx_XDECREF(__pyx_v_t2chrs);
  __Pyx_XDECREF(__pyx_v_c2chrs);
  __Pyx_XDECREF(__pyx_v_common_chrs);
  __Pyx_XDECREF(__pyx_v_chrname);
  __Pyx_XDECREF(__pyx_v_cond1_treat_ps);
  __Pyx_XDECREF(__pyx_v_cond1_treat_vs);
  __Pyx_XDECREF(__pyx_v_cond1_control_ps);
  __Pyx_XDECREF(__pyx_v_cond1_control_vs);
  __Pyx_XDECREF(__pyx_v_cond2_treat_ps);
  __Pyx_XDECREF(__pyx_v_cond2_treat_vs);
  __Pyx_XDECREF(__pyx_v_cond2_control_ps);
  __Pyx_XDECREF(__pyx_v_cond2_control_vs);
  __Pyx_XDECREF(__pyx_v_chrom_max_len);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2076
 *                                    cond2_treat_vs, cond2_control_vs )
 * 
 *     cpdef set_pseudocount( self, int pseudocount ):             # <<<<<<<<<<<<<<
 *         self.pseudocount = pseudocount
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_set_pseudocount(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_v_pseudocount, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_pseudocount", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_pseudocount); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_3set_pseudocount)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_pseudocount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2077
 * 
 *     cpdef set_pseudocount( self, int pseudocount ):
 *         self.pseudocount = pseudocount             # <<<<<<<<<<<<<<
 * 
 *     cdef build_chromosome( self, chrname,
 */
  __pyx_v_self->pseudocount = __pyx_v_pseudocount;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount); /*proto*/
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount) {
  int __pyx_v_pseudocount;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_pseudocount (wrapper)", 0);
  assert(__pyx_arg_pseudocount); {
    __pyx_v_pseudocount = __Pyx_PyInt_AsInt(__pyx_arg_pseudocount); if (unlikely((__pyx_v_pseudocount == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_2set_pseudocount(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), ((int)__pyx_v_pseudocount));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2076
 *                                    cond2_treat_vs, cond2_control_vs )
 * 
 *     cpdef set_pseudocount( self, int pseudocount ):             # <<<<<<<<<<<<<<
 *         self.pseudocount = pseudocount
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_v_pseudocount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_pseudocount", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->set_pseudocount(__pyx_v_self, __pyx_v_pseudocount, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2079
 *         self.pseudocount = pseudocount
 * 
 *     cdef build_chromosome( self, chrname,             # <<<<<<<<<<<<<<
 *                            cond1_treat_ps, cond1_control_ps,
 *                            cond2_treat_ps, cond2_control_ps,
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_build_chromosome(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_chrname, PyObject *__pyx_v_cond1_treat_ps, PyObject *__pyx_v_cond1_control_ps, PyObject *__pyx_v_cond2_treat_ps, PyObject *__pyx_v_cond2_control_ps, PyObject *__pyx_v_cond1_treat_vs, PyObject *__pyx_v_cond1_control_vs, PyObject *__pyx_v_cond2_treat_vs, PyObject *__pyx_v_cond2_control_vs) {
  PyObject *__pyx_v_c1tpn = NULL;
  PyObject *__pyx_v_c1cpn = NULL;
  PyObject *__pyx_v_c2tpn = NULL;
  PyObject *__pyx_v_c2cpn = NULL;
  PyObject *__pyx_v_c1tvn = NULL;
  PyObject *__pyx_v_c1cvn = NULL;
  PyObject *__pyx_v_c2tvn = NULL;
  PyObject *__pyx_v_c2cvn = NULL;
  PyObject *__pyx_v_pre_p = NULL;
  PyObject *__pyx_v_c1tp = NULL;
  PyObject *__pyx_v_c1tv = NULL;
  PyObject *__pyx_v_c1cp = NULL;
  PyObject *__pyx_v_c1cv = NULL;
  PyObject *__pyx_v_c2tp = NULL;
  PyObject *__pyx_v_c2tv = NULL;
  PyObject *__pyx_v_c2cp = NULL;
  PyObject *__pyx_v_c2cv = NULL;
  PyObject *__pyx_v_minp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  float __pyx_t_12;
  float __pyx_t_13;
  float __pyx_t_14;
  float __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_chromosome", 0);

  /* "MACS2/IO/cScoreTrack.pyx":2086
 * 
 * 
 *         c1tpn = iter(cond1_treat_ps).next             # <<<<<<<<<<<<<<
 *         c1cpn = iter(cond1_control_ps).next
 *         c2tpn = iter(cond2_treat_ps).next
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_cond1_treat_ps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c1tpn = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2087
 * 
 *         c1tpn = iter(cond1_treat_ps).next
 *         c1cpn = iter(cond1_control_ps).next             # <<<<<<<<<<<<<<
 *         c2tpn = iter(cond2_treat_ps).next
 *         c2cpn = iter(cond2_control_ps).next
 */
  __pyx_t_2 = PyObject_GetIter(__pyx_v_cond1_control_ps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c1cpn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2088
 *         c1tpn = iter(cond1_treat_ps).next
 *         c1cpn = iter(cond1_control_ps).next
 *         c2tpn = iter(cond2_treat_ps).next             # <<<<<<<<<<<<<<
 *         c2cpn = iter(cond2_control_ps).next
 *         c1tvn = iter(cond1_treat_vs).next
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_cond2_treat_ps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c2tpn = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2089
 *         c1cpn = iter(cond1_control_ps).next
 *         c2tpn = iter(cond2_treat_ps).next
 *         c2cpn = iter(cond2_control_ps).next             # <<<<<<<<<<<<<<
 *         c1tvn = iter(cond1_treat_vs).next
 *         c1cvn = iter(cond1_control_vs).next
 */
  __pyx_t_2 = PyObject_GetIter(__pyx_v_cond2_control_ps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c2cpn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2090
 *         c2tpn = iter(cond2_treat_ps).next
 *         c2cpn = iter(cond2_control_ps).next
 *         c1tvn = iter(cond1_treat_vs).next             # <<<<<<<<<<<<<<
 *         c1cvn = iter(cond1_control_vs).next
 *         c2tvn = iter(cond2_treat_vs).next
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_cond1_treat_vs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c1tvn = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2091
 *         c2cpn = iter(cond2_control_ps).next
 *         c1tvn = iter(cond1_treat_vs).next
 *         c1cvn = iter(cond1_control_vs).next             # <<<<<<<<<<<<<<
 *         c2tvn = iter(cond2_treat_vs).next
 *         c2cvn = iter(cond2_control_vs).next
 */
  __pyx_t_2 = PyObject_GetIter(__pyx_v_cond1_control_vs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c1cvn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2092
 *         c1tvn = iter(cond1_treat_vs).next
 *         c1cvn = iter(cond1_control_vs).next
 *         c2tvn = iter(cond2_treat_vs).next             # <<<<<<<<<<<<<<
 *         c2cvn = iter(cond2_control_vs).next
 * 
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_cond2_treat_vs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c2tvn = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2093
 *         c1cvn = iter(cond1_control_vs).next
 *         c2tvn = iter(cond2_treat_vs).next
 *         c2cvn = iter(cond2_control_vs).next             # <<<<<<<<<<<<<<
 * 
 *         pre_p = 0
 */
  __pyx_t_2 = PyObject_GetIter(__pyx_v_cond2_control_vs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c2cvn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2095
 *         c2cvn = iter(cond2_control_vs).next
 * 
 *         pre_p = 0             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_pre_p = __pyx_int_0;

  /* "MACS2/IO/cScoreTrack.pyx":2097
 *         pre_p = 0
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             c1tp = c1tpn()
 *             c1tv = c1tvn()
 */
  {
    __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:*/ {

      /* "MACS2/IO/cScoreTrack.pyx":2098
 * 
 *         try:
 *             c1tp = c1tpn()             # <<<<<<<<<<<<<<
 *             c1tv = c1tvn()
 * 
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c1tpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c1tp = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2099
 *         try:
 *             c1tp = c1tpn()
 *             c1tv = c1tvn()             # <<<<<<<<<<<<<<
 * 
 *             c1cp = c1cpn()
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c1tvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c1tv = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2101
 *             c1tv = c1tvn()
 * 
 *             c1cp = c1cpn()             # <<<<<<<<<<<<<<
 *             c1cv = c1cvn()
 * 
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c1cpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c1cp = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2102
 * 
 *             c1cp = c1cpn()
 *             c1cv = c1cvn()             # <<<<<<<<<<<<<<
 * 
 *             c2tp = c2tpn()
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c1cvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c1cv = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2104
 *             c1cv = c1cvn()
 * 
 *             c2tp = c2tpn()             # <<<<<<<<<<<<<<
 *             c2tv = c2tvn()
 * 
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c2tpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c2tp = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2105
 * 
 *             c2tp = c2tpn()
 *             c2tv = c2tvn()             # <<<<<<<<<<<<<<
 * 
 *             c2cp = c2cpn()
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c2tvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c2tv = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2107
 *             c2tv = c2tvn()
 * 
 *             c2cp = c2cpn()             # <<<<<<<<<<<<<<
 *             c2cv = c2cvn()
 * 
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c2cpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c2cp = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2108
 * 
 *             c2cp = c2cpn()
 *             c2cv = c2cvn()             # <<<<<<<<<<<<<<
 * 
 *             while True:
 */
      __pyx_t_1 = PyObject_Call(__pyx_v_c2cvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_c2cv = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2110
 *             c2cv = c2cvn()
 * 
 *             while True:             # <<<<<<<<<<<<<<
 *                 minp = min(c1tp, c1cp, c2tp, c2cp)
 *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
 */
      while (1) {
        if (!1) break;

        /* "MACS2/IO/cScoreTrack.pyx":2111
 * 
 *             while True:
 *                 minp = min(c1tp, c1cp, c2tp, c2cp)             # <<<<<<<<<<<<<<
 *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
 *                 pre_p = minp
 */
        __Pyx_INCREF(__pyx_v_c1cp);
        __pyx_t_1 = __pyx_v_c1cp;
        __Pyx_INCREF(__pyx_v_c2tp);
        __pyx_t_2 = __pyx_v_c2tp;
        __Pyx_INCREF(__pyx_v_c2cp);
        __pyx_t_6 = __pyx_v_c2cp;
        __Pyx_INCREF(__pyx_v_c1tp);
        __pyx_t_7 = __pyx_v_c1tp;
        __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_8 = __pyx_t_1;
        } else {
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_8 = __pyx_t_7;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_7 = __pyx_t_8;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_8 = __pyx_t_2;
        } else {
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_8 = __pyx_t_7;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_7 = __pyx_t_8;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_8 = __pyx_t_6;
        } else {
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_8 = __pyx_t_7;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __pyx_t_8;
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_v_minp);
        __pyx_v_minp = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2112
 *             while True:
 *                 minp = min(c1tp, c1cp, c2tp, c2cp)
 *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )             # <<<<<<<<<<<<<<
 *                 pre_p = minp
 *                 if c1tp == minp:
 */
        if (!(likely(PyString_CheckExact(__pyx_v_chrname))||((__pyx_v_chrname) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_v_chrname)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_pre_p); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_v_c1tv); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_v_c1cv); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_v_c2tv); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_15 = __pyx_PyFloat_AsFloat(__pyx_v_c2cv); if (unlikely((__pyx_t_15 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->add(__pyx_v_self, ((PyObject*)__pyx_v_chrname), __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2113
 *                 minp = min(c1tp, c1cp, c2tp, c2cp)
 *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
 *                 pre_p = minp             # <<<<<<<<<<<<<<
 *                 if c1tp == minp:
 *                     c1tp = c1tpn()
 */
        __Pyx_INCREF(__pyx_v_minp);
        __Pyx_DECREF(__pyx_v_pre_p);
        __pyx_v_pre_p = __pyx_v_minp;

        /* "MACS2/IO/cScoreTrack.pyx":2114
 *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
 *                 pre_p = minp
 *                 if c1tp == minp:             # <<<<<<<<<<<<<<
 *                     c1tp = c1tpn()
 *                     c1tv = c1tvn()
 */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_c1tp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_10) {

          /* "MACS2/IO/cScoreTrack.pyx":2115
 *                 pre_p = minp
 *                 if c1tp == minp:
 *                     c1tp = c1tpn()             # <<<<<<<<<<<<<<
 *                     c1tv = c1tvn()
 *                 if c1cp == minp:
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c1tpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c1tp);
          __pyx_v_c1tp = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":2116
 *                 if c1tp == minp:
 *                     c1tp = c1tpn()
 *                     c1tv = c1tvn()             # <<<<<<<<<<<<<<
 *                 if c1cp == minp:
 *                     c1cp = c1cpn()
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c1tvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c1tv);
          __pyx_v_c1tv = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L13;
        }
        __pyx_L13:;

        /* "MACS2/IO/cScoreTrack.pyx":2117
 *                     c1tp = c1tpn()
 *                     c1tv = c1tvn()
 *                 if c1cp == minp:             # <<<<<<<<<<<<<<
 *                     c1cp = c1cpn()
 *                     c1cv = c1cvn()
 */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_c1cp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_10) {

          /* "MACS2/IO/cScoreTrack.pyx":2118
 *                     c1tv = c1tvn()
 *                 if c1cp == minp:
 *                     c1cp = c1cpn()             # <<<<<<<<<<<<<<
 *                     c1cv = c1cvn()
 *                 if c2tp == minp:
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c1cpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c1cp);
          __pyx_v_c1cp = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":2119
 *                 if c1cp == minp:
 *                     c1cp = c1cpn()
 *                     c1cv = c1cvn()             # <<<<<<<<<<<<<<
 *                 if c2tp == minp:
 *                     c2tp = c2tpn()
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c1cvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c1cv);
          __pyx_v_c1cv = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "MACS2/IO/cScoreTrack.pyx":2120
 *                     c1cp = c1cpn()
 *                     c1cv = c1cvn()
 *                 if c2tp == minp:             # <<<<<<<<<<<<<<
 *                     c2tp = c2tpn()
 *                     c2tv = c2tvn()
 */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_c2tp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_10) {

          /* "MACS2/IO/cScoreTrack.pyx":2121
 *                     c1cv = c1cvn()
 *                 if c2tp == minp:
 *                     c2tp = c2tpn()             # <<<<<<<<<<<<<<
 *                     c2tv = c2tvn()
 *                 if c2cp == minp:
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c2tpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c2tp);
          __pyx_v_c2tp = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":2122
 *                 if c2tp == minp:
 *                     c2tp = c2tpn()
 *                     c2tv = c2tvn()             # <<<<<<<<<<<<<<
 *                 if c2cp == minp:
 *                     c2cp = c2cpn()
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c2tvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c2tv);
          __pyx_v_c2tv = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L15;
        }
        __pyx_L15:;

        /* "MACS2/IO/cScoreTrack.pyx":2123
 *                     c2tp = c2tpn()
 *                     c2tv = c2tvn()
 *                 if c2cp == minp:             # <<<<<<<<<<<<<<
 *                     c2cp = c2cpn()
 *                     c2cv = c2cvn()
 */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_c2cp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_10) {

          /* "MACS2/IO/cScoreTrack.pyx":2124
 *                     c2tv = c2tvn()
 *                 if c2cp == minp:
 *                     c2cp = c2cpn()             # <<<<<<<<<<<<<<
 *                     c2cv = c2cvn()
 *         except StopIteration:
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c2cpn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c2cp);
          __pyx_v_c2cp = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":2125
 *                 if c2cp == minp:
 *                     c2cp = c2cpn()
 *                     c2cv = c2cvn()             # <<<<<<<<<<<<<<
 *         except StopIteration:
 *             # meet the end of either bedGraphTrackI, simply exit
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_c2cvn, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_c2cv);
          __pyx_v_c2cv = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L16;
        }
        __pyx_L16:;
      }
    }
    __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_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2126
 *                     c2cp = c2cpn()
 *                     c2cv = c2cvn()
 *         except StopIteration:             # <<<<<<<<<<<<<<
 *             # meet the end of either bedGraphTrackI, simply exit
 *             pass
 */
    __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
    if (__pyx_t_11) {
      PyErr_Restore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    __pyx_L10_try_end:;
  }

  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.build_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c1tpn);
  __Pyx_XDECREF(__pyx_v_c1cpn);
  __Pyx_XDECREF(__pyx_v_c2tpn);
  __Pyx_XDECREF(__pyx_v_c2cpn);
  __Pyx_XDECREF(__pyx_v_c1tvn);
  __Pyx_XDECREF(__pyx_v_c1cvn);
  __Pyx_XDECREF(__pyx_v_c2tvn);
  __Pyx_XDECREF(__pyx_v_c2cvn);
  __Pyx_XDECREF(__pyx_v_pre_p);
  __Pyx_XDECREF(__pyx_v_c1tp);
  __Pyx_XDECREF(__pyx_v_c1tv);
  __Pyx_XDECREF(__pyx_v_c1cp);
  __Pyx_XDECREF(__pyx_v_c1cv);
  __Pyx_XDECREF(__pyx_v_c2tp);
  __Pyx_XDECREF(__pyx_v_c2tv);
  __Pyx_XDECREF(__pyx_v_c2cp);
  __Pyx_XDECREF(__pyx_v_c2cv);
  __Pyx_XDECREF(__pyx_v_minp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2132
 *     # REQUIRES Cython >= 0.16
 *     @cython.boundscheck(False)
 *     cpdef rebuild_chromosomes( self ):             # <<<<<<<<<<<<<<
 *         cdef:
 * #            np.ndarray[np.int32_t] pos, pos_copy
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_5rebuild_chromosomes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_rebuild_chromosomes(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_memviewslice __pyx_v_pos = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_pos_copy = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_t1 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_c1 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_t2 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_c2 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_t1_copy = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_c1_copy = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_t2_copy = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_c2_copy = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_i_new;
  int __pyx_v_n;
  PyObject *__pyx_v_chrom = 0;
  PyArrayObject *__pyx_v_peaks = 0;
  int __pyx_v_datalength;
  PyObject *__pyx_v_peaks1 = NULL;
  PyObject *__pyx_v_peaks2 = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_peaks;
  __Pyx_Buffer __pyx_pybuffer_peaks;
  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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  int __pyx_t_20;
  int __pyx_t_21;
  int __pyx_t_22;
  int __pyx_t_23;
  int __pyx_t_24;
  int __pyx_t_25;
  int __pyx_t_26;
  int __pyx_t_27;
  int __pyx_t_28;
  int __pyx_t_29;
  int __pyx_t_30;
  int __pyx_t_31;
  int __pyx_t_32;
  int __pyx_t_33;
  int __pyx_t_34;
  int __pyx_t_35;
  int __pyx_t_36;
  int __pyx_t_37;
  int __pyx_t_38;
  int __pyx_t_39;
  int __pyx_t_40;
  int __pyx_t_41;
  int __pyx_t_42;
  int __pyx_t_43;
  int __pyx_t_44;
  int __pyx_t_45;
  int __pyx_t_46;
  int __pyx_t_47;
  int __pyx_t_48;
  int __pyx_t_49;
  int __pyx_t_50;
  int __pyx_t_51;
  int __pyx_t_52;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rebuild_chromosomes", 0);
  __pyx_pybuffer_peaks.pybuffer.buf = NULL;
  __pyx_pybuffer_peaks.refcount = 0;
  __pyx_pybuffernd_peaks.data = NULL;
  __pyx_pybuffernd_peaks.rcbuffer = &__pyx_pybuffer_peaks;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__rebuild_chromosomes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_5rebuild_chromosomes)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2144
 *             np.ndarray[np.int32_t] peaks
 *             int datalength
 *         for chrom in self.pos.keys():             # <<<<<<<<<<<<<<
 *             try:
 *                 peaks1 = self.p1io.get_data_from_chrom(chrom)
 */
  if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2145
 *             int datalength
 *         for chrom in self.pos.keys():
 *             try:             # <<<<<<<<<<<<<<
 *                 peaks1 = self.p1io.get_data_from_chrom(chrom)
 *             except KeyError: peaks1 = []
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "MACS2/IO/cScoreTrack.pyx":2146
 *         for chrom in self.pos.keys():
 *             try:
 *                 peaks1 = self.p1io.get_data_from_chrom(chrom)             # <<<<<<<<<<<<<<
 *             except KeyError: peaks1 = []
 *             try:
 */
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->p1io, __pyx_n_s__get_data_from_chrom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_chrom));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
        __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_v_peaks1);
        __pyx_v_peaks1 = __pyx_t_9;
        __pyx_t_9 = 0;
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2147
 *             try:
 *                 peaks1 = self.p1io.get_data_from_chrom(chrom)
 *             except KeyError: peaks1 = []             # <<<<<<<<<<<<<<
 *             try:
 *                 peaks2 = self.p2io.get_data_from_chrom(chrom)
 */
      __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_10) {
        __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.rebuild_chromosomes", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF(__pyx_v_peaks1);
        __pyx_v_peaks1 = ((PyObject *)__pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L6_exception_handled;
      }
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      __pyx_L12_try_end:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":2148
 *                 peaks1 = self.p1io.get_data_from_chrom(chrom)
 *             except KeyError: peaks1 = []
 *             try:             # <<<<<<<<<<<<<<
 *                 peaks2 = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "MACS2/IO/cScoreTrack.pyx":2149
 *             except KeyError: peaks1 = []
 *             try:
 *                 peaks2 = self.p2io.get_data_from_chrom(chrom)             # <<<<<<<<<<<<<<
 *             except KeyError: peaks2 = []
 *             peaks = np.unique(np.array(map(itemgetter('start'), peaks1) +
 */
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->p2io, __pyx_n_s__get_data_from_chrom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_chrom));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
        __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_v_peaks2);
        __pyx_v_peaks2 = __pyx_t_9;
        __pyx_t_9 = 0;
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L22_try_end;
      __pyx_L15_error:;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2150
 *             try:
 *                 peaks2 = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []             # <<<<<<<<<<<<<<
 *             peaks = np.unique(np.array(map(itemgetter('start'), peaks1) +
 *                              map(itemgetter('end'), peaks1) +
 */
      __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_10) {
        __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.rebuild_chromosomes", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF(__pyx_v_peaks2);
        __pyx_v_peaks2 = ((PyObject *)__pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L16_exception_handled;
      }
      __pyx_L17_except_error:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L16_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
      __pyx_L22_try_end:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":2151
 *                 peaks2 = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []
 *             peaks = np.unique(np.array(map(itemgetter('start'), peaks1) +             # <<<<<<<<<<<<<<
 *                              map(itemgetter('end'), peaks1) +
 *                              map(itemgetter('start'), peaks2) +
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__unique); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2152
 *             except KeyError: peaks2 = []
 *             peaks = np.unique(np.array(map(itemgetter('start'), peaks1) +
 *                              map(itemgetter('end'), peaks1) +             # <<<<<<<<<<<<<<
 *                              map(itemgetter('start'), peaks2) +
 *                              map(itemgetter('end'), peaks2),
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);

    /* "MACS2/IO/cScoreTrack.pyx":2151
 *                 peaks2 = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []
 *             peaks = np.unique(np.array(map(itemgetter('start'), peaks1) +             # <<<<<<<<<<<<<<
 *                              map(itemgetter('end'), peaks1) +
 *                              map(itemgetter('start'), peaks2) +
 */
    __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_42), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_v_peaks1);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_peaks1);
    __Pyx_GIVEREF(__pyx_v_peaks1);
    __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2152
 *             except KeyError: peaks2 = []
 *             peaks = np.unique(np.array(map(itemgetter('start'), peaks1) +
 *                              map(itemgetter('end'), peaks1) +             # <<<<<<<<<<<<<<
 *                              map(itemgetter('start'), peaks2) +
 *                              map(itemgetter('end'), peaks2),
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_43), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_v_peaks1);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_peaks1);
    __Pyx_GIVEREF(__pyx_v_peaks1);
    __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __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_12); __pyx_t_12 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2153
 *             peaks = np.unique(np.array(map(itemgetter('start'), peaks1) +
 *                              map(itemgetter('end'), peaks1) +
 *                              map(itemgetter('start'), peaks2) +             # <<<<<<<<<<<<<<
 *                              map(itemgetter('end'), peaks2),
 *                              dtype='int32'))
 */
    __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_k_tuple_44), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_v_peaks2);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_peaks2);
    __Pyx_GIVEREF(__pyx_v_peaks2);
    __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2154
 *                              map(itemgetter('end'), peaks1) +
 *                              map(itemgetter('start'), peaks2) +
 *                              map(itemgetter('end'), peaks2),             # <<<<<<<<<<<<<<
 *                              dtype='int32'))
 *             n = peaks.size
 */
    __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_peaks2);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_peaks2);
    __Pyx_GIVEREF(__pyx_v_peaks2);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __pyx_t_11 = PyNumber_Add(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_t_11 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2151
 *                 peaks2 = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []
 *             peaks = np.unique(np.array(map(itemgetter('start'), peaks1) +             # <<<<<<<<<<<<<<
 *                              map(itemgetter('end'), peaks1) +
 *                              map(itemgetter('start'), peaks2) +
 */
    __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_11));
    if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__int32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peaks.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peaks.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peaks.rcbuffer->pybuffer, (PyObject*)__pyx_v_peaks, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_peaks.diminfo[0].strides = __pyx_pybuffernd_peaks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_peaks.diminfo[0].shape = __pyx_pybuffernd_peaks.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_peaks));
    __pyx_v_peaks = ((PyArrayObject *)__pyx_t_12);
    __pyx_t_12 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2156
 *                              map(itemgetter('end'), peaks2),
 *                              dtype='int32'))
 *             n = peaks.size             # <<<<<<<<<<<<<<
 *             datalength = self.datalength[chrom]
 *             # resize the originals
 */
    __pyx_t_12 = PyObject_GetAttr(((PyObject *)__pyx_v_peaks), __pyx_n_s__size); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_12); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_v_n = __pyx_t_10;

    /* "MACS2/IO/cScoreTrack.pyx":2157
 *                              dtype='int32'))
 *             n = peaks.size
 *             datalength = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             # resize the originals
 *             self.pos[chrom].resize(datalength + n, refcheck=False)
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_12); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_v_datalength = __pyx_t_10;

    /* "MACS2/IO/cScoreTrack.pyx":2159
 *             datalength = self.datalength[chrom]
 *             # resize the originals
 *             self.pos[chrom].resize(datalength + n, refcheck=False)             # <<<<<<<<<<<<<<
 *             self.t1[chrom].resize(datalength + n, refcheck=False)
 *             self.c1[chrom].resize(datalength + n, refcheck=False)
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__resize); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyInt_FromLong((__pyx_v_datalength + __pyx_v_n)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_12));
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2160
 *             # resize the originals
 *             self.pos[chrom].resize(datalength + n, refcheck=False)
 *             self.t1[chrom].resize(datalength + n, refcheck=False)             # <<<<<<<<<<<<<<
 *             self.c1[chrom].resize(datalength + n, refcheck=False)
 *             self.t2[chrom].resize(datalength + n, refcheck=False)
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__resize); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong((__pyx_v_datalength + __pyx_v_n)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2161
 *             self.pos[chrom].resize(datalength + n, refcheck=False)
 *             self.t1[chrom].resize(datalength + n, refcheck=False)
 *             self.c1[chrom].resize(datalength + n, refcheck=False)             # <<<<<<<<<<<<<<
 *             self.t2[chrom].resize(datalength + n, refcheck=False)
 *             self.c2[chrom].resize(datalength + n, refcheck=False)
 */
    if (unlikely(((PyObject *)__pyx_v_self->c1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyInt_FromLong((__pyx_v_datalength + __pyx_v_n)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_t_11 = 0;
    __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_11));
    __pyx_t_12 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2162
 *             self.t1[chrom].resize(datalength + n, refcheck=False)
 *             self.c1[chrom].resize(datalength + n, refcheck=False)
 *             self.t2[chrom].resize(datalength + n, refcheck=False)             # <<<<<<<<<<<<<<
 *             self.c2[chrom].resize(datalength + n, refcheck=False)
 *             pos = self.pos[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__resize); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyInt_FromLong((__pyx_v_datalength + __pyx_v_n)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_12));
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2163
 *             self.c1[chrom].resize(datalength + n, refcheck=False)
 *             self.t2[chrom].resize(datalength + n, refcheck=False)
 *             self.c2[chrom].resize(datalength + n, refcheck=False)             # <<<<<<<<<<<<<<
 *             pos = self.pos[chrom]
 *             t1 = self.t1[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->c2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__resize); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong((__pyx_v_datalength + __pyx_v_n)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2164
 *             self.t2[chrom].resize(datalength + n, refcheck=False)
 *             self.c2[chrom].resize(datalength + n, refcheck=False)
 *             pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *             t1 = self.t1[chrom]
 *             c1 = self.c1[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_11);
    if (unlikely(!__pyx_t_14.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_XDEC_MEMVIEW(&__pyx_v_pos, 1);
    __pyx_v_pos = __pyx_t_14;
    __pyx_t_14.memview = NULL;
    __pyx_t_14.data = NULL;

    /* "MACS2/IO/cScoreTrack.pyx":2165
 *             self.c2[chrom].resize(datalength + n, refcheck=False)
 *             pos = self.pos[chrom]
 *             t1 = self.t1[chrom]             # <<<<<<<<<<<<<<
 *             c1 = self.c1[chrom]
 *             t2 = self.t2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_11);
    if (unlikely(!__pyx_t_15.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_XDEC_MEMVIEW(&__pyx_v_t1, 1);
    __pyx_v_t1 = __pyx_t_15;
    __pyx_t_15.memview = NULL;
    __pyx_t_15.data = NULL;

    /* "MACS2/IO/cScoreTrack.pyx":2166
 *             pos = self.pos[chrom]
 *             t1 = self.t1[chrom]
 *             c1 = self.c1[chrom]             # <<<<<<<<<<<<<<
 *             t2 = self.t2[chrom]
 *             c2 = self.c2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->c1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_11);
    if (unlikely(!__pyx_t_15.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_XDEC_MEMVIEW(&__pyx_v_c1, 1);
    __pyx_v_c1 = __pyx_t_15;
    __pyx_t_15.memview = NULL;
    __pyx_t_15.data = NULL;

    /* "MACS2/IO/cScoreTrack.pyx":2167
 *             t1 = self.t1[chrom]
 *             c1 = self.c1[chrom]
 *             t2 = self.t2[chrom]             # <<<<<<<<<<<<<<
 *             c2 = self.c2[chrom]
 *             pos_copy = np.ndarray(datalength, 'int32')
 */
    if (unlikely(((PyObject *)__pyx_v_self->t2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_11);
    if (unlikely(!__pyx_t_15.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_XDEC_MEMVIEW(&__pyx_v_t2, 1);
    __pyx_v_t2 = __pyx_t_15;
    __pyx_t_15.memview = NULL;
    __pyx_t_15.data = NULL;

    /* "MACS2/IO/cScoreTrack.pyx":2168
 *             c1 = self.c1[chrom]
 *             t2 = self.t2[chrom]
 *             c2 = self.c2[chrom]             # <<<<<<<<<<<<<<
 *             pos_copy = np.ndarray(datalength, 'int32')
 *             t1_copy = np.ndarray(datalength, 'float32')
 */
    if (unlikely(((PyObject *)__pyx_v_self->c2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_11);
    if (unlikely(!__pyx_t_15.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_XDEC_MEMVIEW(&__pyx_v_c2, 1);
    __pyx_v_c2 = __pyx_t_15;
    __pyx_t_15.memview = NULL;
    __pyx_t_15.data = NULL;

    /* "MACS2/IO/cScoreTrack.pyx":2169
 *             t2 = self.t2[chrom]
 *             c2 = self.c2[chrom]
 *             pos_copy = np.ndarray(datalength, 'int32')             # <<<<<<<<<<<<<<
 *             t1_copy = np.ndarray(datalength, 'float32')
 *             c1_copy = np.ndarray(datalength, 'float32')
 */
    __pyx_t_11 = PyInt_FromLong(__pyx_v_datalength); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__int32));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__int32));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
    __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5MACS2_2IO_5numpy_ndarray)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_11);
    if (unlikely(!__pyx_t_14.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_XDEC_MEMVIEW(&__pyx_v_pos_copy, 1);
    __pyx_v_pos_copy = __pyx_t_14;
    __pyx_t_14.memview = NULL;
    __pyx_t_14.data = NULL;

    /* "MACS2/IO/cScoreTrack.pyx":2170
 *             c2 = self.c2[chrom]
 *             pos_copy = np.ndarray(datalength, 'int32')
 *             t1_copy = np.ndarray(datalength, 'float32')             # <<<<<<<<<<<<<<
 *             c1_copy = np.ndarray(datalength, 'float32')
 *             t2_copy = np.ndarray(datalength, 'float32')
 */
    __pyx_t_11 = PyInt_FromLong(__pyx_v_datalength); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__float32));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
    __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5MACS2_2IO_5numpy_ndarray)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_11);
    if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_XDEC_MEMVIEW(&__pyx_v_t1_copy, 1);
    __pyx_v_t1_copy = __pyx_t_16;
    __pyx_t_16.memview = NULL;
    __pyx_t_16.data = NULL;

    /* "MACS2/IO/cScoreTrack.pyx":2171
 *             pos_copy = np.ndarray(datalength, 'int32')
 *             t1_copy = np.ndarray(datalength, 'float32')
 *             c1_copy = np.ndarray(datalength, 'float32')             # <<<<<<<<<<<<<<
 *             t2_copy = np.ndarray(datalength, 'float32')
 *             c2_copy = np.ndarray(datalength, 'float32')
 */
    __pyx_t_11 = PyInt_FromLong(__pyx_v_datalength); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__float32));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
    __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5MACS2_2IO_5numpy_ndarray)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_11);
    if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_XDEC_MEMVIEW(&__pyx_v_c1_copy, 1);
    __pyx_v_c1_copy = __pyx_t_16;
    __pyx_t_16.memview = NULL;
    __pyx_t_16.data = NULL;

    /* "MACS2/IO/cScoreTrack.pyx":2172
 *             t1_copy = np.ndarray(datalength, 'float32')
 *             c1_copy = np.ndarray(datalength, 'float32')
 *             t2_copy = np.ndarray(datalength, 'float32')             # <<<<<<<<<<<<<<
 *             c2_copy = np.ndarray(datalength, 'float32')
 *             # GIL not needed here, provides speedup
 */
    __pyx_t_11 = PyInt_FromLong(__pyx_v_datalength); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__float32));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
    __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5MACS2_2IO_5numpy_ndarray)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_11);
    if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_XDEC_MEMVIEW(&__pyx_v_t2_copy, 1);
    __pyx_v_t2_copy = __pyx_t_16;
    __pyx_t_16.memview = NULL;
    __pyx_t_16.data = NULL;

    /* "MACS2/IO/cScoreTrack.pyx":2173
 *             c1_copy = np.ndarray(datalength, 'float32')
 *             t2_copy = np.ndarray(datalength, 'float32')
 *             c2_copy = np.ndarray(datalength, 'float32')             # <<<<<<<<<<<<<<
 *             # GIL not needed here, provides speedup
 *             with cython.boundscheck(False):
 */
    __pyx_t_11 = PyInt_FromLong(__pyx_v_datalength); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__float32));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
    __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5MACS2_2IO_5numpy_ndarray)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_11);
    if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_XDEC_MEMVIEW(&__pyx_v_c2_copy, 1);
    __pyx_v_c2_copy = __pyx_t_16;
    __pyx_t_16.memview = NULL;
    __pyx_t_16.data = NULL;

    /* "MACS2/IO/cScoreTrack.pyx":2176
 *             # GIL not needed here, provides speedup
 *             with cython.boundscheck(False):
 *                 with nogil, parallel():             # <<<<<<<<<<<<<<
 *                     for i in prange(datalength):
 * #            for i in range(datalength):
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save = NULL;
        #endif
        Py_UNBLOCK_THREADS
        /*try:*/ {
          {
              #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                  #undef likely
                  #undef unlikely
                  #define likely(x)   (x)
                  #define unlikely(x) (x)
              #endif
              #ifdef _OPENMP
              #pragma omp parallel  private(__pyx_t_17, __pyx_t_19, __pyx_t_18, __pyx_t_24, __pyx_t_26, __pyx_t_27, __pyx_t_10, __pyx_t_20, __pyx_t_22, __pyx_t_21, __pyx_t_23, __pyx_t_25, __pyx_t_28)
              #endif /* _OPENMP */
              {

                  /* "MACS2/IO/cScoreTrack.pyx":2177
 *             with cython.boundscheck(False):
 *                 with nogil, parallel():
 *                     for i in prange(datalength):             # <<<<<<<<<<<<<<
 * #            for i in range(datalength):
 *                         pos_copy[i] = pos[i]
 */
                  __pyx_t_10 = __pyx_v_datalength;
                  if (1 == 0) abort();
                  {
                      __pyx_t_18 = (__pyx_t_10 - 0) / 1;
                      if (__pyx_t_18 > 0)
                      {
                          #ifdef _OPENMP
                          #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i)
                          #endif /* _OPENMP */
                          for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_18; __pyx_t_17++){
                              {
                                  __pyx_v_i = 0 + 1 * __pyx_t_17;

                                  /* "MACS2/IO/cScoreTrack.pyx":2179
 *                     for i in prange(datalength):
 * #            for i in range(datalength):
 *                         pos_copy[i] = pos[i]             # <<<<<<<<<<<<<<
 *                         t1_copy[i] = t1[i]
 *                         c1_copy[i] = c1[i]
 */
                                  __pyx_t_19 = __pyx_v_i;
                                  if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_pos.shape[0];
                                  __pyx_t_20 = __pyx_v_i;
                                  if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_pos_copy.shape[0];
                                  *((int *) ( /* dim=0 */ (__pyx_v_pos_copy.data + __pyx_t_20 * __pyx_v_pos_copy.strides[0]) )) = (*((int *) ( /* dim=0 */ (__pyx_v_pos.data + __pyx_t_19 * __pyx_v_pos.strides[0]) )));

                                  /* "MACS2/IO/cScoreTrack.pyx":2180
 * #            for i in range(datalength):
 *                         pos_copy[i] = pos[i]
 *                         t1_copy[i] = t1[i]             # <<<<<<<<<<<<<<
 *                         c1_copy[i] = c1[i]
 *                         t2_copy[i] = t2[i]
 */
                                  __pyx_t_21 = __pyx_v_i;
                                  if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_v_t1.shape[0];
                                  __pyx_t_22 = __pyx_v_i;
                                  if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_v_t1_copy.shape[0];
                                  *((float *) ( /* dim=0 */ (__pyx_v_t1_copy.data + __pyx_t_22 * __pyx_v_t1_copy.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_t1.data + __pyx_t_21 * __pyx_v_t1.strides[0]) )));

                                  /* "MACS2/IO/cScoreTrack.pyx":2181
 *                         pos_copy[i] = pos[i]
 *                         t1_copy[i] = t1[i]
 *                         c1_copy[i] = c1[i]             # <<<<<<<<<<<<<<
 *                         t2_copy[i] = t2[i]
 *                         c2_copy[i] = c2[i]
 */
                                  __pyx_t_23 = __pyx_v_i;
                                  if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_v_c1.shape[0];
                                  __pyx_t_24 = __pyx_v_i;
                                  if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_c1_copy.shape[0];
                                  *((float *) ( /* dim=0 */ (__pyx_v_c1_copy.data + __pyx_t_24 * __pyx_v_c1_copy.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_c1.data + __pyx_t_23 * __pyx_v_c1.strides[0]) )));

                                  /* "MACS2/IO/cScoreTrack.pyx":2182
 *                         t1_copy[i] = t1[i]
 *                         c1_copy[i] = c1[i]
 *                         t2_copy[i] = t2[i]             # <<<<<<<<<<<<<<
 *                         c2_copy[i] = c2[i]
 * 
 */
                                  __pyx_t_25 = __pyx_v_i;
                                  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_t2.shape[0];
                                  __pyx_t_26 = __pyx_v_i;
                                  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_t2_copy.shape[0];
                                  *((float *) ( /* dim=0 */ (__pyx_v_t2_copy.data + __pyx_t_26 * __pyx_v_t2_copy.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_t2.data + __pyx_t_25 * __pyx_v_t2.strides[0]) )));

                                  /* "MACS2/IO/cScoreTrack.pyx":2183
 *                         c1_copy[i] = c1[i]
 *                         t2_copy[i] = t2[i]
 *                         c2_copy[i] = c2[i]             # <<<<<<<<<<<<<<
 * 
 *                 j = 0
 */
                                  __pyx_t_27 = __pyx_v_i;
                                  if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_c2.shape[0];
                                  __pyx_t_28 = __pyx_v_i;
                                  if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_v_c2_copy.shape[0];
                                  *((float *) ( /* dim=0 */ (__pyx_v_c2_copy.data + __pyx_t_28 * __pyx_v_c2_copy.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_c2.data + __pyx_t_27 * __pyx_v_c2.strides[0]) )));
                              }
                          }
                      }
                  }
              }
          }
          #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
              #undef likely
              #undef unlikely
              #define likely(x)   __builtin_expect(!!(x), 1)
              #define unlikely(x) __builtin_expect(!!(x), 0)
          #endif
        }

        /* "MACS2/IO/cScoreTrack.pyx":2176
 *             # GIL not needed here, provides speedup
 *             with cython.boundscheck(False):
 *                 with nogil, parallel():             # <<<<<<<<<<<<<<
 *                     for i in prange(datalength):
 * #            for i in range(datalength):
 */
        /*finally:*/ {
          Py_BLOCK_THREADS
        }
    }

    /* "MACS2/IO/cScoreTrack.pyx":2185
 *                         c2_copy[i] = c2[i]
 * 
 *                 j = 0             # <<<<<<<<<<<<<<
 *                 i_new = 0
 *                 for i in range(datalength):
 */
    __pyx_v_j = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2186
 * 
 *                 j = 0
 *                 i_new = 0             # <<<<<<<<<<<<<<
 *                 for i in range(datalength):
 *                     while True:
 */
    __pyx_v_i_new = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2187
 *                 j = 0
 *                 i_new = 0
 *                 for i in range(datalength):             # <<<<<<<<<<<<<<
 *                     while True:
 *                         if j == n: break
 */
    __pyx_t_18 = __pyx_v_datalength;
    for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_18; __pyx_t_17+=1) {
      __pyx_v_i = __pyx_t_17;

      /* "MACS2/IO/cScoreTrack.pyx":2188
 *                 i_new = 0
 *                 for i in range(datalength):
 *                     while True:             # <<<<<<<<<<<<<<
 *                         if j == n: break
 *                         if peaks[j] < pos_copy[i]:
 */
      while (1) {
        if (!1) break;

        /* "MACS2/IO/cScoreTrack.pyx":2189
 *                 for i in range(datalength):
 *                     while True:
 *                         if j == n: break             # <<<<<<<<<<<<<<
 *                         if peaks[j] < pos_copy[i]:
 *                             pos[i_new] = peaks[j]
 */
        __pyx_t_29 = (__pyx_v_j == __pyx_v_n);
        if (__pyx_t_29) {
          goto __pyx_L45_break;
          goto __pyx_L46;
        }
        __pyx_L46:;

        /* "MACS2/IO/cScoreTrack.pyx":2190
 *                     while True:
 *                         if j == n: break
 *                         if peaks[j] < pos_copy[i]:             # <<<<<<<<<<<<<<
 *                             pos[i_new] = peaks[j]
 *                             j += 1
 */
        __pyx_t_10 = __pyx_v_j;
        if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_pybuffernd_peaks.diminfo[0].shape;
        __pyx_t_30 = __pyx_v_i;
        if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_v_pos_copy.shape[0];
        __pyx_t_29 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_peaks.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_peaks.diminfo[0].strides)) < (*((int *) ( /* dim=0 */ (__pyx_v_pos_copy.data + __pyx_t_30 * __pyx_v_pos_copy.strides[0]) ))));
        if (__pyx_t_29) {

          /* "MACS2/IO/cScoreTrack.pyx":2191
 *                         if j == n: break
 *                         if peaks[j] < pos_copy[i]:
 *                             pos[i_new] = peaks[j]             # <<<<<<<<<<<<<<
 *                             j += 1
 *                             t1[i_new] = t1_copy[i]
 */
          __pyx_t_31 = __pyx_v_j;
          if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_pybuffernd_peaks.diminfo[0].shape;
          __pyx_t_32 = __pyx_v_i_new;
          if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_v_pos.shape[0];
          *((int *) ( /* dim=0 */ (__pyx_v_pos.data + __pyx_t_32 * __pyx_v_pos.strides[0]) )) = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_peaks.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_peaks.diminfo[0].strides));

          /* "MACS2/IO/cScoreTrack.pyx":2192
 *                         if peaks[j] < pos_copy[i]:
 *                             pos[i_new] = peaks[j]
 *                             j += 1             # <<<<<<<<<<<<<<
 *                             t1[i_new] = t1_copy[i]
 *                             t2[i_new] = t2_copy[i]
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "MACS2/IO/cScoreTrack.pyx":2193
 *                             pos[i_new] = peaks[j]
 *                             j += 1
 *                             t1[i_new] = t1_copy[i]             # <<<<<<<<<<<<<<
 *                             t2[i_new] = t2_copy[i]
 *                             c1[i_new] = c1_copy[i]
 */
          __pyx_t_33 = __pyx_v_i;
          if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_t1_copy.shape[0];
          __pyx_t_34 = __pyx_v_i_new;
          if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_t1.shape[0];
          *((float *) ( /* dim=0 */ (__pyx_v_t1.data + __pyx_t_34 * __pyx_v_t1.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_t1_copy.data + __pyx_t_33 * __pyx_v_t1_copy.strides[0]) )));

          /* "MACS2/IO/cScoreTrack.pyx":2194
 *                             j += 1
 *                             t1[i_new] = t1_copy[i]
 *                             t2[i_new] = t2_copy[i]             # <<<<<<<<<<<<<<
 *                             c1[i_new] = c1_copy[i]
 *                             c2[i_new] = c2_copy[i]
 */
          __pyx_t_35 = __pyx_v_i;
          if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_t2_copy.shape[0];
          __pyx_t_36 = __pyx_v_i_new;
          if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_t2.shape[0];
          *((float *) ( /* dim=0 */ (__pyx_v_t2.data + __pyx_t_36 * __pyx_v_t2.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_t2_copy.data + __pyx_t_35 * __pyx_v_t2_copy.strides[0]) )));

          /* "MACS2/IO/cScoreTrack.pyx":2195
 *                             t1[i_new] = t1_copy[i]
 *                             t2[i_new] = t2_copy[i]
 *                             c1[i_new] = c1_copy[i]             # <<<<<<<<<<<<<<
 *                             c2[i_new] = c2_copy[i]
 *                             i_new += 1
 */
          __pyx_t_37 = __pyx_v_i;
          if (__pyx_t_37 < 0) __pyx_t_37 += __pyx_v_c1_copy.shape[0];
          __pyx_t_38 = __pyx_v_i_new;
          if (__pyx_t_38 < 0) __pyx_t_38 += __pyx_v_c1.shape[0];
          *((float *) ( /* dim=0 */ (__pyx_v_c1.data + __pyx_t_38 * __pyx_v_c1.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_c1_copy.data + __pyx_t_37 * __pyx_v_c1_copy.strides[0]) )));

          /* "MACS2/IO/cScoreTrack.pyx":2196
 *                             t2[i_new] = t2_copy[i]
 *                             c1[i_new] = c1_copy[i]
 *                             c2[i_new] = c2_copy[i]             # <<<<<<<<<<<<<<
 *                             i_new += 1
 *                         elif peaks[j] == pos[i]:
 */
          __pyx_t_39 = __pyx_v_i;
          if (__pyx_t_39 < 0) __pyx_t_39 += __pyx_v_c2_copy.shape[0];
          __pyx_t_40 = __pyx_v_i_new;
          if (__pyx_t_40 < 0) __pyx_t_40 += __pyx_v_c2.shape[0];
          *((float *) ( /* dim=0 */ (__pyx_v_c2.data + __pyx_t_40 * __pyx_v_c2.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_c2_copy.data + __pyx_t_39 * __pyx_v_c2_copy.strides[0]) )));

          /* "MACS2/IO/cScoreTrack.pyx":2197
 *                             c1[i_new] = c1_copy[i]
 *                             c2[i_new] = c2_copy[i]
 *                             i_new += 1             # <<<<<<<<<<<<<<
 *                         elif peaks[j] == pos[i]:
 *                             j += 1
 */
          __pyx_v_i_new = (__pyx_v_i_new + 1);
          goto __pyx_L47;
        }

        /* "MACS2/IO/cScoreTrack.pyx":2198
 *                             c2[i_new] = c2_copy[i]
 *                             i_new += 1
 *                         elif peaks[j] == pos[i]:             # <<<<<<<<<<<<<<
 *                             j += 1
 *                             break
 */
        __pyx_t_41 = __pyx_v_j;
        if (__pyx_t_41 < 0) __pyx_t_41 += __pyx_pybuffernd_peaks.diminfo[0].shape;
        __pyx_t_42 = __pyx_v_i;
        if (__pyx_t_42 < 0) __pyx_t_42 += __pyx_v_pos.shape[0];
        __pyx_t_29 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_peaks.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_peaks.diminfo[0].strides)) == (*((int *) ( /* dim=0 */ (__pyx_v_pos.data + __pyx_t_42 * __pyx_v_pos.strides[0]) ))));
        if (__pyx_t_29) {

          /* "MACS2/IO/cScoreTrack.pyx":2199
 *                             i_new += 1
 *                         elif peaks[j] == pos[i]:
 *                             j += 1             # <<<<<<<<<<<<<<
 *                             break
 *                         else: # pos[i] < peaks[j], keep increasing pos
 */
          __pyx_v_j = (__pyx_v_j + 1);

          /* "MACS2/IO/cScoreTrack.pyx":2200
 *                         elif peaks[j] == pos[i]:
 *                             j += 1
 *                             break             # <<<<<<<<<<<<<<
 *                         else: # pos[i] < peaks[j], keep increasing pos
 *                             break
 */
          goto __pyx_L45_break;
          goto __pyx_L47;
        }
        /*else*/ {

          /* "MACS2/IO/cScoreTrack.pyx":2202
 *                             break
 *                         else: # pos[i] < peaks[j], keep increasing pos
 *                             break             # <<<<<<<<<<<<<<
 *                     # this would just copy the array without the above loop
 *                     if j == n: break
 */
          goto __pyx_L45_break;
        }
        __pyx_L47:;
      }
      __pyx_L45_break:;

      /* "MACS2/IO/cScoreTrack.pyx":2204
 *                             break
 *                     # this would just copy the array without the above loop
 *                     if j == n: break             # <<<<<<<<<<<<<<
 *                     pos[i_new] = pos_copy[i]
 *                     t1[i_new] = t1_copy[i]
 */
      __pyx_t_29 = (__pyx_v_j == __pyx_v_n);
      if (__pyx_t_29) {
        goto __pyx_L43_break;
        goto __pyx_L48;
      }
      __pyx_L48:;

      /* "MACS2/IO/cScoreTrack.pyx":2205
 *                     # this would just copy the array without the above loop
 *                     if j == n: break
 *                     pos[i_new] = pos_copy[i]             # <<<<<<<<<<<<<<
 *                     t1[i_new] = t1_copy[i]
 *                     t2[i_new] = t2_copy[i]
 */
      __pyx_t_43 = __pyx_v_i;
      if (__pyx_t_43 < 0) __pyx_t_43 += __pyx_v_pos_copy.shape[0];
      __pyx_t_44 = __pyx_v_i_new;
      if (__pyx_t_44 < 0) __pyx_t_44 += __pyx_v_pos.shape[0];
      *((int *) ( /* dim=0 */ (__pyx_v_pos.data + __pyx_t_44 * __pyx_v_pos.strides[0]) )) = (*((int *) ( /* dim=0 */ (__pyx_v_pos_copy.data + __pyx_t_43 * __pyx_v_pos_copy.strides[0]) )));

      /* "MACS2/IO/cScoreTrack.pyx":2206
 *                     if j == n: break
 *                     pos[i_new] = pos_copy[i]
 *                     t1[i_new] = t1_copy[i]             # <<<<<<<<<<<<<<
 *                     t2[i_new] = t2_copy[i]
 *                     c1[i_new] = c1_copy[i]
 */
      __pyx_t_45 = __pyx_v_i;
      if (__pyx_t_45 < 0) __pyx_t_45 += __pyx_v_t1_copy.shape[0];
      __pyx_t_46 = __pyx_v_i_new;
      if (__pyx_t_46 < 0) __pyx_t_46 += __pyx_v_t1.shape[0];
      *((float *) ( /* dim=0 */ (__pyx_v_t1.data + __pyx_t_46 * __pyx_v_t1.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_t1_copy.data + __pyx_t_45 * __pyx_v_t1_copy.strides[0]) )));

      /* "MACS2/IO/cScoreTrack.pyx":2207
 *                     pos[i_new] = pos_copy[i]
 *                     t1[i_new] = t1_copy[i]
 *                     t2[i_new] = t2_copy[i]             # <<<<<<<<<<<<<<
 *                     c1[i_new] = c1_copy[i]
 *                     c2[i_new] = c2_copy[i]
 */
      __pyx_t_47 = __pyx_v_i;
      if (__pyx_t_47 < 0) __pyx_t_47 += __pyx_v_t2_copy.shape[0];
      __pyx_t_48 = __pyx_v_i_new;
      if (__pyx_t_48 < 0) __pyx_t_48 += __pyx_v_t2.shape[0];
      *((float *) ( /* dim=0 */ (__pyx_v_t2.data + __pyx_t_48 * __pyx_v_t2.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_t2_copy.data + __pyx_t_47 * __pyx_v_t2_copy.strides[0]) )));

      /* "MACS2/IO/cScoreTrack.pyx":2208
 *                     t1[i_new] = t1_copy[i]
 *                     t2[i_new] = t2_copy[i]
 *                     c1[i_new] = c1_copy[i]             # <<<<<<<<<<<<<<
 *                     c2[i_new] = c2_copy[i]
 *                     i_new += 1
 */
      __pyx_t_49 = __pyx_v_i;
      if (__pyx_t_49 < 0) __pyx_t_49 += __pyx_v_c1_copy.shape[0];
      __pyx_t_50 = __pyx_v_i_new;
      if (__pyx_t_50 < 0) __pyx_t_50 += __pyx_v_c1.shape[0];
      *((float *) ( /* dim=0 */ (__pyx_v_c1.data + __pyx_t_50 * __pyx_v_c1.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_c1_copy.data + __pyx_t_49 * __pyx_v_c1_copy.strides[0]) )));

      /* "MACS2/IO/cScoreTrack.pyx":2209
 *                     t2[i_new] = t2_copy[i]
 *                     c1[i_new] = c1_copy[i]
 *                     c2[i_new] = c2_copy[i]             # <<<<<<<<<<<<<<
 *                     i_new += 1
 * #            pos_copy.resize(0, refcheck=False)
 */
      __pyx_t_51 = __pyx_v_i;
      if (__pyx_t_51 < 0) __pyx_t_51 += __pyx_v_c2_copy.shape[0];
      __pyx_t_52 = __pyx_v_i_new;
      if (__pyx_t_52 < 0) __pyx_t_52 += __pyx_v_c2.shape[0];
      *((float *) ( /* dim=0 */ (__pyx_v_c2.data + __pyx_t_52 * __pyx_v_c2.strides[0]) )) = (*((float *) ( /* dim=0 */ (__pyx_v_c2_copy.data + __pyx_t_51 * __pyx_v_c2_copy.strides[0]) )));

      /* "MACS2/IO/cScoreTrack.pyx":2210
 *                     c1[i_new] = c1_copy[i]
 *                     c2[i_new] = c2_copy[i]
 *                     i_new += 1             # <<<<<<<<<<<<<<
 * #            pos_copy.resize(0, refcheck=False)
 * #            t1_copy.resize(0, refcheck=False)
 */
      __pyx_v_i_new = (__pyx_v_i_new + 1);
    }
    __pyx_L43_break:;

    /* "MACS2/IO/cScoreTrack.pyx":2217
 * #            c1_copy.resize(0, refcheck=False)
 *             # j should never be greater than n - 1 if we used MACS2
 *             self.pos[chrom].resize(i_new, refcheck=False)             # <<<<<<<<<<<<<<
 *             self.t1[chrom].resize(i_new, refcheck=False)
 *             self.c1[chrom].resize(i_new, refcheck=False)
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyInt_FromLong(__pyx_v_i_new); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_t_11 = 0;
    __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_11));
    __pyx_t_12 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2218
 *             # j should never be greater than n - 1 if we used MACS2
 *             self.pos[chrom].resize(i_new, refcheck=False)
 *             self.t1[chrom].resize(i_new, refcheck=False)             # <<<<<<<<<<<<<<
 *             self.c1[chrom].resize(i_new, refcheck=False)
 *             self.t2[chrom].resize(i_new, refcheck=False)
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__resize); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyInt_FromLong(__pyx_v_i_new); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_12));
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2219
 *             self.pos[chrom].resize(i_new, refcheck=False)
 *             self.t1[chrom].resize(i_new, refcheck=False)
 *             self.c1[chrom].resize(i_new, refcheck=False)             # <<<<<<<<<<<<<<
 *             self.t2[chrom].resize(i_new, refcheck=False)
 *             self.c2[chrom].resize(i_new, refcheck=False)
 */
    if (unlikely(((PyObject *)__pyx_v_self->c1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__resize); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong(__pyx_v_i_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2220
 *             self.t1[chrom].resize(i_new, refcheck=False)
 *             self.c1[chrom].resize(i_new, refcheck=False)
 *             self.t2[chrom].resize(i_new, refcheck=False)             # <<<<<<<<<<<<<<
 *             self.c2[chrom].resize(i_new, refcheck=False)
 *             self.datalength[chrom] = i_new # resize everything last
 */
    if (unlikely(((PyObject *)__pyx_v_self->t2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyInt_FromLong(__pyx_v_i_new); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_t_11 = 0;
    __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_11));
    __pyx_t_12 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2221
 *             self.c1[chrom].resize(i_new, refcheck=False)
 *             self.t2[chrom].resize(i_new, refcheck=False)
 *             self.c2[chrom].resize(i_new, refcheck=False)             # <<<<<<<<<<<<<<
 *             self.datalength[chrom] = i_new # resize everything last
 *         self.finalize()
 */
    if (unlikely(((PyObject *)__pyx_v_self->c2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__resize); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyInt_FromLong(__pyx_v_i_new); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_12));
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2222
 *             self.t2[chrom].resize(i_new, refcheck=False)
 *             self.c2[chrom].resize(i_new, refcheck=False)
 *             self.datalength[chrom] = i_new # resize everything last             # <<<<<<<<<<<<<<
 *         self.finalize()
 * 
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_i_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2223
 *             self.c2[chrom].resize(i_new, refcheck=False)
 *             self.datalength[chrom] = i_new # resize everything last
 *         self.finalize()             # <<<<<<<<<<<<<<
 * 
 *     cdef add_chromosome ( self, str chrom, int chrom_max_len ):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->finalize(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peaks.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.rebuild_chromosomes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peaks.rcbuffer->pybuffer);
  __pyx_L2:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_pos, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_pos_copy, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_t1, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_c1, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_t2, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_c2, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_t1_copy, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_c1_copy, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_t2_copy, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_c2_copy, 1);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_peaks);
  __Pyx_XDECREF(__pyx_v_peaks1);
  __Pyx_XDECREF(__pyx_v_peaks2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_5rebuild_chromosomes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_5rebuild_chromosomes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rebuild_chromosomes (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_4rebuild_chromosomes(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2132
 *     # REQUIRES Cython >= 0.16
 *     @cython.boundscheck(False)
 *     cpdef rebuild_chromosomes( self ):             # <<<<<<<<<<<<<<
 *         cdef:
 * #            np.ndarray[np.int32_t] pos, pos_copy
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_4rebuild_chromosomes(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rebuild_chromosomes", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->rebuild_chromosomes(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.rebuild_chromosomes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2225
 *         self.finalize()
 * 
 *     cdef add_chromosome ( self, str chrom, int chrom_max_len ):             # <<<<<<<<<<<<<<
 *         """
 *         chrom: chromosome name
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_add_chromosome(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_chrom, int __pyx_v_chrom_max_len) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_chromosome", 0);

  /* "MACS2/IO/cScoreTrack.pyx":2231
 * 
 *         """
 *         if not self.pos.has_key(chrom):             # <<<<<<<<<<<<<<
 *             self.pos[chrom] = np.zeros( chrom_max_len, dtype="int32" ) # pos
 *             self.t1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # t1
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->pos), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "MACS2/IO/cScoreTrack.pyx":2232
 *         """
 *         if not self.pos.has_key(chrom):
 *             self.pos[chrom] = np.zeros( chrom_max_len, dtype="int32" ) # pos             # <<<<<<<<<<<<<<
 *             self.t1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # t1
 *             self.c1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__int32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2233
 *         if not self.pos.has_key(chrom):
 *             self.pos[chrom] = np.zeros( chrom_max_len, dtype="int32" ) # pos
 *             self.t1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # t1             # <<<<<<<<<<<<<<
 *             self.c1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 *             self.tvsc1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->t1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->t1), ((PyObject *)__pyx_v_chrom), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2234
 *             self.pos[chrom] = np.zeros( chrom_max_len, dtype="int32" ) # pos
 *             self.t1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # t1
 *             self.c1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1             # <<<<<<<<<<<<<<
 *             self.tvsc1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 *             self.t2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # t2
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->c1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->c1), ((PyObject *)__pyx_v_chrom), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2235
 *             self.t1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # t1
 *             self.c1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 *             self.tvsc1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1             # <<<<<<<<<<<<<<
 *             self.t2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # t2
 *             self.c2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c2
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->tvsc1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->tvsc1), ((PyObject *)__pyx_v_chrom), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2236
 *             self.c1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 *             self.tvsc1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 *             self.t2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # t2             # <<<<<<<<<<<<<<
 *             self.c2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c2
 *             self.tvsc2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->t2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->t2), ((PyObject *)__pyx_v_chrom), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2237
 *             self.tvsc1[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 *             self.t2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # t2
 *             self.c2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c2             # <<<<<<<<<<<<<<
 *             self.tvsc2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 *             self.t1vs2[chrom] = np.zeros(chrom_max_len, dtype="float32" ) # c1
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->c2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->c2), ((PyObject *)__pyx_v_chrom), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2238
 *             self.t2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # t2
 *             self.c2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c2
 *             self.tvsc2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1             # <<<<<<<<<<<<<<
 *             self.t1vs2[chrom] = np.zeros(chrom_max_len, dtype="float32" ) # c1
 *             self.tlogLR[chrom] = np.ndarray( chrom_max_len, dtype="float32")
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->tvsc2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->tvsc2), ((PyObject *)__pyx_v_chrom), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2239
 *             self.c2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c2
 *             self.tvsc2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 *             self.t1vs2[chrom] = np.zeros(chrom_max_len, dtype="float32" ) # c1             # <<<<<<<<<<<<<<
 *             self.tlogLR[chrom] = np.ndarray( chrom_max_len, dtype="float32")
 *             self.datalength[chrom] = 0
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->t1vs2), ((PyObject *)__pyx_v_chrom), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2240
 *             self.tvsc2[chrom] = np.zeros( chrom_max_len, dtype="float32" ) # c1
 *             self.t1vs2[chrom] = np.zeros(chrom_max_len, dtype="float32" ) # c1
 *             self.tlogLR[chrom] = np.ndarray( chrom_max_len, dtype="float32")             # <<<<<<<<<<<<<<
 *             self.datalength[chrom] = 0
 * 
 */
    __pyx_t_2 = PyInt_FromLong(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5MACS2_2IO_5numpy_ndarray)), ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->tlogLR) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->tlogLR), ((PyObject *)__pyx_v_chrom), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2241
 *             self.t1vs2[chrom] = np.zeros(chrom_max_len, dtype="float32" ) # c1
 *             self.tlogLR[chrom] = np.ndarray( chrom_max_len, dtype="float32")
 *             self.datalength[chrom] = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef add (self, str chromosome, int endpos, float t1, float c1, float t2, float c2):
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2243
 *             self.datalength[chrom] = 0
 * 
 *     cdef add (self, str chromosome, int endpos, float t1, float c1, float t2, float c2):             # <<<<<<<<<<<<<<
 *         """Add a chr-endpos-sample-control block into data
 *         dictionary.
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_add(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_v_endpos, float __pyx_v_t1, float __pyx_v_c1, float __pyx_v_t2, float __pyx_v_c2) {
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 0);

  /* "MACS2/IO/cScoreTrack.pyx":2255
 *         """
 *         cdef int i
 *         i = self.datalength[chromosome]             # <<<<<<<<<<<<<<
 *         self.pos[chromosome][ i ] = endpos
 *         self.t1[chromosome][ i ] = t1 * self.cond1_depth
 */
  if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_i = __pyx_t_2;

  /* "MACS2/IO/cScoreTrack.pyx":2256
 *         cdef int i
 *         i = self.datalength[chromosome]
 *         self.pos[chromosome][ i ] = endpos             # <<<<<<<<<<<<<<
 *         self.t1[chromosome][ i ] = t1 * self.cond1_depth
 *         self.c1[chromosome][ i ] = c1 * self.cond1_depth
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_endpos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2257
 *         i = self.datalength[chromosome]
 *         self.pos[chromosome][ i ] = endpos
 *         self.t1[chromosome][ i ] = t1 * self.cond1_depth             # <<<<<<<<<<<<<<
 *         self.c1[chromosome][ i ] = c1 * self.cond1_depth
 *         self.t2[chromosome][ i ] = t2 * self.cond2_depth
 */
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_t1 * __pyx_v_self->cond1_depth)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((PyObject *)__pyx_v_self->t1) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2258
 *         self.pos[chromosome][ i ] = endpos
 *         self.t1[chromosome][ i ] = t1 * self.cond1_depth
 *         self.c1[chromosome][ i ] = c1 * self.cond1_depth             # <<<<<<<<<<<<<<
 *         self.t2[chromosome][ i ] = t2 * self.cond2_depth
 *         self.c2[chromosome][ i ] = c2 * self.cond2_depth
 */
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_c1 * __pyx_v_self->cond1_depth)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((PyObject *)__pyx_v_self->c1) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c1), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2259
 *         self.t1[chromosome][ i ] = t1 * self.cond1_depth
 *         self.c1[chromosome][ i ] = c1 * self.cond1_depth
 *         self.t2[chromosome][ i ] = t2 * self.cond2_depth             # <<<<<<<<<<<<<<
 *         self.c2[chromosome][ i ] = c2 * self.cond2_depth
 *         self.datalength[chromosome] += 1
 */
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_t2 * __pyx_v_self->cond2_depth)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((PyObject *)__pyx_v_self->t2) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t2), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2260
 *         self.c1[chromosome][ i ] = c1 * self.cond1_depth
 *         self.t2[chromosome][ i ] = t2 * self.cond2_depth
 *         self.c2[chromosome][ i ] = c2 * self.cond2_depth             # <<<<<<<<<<<<<<
 *         self.datalength[chromosome] += 1
 * 
 */
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_c2 * __pyx_v_self->cond2_depth)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((PyObject *)__pyx_v_self->c2) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c2), ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2261
 *         self.t2[chromosome][ i ] = t2 * self.cond2_depth
 *         self.c2[chromosome][ i ] = c2 * self.cond2_depth
 *         self.datalength[chromosome] += 1             # <<<<<<<<<<<<<<
 * 
 *     cpdef finalize ( self ):
 */
  if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self->datalength));
  __pyx_t_4 = __pyx_v_self->datalength;
  __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
  __pyx_t_5 = __pyx_v_chromosome;
  if (unlikely(((PyObject *)__pyx_t_4) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(((PyObject *)__pyx_t_4) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (PyDict_SetItem(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(((PyObject *)__pyx_t_4));
  __Pyx_XDECREF(((PyObject *)__pyx_t_5));
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2263
 *         self.datalength[chromosome] += 1
 * 
 *     cpdef finalize ( self ):             # <<<<<<<<<<<<<<
 *         """
 *         Adjust array size of each chromosome.
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_7finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_finalize(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_l;
  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 *);
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("finalize", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__finalize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_7finalize)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2272
 *             int l
 * 
 *         for chrom in self.pos.keys():             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             self.pos[chrom].resize( l, refcheck = False )
 */
  if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2273
 * 
 *         for chrom in self.pos.keys():
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             self.pos[chrom].resize( l, refcheck = False )
 *             self.t1[chrom].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_l = __pyx_t_5;

    /* "MACS2/IO/cScoreTrack.pyx":2274
 *         for chrom in self.pos.keys():
 *             l = self.datalength[chrom]
 *             self.pos[chrom].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             self.t1[chrom].resize( l, refcheck = False )
 *             self.c1[chrom].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__resize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2275
 *             l = self.datalength[chrom]
 *             self.pos[chrom].resize( l, refcheck = False )
 *             self.t1[chrom].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             self.c1[chrom].resize( l, refcheck = False )
 *             self.tvsc1[chrom].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2276
 *             self.pos[chrom].resize( l, refcheck = False )
 *             self.t1[chrom].resize( l, refcheck = False )
 *             self.c1[chrom].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             self.tvsc1[chrom].resize( l, refcheck = False )
 *             self.t2[chrom].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->c1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__resize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2277
 *             self.t1[chrom].resize( l, refcheck = False )
 *             self.c1[chrom].resize( l, refcheck = False )
 *             self.tvsc1[chrom].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             self.t2[chrom].resize( l, refcheck = False )
 *             self.c2[chrom].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->tvsc1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tvsc1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__resize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2278
 *             self.c1[chrom].resize( l, refcheck = False )
 *             self.tvsc1[chrom].resize( l, refcheck = False )
 *             self.t2[chrom].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             self.c2[chrom].resize( l, refcheck = False )
 *             self.tvsc2[chrom].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->t2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2279
 *             self.tvsc1[chrom].resize( l, refcheck = False )
 *             self.t2[chrom].resize( l, refcheck = False )
 *             self.c2[chrom].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             self.tvsc2[chrom].resize( l, refcheck = False )
 *             self.t1vs2[chrom].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->c2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__resize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2280
 *             self.t2[chrom].resize( l, refcheck = False )
 *             self.c2[chrom].resize( l, refcheck = False )
 *             self.tvsc2[chrom].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             self.t1vs2[chrom].resize( l, refcheck = False )
 *             self.tlogLR[chrom].resize( l, refcheck = False )
 */
    if (unlikely(((PyObject *)__pyx_v_self->tvsc2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tvsc2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__resize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2281
 *             self.c2[chrom].resize( l, refcheck = False )
 *             self.tvsc2[chrom].resize( l, refcheck = False )
 *             self.t1vs2[chrom].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *             self.tlogLR[chrom].resize( l, refcheck = False )
 *         return
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2282
 *             self.tvsc2[chrom].resize( l, refcheck = False )
 *             self.t1vs2[chrom].resize( l, refcheck = False )
 *             self.tlogLR[chrom].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self->tlogLR) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tlogLR), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__resize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyInt_FromLong(__pyx_v_l); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2283
 *             self.t1vs2[chrom].resize( l, refcheck = False )
 *             self.tlogLR[chrom].resize( l, refcheck = False )
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_track_score_method (self, str scoring_method):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_7finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_6finalize[] = "\n        Adjust array size of each chromosome.\n\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_7finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_6finalize(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2263
 *         self.datalength[chromosome] += 1
 * 
 *     cpdef finalize ( self ):             # <<<<<<<<<<<<<<
 *         """
 *         Adjust array size of each chromosome.
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_6finalize(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("finalize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->finalize(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2285
 *         return
 * 
 *     cpdef set_track_score_method (self, str scoring_method):             # <<<<<<<<<<<<<<
 *         """
 *         scoring_method:  p: -log10 pvalue;
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_9set_track_score_method(PyObject *__pyx_v_self, PyObject *__pyx_v_scoring_method); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_set_track_score_method(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_scoring_method, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_track_score_method", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_46); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_9set_track_score_method)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_scoring_method));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_scoring_method));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_scoring_method));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2295
 *                          m: fragment pileup per million reads
 *         """
 *         if scoring_method == 'p':             # <<<<<<<<<<<<<<
 *             self.compute_treatcontrol_pvalues()
 *         elif scoring_method == 'q':
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_scoring_method), ((PyObject *)__pyx_n_s__p), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":2296
 *         """
 *         if scoring_method == 'p':
 *             self.compute_treatcontrol_pvalues()             # <<<<<<<<<<<<<<
 *         elif scoring_method == 'q':
 *             #if not already calculated p, compute pvalue first
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->compute_treatcontrol_pvalues(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2297
 *         if scoring_method == 'p':
 *             self.compute_treatcontrol_pvalues()
 *         elif scoring_method == 'q':             # <<<<<<<<<<<<<<
 *             #if not already calculated p, compute pvalue first
 *             if self.track_scoring_method != 'p':
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_scoring_method), ((PyObject *)__pyx_n_s__q), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":2299
 *         elif scoring_method == 'q':
 *             #if not already calculated p, compute pvalue first
 *             if self.track_scoring_method != 'p':             # <<<<<<<<<<<<<<
 *                 self.compute_treatcontrol_pvalues()
 *             self.compute_treatcontrol_qvalues()
 */
    __pyx_t_4 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_self->track_scoring_method), ((PyObject *)__pyx_n_s__p), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "MACS2/IO/cScoreTrack.pyx":2300
 *             #if not already calculated p, compute pvalue first
 *             if self.track_scoring_method != 'p':
 *                 self.compute_treatcontrol_pvalues()             # <<<<<<<<<<<<<<
 *             self.compute_treatcontrol_qvalues()
 *         else:
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->compute_treatcontrol_pvalues(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "MACS2/IO/cScoreTrack.pyx":2301
 *             if self.track_scoring_method != 'p':
 *                 self.compute_treatcontrol_pvalues()
 *             self.compute_treatcontrol_qvalues()             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplemented
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->compute_treatcontrol_qvalues(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":2303
 *             self.compute_treatcontrol_qvalues()
 *         else:
 *             raise NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     cdef compute_treatcontrol_pvalues ( self ):
 */
    __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.set_track_score_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_9set_track_score_method(PyObject *__pyx_v_self, PyObject *__pyx_v_scoring_method); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_8set_track_score_method[] = "\n        scoring_method:  p: -log10 pvalue;\n                         q: -log10 qvalue;\n                         l: log10 likelihood ratio ( minus for depletion )\n                         f: log10 fold enrichment\n                         F: linear fold enrichment\n                         d: subtraction\n                         m: fragment pileup per million reads\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_9set_track_score_method(PyObject *__pyx_v_self, PyObject *__pyx_v_scoring_method) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_track_score_method (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scoring_method), (&PyString_Type), 1, "scoring_method", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_8set_track_score_method(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), ((PyObject*)__pyx_v_scoring_method));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2285
 *         return
 * 
 *     cpdef set_track_score_method (self, str scoring_method):             # <<<<<<<<<<<<<<
 *         """
 *         scoring_method:  p: -log10 pvalue;
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_8set_track_score_method(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_scoring_method) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_track_score_method", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->set_track_score_method(__pyx_v_self, __pyx_v_scoring_method, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.set_track_score_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2305
 *             raise NotImplemented
 * 
 *     cdef compute_treatcontrol_pvalues ( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(pvalue)
 *         """
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_compute_treatcontrol_pvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  PyArrayObject *__pyx_v_p = 0;
  PyArrayObject *__pyx_v_c = 0;
  PyArrayObject *__pyx_v_v = 0;
  PyArrayObject *__pyx_v_pos = 0;
  long __pyx_v_l;
  long __pyx_v_i;
  long __pyx_v_prev_pos;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_pseudocount = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_c;
  __Pyx_Buffer __pyx_pybuffer_c;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_p;
  __Pyx_Buffer __pyx_pybuffer_p;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
  __Pyx_Buffer __pyx_pybuffer_pos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
  __Pyx_Buffer __pyx_pybuffer_v;
  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 *);
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyArrayObject *__pyx_t_10 = NULL;
  long __pyx_t_11;
  long __pyx_t_12;
  long __pyx_t_13;
  long __pyx_t_14;
  int __pyx_t_15;
  long __pyx_t_16;
  long __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  long __pyx_t_19;
  int __pyx_t_20;
  long __pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  long __pyx_t_23;
  long __pyx_t_24;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  long __pyx_t_27;
  long __pyx_t_28;
  PyObject *__pyx_t_29 = NULL;
  long __pyx_t_30;
  long __pyx_t_31;
  long __pyx_t_32;
  long __pyx_t_33;
  long __pyx_t_34;
  long __pyx_t_35;
  long __pyx_t_36;
  long __pyx_t_37;
  long __pyx_t_38;
  long __pyx_t_39;
  long __pyx_t_40;
  long __pyx_t_41;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_treatcontrol_pvalues", 0);
  __pyx_pybuffer_p.pybuffer.buf = NULL;
  __pyx_pybuffer_p.refcount = 0;
  __pyx_pybuffernd_p.data = NULL;
  __pyx_pybuffernd_p.rcbuffer = &__pyx_pybuffer_p;
  __pyx_pybuffer_c.pybuffer.buf = NULL;
  __pyx_pybuffer_c.refcount = 0;
  __pyx_pybuffernd_c.data = NULL;
  __pyx_pybuffernd_c.rcbuffer = &__pyx_pybuffer_c;
  __pyx_pybuffer_v.pybuffer.buf = NULL;
  __pyx_pybuffer_v.refcount = 0;
  __pyx_pybuffernd_v.data = NULL;
  __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
  __pyx_pybuffer_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_pos.refcount = 0;
  __pyx_pybuffernd_pos.data = NULL;
  __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;

  /* "MACS2/IO/cScoreTrack.pyx":2314
 *             str chrom
 * 
 *         pseudocount = self.pseudocount             # <<<<<<<<<<<<<<
 *         for chrom in self.pos.keys():
 *             prev_pos = 0
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pseudocount = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2315
 * 
 *         pseudocount = self.pseudocount
 *         for chrom in self.pos.keys():             # <<<<<<<<<<<<<<
 *             prev_pos = 0
 *             pos = self.pos[chrom]
 */
  if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2316
 *         pseudocount = self.pseudocount
 *         for chrom in self.pos.keys():
 *             prev_pos = 0             # <<<<<<<<<<<<<<
 *             pos = self.pos[chrom]
 *             p = self.t1[chrom]
 */
    __pyx_v_prev_pos = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2317
 *         for chrom in self.pos.keys():
 *             prev_pos = 0
 *             pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *             p = self.t1[chrom]
 *             c = self.c1[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2318
 *             prev_pos = 0
 *             pos = self.pos[chrom]
 *             p = self.t1[chrom]             # <<<<<<<<<<<<<<
 *             c = self.c1[chrom]
 *             v = self.tvsc1[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_v_p, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_p.diminfo[0].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p.diminfo[0].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_p));
    __pyx_v_p = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2319
 *             pos = self.pos[chrom]
 *             p = self.t1[chrom]
 *             c = self.c1[chrom]             # <<<<<<<<<<<<<<
 *             v = self.tvsc1[chrom]
 *             l = self.datalength[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->c1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c.rcbuffer->pybuffer, (PyObject*)__pyx_v_c, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_pybuffernd_c.diminfo[0].strides = __pyx_pybuffernd_c.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c.diminfo[0].shape = __pyx_pybuffernd_c.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_c));
    __pyx_v_c = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2320
 *             p = self.t1[chrom]
 *             c = self.c1[chrom]
 *             v = self.tvsc1[chrom]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             for i in range(l):
 */
    if (unlikely(((PyObject *)__pyx_v_self->tvsc1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tvsc1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2321
 *             c = self.c1[chrom]
 *             v = self.tvsc1[chrom]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 if c[i] > p[i]:
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_l = __pyx_t_11;

    /* "MACS2/IO/cScoreTrack.pyx":2322
 *             v = self.tvsc1[chrom]
 *             l = self.datalength[chrom]
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 if c[i] > p[i]:
 *                     v[i] = 1
 */
    __pyx_t_11 = __pyx_v_l;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "MACS2/IO/cScoreTrack.pyx":2323
 *             l = self.datalength[chrom]
 *             for i in range(l):
 *                 if c[i] > p[i]:             # <<<<<<<<<<<<<<
 *                     v[i] = 1
 *                 else:
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_pybuffernd_c.diminfo[0].shape;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_c.diminfo[0].shape)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_p.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_p.diminfo[0].shape)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_c.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_c.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_p.diminfo[0].strides)));
      if (__pyx_t_15) {

        /* "MACS2/IO/cScoreTrack.pyx":2324
 *             for i in range(l):
 *                 if c[i] > p[i]:
 *                     v[i] = 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     v[ i ] =  get_pscore(p[i] + pseudocount, c[i])
 */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_6 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
          if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides) = 1.0;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":2326
 *                     v[i] = 1
 *                 else:
 *                     v[ i ] =  get_pscore(p[i] + pseudocount, c[i])             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.pvalue_stat1[v[ i ]] += pos[ i ] - prev_pos
 */
        __pyx_t_17 = __pyx_v_i;
        __pyx_t_6 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_17 += __pyx_pybuffernd_p.diminfo[0].shape;
          if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_p.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_p.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_18 = PyNumber_Add(__pyx_t_1, __pyx_v_pseudocount); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_18);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = -1;
        if (__pyx_t_19 < 0) {
          __pyx_t_19 += __pyx_pybuffernd_c.diminfo[0].shape;
          if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 0;
        } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_c.diminfo[0].shape)) __pyx_t_20 = 0;
        if (unlikely(__pyx_t_20 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_20);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_20 = -1;
        if (__pyx_t_21 < 0) {
          __pyx_t_21 += __pyx_pybuffernd_v.diminfo[0].shape;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_20 = 0;
        } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_20 = 0;
        if (unlikely(__pyx_t_20 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_20);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_f_5MACS2_2IO_11cScoreTrack_get_pscore(__pyx_t_6, (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_c.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_c.diminfo[0].strides)));
      }
      __pyx_L7:;

      /* "MACS2/IO/cScoreTrack.pyx":2327
 *                 else:
 *                     v[ i ] =  get_pscore(p[i] + pseudocount, c[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.pvalue_stat1[v[ i ]] += pos[ i ] - prev_pos
 *                 except:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "MACS2/IO/cScoreTrack.pyx":2328
 *                     v[ i ] =  get_pscore(p[i] + pseudocount, c[i])
 *                 try:
 *                     self.pvalue_stat1[v[ i ]] += pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.pvalue_stat1[v[ i ]] = pos[ i ] - prev_pos
 */
          if (unlikely(((PyObject *)__pyx_v_self->pvalue_stat1) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_self->pvalue_stat1));
          __pyx_t_22 = __pyx_v_self->pvalue_stat1;
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_6 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_v.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_6 = 0;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          }
          __pyx_t_18 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_v.diminfo[0].strides))); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_18);
          if (unlikely(((PyObject *)__pyx_t_22) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          }
          __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_22), __pyx_t_18); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_24 = __pyx_v_i;
          __pyx_t_6 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_6 = 0;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          }
          __pyx_t_25 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_25);
          __pyx_t_26 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_25); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_26);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
          if (unlikely(((PyObject *)__pyx_t_22) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          }
          if (PyDict_SetItem(((PyObject *)__pyx_t_22), __pyx_t_18, __pyx_t_26) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_22)); __pyx_t_22 = 0;
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(((PyObject *)__pyx_t_22)); __pyx_t_22 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
        __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2329
 *                 try:
 *                     self.pvalue_stat1[v[ i ]] += pos[ i ] - prev_pos
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.pvalue_stat1[v[ i ]] = pos[ i ] - prev_pos
 *                 prev_pos = pos[ i ]
 */
        /*except:*/ {
          __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.compute_treatcontrol_pvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_18, &__pyx_t_26, &__pyx_t_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __Pyx_GOTREF(__pyx_t_26);
          __Pyx_GOTREF(__pyx_t_25);

          /* "MACS2/IO/cScoreTrack.pyx":2330
 *                     self.pvalue_stat1[v[ i ]] += pos[ i ] - prev_pos
 *                 except:
 *                     self.pvalue_stat1[v[ i ]] = pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
 *                 prev_pos = pos[ i ]
 * 
 */
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_6 = -1;
          if (__pyx_t_27 < 0) {
            __pyx_t_27 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_6 = 0;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          }
          __pyx_t_1 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely(((PyObject *)__pyx_v_self->pvalue_stat1) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          }
          __pyx_t_28 = __pyx_v_i;
          __pyx_t_6 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_pybuffernd_v.diminfo[0].shape;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_6 = 0;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          }
          __pyx_t_29 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_v.diminfo[0].strides))); if (unlikely(!__pyx_t_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_29);
          if (PyDict_SetItem(((PyObject *)__pyx_v_self->pvalue_stat1), __pyx_t_29, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
          __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
          goto __pyx_L9_exception_handled;
        }
        __pyx_L10_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L9_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L15_try_end:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":2331
 *                 except:
 *                     self.pvalue_stat1[v[ i ]] = pos[ i ] - prev_pos
 *                 prev_pos = pos[ i ]             # <<<<<<<<<<<<<<
 * 
 *         for chrom in self.pos.keys():
 */
      __pyx_t_30 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_30 < 0) {
        __pyx_t_30 += __pyx_pybuffernd_pos.diminfo[0].shape;
        if (unlikely(__pyx_t_30 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_pos.diminfo[0].strides));
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2333
 *                 prev_pos = pos[ i ]
 * 
 *         for chrom in self.pos.keys():             # <<<<<<<<<<<<<<
 *             prev_pos = 0
 *             pos = self.pos[chrom]
 */
  if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyDict_Keys(__pyx_v_self->pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_25 = __pyx_t_2; __Pyx_INCREF(__pyx_t_25); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_25 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_25);
    __pyx_t_4 = Py_TYPE(__pyx_t_25)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_25)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_25)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_25, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_25, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_25)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_25)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_25, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_25, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_25);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __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 str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2334
 * 
 *         for chrom in self.pos.keys():
 *             prev_pos = 0             # <<<<<<<<<<<<<<
 *             pos = self.pos[chrom]
 *             p = self.t2[chrom]
 */
    __pyx_v_prev_pos = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2335
 *         for chrom in self.pos.keys():
 *             prev_pos = 0
 *             pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *             p = self.t2[chrom]
 *             c = self.c2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2336
 *             prev_pos = 0
 *             pos = self.pos[chrom]
 *             p = self.t2[chrom]             # <<<<<<<<<<<<<<
 *             c = self.c2[chrom]
 *             v = self.tvsc2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_v_p, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_pybuffernd_p.diminfo[0].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p.diminfo[0].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_p));
    __pyx_v_p = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2337
 *             pos = self.pos[chrom]
 *             p = self.t2[chrom]
 *             c = self.c2[chrom]             # <<<<<<<<<<<<<<
 *             v = self.tvsc2[chrom]
 *             l = self.datalength[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->c2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c.rcbuffer->pybuffer, (PyObject*)__pyx_v_c, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_c.diminfo[0].strides = __pyx_pybuffernd_c.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c.diminfo[0].shape = __pyx_pybuffernd_c.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_c));
    __pyx_v_c = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2338
 *             p = self.t2[chrom]
 *             c = self.c2[chrom]
 *             v = self.tvsc2[chrom]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             for i in range(l):
 */
    if (unlikely(((PyObject *)__pyx_v_self->tvsc2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tvsc2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2339
 *             c = self.c2[chrom]
 *             v = self.tvsc2[chrom]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 if c[i] > p[i]:
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_l = __pyx_t_11;

    /* "MACS2/IO/cScoreTrack.pyx":2340
 *             v = self.tvsc2[chrom]
 *             l = self.datalength[chrom]
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 if c[i] > p[i]:
 *                     v[i] = 1
 */
    __pyx_t_11 = __pyx_v_l;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "MACS2/IO/cScoreTrack.pyx":2341
 *             l = self.datalength[chrom]
 *             for i in range(l):
 *                 if c[i] > p[i]:             # <<<<<<<<<<<<<<
 *                     v[i] = 1
 *                 else:
 */
      __pyx_t_31 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_31 < 0) {
        __pyx_t_31 += __pyx_pybuffernd_c.diminfo[0].shape;
        if (unlikely(__pyx_t_31 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_c.diminfo[0].shape)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_32 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_32 < 0) {
        __pyx_t_32 += __pyx_pybuffernd_p.diminfo[0].shape;
        if (unlikely(__pyx_t_32 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_p.diminfo[0].shape)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_c.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_c.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_p.diminfo[0].strides)));
      if (__pyx_t_15) {

        /* "MACS2/IO/cScoreTrack.pyx":2342
 *             for i in range(l):
 *                 if c[i] > p[i]:
 *                     v[i] = 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     v[ i ] =  get_interpolated_pscore(p[i], c[i])
 */
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_6 = -1;
        if (__pyx_t_33 < 0) {
          __pyx_t_33 += __pyx_pybuffernd_v.diminfo[0].shape;
          if (unlikely(__pyx_t_33 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_v.diminfo[0].strides) = 1.0;
        goto __pyx_L22;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":2344
 *                     v[i] = 1
 *                 else:
 *                     v[ i ] =  get_interpolated_pscore(p[i], c[i])             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.pvalue_stat2[v[ i ]] += pos[ i ] - prev_pos
 */
        __pyx_t_34 = __pyx_v_i;
        __pyx_t_6 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_p.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_p.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_35 = __pyx_v_i;
        __pyx_t_6 = -1;
        if (__pyx_t_35 < 0) {
          __pyx_t_35 += __pyx_pybuffernd_c.diminfo[0].shape;
          if (unlikely(__pyx_t_35 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_c.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_36 = __pyx_v_i;
        __pyx_t_6 = -1;
        if (__pyx_t_36 < 0) {
          __pyx_t_36 += __pyx_pybuffernd_v.diminfo[0].shape;
          if (unlikely(__pyx_t_36 < 0)) __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_f_5MACS2_2IO_11cScoreTrack_get_interpolated_pscore((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_p.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_c.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_c.diminfo[0].strides)));
      }
      __pyx_L22:;

      /* "MACS2/IO/cScoreTrack.pyx":2345
 *                 else:
 *                     v[ i ] =  get_interpolated_pscore(p[i], c[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.pvalue_stat2[v[ i ]] += pos[ i ] - prev_pos
 *                 except:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_7);
        /*try:*/ {

          /* "MACS2/IO/cScoreTrack.pyx":2346
 *                     v[ i ] =  get_interpolated_pscore(p[i], c[i])
 *                 try:
 *                     self.pvalue_stat2[v[ i ]] += pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.pvalue_stat2[v[ i ]] = pos[ i ] - prev_pos
 */
          if (unlikely(((PyObject *)__pyx_v_self->pvalue_stat2) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_self->pvalue_stat2));
          __pyx_t_22 = __pyx_v_self->pvalue_stat2;
          __pyx_t_37 = __pyx_v_i;
          __pyx_t_6 = -1;
          if (__pyx_t_37 < 0) {
            __pyx_t_37 += __pyx_pybuffernd_v.diminfo[0].shape;
            if (unlikely(__pyx_t_37 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_6 = 0;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          }
          __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_v.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_GOTREF(__pyx_t_2);
          if (unlikely(((PyObject *)__pyx_t_22) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          }
          __pyx_t_26 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_22), __pyx_t_2); if (!__pyx_t_26) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_GOTREF(__pyx_t_26);
          __pyx_t_38 = __pyx_v_i;
          __pyx_t_6 = -1;
          if (__pyx_t_38 < 0) {
            __pyx_t_38 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_38 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_6 = 0;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          }
          __pyx_t_18 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_26, __pyx_t_18); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (unlikely(((PyObject *)__pyx_t_22) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          }
          if (PyDict_SetItem(((PyObject *)__pyx_t_22), __pyx_t_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_22)); __pyx_t_22 = 0;
        }
        __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;
        goto __pyx_L30_try_end;
        __pyx_L23_error:;
        __Pyx_XDECREF(((PyObject *)__pyx_t_22)); __pyx_t_22 = 0;
        __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2347
 *                 try:
 *                     self.pvalue_stat2[v[ i ]] += pos[ i ] - prev_pos
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.pvalue_stat2[v[ i ]] = pos[ i ] - prev_pos
 *                 prev_pos = pos[ i ]
 */
        /*except:*/ {
          __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.compute_treatcontrol_pvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_18);

          /* "MACS2/IO/cScoreTrack.pyx":2348
 *                     self.pvalue_stat2[v[ i ]] += pos[ i ] - prev_pos
 *                 except:
 *                     self.pvalue_stat2[v[ i ]] = pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
 *                 prev_pos = pos[ i ]
 * 
 */
          __pyx_t_39 = __pyx_v_i;
          __pyx_t_6 = -1;
          if (__pyx_t_39 < 0) {
            __pyx_t_39 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_39 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_6 = 0;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          }
          __pyx_t_26 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          __Pyx_GOTREF(__pyx_t_26);
          if (unlikely(((PyObject *)__pyx_v_self->pvalue_stat2) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          }
          __pyx_t_40 = __pyx_v_i;
          __pyx_t_6 = -1;
          if (__pyx_t_40 < 0) {
            __pyx_t_40 += __pyx_pybuffernd_v.diminfo[0].shape;
            if (unlikely(__pyx_t_40 < 0)) __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_6 = 0;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          }
          __pyx_t_29 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_v.diminfo[0].strides))); if (unlikely(!__pyx_t_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          __Pyx_GOTREF(__pyx_t_29);
          if (PyDict_SetItem(((PyObject *)__pyx_v_self->pvalue_stat2), __pyx_t_29, __pyx_t_26) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          goto __pyx_L24_exception_handled;
        }
        __pyx_L25_except_error:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        goto __pyx_L1_error;
        __pyx_L24_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        __pyx_L30_try_end:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":2349
 *                 except:
 *                     self.pvalue_stat2[v[ i ]] = pos[ i ] - prev_pos
 *                 prev_pos = pos[ i ]             # <<<<<<<<<<<<<<
 * 
 *         self.track_scoring_method = 'p'
 */
      __pyx_t_41 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_41 < 0) {
        __pyx_t_41 += __pyx_pybuffernd_pos.diminfo[0].shape;
        if (unlikely(__pyx_t_41 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_pos.diminfo[0].strides));
    }
  }
  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2351
 *                 prev_pos = pos[ i ]
 * 
 *         self.track_scoring_method = 'p'             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p));
  __Pyx_GOTREF(__pyx_v_self->track_scoring_method);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->track_scoring_method));
  __pyx_v_self->track_scoring_method = __pyx_n_s__p;

  /* "MACS2/IO/cScoreTrack.pyx":2352
 * 
 *         self.track_scoring_method = 'p'
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cdef compute_treatcontrol_qvalues ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(((PyObject *)__pyx_t_22));
  __Pyx_XDECREF(__pyx_t_25);
  __Pyx_XDECREF(__pyx_t_26);
  __Pyx_XDECREF(__pyx_t_29);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.compute_treatcontrol_pvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_p);
  __Pyx_XDECREF((PyObject *)__pyx_v_c);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_pseudocount);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2354
 *         return
 * 
 *     cdef compute_treatcontrol_qvalues ( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(qvalue)
 *         """
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_compute_treatcontrol_qvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  PyObject *__pyx_v_pqtable1 = 0;
  PyObject *__pyx_v_pqtable2 = 0;
  long __pyx_v_i;
  long __pyx_v_l;
  double __pyx_v_k;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_s_p2q1 = NULL;
  PyObject *__pyx_v_s_p2q2 = NULL;
  PyObject *__pyx_v_g1 = NULL;
  PyObject *__pyx_v_g2 = NULL;
  PyObject *__pyx_v_v1 = NULL;
  PyObject *__pyx_v_v2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  double __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  long __pyx_t_11;
  long __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_treatcontrol_qvalues", 0);

  /* "MACS2/IO/cScoreTrack.pyx":2365
 * 
 *         # pvalue should be computed first!
 *         assert self.track_scoring_method == 'p'             # <<<<<<<<<<<<<<
 *         # make pqtable
 *         (pqtable1, pqtable2) = self.make_treatcontrol_pq_tables()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_self->track_scoring_method), ((PyObject *)__pyx_n_s__p), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_t_1)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":2367
 *         assert self.track_scoring_method == 'p'
 *         # make pqtable
 *         (pqtable1, pqtable2) = self.make_treatcontrol_pq_tables()             # <<<<<<<<<<<<<<
 * 
 *         # convert p to q
 */
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->make_treatcontrol_pq_tables(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyTuple_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else if (1) {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  } else
  {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(PyDict_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_pqtable1 = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_v_pqtable2 = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2373
 *         # convert pvalue2qvalue to a simple dict based on khash
 *         # khash has big advantage while checking keys for millions of times.
 *         s_p2q1 = Float64HashTable()             # <<<<<<<<<<<<<<
 *         for k in pqtable1.keys():
 *             s_p2q1.set_item(k,pqtable1[k])
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__Float64HashTable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_s_p2q1 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2374
 *         # khash has big advantage while checking keys for millions of times.
 *         s_p2q1 = Float64HashTable()
 *         for k in pqtable1.keys():             # <<<<<<<<<<<<<<
 *             s_p2q1.set_item(k,pqtable1[k])
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_pqtable1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = PyDict_Keys(__pyx_v_pqtable1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_2);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_k = __pyx_t_9;

    /* "MACS2/IO/cScoreTrack.pyx":2375
 *         s_p2q1 = Float64HashTable()
 *         for k in pqtable1.keys():
 *             s_p2q1.set_item(k,pqtable1[k])             # <<<<<<<<<<<<<<
 * 
 *         s_p2q2 = Float64HashTable()
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_s_p2q1, __pyx_n_s__set_item); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(((PyObject *)__pyx_v_pqtable1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pqtable1), __pyx_t_5); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_3 = 0;
    __pyx_t_10 = 0;
    __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2377
 *             s_p2q1.set_item(k,pqtable1[k])
 * 
 *         s_p2q2 = Float64HashTable()             # <<<<<<<<<<<<<<
 *         for k in pqtable2.keys():
 *             s_p2q2.set_item(k,pqtable2[k])
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__Float64HashTable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_s_p2q2 = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2378
 * 
 *         s_p2q2 = Float64HashTable()
 *         for k in pqtable2.keys():             # <<<<<<<<<<<<<<
 *             s_p2q2.set_item(k,pqtable2[k])
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_pqtable2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = PyDict_Keys(__pyx_v_pqtable2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (PyList_CheckExact(__pyx_t_10) || PyTuple_CheckExact(__pyx_t_10)) {
    __pyx_t_2 = __pyx_t_10; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  for (;;) {
    if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_10 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_10 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_10 = __pyx_t_8(__pyx_t_2);
      if (unlikely(!__pyx_t_10)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_10);
    }
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_v_k = __pyx_t_9;

    /* "MACS2/IO/cScoreTrack.pyx":2379
 *         s_p2q2 = Float64HashTable()
 *         for k in pqtable2.keys():
 *             s_p2q2.set_item(k,pqtable2[k])             # <<<<<<<<<<<<<<
 * 
 *         g1 = s_p2q1.get_item
 */
    __pyx_t_10 = PyObject_GetAttr(__pyx_v_s_p2q2, __pyx_n_s__set_item); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(((PyObject *)__pyx_v_pqtable2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_k); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pqtable2), __pyx_t_4); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2381
 *             s_p2q2.set_item(k,pqtable2[k])
 * 
 *         g1 = s_p2q1.get_item             # <<<<<<<<<<<<<<
 *         g2 = s_p2q2.get_item
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_s_p2q1, __pyx_n_s__get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_g1 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2382
 * 
 *         g1 = s_p2q1.get_item
 *         g2 = s_p2q2.get_item             # <<<<<<<<<<<<<<
 * 
 *         for chrom in self.pos.keys():
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_s_p2q2, __pyx_n_s__get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_g2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2384
 *         g2 = s_p2q2.get_item
 * 
 *         for chrom in self.pos.keys():             # <<<<<<<<<<<<<<
 *             v1 = self.tvsc1[chrom]
 *             v2 = self.tvsc2[chrom]
 */
  if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyDict_Keys(__pyx_v_self->pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __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 str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2385
 * 
 *         for chrom in self.pos.keys():
 *             v1 = self.tvsc1[chrom]             # <<<<<<<<<<<<<<
 *             v2 = self.tvsc2[chrom]
 *             l = self.datalength[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->tvsc1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tvsc1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_v1);
    __pyx_v_v1 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2386
 *         for chrom in self.pos.keys():
 *             v1 = self.tvsc1[chrom]
 *             v2 = self.tvsc2[chrom]             # <<<<<<<<<<<<<<
 *             l = self.datalength[chrom]
 *             for i in range(l):
 */
    if (unlikely(((PyObject *)__pyx_v_self->tvsc2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tvsc2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_v2);
    __pyx_v_v2 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2387
 *             v1 = self.tvsc1[chrom]
 *             v2 = self.tvsc2[chrom]
 *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 v1[ i ] =  g1( v1[ i ])
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_l = __pyx_t_11;

    /* "MACS2/IO/cScoreTrack.pyx":2388
 *             v2 = self.tvsc2[chrom]
 *             l = self.datalength[chrom]
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 v1[ i ] =  g1( v1[ i ])
 *                 v2[ i ] =  g2( v2[ i ])
 */
    __pyx_t_11 = __pyx_v_l;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "MACS2/IO/cScoreTrack.pyx":2389
 *             l = self.datalength[chrom]
 *             for i in range(l):
 *                 v1[ i ] =  g1( v1[ i ])             # <<<<<<<<<<<<<<
 *                 v2[ i ] =  g2( v2[ i ])
 * 
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_v1, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_v_g1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      if (__Pyx_SetItemInt(__pyx_v_v1, __pyx_v_i, __pyx_t_2, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2390
 *             for i in range(l):
 *                 v1[ i ] =  g1( v1[ i ])
 *                 v2[ i ] =  g2( v2[ i ])             # <<<<<<<<<<<<<<
 * 
 *         self.track_scoring_method = 'q'
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_v2, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_v_g2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      if (__Pyx_SetItemInt(__pyx_v_v2, __pyx_v_i, __pyx_t_2, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2392
 *                 v2[ i ] =  g2( v2[ i ])
 * 
 *         self.track_scoring_method = 'q'             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_n_s__q));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__q));
  __Pyx_GOTREF(__pyx_v_self->track_scoring_method);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->track_scoring_method));
  __pyx_v_self->track_scoring_method = __pyx_n_s__q;

  /* "MACS2/IO/cScoreTrack.pyx":2393
 * 
 *         self.track_scoring_method = 'q'
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cpdef break_on_peaks(self, p1io, p2io):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.compute_treatcontrol_qvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pqtable1);
  __Pyx_XDECREF(__pyx_v_pqtable2);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_s_p2q1);
  __Pyx_XDECREF(__pyx_v_s_p2q2);
  __Pyx_XDECREF(__pyx_v_g1);
  __Pyx_XDECREF(__pyx_v_g2);
  __Pyx_XDECREF(__pyx_v_v1);
  __Pyx_XDECREF(__pyx_v_v2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2395
 *         return
 * 
 *     cpdef break_on_peaks(self, p1io, p2io):             # <<<<<<<<<<<<<<
 *         """Introduce breaks at peak regions as needed
 *         """
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_11break_on_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_break_on_peaks(CYTHON_UNUSED struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_p1io, CYTHON_UNUSED PyObject *__pyx_v_p2io, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("break_on_peaks", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__break_on_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_11break_on_peaks)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_p1io);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_p1io);
      __Pyx_GIVEREF(__pyx_v_p1io);
      __Pyx_INCREF(__pyx_v_p2io);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_p2io);
      __Pyx_GIVEREF(__pyx_v_p2io);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2399
 *         """
 * 
 *     cpdef call_peaks (self, float cutoff=2.0, int min_length=200, int max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.break_on_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_11break_on_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_10break_on_peaks[] = "Introduce breaks at peak regions as needed\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_11break_on_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p1io = 0;
  PyObject *__pyx_v_p2io = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("break_on_peaks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__p1io,&__pyx_n_s__p2io,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__p1io)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p2io)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("break_on_peaks", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "break_on_peaks") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __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_p1io = values[0];
    __pyx_v_p2io = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("break_on_peaks", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.break_on_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_10break_on_peaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), __pyx_v_p1io, __pyx_v_p2io);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2395
 *         return
 * 
 *     cpdef break_on_peaks(self, p1io, p2io):             # <<<<<<<<<<<<<<
 *         """Introduce breaks at peak regions as needed
 *         """
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_10break_on_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_p1io, PyObject *__pyx_v_p2io) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("break_on_peaks", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->break_on_peaks(__pyx_v_self, __pyx_v_p1io, __pyx_v_p2io, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.break_on_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2399
 *         """
 * 
 *     cpdef call_peaks (self, float cutoff=2.0, int min_length=200, int max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_13call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_peaks *__pyx_optional_args) {
  float __pyx_v_cutoff = ((float)2.0);
  int __pyx_v_min_length = ((int)200);
  int __pyx_v_max_gap = ((int)50);
  int __pyx_v_i;
  int __pyx_v_first_i;
  int __pyx_v_first_start;
  int __pyx_v_this_start;
  int __pyx_v_this_end;
  int __pyx_v_last_end;
  PyObject *__pyx_v_chrom = 0;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_value = 0;
  PyArrayObject *__pyx_v_above_cutoff = 0;
  PyArrayObject *__pyx_v_above_cutoff_endpos = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_above_cutoff_startpos = 0;
  PyArrayObject *__pyx_v_in_peaks = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  long __pyx_t_11;
  long __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call_peaks", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cutoff = __pyx_optional_args->cutoff;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_min_length = __pyx_optional_args->min_length;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_max_gap = __pyx_optional_args->max_gap;
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__call_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_13call_peaks)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyInt_FromLong(__pyx_v_max_gap); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2420
 *             np.ndarray in_peaks
 * 
 *         self.cutoff = cutoff             # <<<<<<<<<<<<<<
 *         for chrom in self.pos.keys():
 *             in_peaks = np.zeros(self.datalength[chrom], dtype=np.bool)
 */
  __pyx_v_self->cutoff = __pyx_v_cutoff;

  /* "MACS2/IO/cScoreTrack.pyx":2421
 * 
 *         self.cutoff = cutoff
 *         for chrom in self.pos.keys():             # <<<<<<<<<<<<<<
 *             in_peaks = np.zeros(self.datalength[chrom], dtype=np.bool)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_4)) {
      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_4)) {
      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_4);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2422
 *         self.cutoff = cutoff
 *         for chrom in self.pos.keys():
 *             in_peaks = np.zeros(self.datalength[chrom], dtype=np.bool)             # <<<<<<<<<<<<<<
 * 
 *             pos = self.pos[chrom]
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__bool); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_in_peaks));
    __pyx_v_in_peaks = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2424
 *             in_peaks = np.zeros(self.datalength[chrom], dtype=np.bool)
 * 
 *             pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *             value = self.tvsc1[chrom]
 *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2425
 * 
 *             pos = self.pos[chrom]
 *             value = self.tvsc1[chrom]             # <<<<<<<<<<<<<<
 *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff
 *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff
 */
    if (unlikely(((PyObject *)__pyx_v_self->tvsc1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tvsc1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_value));
    __pyx_v_value = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2426
 *             pos = self.pos[chrom]
 *             value = self.tvsc1[chrom]
 *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff             # <<<<<<<<<<<<<<
 *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff
 * 
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__nonzero); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_v_value), __pyx_t_8, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_above_cutoff));
    __pyx_v_above_cutoff = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2427
 *             value = self.tvsc1[chrom]
 *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff
 *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 * 
 * #            print "Regions > cutoff: %d" % above_cutoff.size
 */
    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_pos), ((PyObject *)__pyx_v_above_cutoff)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_above_cutoff_endpos));
    __pyx_v_above_cutoff_endpos = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2430
 * 
 * #            print "Regions > cutoff: %d" % above_cutoff.size
 *             if above_cutoff.size > 1:             # <<<<<<<<<<<<<<
 *                 # Do zero manually
 *                 first_i = 0
 */
    __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_above_cutoff), __pyx_n_s__size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_9) {

      /* "MACS2/IO/cScoreTrack.pyx":2432
 *             if above_cutoff.size > 1:
 *                 # Do zero manually
 *                 first_i = 0             # <<<<<<<<<<<<<<
 *                 this_start = pos[above_cutoff[0] - 1]
 *                 this_end = above_cutoff_endpos[0]
 */
      __pyx_v_first_i = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2433
 *                 # Do zero manually
 *                 first_i = 0
 *                 this_start = pos[above_cutoff[0] - 1]             # <<<<<<<<<<<<<<
 *                 this_end = above_cutoff_endpos[0]
 *                 if this_start > this_end:
 */
      __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_8); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_this_start = __pyx_t_10;

      /* "MACS2/IO/cScoreTrack.pyx":2434
 *                 first_i = 0
 *                 this_start = pos[above_cutoff[0] - 1]
 *                 this_end = above_cutoff_endpos[0]             # <<<<<<<<<<<<<<
 *                 if this_start > this_end:
 *                     this_start = 0
 */
      __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_this_end = __pyx_t_10;

      /* "MACS2/IO/cScoreTrack.pyx":2435
 *                 this_start = pos[above_cutoff[0] - 1]
 *                 this_end = above_cutoff_endpos[0]
 *                 if this_start > this_end:             # <<<<<<<<<<<<<<
 *                     this_start = 0
 *                 first_start = this_start
 */
      __pyx_t_9 = (__pyx_v_this_start > __pyx_v_this_end);
      if (__pyx_t_9) {

        /* "MACS2/IO/cScoreTrack.pyx":2436
 *                 this_end = above_cutoff_endpos[0]
 *                 if this_start > this_end:
 *                     this_start = 0             # <<<<<<<<<<<<<<
 *                 first_start = this_start
 *                 last_end = this_end
 */
        __pyx_v_this_start = 0;
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "MACS2/IO/cScoreTrack.pyx":2437
 *                 if this_start > this_end:
 *                     this_start = 0
 *                 first_start = this_start             # <<<<<<<<<<<<<<
 *                 last_end = this_end
 *                 for i in range(1, above_cutoff.size):
 */
      __pyx_v_first_start = __pyx_v_this_start;

      /* "MACS2/IO/cScoreTrack.pyx":2438
 *                     this_start = 0
 *                 first_start = this_start
 *                 last_end = this_end             # <<<<<<<<<<<<<<
 *                 for i in range(1, above_cutoff.size):
 *                     this_start = above_cutoff_endpos[i - 1]
 */
      __pyx_v_last_end = __pyx_v_this_end;

      /* "MACS2/IO/cScoreTrack.pyx":2439
 *                 first_start = this_start
 *                 last_end = this_end
 *                 for i in range(1, above_cutoff.size):             # <<<<<<<<<<<<<<
 *                     this_start = above_cutoff_endpos[i - 1]
 *                     this_end = above_cutoff_endpos[i]
 */
      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_above_cutoff), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_11; __pyx_t_10+=1) {
        __pyx_v_i = __pyx_t_10;

        /* "MACS2/IO/cScoreTrack.pyx":2440
 *                 last_end = this_end
 *                 for i in range(1, above_cutoff.size):
 *                     this_start = above_cutoff_endpos[i - 1]             # <<<<<<<<<<<<<<
 *                     this_end = above_cutoff_endpos[i]
 *                     if first_i == -1:
 */
        __pyx_t_12 = (__pyx_v_i - 1);
        __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), __pyx_t_12, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_this_start = __pyx_t_13;

        /* "MACS2/IO/cScoreTrack.pyx":2441
 *                 for i in range(1, above_cutoff.size):
 *                     this_start = above_cutoff_endpos[i - 1]
 *                     this_end = above_cutoff_endpos[i]             # <<<<<<<<<<<<<<
 *                     if first_i == -1:
 *                         first_i = i
 */
        __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_this_end = __pyx_t_13;

        /* "MACS2/IO/cScoreTrack.pyx":2442
 *                     this_start = above_cutoff_endpos[i - 1]
 *                     this_end = above_cutoff_endpos[i]
 *                     if first_i == -1:             # <<<<<<<<<<<<<<
 *                         first_i = i
 *                         first_start = this_start
 */
        __pyx_t_9 = (__pyx_v_first_i == -1);
        if (__pyx_t_9) {

          /* "MACS2/IO/cScoreTrack.pyx":2443
 *                     this_end = above_cutoff_endpos[i]
 *                     if first_i == -1:
 *                         first_i = i             # <<<<<<<<<<<<<<
 *                         first_start = this_start
 *                     elif (this_end - last_end) > max_gap:
 */
          __pyx_v_first_i = __pyx_v_i;

          /* "MACS2/IO/cScoreTrack.pyx":2444
 *                     if first_i == -1:
 *                         first_i = i
 *                         first_start = this_start             # <<<<<<<<<<<<<<
 *                     elif (this_end - last_end) > max_gap:
 *                         if (last_end - first_start) >= min_length:
 */
          __pyx_v_first_start = __pyx_v_this_start;
          goto __pyx_L9;
        }

        /* "MACS2/IO/cScoreTrack.pyx":2445
 *                         first_i = i
 *                         first_start = this_start
 *                     elif (this_end - last_end) > max_gap:             # <<<<<<<<<<<<<<
 *                         if (last_end - first_start) >= min_length:
 *                             in_peaks[above_cutoff[first_i]:above_cutoff[i - 1]] = True
 */
        __pyx_t_9 = ((__pyx_v_this_end - __pyx_v_last_end) > __pyx_v_max_gap);
        if (__pyx_t_9) {

          /* "MACS2/IO/cScoreTrack.pyx":2446
 *                         first_start = this_start
 *                     elif (this_end - last_end) > max_gap:
 *                         if (last_end - first_start) >= min_length:             # <<<<<<<<<<<<<<
 *                             in_peaks[above_cutoff[first_i]:above_cutoff[i - 1]] = True
 * #                        else:
 */
          __pyx_t_9 = ((__pyx_v_last_end - __pyx_v_first_start) >= __pyx_v_min_length);
          if (__pyx_t_9) {

            /* "MACS2/IO/cScoreTrack.pyx":2447
 *                     elif (this_end - last_end) > max_gap:
 *                         if (last_end - first_start) >= min_length:
 *                             in_peaks[above_cutoff[first_i]:above_cutoff[i - 1]] = True             # <<<<<<<<<<<<<<
 * #                        else:
 * #                            print "Rejected", pos[above_cutoff[first_i]-1], pos[above_cutoff[i - 1]]
 */
            __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_v_first_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_12 = (__pyx_v_i - 1);
            __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_t_12, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (__Pyx_PySequence_SetSlice(((PyObject *)__pyx_v_in_peaks), __pyx_t_14, __pyx_t_15, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L10;
          }
          __pyx_L10:;

          /* "MACS2/IO/cScoreTrack.pyx":2450
 * #                        else:
 * #                            print "Rejected", pos[above_cutoff[first_i]-1], pos[above_cutoff[i - 1]]
 *                         first_i = -1             # <<<<<<<<<<<<<<
 *                     last_end = this_end
 * 
 */
          __pyx_v_first_i = -1;
          goto __pyx_L9;
        }
        __pyx_L9:;

        /* "MACS2/IO/cScoreTrack.pyx":2451
 * #                            print "Rejected", pos[above_cutoff[first_i]-1], pos[above_cutoff[i - 1]]
 *                         first_i = -1
 *                     last_end = this_end             # <<<<<<<<<<<<<<
 * 
 *                 if not first_i == -1:
 */
        __pyx_v_last_end = __pyx_v_this_end;
      }

      /* "MACS2/IO/cScoreTrack.pyx":2453
 *                     last_end = this_end
 * 
 *                 if not first_i == -1:             # <<<<<<<<<<<<<<
 *                     if last_end - first_start >= min_length:
 *                         in_peaks[above_cutoff[first_i]:above_cutoff[i]] = True
 */
      __pyx_t_9 = (!(__pyx_v_first_i == -1));
      if (__pyx_t_9) {

        /* "MACS2/IO/cScoreTrack.pyx":2454
 * 
 *                 if not first_i == -1:
 *                     if last_end - first_start >= min_length:             # <<<<<<<<<<<<<<
 *                         in_peaks[above_cutoff[first_i]:above_cutoff[i]] = True
 * 
 */
        __pyx_t_9 = ((__pyx_v_last_end - __pyx_v_first_start) >= __pyx_v_min_length);
        if (__pyx_t_9) {

          /* "MACS2/IO/cScoreTrack.pyx":2455
 *                 if not first_i == -1:
 *                     if last_end - first_start >= min_length:
 *                         in_peaks[above_cutoff[first_i]:above_cutoff[i]] = True             # <<<<<<<<<<<<<<
 * 
 *             value = self.tvsc2[chrom]
 */
          __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_v_first_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (__Pyx_PySequence_SetSlice(((PyObject *)__pyx_v_in_peaks), __pyx_t_15, __pyx_t_14, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L12;
        }
        __pyx_L12:;
        goto __pyx_L11;
      }
      __pyx_L11:;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "MACS2/IO/cScoreTrack.pyx":2457
 *                         in_peaks[above_cutoff[first_i]:above_cutoff[i]] = True
 * 
 *             value = self.tvsc2[chrom]             # <<<<<<<<<<<<<<
 *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff
 *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff
 */
    if (unlikely(((PyObject *)__pyx_v_self->tvsc2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tvsc2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_value));
    __pyx_v_value = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2458
 * 
 *             value = self.tvsc2[chrom]
 *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff             # <<<<<<<<<<<<<<
 *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff
 *             above_cutoff_startpos = pos[above_cutoff-1] # start positions of regions where score is above cutoff
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__nonzero); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_value), __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_above_cutoff));
    __pyx_v_above_cutoff = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2459
 *             value = self.tvsc2[chrom]
 *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff
 *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 *             above_cutoff_startpos = pos[above_cutoff-1] # start positions of regions where score is above cutoff
 * 
 */
    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_pos), ((PyObject *)__pyx_v_above_cutoff)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_above_cutoff_endpos));
    __pyx_v_above_cutoff_endpos = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2460
 *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff
 *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff
 *             above_cutoff_startpos = pos[above_cutoff-1] # start positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 * 
 *             if above_cutoff.size > 1:
 */
    __pyx_t_3 = PyNumber_Subtract(((PyObject *)__pyx_v_above_cutoff), __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_3); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_above_cutoff_startpos));
    __pyx_v_above_cutoff_startpos = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2462
 *             above_cutoff_startpos = pos[above_cutoff-1] # start positions of regions where score is above cutoff
 * 
 *             if above_cutoff.size > 1:             # <<<<<<<<<<<<<<
 *                 # Do zero manually
 *                 first_i = 0
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_above_cutoff), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_9) {

      /* "MACS2/IO/cScoreTrack.pyx":2464
 *             if above_cutoff.size > 1:
 *                 # Do zero manually
 *                 first_i = 0             # <<<<<<<<<<<<<<
 *                 this_start = pos[above_cutoff[0] - 1]
 *                 this_end = above_cutoff_endpos[0]
 */
      __pyx_v_first_i = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2465
 *                 # Do zero manually
 *                 first_i = 0
 *                 this_start = pos[above_cutoff[0] - 1]             # <<<<<<<<<<<<<<
 *                 this_end = above_cutoff_endpos[0]
 *                 if this_start > this_end:
 */
      __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_this_start = __pyx_t_10;

      /* "MACS2/IO/cScoreTrack.pyx":2466
 *                 first_i = 0
 *                 this_start = pos[above_cutoff[0] - 1]
 *                 this_end = above_cutoff_endpos[0]             # <<<<<<<<<<<<<<
 *                 if this_start > this_end:
 *                     this_start = 0
 */
      __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_this_end = __pyx_t_10;

      /* "MACS2/IO/cScoreTrack.pyx":2467
 *                 this_start = pos[above_cutoff[0] - 1]
 *                 this_end = above_cutoff_endpos[0]
 *                 if this_start > this_end:             # <<<<<<<<<<<<<<
 *                     this_start = 0
 *                 first_start = this_start
 */
      __pyx_t_9 = (__pyx_v_this_start > __pyx_v_this_end);
      if (__pyx_t_9) {

        /* "MACS2/IO/cScoreTrack.pyx":2468
 *                 this_end = above_cutoff_endpos[0]
 *                 if this_start > this_end:
 *                     this_start = 0             # <<<<<<<<<<<<<<
 *                 first_start = this_start
 *                 last_end = this_end
 */
        __pyx_v_this_start = 0;
        goto __pyx_L14;
      }
      __pyx_L14:;

      /* "MACS2/IO/cScoreTrack.pyx":2469
 *                 if this_start > this_end:
 *                     this_start = 0
 *                 first_start = this_start             # <<<<<<<<<<<<<<
 *                 last_end = this_end
 *                 for i in range(1, above_cutoff.size):
 */
      __pyx_v_first_start = __pyx_v_this_start;

      /* "MACS2/IO/cScoreTrack.pyx":2470
 *                     this_start = 0
 *                 first_start = this_start
 *                 last_end = this_end             # <<<<<<<<<<<<<<
 *                 for i in range(1, above_cutoff.size):
 *                     this_start = above_cutoff_endpos[i - 1]
 */
      __pyx_v_last_end = __pyx_v_this_end;

      /* "MACS2/IO/cScoreTrack.pyx":2471
 *                 first_start = this_start
 *                 last_end = this_end
 *                 for i in range(1, above_cutoff.size):             # <<<<<<<<<<<<<<
 *                     this_start = above_cutoff_endpos[i - 1]
 *                     this_end = above_cutoff_endpos[i]
 */
      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_above_cutoff), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_11; __pyx_t_10+=1) {
        __pyx_v_i = __pyx_t_10;

        /* "MACS2/IO/cScoreTrack.pyx":2472
 *                 last_end = this_end
 *                 for i in range(1, above_cutoff.size):
 *                     this_start = above_cutoff_endpos[i - 1]             # <<<<<<<<<<<<<<
 *                     this_end = above_cutoff_endpos[i]
 *                     if first_i == -1:
 */
        __pyx_t_12 = (__pyx_v_i - 1);
        __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), __pyx_t_12, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_this_start = __pyx_t_13;

        /* "MACS2/IO/cScoreTrack.pyx":2473
 *                 for i in range(1, above_cutoff.size):
 *                     this_start = above_cutoff_endpos[i - 1]
 *                     this_end = above_cutoff_endpos[i]             # <<<<<<<<<<<<<<
 *                     if first_i == -1:
 *                         first_i = i
 */
        __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_this_end = __pyx_t_13;

        /* "MACS2/IO/cScoreTrack.pyx":2474
 *                     this_start = above_cutoff_endpos[i - 1]
 *                     this_end = above_cutoff_endpos[i]
 *                     if first_i == -1:             # <<<<<<<<<<<<<<
 *                         first_i = i
 *                         first_start = this_start
 */
        __pyx_t_9 = (__pyx_v_first_i == -1);
        if (__pyx_t_9) {

          /* "MACS2/IO/cScoreTrack.pyx":2475
 *                     this_end = above_cutoff_endpos[i]
 *                     if first_i == -1:
 *                         first_i = i             # <<<<<<<<<<<<<<
 *                         first_start = this_start
 *                     elif (this_end - last_end) > max_gap:
 */
          __pyx_v_first_i = __pyx_v_i;

          /* "MACS2/IO/cScoreTrack.pyx":2476
 *                     if first_i == -1:
 *                         first_i = i
 *                         first_start = this_start             # <<<<<<<<<<<<<<
 *                     elif (this_end - last_end) > max_gap:
 *                         if (last_end - first_start) >= min_length:
 */
          __pyx_v_first_start = __pyx_v_this_start;
          goto __pyx_L17;
        }

        /* "MACS2/IO/cScoreTrack.pyx":2477
 *                         first_i = i
 *                         first_start = this_start
 *                     elif (this_end - last_end) > max_gap:             # <<<<<<<<<<<<<<
 *                         if (last_end - first_start) >= min_length:
 *                             in_peaks[above_cutoff[first_i]:above_cutoff[i - 1]] = True
 */
        __pyx_t_9 = ((__pyx_v_this_end - __pyx_v_last_end) > __pyx_v_max_gap);
        if (__pyx_t_9) {

          /* "MACS2/IO/cScoreTrack.pyx":2478
 *                         first_start = this_start
 *                     elif (this_end - last_end) > max_gap:
 *                         if (last_end - first_start) >= min_length:             # <<<<<<<<<<<<<<
 *                             in_peaks[above_cutoff[first_i]:above_cutoff[i - 1]] = True
 *                         first_i = -1
 */
          __pyx_t_9 = ((__pyx_v_last_end - __pyx_v_first_start) >= __pyx_v_min_length);
          if (__pyx_t_9) {

            /* "MACS2/IO/cScoreTrack.pyx":2479
 *                     elif (this_end - last_end) > max_gap:
 *                         if (last_end - first_start) >= min_length:
 *                             in_peaks[above_cutoff[first_i]:above_cutoff[i - 1]] = True             # <<<<<<<<<<<<<<
 *                         first_i = -1
 *                     last_end = this_end
 */
            __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_v_first_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_12 = (__pyx_v_i - 1);
            __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_t_12, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__Pyx_PySequence_SetSlice(((PyObject *)__pyx_v_in_peaks), __pyx_t_14, __pyx_t_15, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L18;
          }
          __pyx_L18:;

          /* "MACS2/IO/cScoreTrack.pyx":2480
 *                         if (last_end - first_start) >= min_length:
 *                             in_peaks[above_cutoff[first_i]:above_cutoff[i - 1]] = True
 *                         first_i = -1             # <<<<<<<<<<<<<<
 *                     last_end = this_end
 * 
 */
          __pyx_v_first_i = -1;
          goto __pyx_L17;
        }
        __pyx_L17:;

        /* "MACS2/IO/cScoreTrack.pyx":2481
 *                             in_peaks[above_cutoff[first_i]:above_cutoff[i - 1]] = True
 *                         first_i = -1
 *                     last_end = this_end             # <<<<<<<<<<<<<<
 * 
 *                 if not first_i == -1:
 */
        __pyx_v_last_end = __pyx_v_this_end;
      }

      /* "MACS2/IO/cScoreTrack.pyx":2483
 *                     last_end = this_end
 * 
 *                 if not first_i == -1:             # <<<<<<<<<<<<<<
 *                     if last_end - first_start >= min_length:
 *                         in_peaks[above_cutoff[first_i]:above_cutoff[i]] = True
 */
      __pyx_t_9 = (!(__pyx_v_first_i == -1));
      if (__pyx_t_9) {

        /* "MACS2/IO/cScoreTrack.pyx":2484
 * 
 *                 if not first_i == -1:
 *                     if last_end - first_start >= min_length:             # <<<<<<<<<<<<<<
 *                         in_peaks[above_cutoff[first_i]:above_cutoff[i]] = True
 * 
 */
        __pyx_t_9 = ((__pyx_v_last_end - __pyx_v_first_start) >= __pyx_v_min_length);
        if (__pyx_t_9) {

          /* "MACS2/IO/cScoreTrack.pyx":2485
 *                 if not first_i == -1:
 *                     if last_end - first_start >= min_length:
 *                         in_peaks[above_cutoff[first_i]:above_cutoff[i]] = True             # <<<<<<<<<<<<<<
 * 
 *             self.where_peaks[chrom] = np.where(in_peaks)[0].astype('int32')
 */
          __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_v_first_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__Pyx_PySequence_SetSlice(((PyObject *)__pyx_v_in_peaks), __pyx_t_15, __pyx_t_14, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L20;
        }
        __pyx_L20:;
        goto __pyx_L19;
      }
      __pyx_L19:;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "MACS2/IO/cScoreTrack.pyx":2487
 *                         in_peaks[above_cutoff[first_i]:above_cutoff[i]] = True
 * 
 *             self.where_peaks[chrom] = np.where(in_peaks)[0].astype('int32')             # <<<<<<<<<<<<<<
 * #            print "Total peakage in bp", in_peaks.sum()
 * 
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__where); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_in_peaks));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_in_peaks));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_in_peaks));
    __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->where_peaks), ((PyObject *)__pyx_v_chrom), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2490
 * #            print "Total peakage in bp", in_peaks.sum()
 * 
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cpdef store_peaks(self, p1io, p2io):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_value);
  __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff);
  __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff_endpos);
  __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff_startpos);
  __Pyx_XDECREF((PyObject *)__pyx_v_in_peaks);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_13call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_12call_peaks[] = "This function try to find regions within which, scores\n        are continuously higher than a given cutoff.\n\n        This function is NOT using sliding-windows. Instead, any\n        regions in bedGraph above certain cutoff will be detected,\n        then merged if the gap between nearby two regions are below\n        max_gap. After this, peak is reported if its length is above\n        min_length.\n\n        cutoff:  cutoff of value, default 2. For -log10pvalue, it means 10^-5.\n        min_length :  minimum peak length, default 200.\n        gap   :  maximum gap to merge nearby peaks, default 50.\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_13call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_cutoff;
  int __pyx_v_min_length;
  int __pyx_v_max_gap;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_peaks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cutoff,&__pyx_n_s__min_length,&__pyx_n_s__max_gap,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cutoff);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_length);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_gap);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "call_peaks") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_cutoff = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_cutoff == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "MACS2/IO/cScoreTrack.pyx":2399
 *         """
 * 
 *     cpdef call_peaks (self, float cutoff=2.0, int min_length=200, int max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
      __pyx_v_cutoff = ((float)2.0);
    }
    if (values[1]) {
      __pyx_v_min_length = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_min_length == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_length = ((int)200);
    }
    if (values[2]) {
      __pyx_v_max_gap = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_max_gap == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_max_gap = ((int)50);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_peaks", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_12call_peaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_min_length, __pyx_v_max_gap);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_12call_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, float __pyx_v_cutoff, int __pyx_v_min_length, int __pyx_v_max_gap) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_peaks __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call_peaks", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.cutoff = __pyx_v_cutoff;
  __pyx_t_2.min_length = __pyx_v_min_length;
  __pyx_t_2.max_gap = __pyx_v_max_gap;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->call_peaks(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2492
 *         return
 * 
 *     cpdef store_peaks(self, p1io, p2io):             # <<<<<<<<<<<<<<
 *         self.p1io = p1io
 *         self.p2io = p2io
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_15store_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_store_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_p1io, PyObject *__pyx_v_p2io, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("store_peaks", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__store_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_15store_peaks)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_p1io);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_p1io);
      __Pyx_GIVEREF(__pyx_v_p1io);
      __Pyx_INCREF(__pyx_v_p2io);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_p2io);
      __Pyx_GIVEREF(__pyx_v_p2io);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2493
 * 
 *     cpdef store_peaks(self, p1io, p2io):
 *         self.p1io = p1io             # <<<<<<<<<<<<<<
 *         self.p2io = p2io
 * 
 */
  __Pyx_INCREF(__pyx_v_p1io);
  __Pyx_GIVEREF(__pyx_v_p1io);
  __Pyx_GOTREF(__pyx_v_self->p1io);
  __Pyx_DECREF(__pyx_v_self->p1io);
  __pyx_v_self->p1io = __pyx_v_p1io;

  /* "MACS2/IO/cScoreTrack.pyx":2494
 *     cpdef store_peaks(self, p1io, p2io):
 *         self.p1io = p1io
 *         self.p2io = p2io             # <<<<<<<<<<<<<<
 * 
 *     cpdef annotate_peaks(self):
 */
  __Pyx_INCREF(__pyx_v_p2io);
  __Pyx_GIVEREF(__pyx_v_p2io);
  __Pyx_GOTREF(__pyx_v_self->p2io);
  __Pyx_DECREF(__pyx_v_self->p2io);
  __pyx_v_self->p2io = __pyx_v_p2io;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.store_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_15store_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_15store_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p1io = 0;
  PyObject *__pyx_v_p2io = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("store_peaks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__p1io,&__pyx_n_s__p2io,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__p1io)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p2io)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("store_peaks", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "store_peaks") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __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_p1io = values[0];
    __pyx_v_p2io = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("store_peaks", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.store_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_14store_peaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), __pyx_v_p1io, __pyx_v_p2io);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2492
 *         return
 * 
 *     cpdef store_peaks(self, p1io, p2io):             # <<<<<<<<<<<<<<
 *         self.p1io = p1io
 *         self.p2io = p2io
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_14store_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_p1io, PyObject *__pyx_v_p2io) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("store_peaks", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->store_peaks(__pyx_v_self, __pyx_v_p1io, __pyx_v_p2io, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.store_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2496
 *         self.p2io = p2io
 * 
 *     cpdef annotate_peaks(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             str chrom
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_17annotate_peaks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_annotate_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_i;
  int __pyx_v_i_max;
  int __pyx_v_ii;
  int __pyx_v_j;
  int __pyx_v_j_max;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_where_peaks = 0;
  PyArrayObject *__pyx_v_which_peaks1 = 0;
  PyArrayObject *__pyx_v_which_peaks2 = 0;
  PyArrayObject *__pyx_v_p1starts = 0;
  PyArrayObject *__pyx_v_p1ends = 0;
  PyArrayObject *__pyx_v_p2starts = 0;
  PyArrayObject *__pyx_v_p2ends = 0;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_end = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_p1ends;
  __Pyx_Buffer __pyx_pybuffer_p1ends;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_p1starts;
  __Pyx_Buffer __pyx_pybuffer_p1starts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_p2ends;
  __Pyx_Buffer __pyx_pybuffer_p2ends;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_p2starts;
  __Pyx_Buffer __pyx_pybuffer_p2starts;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
  __Pyx_Buffer __pyx_pybuffer_pos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_where_peaks;
  __Pyx_Buffer __pyx_pybuffer_where_peaks;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_which_peaks1;
  __Pyx_Buffer __pyx_pybuffer_which_peaks1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_which_peaks2;
  __Pyx_Buffer __pyx_pybuffer_which_peaks2;
  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 *);
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  long __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  int __pyx_t_20;
  int __pyx_t_21;
  int __pyx_t_22;
  long __pyx_t_23;
  int __pyx_t_24;
  int __pyx_t_25;
  long __pyx_t_26;
  int __pyx_t_27;
  int __pyx_t_28;
  PyObject *__pyx_t_29 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("annotate_peaks", 0);
  __pyx_pybuffer_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_pos.refcount = 0;
  __pyx_pybuffernd_pos.data = NULL;
  __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
  __pyx_pybuffer_where_peaks.pybuffer.buf = NULL;
  __pyx_pybuffer_where_peaks.refcount = 0;
  __pyx_pybuffernd_where_peaks.data = NULL;
  __pyx_pybuffernd_where_peaks.rcbuffer = &__pyx_pybuffer_where_peaks;
  __pyx_pybuffer_which_peaks1.pybuffer.buf = NULL;
  __pyx_pybuffer_which_peaks1.refcount = 0;
  __pyx_pybuffernd_which_peaks1.data = NULL;
  __pyx_pybuffernd_which_peaks1.rcbuffer = &__pyx_pybuffer_which_peaks1;
  __pyx_pybuffer_which_peaks2.pybuffer.buf = NULL;
  __pyx_pybuffer_which_peaks2.refcount = 0;
  __pyx_pybuffernd_which_peaks2.data = NULL;
  __pyx_pybuffernd_which_peaks2.rcbuffer = &__pyx_pybuffer_which_peaks2;
  __pyx_pybuffer_p1starts.pybuffer.buf = NULL;
  __pyx_pybuffer_p1starts.refcount = 0;
  __pyx_pybuffernd_p1starts.data = NULL;
  __pyx_pybuffernd_p1starts.rcbuffer = &__pyx_pybuffer_p1starts;
  __pyx_pybuffer_p1ends.pybuffer.buf = NULL;
  __pyx_pybuffer_p1ends.refcount = 0;
  __pyx_pybuffernd_p1ends.data = NULL;
  __pyx_pybuffernd_p1ends.rcbuffer = &__pyx_pybuffer_p1ends;
  __pyx_pybuffer_p2starts.pybuffer.buf = NULL;
  __pyx_pybuffer_p2starts.refcount = 0;
  __pyx_pybuffernd_p2starts.data = NULL;
  __pyx_pybuffernd_p2starts.rcbuffer = &__pyx_pybuffer_p2starts;
  __pyx_pybuffer_p2ends.pybuffer.buf = NULL;
  __pyx_pybuffer_p2ends.refcount = 0;
  __pyx_pybuffernd_p2ends.data = NULL;
  __pyx_pybuffernd_p2ends.rcbuffer = &__pyx_pybuffer_p2ends;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__annotate_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_17annotate_peaks)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2502
 *             np.ndarray[np.int32_t] pos, where_peaks, which_peaks1, which_peaks2
 *             np.ndarray[np.int32_t] p1starts, p1ends, p2starts, p2ends
 *         for chrom in self.pos.keys():             # <<<<<<<<<<<<<<
 *             pos = self.pos[chrom]
 *             i_max = self.datalength[chrom]
 */
  if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2503
 *             np.ndarray[np.int32_t] p1starts, p1ends, p2starts, p2ends
 *         for chrom in self.pos.keys():
 *             pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *             i_max = self.datalength[chrom]
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2504
 *         for chrom in self.pos.keys():
 *             pos = self.pos[chrom]
 *             i_max = self.datalength[chrom]             # <<<<<<<<<<<<<<
 * 
 *             which_peaks1 = -np.ones(self.datalength[chrom], dtype='int32')
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_i_max = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":2506
 *             i_max = self.datalength[chrom]
 * 
 *             which_peaks1 = -np.ones(self.datalength[chrom], dtype='int32')             # <<<<<<<<<<<<<<
 *             which_peaks2 = -np.ones(self.datalength[chrom], dtype='int32')
 *             try:
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ones); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__int32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Negative(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer, (PyObject*)__pyx_v_which_peaks1, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_which_peaks1.diminfo[0].strides = __pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_which_peaks1.diminfo[0].shape = __pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_which_peaks1));
    __pyx_v_which_peaks1 = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2507
 * 
 *             which_peaks1 = -np.ones(self.datalength[chrom], dtype='int32')
 *             which_peaks2 = -np.ones(self.datalength[chrom], dtype='int32')             # <<<<<<<<<<<<<<
 *             try:
 *                 data = self.p1io.get_data_from_chrom(chrom)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ones); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__int32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Negative(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer, (PyObject*)__pyx_v_which_peaks2, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_pybuffernd_which_peaks2.diminfo[0].strides = __pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_which_peaks2.diminfo[0].shape = __pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_which_peaks2));
    __pyx_v_which_peaks2 = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2508
 *             which_peaks1 = -np.ones(self.datalength[chrom], dtype='int32')
 *             which_peaks2 = -np.ones(self.datalength[chrom], dtype='int32')
 *             try:             # <<<<<<<<<<<<<<
 *                 data = self.p1io.get_data_from_chrom(chrom)
 *             except KeyError: data = []
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "MACS2/IO/cScoreTrack.pyx":2509
 *             which_peaks2 = -np.ones(self.datalength[chrom], dtype='int32')
 *             try:
 *                 data = self.p1io.get_data_from_chrom(chrom)             # <<<<<<<<<<<<<<
 *             except KeyError: data = []
 *             p1starts = np.array(map(itemgetter("start"), data), 'int32')
 */
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->p1io, __pyx_n_s__get_data_from_chrom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_chrom));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
        __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_v_data);
        __pyx_v_data = __pyx_t_11;
        __pyx_t_11 = 0;
      }
      __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;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2510
 *             try:
 *                 data = self.p1io.get_data_from_chrom(chrom)
 *             except KeyError: data = []             # <<<<<<<<<<<<<<
 *             p1starts = np.array(map(itemgetter("start"), data), 'int32')
 *             p1ends = np.array(map(itemgetter("end"), data), 'int32')
 */
      __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_6) {
        __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.annotate_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_XDECREF(__pyx_v_data);
        __pyx_v_data = ((PyObject *)__pyx_t_12);
        __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L6_exception_handled;
      }
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      __pyx_L12_try_end:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":2511
 *                 data = self.p1io.get_data_from_chrom(chrom)
 *             except KeyError: data = []
 *             p1starts = np.array(map(itemgetter("start"), data), 'int32')             # <<<<<<<<<<<<<<
 *             p1ends = np.array(map(itemgetter("end"), data), 'int32')
 *             j = 0
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_48), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__int32));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__int32));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
    __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1starts.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p1starts.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p1starts.rcbuffer->pybuffer, (PyObject*)__pyx_v_p1starts, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_pybuffernd_p1starts.diminfo[0].strides = __pyx_pybuffernd_p1starts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p1starts.diminfo[0].shape = __pyx_pybuffernd_p1starts.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_p1starts));
    __pyx_v_p1starts = ((PyArrayObject *)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2512
 *             except KeyError: data = []
 *             p1starts = np.array(map(itemgetter("start"), data), 'int32')
 *             p1ends = np.array(map(itemgetter("end"), data), 'int32')             # <<<<<<<<<<<<<<
 *             j = 0
 *             j_max = p1starts.size
 */
    __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __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_INCREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    __pyx_t_10 = 0;
    __pyx_t_10 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __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_INCREF(((PyObject *)__pyx_n_s__int32));
    PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_n_s__int32));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
    __pyx_t_10 = 0;
    __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = ((PyArrayObject *)__pyx_t_10);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1ends.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p1ends.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p1ends.rcbuffer->pybuffer, (PyObject*)__pyx_v_p1ends, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_p1ends.diminfo[0].strides = __pyx_pybuffernd_p1ends.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p1ends.diminfo[0].shape = __pyx_pybuffernd_p1ends.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_p1ends));
    __pyx_v_p1ends = ((PyArrayObject *)__pyx_t_10);
    __pyx_t_10 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2513
 *             p1starts = np.array(map(itemgetter("start"), data), 'int32')
 *             p1ends = np.array(map(itemgetter("end"), data), 'int32')
 *             j = 0             # <<<<<<<<<<<<<<
 *             j_max = p1starts.size
 *             for i in range(i_max - 1):
 */
    __pyx_v_j = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2514
 *             p1ends = np.array(map(itemgetter("end"), data), 'int32')
 *             j = 0
 *             j_max = p1starts.size             # <<<<<<<<<<<<<<
 *             for i in range(i_max - 1):
 *                 if j == j_max: break
 */
    __pyx_t_10 = PyObject_GetAttr(((PyObject *)__pyx_v_p1starts), __pyx_n_s__size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_v_j_max = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":2515
 *             j = 0
 *             j_max = p1starts.size
 *             for i in range(i_max - 1):             # <<<<<<<<<<<<<<
 *                 if j == j_max: break
 *                 if pos[i] == p1starts[j]:
 */
    __pyx_t_14 = (__pyx_v_i_max - 1);
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_14; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "MACS2/IO/cScoreTrack.pyx":2516
 *             j_max = p1starts.size
 *             for i in range(i_max - 1):
 *                 if j == j_max: break             # <<<<<<<<<<<<<<
 *                 if pos[i] == p1starts[j]:
 *                 # then the i + 1 fragment starts with the correct value
 */
      __pyx_t_15 = (__pyx_v_j == __pyx_v_j_max);
      if (__pyx_t_15) {
        goto __pyx_L16_break;
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "MACS2/IO/cScoreTrack.pyx":2517
 *             for i in range(i_max - 1):
 *                 if j == j_max: break
 *                 if pos[i] == p1starts[j]:             # <<<<<<<<<<<<<<
 *                 # then the i + 1 fragment starts with the correct value
 *                     # find the end
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_pos.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_17 = 0;
      if (unlikely(__pyx_t_17 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_17);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_17 = __pyx_v_j;
      __pyx_t_18 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_p1starts.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_p1starts.diminfo[0].shape)) __pyx_t_18 = 0;
      if (unlikely(__pyx_t_18 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_18);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_pos.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_p1starts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_p1starts.diminfo[0].strides)));
      if (__pyx_t_15) {

        /* "MACS2/IO/cScoreTrack.pyx":2520
 *                 # then the i + 1 fragment starts with the correct value
 *                     # find the end
 *                     end = p1ends[j]             # <<<<<<<<<<<<<<
 *                     for ii in range(i + 1, i_max):
 *                         if pos[ii] == end:
 */
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_19 = -1;
        if (__pyx_t_18 < 0) {
          __pyx_t_18 += __pyx_pybuffernd_p1ends.diminfo[0].shape;
          if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 0;
        } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_p1ends.diminfo[0].shape)) __pyx_t_19 = 0;
        if (unlikely(__pyx_t_19 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_19);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_10 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_p1ends.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_p1ends.diminfo[0].strides))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_XDECREF(__pyx_v_end);
        __pyx_v_end = __pyx_t_10;
        __pyx_t_10 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2521
 *                     # find the end
 *                     end = p1ends[j]
 *                     for ii in range(i + 1, i_max):             # <<<<<<<<<<<<<<
 *                         if pos[ii] == end:
 *                             break
 */
        __pyx_t_19 = __pyx_v_i_max;
        for (__pyx_t_20 = (__pyx_v_i + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_ii = __pyx_t_20;

          /* "MACS2/IO/cScoreTrack.pyx":2522
 *                     end = p1ends[j]
 *                     for ii in range(i + 1, i_max):
 *                         if pos[ii] == end:             # <<<<<<<<<<<<<<
 *                             break
 *                         # assert pos[ii] < end, "something went wrong"
 */
          __pyx_t_21 = __pyx_v_ii;
          __pyx_t_22 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 0;
          } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_22 = 0;
          if (unlikely(__pyx_t_22 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_22);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_10 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = PyObject_RichCompare(__pyx_t_10, __pyx_v_end, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_15) {

            /* "MACS2/IO/cScoreTrack.pyx":2523
 *                     for ii in range(i + 1, i_max):
 *                         if pos[ii] == end:
 *                             break             # <<<<<<<<<<<<<<
 *                         # assert pos[ii] < end, "something went wrong"
 *                     # ii end = true end, but ii is still part of peak
 */
            goto __pyx_L20_break;
            goto __pyx_L21;
          }
          __pyx_L21:;
        }
        __pyx_L20_break:;

        /* "MACS2/IO/cScoreTrack.pyx":2526
 *                         # assert pos[ii] < end, "something went wrong"
 *                     # ii end = true end, but ii is still part of peak
 *                     which_peaks1[(i + 1):(ii + 1)] = j             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     # skip additional subpeaks
 */
        __pyx_t_11 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        if (__Pyx_PySequence_SetSlice(((PyObject *)__pyx_v_which_peaks1), (__pyx_v_i + 1), (__pyx_v_ii + 1), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2527
 *                     # ii end = true end, but ii is still part of peak
 *                     which_peaks1[(i + 1):(ii + 1)] = j
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     # skip additional subpeaks
 *                     while True:
 */
        __pyx_v_j = (__pyx_v_j + 1);

        /* "MACS2/IO/cScoreTrack.pyx":2529
 *                     j += 1
 *                     # skip additional subpeaks
 *                     while True:             # <<<<<<<<<<<<<<
 *                         if j == j_max: break
 *                         if p1ends[j] == p1ends[j - 1]: j += 1
 */
        while (1) {
          if (!1) break;

          /* "MACS2/IO/cScoreTrack.pyx":2530
 *                     # skip additional subpeaks
 *                     while True:
 *                         if j == j_max: break             # <<<<<<<<<<<<<<
 *                         if p1ends[j] == p1ends[j - 1]: j += 1
 *                         else: break
 */
          __pyx_t_15 = (__pyx_v_j == __pyx_v_j_max);
          if (__pyx_t_15) {
            goto __pyx_L23_break;
            goto __pyx_L24;
          }
          __pyx_L24:;

          /* "MACS2/IO/cScoreTrack.pyx":2531
 *                     while True:
 *                         if j == j_max: break
 *                         if p1ends[j] == p1ends[j - 1]: j += 1             # <<<<<<<<<<<<<<
 *                         else: break
 * 
 */
          __pyx_t_19 = __pyx_v_j;
          __pyx_t_20 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_p1ends.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 0;
          } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_p1ends.diminfo[0].shape)) __pyx_t_20 = 0;
          if (unlikely(__pyx_t_20 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_20);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_23 = (__pyx_v_j - 1);
          __pyx_t_20 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_p1ends.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_20 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_p1ends.diminfo[0].shape)) __pyx_t_20 = 0;
          if (unlikely(__pyx_t_20 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_20);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_p1ends.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_p1ends.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_p1ends.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_p1ends.diminfo[0].strides)));
          if (__pyx_t_15) {
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L25;
          }
          /*else*/ {

            /* "MACS2/IO/cScoreTrack.pyx":2532
 *                         if j == j_max: break
 *                         if p1ends[j] == p1ends[j - 1]: j += 1
 *                         else: break             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
            goto __pyx_L23_break;
          }
          __pyx_L25:;
        }
        __pyx_L23_break:;
        goto __pyx_L18;
      }
      __pyx_L18:;
    }
    __pyx_L16_break:;

    /* "MACS2/IO/cScoreTrack.pyx":2534
 *                         else: break
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 data = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: data = []
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      /*try:*/ {

        /* "MACS2/IO/cScoreTrack.pyx":2535
 * 
 *             try:
 *                 data = self.p2io.get_data_from_chrom(chrom)             # <<<<<<<<<<<<<<
 *             except KeyError: data = []
 *             p2starts = np.array(map(itemgetter("start"), data), 'int32')
 */
        __pyx_t_11 = PyObject_GetAttr(__pyx_v_self->p2io, __pyx_n_s__get_data_from_chrom); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_chrom));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
        __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_v_data);
        __pyx_v_data = __pyx_t_1;
        __pyx_t_1 = 0;
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L33_try_end;
      __pyx_L26_error:;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2536
 *             try:
 *                 data = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: data = []             # <<<<<<<<<<<<<<
 *             p2starts = np.array(map(itemgetter("start"), data), 'int32')
 *             p2ends = np.array(map(itemgetter("end"), data), 'int32')
 */
      __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_6) {
        __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.annotate_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_10, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2536; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2536; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_v_data);
        __pyx_v_data = ((PyObject *)__pyx_t_12);
        __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L27_exception_handled;
      }
      __pyx_L28_except_error:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      goto __pyx_L1_error;
      __pyx_L27_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      __pyx_L33_try_end:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":2537
 *                 data = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: data = []
 *             p2starts = np.array(map(itemgetter("start"), data), 'int32')             # <<<<<<<<<<<<<<
 *             p2ends = np.array(map(itemgetter("end"), data), 'int32')
 *             j = 0
 */
    __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_10 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__array); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__int32));
    PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_n_s__int32));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2starts.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p2starts.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p2starts.rcbuffer->pybuffer, (PyObject*)__pyx_v_p2starts, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_p2starts.diminfo[0].strides = __pyx_pybuffernd_p2starts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p2starts.diminfo[0].shape = __pyx_pybuffernd_p2starts.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_p2starts));
    __pyx_v_p2starts = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2538
 *             except KeyError: data = []
 *             p2starts = np.array(map(itemgetter("start"), data), 'int32')
 *             p2ends = np.array(map(itemgetter("end"), data), 'int32')             # <<<<<<<<<<<<<<
 *             j = 0
 *             j_max = p2starts.size
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    __pyx_t_10 = 0;
    __pyx_t_10 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__int32));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__int32));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
    __pyx_t_10 = 0;
    __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = ((PyArrayObject *)__pyx_t_10);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2ends.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p2ends.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p2ends.rcbuffer->pybuffer, (PyObject*)__pyx_v_p2ends, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_pybuffernd_p2ends.diminfo[0].strides = __pyx_pybuffernd_p2ends.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p2ends.diminfo[0].shape = __pyx_pybuffernd_p2ends.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_p2ends));
    __pyx_v_p2ends = ((PyArrayObject *)__pyx_t_10);
    __pyx_t_10 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2539
 *             p2starts = np.array(map(itemgetter("start"), data), 'int32')
 *             p2ends = np.array(map(itemgetter("end"), data), 'int32')
 *             j = 0             # <<<<<<<<<<<<<<
 *             j_max = p2starts.size
 *             for i in range(i_max - 1):
 */
    __pyx_v_j = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2540
 *             p2ends = np.array(map(itemgetter("end"), data), 'int32')
 *             j = 0
 *             j_max = p2starts.size             # <<<<<<<<<<<<<<
 *             for i in range(i_max - 1):
 *                 if j == j_max: break
 */
    __pyx_t_10 = PyObject_GetAttr(((PyObject *)__pyx_v_p2starts), __pyx_n_s__size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_v_j_max = __pyx_t_6;

    /* "MACS2/IO/cScoreTrack.pyx":2541
 *             j = 0
 *             j_max = p2starts.size
 *             for i in range(i_max - 1):             # <<<<<<<<<<<<<<
 *                 if j == j_max: break
 *                 if pos[i] == p2starts[j]:
 */
    __pyx_t_14 = (__pyx_v_i_max - 1);
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_14; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "MACS2/IO/cScoreTrack.pyx":2542
 *             j_max = p2starts.size
 *             for i in range(i_max - 1):
 *                 if j == j_max: break             # <<<<<<<<<<<<<<
 *                 if pos[i] == p2starts[j]:
 *                 # then the i + 1 fragment starts with the correct value
 */
      __pyx_t_15 = (__pyx_v_j == __pyx_v_j_max);
      if (__pyx_t_15) {
        goto __pyx_L37_break;
        goto __pyx_L38;
      }
      __pyx_L38:;

      /* "MACS2/IO/cScoreTrack.pyx":2543
 *             for i in range(i_max - 1):
 *                 if j == j_max: break
 *                 if pos[i] == p2starts[j]:             # <<<<<<<<<<<<<<
 *                 # then the i + 1 fragment starts with the correct value
 *                     # find the end
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_22 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_pos.diminfo[0].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_22 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_22 = 0;
      if (unlikely(__pyx_t_22 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_22);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_22 = __pyx_v_j;
      __pyx_t_24 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_pybuffernd_p2starts.diminfo[0].shape;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_24 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_p2starts.diminfo[0].shape)) __pyx_t_24 = 0;
      if (unlikely(__pyx_t_24 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_24);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_pos.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_p2starts.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_p2starts.diminfo[0].strides)));
      if (__pyx_t_15) {

        /* "MACS2/IO/cScoreTrack.pyx":2546
 *                 # then the i + 1 fragment starts with the correct value
 *                     # find the end
 *                     end = p2ends[j]             # <<<<<<<<<<<<<<
 *                     for ii in range(i + 1, i_max - 1):
 *                         if pos[ii] == end:
 */
        __pyx_t_24 = __pyx_v_j;
        __pyx_t_25 = -1;
        if (__pyx_t_24 < 0) {
          __pyx_t_24 += __pyx_pybuffernd_p2ends.diminfo[0].shape;
          if (unlikely(__pyx_t_24 < 0)) __pyx_t_25 = 0;
        } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_p2ends.diminfo[0].shape)) __pyx_t_25 = 0;
        if (unlikely(__pyx_t_25 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_25);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_10 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_p2ends.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_p2ends.diminfo[0].strides))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_XDECREF(__pyx_v_end);
        __pyx_v_end = __pyx_t_10;
        __pyx_t_10 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2547
 *                     # find the end
 *                     end = p2ends[j]
 *                     for ii in range(i + 1, i_max - 1):             # <<<<<<<<<<<<<<
 *                         if pos[ii] == end:
 *                             break
 */
        __pyx_t_26 = (__pyx_v_i_max - 1);
        for (__pyx_t_25 = (__pyx_v_i + 1); __pyx_t_25 < __pyx_t_26; __pyx_t_25+=1) {
          __pyx_v_ii = __pyx_t_25;

          /* "MACS2/IO/cScoreTrack.pyx":2548
 *                     end = p2ends[j]
 *                     for ii in range(i + 1, i_max - 1):
 *                         if pos[ii] == end:             # <<<<<<<<<<<<<<
 *                             break
 *                         # assert pos[ii] < end, "something went wrong"
 */
          __pyx_t_27 = __pyx_v_ii;
          __pyx_t_28 = -1;
          if (__pyx_t_27 < 0) {
            __pyx_t_27 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_28 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_28 = 0;
          if (unlikely(__pyx_t_28 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_28);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_10 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_v_end, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_15) {

            /* "MACS2/IO/cScoreTrack.pyx":2549
 *                     for ii in range(i + 1, i_max - 1):
 *                         if pos[ii] == end:
 *                             break             # <<<<<<<<<<<<<<
 *                         # assert pos[ii] < end, "something went wrong"
 *                     # ii end = true end, but ii is still part of peak
 */
            goto __pyx_L41_break;
            goto __pyx_L42;
          }
          __pyx_L42:;
        }
        __pyx_L41_break:;

        /* "MACS2/IO/cScoreTrack.pyx":2552
 *                         # assert pos[ii] < end, "something went wrong"
 *                     # ii end = true end, but ii is still part of peak
 *                     which_peaks2[(i + 1):(ii + 1)] = j             # <<<<<<<<<<<<<<
 *                     j += 1
 *                     # skip additional subpeaks
 */
        __pyx_t_1 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (__Pyx_PySequence_SetSlice(((PyObject *)__pyx_v_which_peaks2), (__pyx_v_i + 1), (__pyx_v_ii + 1), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2553
 *                     # ii end = true end, but ii is still part of peak
 *                     which_peaks2[(i + 1):(ii + 1)] = j
 *                     j += 1             # <<<<<<<<<<<<<<
 *                     # skip additional subpeaks
 *                     while True:
 */
        __pyx_v_j = (__pyx_v_j + 1);

        /* "MACS2/IO/cScoreTrack.pyx":2555
 *                     j += 1
 *                     # skip additional subpeaks
 *                     while True:             # <<<<<<<<<<<<<<
 *                         if j == j_max: break
 *                         if p2ends[j] == p2ends[j - 1]: j += 1
 */
        while (1) {
          if (!1) break;

          /* "MACS2/IO/cScoreTrack.pyx":2556
 *                     # skip additional subpeaks
 *                     while True:
 *                         if j == j_max: break             # <<<<<<<<<<<<<<
 *                         if p2ends[j] == p2ends[j - 1]: j += 1
 *                         else: break
 */
          __pyx_t_15 = (__pyx_v_j == __pyx_v_j_max);
          if (__pyx_t_15) {
            goto __pyx_L44_break;
            goto __pyx_L45;
          }
          __pyx_L45:;

          /* "MACS2/IO/cScoreTrack.pyx":2557
 *                     while True:
 *                         if j == j_max: break
 *                         if p2ends[j] == p2ends[j - 1]: j += 1             # <<<<<<<<<<<<<<
 *                         else: break
 * 
 */
          __pyx_t_25 = __pyx_v_j;
          __pyx_t_28 = -1;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_pybuffernd_p2ends.diminfo[0].shape;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_28 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_p2ends.diminfo[0].shape)) __pyx_t_28 = 0;
          if (unlikely(__pyx_t_28 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_28);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_26 = (__pyx_v_j - 1);
          __pyx_t_28 = -1;
          if (__pyx_t_26 < 0) {
            __pyx_t_26 += __pyx_pybuffernd_p2ends.diminfo[0].shape;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_28 = 0;
          } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_p2ends.diminfo[0].shape)) __pyx_t_28 = 0;
          if (unlikely(__pyx_t_28 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_28);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_p2ends.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_p2ends.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_p2ends.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_p2ends.diminfo[0].strides)));
          if (__pyx_t_15) {
            __pyx_v_j = (__pyx_v_j + 1);
            goto __pyx_L46;
          }
          /*else*/ {

            /* "MACS2/IO/cScoreTrack.pyx":2558
 *                         if j == j_max: break
 *                         if p2ends[j] == p2ends[j - 1]: j += 1
 *                         else: break             # <<<<<<<<<<<<<<
 * 
 *             where_peaks = np.where(np.logical_or(which_peaks1 >= 0,
 */
            goto __pyx_L44_break;
          }
          __pyx_L46:;
        }
        __pyx_L44_break:;
        goto __pyx_L39;
      }
      __pyx_L39:;
    }
    __pyx_L37_break:;

    /* "MACS2/IO/cScoreTrack.pyx":2560
 *                         else: break
 * 
 *             where_peaks = np.where(np.logical_or(which_peaks1 >= 0,             # <<<<<<<<<<<<<<
 *                                                  which_peaks2 >= 0))[0].astype('int32')
 *             self.where_peaks[chrom] = where_peaks
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__where); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__logical_or); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_which_peaks1), __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "MACS2/IO/cScoreTrack.pyx":2561
 * 
 *             where_peaks = np.where(np.logical_or(which_peaks1 >= 0,
 *                                                  which_peaks2 >= 0))[0].astype('int32')             # <<<<<<<<<<<<<<
 *             self.where_peaks[chrom] = where_peaks
 *             self.which_peaks1[chrom] = which_peaks1[where_peaks]
 */
    __pyx_t_12 = PyObject_RichCompare(((PyObject *)__pyx_v_which_peaks2), __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_29);
    PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_1 = 0;
    __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_29), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_29)); __pyx_t_29 = 0;
    __pyx_t_29 = PyTuple_New(1); if (unlikely(!__pyx_t_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_29);
    PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_29), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_29)); __pyx_t_29 = 0;
    __pyx_t_29 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_29) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_29);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_GetAttr(__pyx_t_29, __pyx_n_s__astype); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
    __pyx_t_29 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_k_tuple_52), NULL); if (unlikely(!__pyx_t_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_29);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (!(likely(((__pyx_t_29) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_29, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = ((PyArrayObject *)__pyx_t_29);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where_peaks.rcbuffer->pybuffer);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_where_peaks.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_where_peaks.rcbuffer->pybuffer, (PyObject*)__pyx_v_where_peaks, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_where_peaks.diminfo[0].strides = __pyx_pybuffernd_where_peaks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_where_peaks.diminfo[0].shape = __pyx_pybuffernd_where_peaks.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_where_peaks));
    __pyx_v_where_peaks = ((PyArrayObject *)__pyx_t_29);
    __pyx_t_29 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2562
 *             where_peaks = np.where(np.logical_or(which_peaks1 >= 0,
 *                                                  which_peaks2 >= 0))[0].astype('int32')
 *             self.where_peaks[chrom] = where_peaks             # <<<<<<<<<<<<<<
 *             self.which_peaks1[chrom] = which_peaks1[where_peaks]
 *             self.which_peaks2[chrom] = which_peaks2[where_peaks]
 */
    if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->where_peaks), ((PyObject *)__pyx_v_chrom), ((PyObject *)__pyx_v_where_peaks)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "MACS2/IO/cScoreTrack.pyx":2563
 *                                                  which_peaks2 >= 0))[0].astype('int32')
 *             self.where_peaks[chrom] = where_peaks
 *             self.which_peaks1[chrom] = which_peaks1[where_peaks]             # <<<<<<<<<<<<<<
 *             self.which_peaks2[chrom] = which_peaks2[where_peaks]
 *             # note that we skipped peaks which have the same start end
 */
    __pyx_t_29 = PyObject_GetItem(((PyObject *)__pyx_v_which_peaks1), ((PyObject *)__pyx_v_where_peaks)); if (!__pyx_t_29) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_29);
    if (unlikely(((PyObject *)__pyx_v_self->which_peaks1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->which_peaks1), ((PyObject *)__pyx_v_chrom), __pyx_t_29) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2564
 *             self.where_peaks[chrom] = where_peaks
 *             self.which_peaks1[chrom] = which_peaks1[where_peaks]
 *             self.which_peaks2[chrom] = which_peaks2[where_peaks]             # <<<<<<<<<<<<<<
 *             # note that we skipped peaks which have the same start end
 *             # we'll find them again later using groupby
 */
    __pyx_t_29 = PyObject_GetItem(((PyObject *)__pyx_v_which_peaks2), ((PyObject *)__pyx_v_where_peaks)); if (!__pyx_t_29) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_29);
    if (unlikely(((PyObject *)__pyx_v_self->which_peaks2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->which_peaks2), ((PyObject *)__pyx_v_chrom), __pyx_t_29) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_29);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1ends.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1starts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2ends.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2starts.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where_peaks.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.annotate_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1ends.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1starts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2ends.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2starts.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_where_peaks.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_where_peaks);
  __Pyx_XDECREF((PyObject *)__pyx_v_which_peaks1);
  __Pyx_XDECREF((PyObject *)__pyx_v_which_peaks2);
  __Pyx_XDECREF((PyObject *)__pyx_v_p1starts);
  __Pyx_XDECREF((PyObject *)__pyx_v_p1ends);
  __Pyx_XDECREF((PyObject *)__pyx_v_p2starts);
  __Pyx_XDECREF((PyObject *)__pyx_v_p2ends);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_17annotate_peaks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_17annotate_peaks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("annotate_peaks (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_16annotate_peaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2496
 *         self.p2io = p2io
 * 
 *     cpdef annotate_peaks(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             str chrom
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_16annotate_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("annotate_peaks", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->annotate_peaks(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.annotate_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2569
 * 
 * 
 *     cpdef tuple make_treatcontrol_pq_tables ( self ):             # <<<<<<<<<<<<<<
 *         """Make pvalue-qvalue table.
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_19make_treatcontrol_pq_tables(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_make_treatcontrol_pq_tables(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_skip_dispatch) {
  CYTHON_UNUSED long __pyx_v_pre_l;
  long __pyx_v_l;
  long __pyx_v_i;
  long __pyx_v_N;
  long __pyx_v_k;
  CYTHON_UNUSED double __pyx_v_pre_v;
  double __pyx_v_v;
  double __pyx_v_q;
  double __pyx_v_pre_q;
  double __pyx_v_f;
  PyObject *__pyx_v_pvalue2qvalue1 = 0;
  PyObject *__pyx_v_pvalue2qvalue2 = 0;
  PyObject *__pyx_v_value_dict = 0;
  PyObject *__pyx_v_unique_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  double __pyx_t_7;
  long __pyx_t_8;
  double __pyx_t_9;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_treatcontrol_pq_tables", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_53); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_19make_treatcontrol_pq_tables)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2588
 *             list unique_values
 * 
 *         assert self.track_scoring_method == 'p'             # <<<<<<<<<<<<<<
 * 
 *         value_dict = self.pvalue_stat1
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_3 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_self->track_scoring_method), ((PyObject *)__pyx_n_s__p), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_t_3)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":2590
 *         assert self.track_scoring_method == 'p'
 * 
 *         value_dict = self.pvalue_stat1             # <<<<<<<<<<<<<<
 *         N = sum(value_dict.values())
 *         k = 1                           # rank
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->pvalue_stat1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_value_dict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2591
 * 
 *         value_dict = self.pvalue_stat1
 *         N = sum(value_dict.values())             # <<<<<<<<<<<<<<
 *         k = 1                           # rank
 *         f = -log10(N)
 */
  if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Values(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_4;

  /* "MACS2/IO/cScoreTrack.pyx":2592
 *         value_dict = self.pvalue_stat1
 *         N = sum(value_dict.values())
 *         k = 1                           # rank             # <<<<<<<<<<<<<<
 *         f = -log10(N)
 *         pre_v = -2147483647
 */
  __pyx_v_k = 1;

  /* "MACS2/IO/cScoreTrack.pyx":2593
 *         N = sum(value_dict.values())
 *         k = 1                           # rank
 *         f = -log10(N)             # <<<<<<<<<<<<<<
 *         pre_v = -2147483647
 *         pre_l = 0
 */
  __pyx_v_f = (-log10(__pyx_v_N));

  /* "MACS2/IO/cScoreTrack.pyx":2594
 *         k = 1                           # rank
 *         f = -log10(N)
 *         pre_v = -2147483647             # <<<<<<<<<<<<<<
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 */
  __pyx_v_pre_v = -2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":2595
 *         f = -log10(N)
 *         pre_v = -2147483647
 *         pre_l = 0             # <<<<<<<<<<<<<<
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue1 = {}#Float64HashTable()
 */
  __pyx_v_pre_l = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2596
 *         pre_v = -2147483647
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value             # <<<<<<<<<<<<<<
 *         pvalue2qvalue1 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 */
  __pyx_v_pre_q = 2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":2597
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue1 = {}#Float64HashTable()             # <<<<<<<<<<<<<<
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_pvalue2qvalue1 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2598
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue1 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)             # <<<<<<<<<<<<<<
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]
 */
  if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__reverse), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_unique_values = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2599
 *         pvalue2qvalue1 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):             # <<<<<<<<<<<<<<
 *             v = unique_values[i]
 *             l = value_dict[v]
 */
  if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_v_unique_values)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_6; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "MACS2/IO/cScoreTrack.pyx":2600
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]             # <<<<<<<<<<<<<<
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)
 */
    if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_unique_values), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_v = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":2601
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]
 *             l = value_dict[v]             # <<<<<<<<<<<<<<
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 */
    if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_5); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_l = __pyx_t_8;

    /* "MACS2/IO/cScoreTrack.pyx":2602
 *             v = unique_values[i]
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)             # <<<<<<<<<<<<<<
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue1[ v ] = q
 */
    __pyx_v_q = (__pyx_v_v + (log10(__pyx_v_k) + __pyx_v_f));

    /* "MACS2/IO/cScoreTrack.pyx":2603
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic             # <<<<<<<<<<<<<<
 *             pvalue2qvalue1[ v ] = q
 *             pre_v = v
 */
    __pyx_t_7 = __pyx_v_q;
    __pyx_t_9 = __pyx_v_pre_q;
    if ((__pyx_t_7 < __pyx_t_9)) {
      __pyx_t_10 = __pyx_t_7;
    } else {
      __pyx_t_10 = __pyx_t_9;
    }
    __pyx_t_7 = __pyx_t_10;
    __pyx_t_8 = 0;
    if ((__pyx_t_7 > __pyx_t_8)) {
      __pyx_t_10 = __pyx_t_7;
    } else {
      __pyx_t_10 = __pyx_t_8;
    }
    __pyx_v_q = __pyx_t_10;

    /* "MACS2/IO/cScoreTrack.pyx":2604
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue1[ v ] = q             # <<<<<<<<<<<<<<
 *             pre_v = v
 *             pre_q = q
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(((PyObject *)__pyx_v_pvalue2qvalue1), __pyx_t_5, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2605
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue1[ v ] = q
 *             pre_v = v             # <<<<<<<<<<<<<<
 *             pre_q = q
 *             k+=l
 */
    __pyx_v_pre_v = __pyx_v_v;

    /* "MACS2/IO/cScoreTrack.pyx":2606
 *             pvalue2qvalue1[ v ] = q
 *             pre_v = v
 *             pre_q = q             # <<<<<<<<<<<<<<
 *             k+=l
 * 
 */
    __pyx_v_pre_q = __pyx_v_q;

    /* "MACS2/IO/cScoreTrack.pyx":2607
 *             pre_v = v
 *             pre_q = q
 *             k+=l             # <<<<<<<<<<<<<<
 * 
 *         value_dict = self.pvalue_stat2
 */
    __pyx_v_k = (__pyx_v_k + __pyx_v_l);
  }

  /* "MACS2/IO/cScoreTrack.pyx":2609
 *             k+=l
 * 
 *         value_dict = self.pvalue_stat2             # <<<<<<<<<<<<<<
 *         N = sum(value_dict.values())
 *         k = 1                           # rank
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->pvalue_stat2);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_v_value_dict));
  __pyx_v_value_dict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2610
 * 
 *         value_dict = self.pvalue_stat2
 *         N = sum(value_dict.values())             # <<<<<<<<<<<<<<
 *         k = 1                           # rank
 *         f = -log10(N)
 */
  if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Values(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_4;

  /* "MACS2/IO/cScoreTrack.pyx":2611
 *         value_dict = self.pvalue_stat2
 *         N = sum(value_dict.values())
 *         k = 1                           # rank             # <<<<<<<<<<<<<<
 *         f = -log10(N)
 *         pre_v = -2147483647
 */
  __pyx_v_k = 1;

  /* "MACS2/IO/cScoreTrack.pyx":2612
 *         N = sum(value_dict.values())
 *         k = 1                           # rank
 *         f = -log10(N)             # <<<<<<<<<<<<<<
 *         pre_v = -2147483647
 *         pre_l = 0
 */
  __pyx_v_f = (-log10(__pyx_v_N));

  /* "MACS2/IO/cScoreTrack.pyx":2613
 *         k = 1                           # rank
 *         f = -log10(N)
 *         pre_v = -2147483647             # <<<<<<<<<<<<<<
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 */
  __pyx_v_pre_v = -2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":2614
 *         f = -log10(N)
 *         pre_v = -2147483647
 *         pre_l = 0             # <<<<<<<<<<<<<<
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue2 = {}#Float64HashTable()
 */
  __pyx_v_pre_l = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2615
 *         pre_v = -2147483647
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value             # <<<<<<<<<<<<<<
 *         pvalue2qvalue2 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 */
  __pyx_v_pre_q = 2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":2616
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue2 = {}#Float64HashTable()             # <<<<<<<<<<<<<<
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_pvalue2qvalue2 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2617
 *         pre_q = 2147483647              # save the previous q-value
 *         pvalue2qvalue2 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)             # <<<<<<<<<<<<<<
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]
 */
  if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__reverse), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_v_unique_values));
  __pyx_v_unique_values = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2618
 *         pvalue2qvalue2 = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):             # <<<<<<<<<<<<<<
 *             v = unique_values[i]
 *             l = value_dict[v]
 */
  if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_v_unique_values)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_6; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "MACS2/IO/cScoreTrack.pyx":2619
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]             # <<<<<<<<<<<<<<
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)
 */
    if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_unique_values), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_v = __pyx_t_10;

    /* "MACS2/IO/cScoreTrack.pyx":2620
 *         for i in range(len(unique_values)):
 *             v = unique_values[i]
 *             l = value_dict[v]             # <<<<<<<<<<<<<<
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 */
    if (unlikely(((PyObject *)__pyx_v_value_dict) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_2); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_l = __pyx_t_8;

    /* "MACS2/IO/cScoreTrack.pyx":2621
 *             v = unique_values[i]
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)             # <<<<<<<<<<<<<<
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue2[ v ] = q
 */
    __pyx_v_q = (__pyx_v_v + (log10(__pyx_v_k) + __pyx_v_f));

    /* "MACS2/IO/cScoreTrack.pyx":2622
 *             l = value_dict[v]
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic             # <<<<<<<<<<<<<<
 *             pvalue2qvalue2[ v ] = q
 *             pre_v = v
 */
    __pyx_t_10 = __pyx_v_q;
    __pyx_t_7 = __pyx_v_pre_q;
    if ((__pyx_t_10 < __pyx_t_7)) {
      __pyx_t_9 = __pyx_t_10;
    } else {
      __pyx_t_9 = __pyx_t_7;
    }
    __pyx_t_10 = __pyx_t_9;
    __pyx_t_8 = 0;
    if ((__pyx_t_10 > __pyx_t_8)) {
      __pyx_t_9 = __pyx_t_10;
    } else {
      __pyx_t_9 = __pyx_t_8;
    }
    __pyx_v_q = __pyx_t_9;

    /* "MACS2/IO/cScoreTrack.pyx":2623
 *             q = v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue2[ v ] = q             # <<<<<<<<<<<<<<
 *             pre_v = v
 *             pre_q = q
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(((PyObject *)__pyx_v_pvalue2qvalue2), __pyx_t_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2624
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue2[ v ] = q
 *             pre_v = v             # <<<<<<<<<<<<<<
 *             pre_q = q
 *             k+=l
 */
    __pyx_v_pre_v = __pyx_v_v;

    /* "MACS2/IO/cScoreTrack.pyx":2625
 *             pvalue2qvalue2[ v ] = q
 *             pre_v = v
 *             pre_q = q             # <<<<<<<<<<<<<<
 *             k+=l
 * 
 */
    __pyx_v_pre_q = __pyx_v_q;

    /* "MACS2/IO/cScoreTrack.pyx":2626
 *             pre_v = v
 *             pre_q = q
 *             k+=l             # <<<<<<<<<<<<<<
 * 
 *         return (pvalue2qvalue1, pvalue2qvalue2)
 */
    __pyx_v_k = (__pyx_v_k + __pyx_v_l);
  }

  /* "MACS2/IO/cScoreTrack.pyx":2628
 *             k+=l
 * 
 *         return (pvalue2qvalue1, pvalue2qvalue2)             # <<<<<<<<<<<<<<
 * 
 *     cpdef compute_diff_pvalues( self ):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_pvalue2qvalue1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_pvalue2qvalue1));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_pvalue2qvalue1));
  __Pyx_INCREF(((PyObject *)__pyx_v_pvalue2qvalue2));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_pvalue2qvalue2));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_pvalue2qvalue2));
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.make_treatcontrol_pq_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pvalue2qvalue1);
  __Pyx_XDECREF(__pyx_v_pvalue2qvalue2);
  __Pyx_XDECREF(__pyx_v_value_dict);
  __Pyx_XDECREF(__pyx_v_unique_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_19make_treatcontrol_pq_tables(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_18make_treatcontrol_pq_tables[] = "Make pvalue-qvalue table.\n\n        Step1: get all pvalue and length of block with this pvalue\n        Step2: Sort them\n        Step3: Apply AFDR method to adjust pvalue and get qvalue for each pvalue\n\n        Return a dictionary of {-log10pvalue:(-log10qvalue,rank,basepairs)} relationships.\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_19make_treatcontrol_pq_tables(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_treatcontrol_pq_tables (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_18make_treatcontrol_pq_tables(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2569
 * 
 * 
 *     cpdef tuple make_treatcontrol_pq_tables ( self ):             # <<<<<<<<<<<<<<
 *         """Make pvalue-qvalue table.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_18make_treatcontrol_pq_tables(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_treatcontrol_pq_tables", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->make_treatcontrol_pq_tables(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.make_treatcontrol_pq_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2630
 *         return (pvalue2qvalue1, pvalue2qvalue2)
 * 
 *     cpdef compute_diff_pvalues( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(pvalue)
 *         """
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_21compute_diff_pvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_compute_diff_pvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_i;
  int __pyx_v_pseudocount;
  PyArrayObject *__pyx_v_t1 = 0;
  PyArrayObject *__pyx_v_t2 = 0;
  PyArrayObject *__pyx_v_v = 0;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_v_sf = NULL;
  PyObject *__pyx_v_log10 = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_c1 = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_c2 = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_t1;
  __Pyx_Buffer __pyx_pybuffer_t1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_t2;
  __Pyx_Buffer __pyx_pybuffer_t2;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
  __Pyx_Buffer __pyx_pybuffer_v;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyArrayObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  long __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_diff_pvalues", 0);
  __pyx_pybuffer_t1.pybuffer.buf = NULL;
  __pyx_pybuffer_t1.refcount = 0;
  __pyx_pybuffernd_t1.data = NULL;
  __pyx_pybuffernd_t1.rcbuffer = &__pyx_pybuffer_t1;
  __pyx_pybuffer_t2.pybuffer.buf = NULL;
  __pyx_pybuffer_t2.refcount = 0;
  __pyx_pybuffernd_t2.data = NULL;
  __pyx_pybuffernd_t2.rcbuffer = &__pyx_pybuffer_t2;
  __pyx_pybuffer_v.pybuffer.buf = NULL;
  __pyx_pybuffer_v.refcount = 0;
  __pyx_pybuffernd_v.data = NULL;
  __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_54); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_21compute_diff_pvalues)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2638
 *             int pseudocount
 *             np.ndarray[np.float32_t] t1, t2, v
 *         rv = chi2(1) # a chi-squared distribution with one degree of freedom             # <<<<<<<<<<<<<<
 *         sf = rv.sf
 *         log10 = np.log10
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__chi2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_55), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rv = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2639
 *             np.ndarray[np.float32_t] t1, t2, v
 *         rv = chi2(1) # a chi-squared distribution with one degree of freedom
 *         sf = rv.sf             # <<<<<<<<<<<<<<
 *         log10 = np.log10
 *         pseudocount = self.pseudocount
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_rv, __pyx_n_s__sf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_sf = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2640
 *         rv = chi2(1) # a chi-squared distribution with one degree of freedom
 *         sf = rv.sf
 *         log10 = np.log10             # <<<<<<<<<<<<<<
 *         pseudocount = self.pseudocount
 *         for chrom in self.pos.keys():
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__log10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_log10 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2641
 *         sf = rv.sf
 *         log10 = np.log10
 *         pseudocount = self.pseudocount             # <<<<<<<<<<<<<<
 *         for chrom in self.pos.keys():
 *             t1 = self.t1[chrom]
 */
  __pyx_t_3 = __pyx_v_self->pseudocount;
  __pyx_v_pseudocount = __pyx_t_3;

  /* "MACS2/IO/cScoreTrack.pyx":2642
 *         log10 = np.log10
 *         pseudocount = self.pseudocount
 *         for chrom in self.pos.keys():             # <<<<<<<<<<<<<<
 *             t1 = self.t1[chrom]
 *             c1 = self.c1[chrom]
 */
  if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2643
 *         pseudocount = self.pseudocount
 *         for chrom in self.pos.keys():
 *             t1 = self.t1[chrom]             # <<<<<<<<<<<<<<
 *             c1 = self.c1[chrom]
 *             t2 = self.t2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t1.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t1.rcbuffer->pybuffer, (PyObject*)__pyx_v_t1, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_pybuffernd_t1.diminfo[0].strides = __pyx_pybuffernd_t1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t1.diminfo[0].shape = __pyx_pybuffernd_t1.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_t1));
    __pyx_v_t1 = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2644
 *         for chrom in self.pos.keys():
 *             t1 = self.t1[chrom]
 *             c1 = self.c1[chrom]             # <<<<<<<<<<<<<<
 *             t2 = self.t2[chrom]
 *             c2 = self.c2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->c1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_c1);
    __pyx_v_c1 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2645
 *             t1 = self.t1[chrom]
 *             c1 = self.c1[chrom]
 *             t2 = self.t2[chrom]             # <<<<<<<<<<<<<<
 *             c2 = self.c2[chrom]
 *             v = self.tlogLR[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t2.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t2.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t2.rcbuffer->pybuffer, (PyObject*)__pyx_v_t2, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_t2.diminfo[0].strides = __pyx_pybuffernd_t2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t2.diminfo[0].shape = __pyx_pybuffernd_t2.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_t2));
    __pyx_v_t2 = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2646
 *             c1 = self.c1[chrom]
 *             t2 = self.t2[chrom]
 *             c2 = self.c2[chrom]             # <<<<<<<<<<<<<<
 *             v = self.tlogLR[chrom]
 *             with cython.boundscheck(False):
 */
    if (unlikely(((PyObject *)__pyx_v_self->c2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_c2);
    __pyx_v_c2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2647
 *             t2 = self.t2[chrom]
 *             c2 = self.c2[chrom]
 *             v = self.tlogLR[chrom]             # <<<<<<<<<<<<<<
 *             with cython.boundscheck(False):
 *                 for i in range(self.pos[chrom].size):
 */
    if (unlikely(((PyObject *)__pyx_v_self->tlogLR) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tlogLR), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2649
 *             v = self.tlogLR[chrom]
 *             with cython.boundscheck(False):
 *                 for i in range(self.pos[chrom].size):             # <<<<<<<<<<<<<<
 *                     v[i] = logLR_adjusted(<int>t1[i] + pseudocount,
 *                                           <int>t2[i] + pseudocount)
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = __Pyx_PyInt_AsLong(__pyx_t_10); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_11; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "MACS2/IO/cScoreTrack.pyx":2650
 *             with cython.boundscheck(False):
 *                 for i in range(self.pos[chrom].size):
 *                     v[i] = logLR_adjusted(<int>t1[i] + pseudocount,             # <<<<<<<<<<<<<<
 *                                           <int>t2[i] + pseudocount)
 *                 self.t1vs2[chrom] = -log10(sf(2 * v / LOG10_E)).astype('float32')
 */
      __pyx_t_12 = __pyx_v_i;
      if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_pybuffernd_t1.diminfo[0].shape;

      /* "MACS2/IO/cScoreTrack.pyx":2651
 *                 for i in range(self.pos[chrom].size):
 *                     v[i] = logLR_adjusted(<int>t1[i] + pseudocount,
 *                                           <int>t2[i] + pseudocount)             # <<<<<<<<<<<<<<
 *                 self.t1vs2[chrom] = -log10(sf(2 * v / LOG10_E)).astype('float32')
 * 
 */
      __pyx_t_13 = __pyx_v_i;
      if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_t2.diminfo[0].shape;

      /* "MACS2/IO/cScoreTrack.pyx":2650
 *             with cython.boundscheck(False):
 *                 for i in range(self.pos[chrom].size):
 *                     v[i] = logLR_adjusted(<int>t1[i] + pseudocount,             # <<<<<<<<<<<<<<
 *                                           <int>t2[i] + pseudocount)
 *                 self.t1vs2[chrom] = -log10(sf(2 * v / LOG10_E)).astype('float32')
 */
      __pyx_t_14 = __pyx_v_i;
      if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
      *__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_f_5MACS2_2IO_11cScoreTrack_logLR_adjusted((((int)(*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t1.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_t1.diminfo[0].strides))) + __pyx_v_pseudocount), (((int)(*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t2.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_t2.diminfo[0].strides))) + __pyx_v_pseudocount));
    }

    /* "MACS2/IO/cScoreTrack.pyx":2652
 *                     v[i] = logLR_adjusted(<int>t1[i] + pseudocount,
 *                                           <int>t2[i] + pseudocount)
 *                 self.t1vs2[chrom] = -log10(sf(2 * v / LOG10_E)).astype('float32')             # <<<<<<<<<<<<<<
 * 
 *     cpdef compute_diff_qvalues ( self ):
 */
    __pyx_t_10 = PyNumber_Multiply(__pyx_int_2, ((PyObject *)__pyx_v_v)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__LOG10_E); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_15 = __Pyx_PyNumber_Divide(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_15);
    __pyx_t_15 = 0;
    __pyx_t_15 = PyObject_Call(__pyx_v_sf, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_15);
    __pyx_t_15 = 0;
    __pyx_t_15 = PyObject_Call(__pyx_v_log10, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_15 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_56), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Negative(__pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->t1vs2), ((PyObject *)__pyx_v_chrom), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_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_10);
  __Pyx_XDECREF(__pyx_t_15);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t2.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.compute_diff_pvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t2.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_t1);
  __Pyx_XDECREF((PyObject *)__pyx_v_t2);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XDECREF(__pyx_v_sf);
  __Pyx_XDECREF(__pyx_v_log10);
  __Pyx_XDECREF(__pyx_v_c1);
  __Pyx_XDECREF(__pyx_v_c2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_21compute_diff_pvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_20compute_diff_pvalues[] = "Compute -log_{10}(pvalue)\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_21compute_diff_pvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_diff_pvalues (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_20compute_diff_pvalues(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2630
 *         return (pvalue2qvalue1, pvalue2qvalue2)
 * 
 *     cpdef compute_diff_pvalues( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(pvalue)
 *         """
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_20compute_diff_pvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_diff_pvalues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->compute_diff_pvalues(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.compute_diff_pvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2654
 *                 self.t1vs2[chrom] = -log10(sf(2 * v / LOG10_E)).astype('float32')
 * 
 *     cpdef compute_diff_qvalues ( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(qvalue)
 *         """
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_23compute_diff_qvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_compute_diff_qvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_value_dict = 0;
  PyObject *__pyx_v_pqtable = 0;
  PyObject *__pyx_v_unique_values = 0;
  long __pyx_v_i;
  long __pyx_v_l;
  long __pyx_v_j;
  CYTHON_UNUSED long __pyx_v_prev_i;
  PyArrayObject *__pyx_v_v = 0;
  CYTHON_UNUSED long __pyx_v_pre_l;
  CYTHON_UNUSED double __pyx_v_pre_v;
  double __pyx_v_unique_v;
  double __pyx_v_q;
  double __pyx_v_pre_q;
  long __pyx_v_N;
  long __pyx_v_k;
  double __pyx_v_f;
  double __pyx_v_pvalue;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_stat = NULL;
  PyObject *__pyx_v_where_peaks = NULL;
  PyObject *__pyx_v_s_p2q = NULL;
  PyObject *__pyx_v_g = NULL;
  PyObject *__pyx_v_qvalues = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  long __pyx_t_7;
  long __pyx_t_8;
  long __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  double __pyx_t_19;
  double __pyx_t_20;
  double __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_diff_qvalues", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_57); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_23compute_diff_qvalues)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2668
 * 
 *         # make pqtable for category
 *         value_dict = {}             # <<<<<<<<<<<<<<
 *         for chrom in self.t1vs2.keys():
 *             if self.t1vs2[chrom].size == 0: continue
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_value_dict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2669
 *         # make pqtable for category
 *         value_dict = {}
 *         for chrom in self.t1vs2.keys():             # <<<<<<<<<<<<<<
 *             if self.t1vs2[chrom].size == 0: continue
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->t1vs2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2670
 *         value_dict = {}
 *         for chrom in self.t1vs2.keys():
 *             if self.t1vs2[chrom].size == 0: continue             # <<<<<<<<<<<<<<
 * 
 *             pos = self.pos[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "MACS2/IO/cScoreTrack.pyx":2672
 *             if self.t1vs2[chrom].size == 0: continue
 * 
 *             pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *             stat = self.t1vs2[chrom]
 *             where_peaks = self.where_peaks[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_pos);
    __pyx_v_pos = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2673
 * 
 *             pos = self.pos[chrom]
 *             stat = self.t1vs2[chrom]             # <<<<<<<<<<<<<<
 *             where_peaks = self.where_peaks[chrom]
 *             prev_i = -1
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_stat);
    __pyx_v_stat = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2674
 *             pos = self.pos[chrom]
 *             stat = self.t1vs2[chrom]
 *             where_peaks = self.where_peaks[chrom]             # <<<<<<<<<<<<<<
 *             prev_i = -1
 *             for j in range(where_peaks.size):
 */
    if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->where_peaks), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_where_peaks);
    __pyx_v_where_peaks = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2675
 *             stat = self.t1vs2[chrom]
 *             where_peaks = self.where_peaks[chrom]
 *             prev_i = -1             # <<<<<<<<<<<<<<
 *             for j in range(where_peaks.size):
 *                 i = where_peaks[j]
 */
    __pyx_v_prev_i = -1;

    /* "MACS2/IO/cScoreTrack.pyx":2676
 *             where_peaks = self.where_peaks[chrom]
 *             prev_i = -1
 *             for j in range(where_peaks.size):             # <<<<<<<<<<<<<<
 *                 i = where_peaks[j]
 *                 try:
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_where_peaks, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_j = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":2677
 *             prev_i = -1
 *             for j in range(where_peaks.size):
 *                 i = where_peaks[j]             # <<<<<<<<<<<<<<
 *                 try:
 * #                    if (prev_i + 1) == i:
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_where_peaks, __pyx_v_j, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_i = __pyx_t_9;

      /* "MACS2/IO/cScoreTrack.pyx":2678
 *             for j in range(where_peaks.size):
 *                 i = where_peaks[j]
 *                 try:             # <<<<<<<<<<<<<<
 * #                    if (prev_i + 1) == i:
 * #                        if pos[i]-pos[prev_i] > 1000: print pos[i], pos[i]-pos[prev_i]
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {

          /* "MACS2/IO/cScoreTrack.pyx":2683
 * #                    else:
 * #                        if pos[i]-pos[i-1] > 1000: print pos[i], pos[i]-pos[i-1], "i-"
 *                     value_dict[stat[i]] += pos[i] - pos[i - 1]             # <<<<<<<<<<<<<<
 *                 except IndexError:
 *                     if not value_dict.has_key(stat[i]):
 */
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_stat, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2683; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2683; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_pos, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2683; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_9 = (__pyx_v_i - 1);
          __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_pos, __pyx_t_9, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2683; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = PyNumber_Subtract(__pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2683; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_15); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2683; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PyDict_SetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_1, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2683; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2684
 * #                        if pos[i]-pos[i-1] > 1000: print pos[i], pos[i]-pos[i-1], "i-"
 *                     value_dict[stat[i]] += pos[i] - pos[i - 1]
 *                 except IndexError:             # <<<<<<<<<<<<<<
 *                     if not value_dict.has_key(stat[i]):
 *                         value_dict[stat[i]] = 0
 */
        __pyx_t_16 = PyErr_ExceptionMatches(__pyx_builtin_IndexError);
        if (__pyx_t_16) {
          __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.compute_diff_qvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_14, &__pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2684; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GOTREF(__pyx_t_15);

          /* "MACS2/IO/cScoreTrack.pyx":2685
 *                     value_dict[stat[i]] += pos[i] - pos[i - 1]
 *                 except IndexError:
 *                     if not value_dict.has_key(stat[i]):             # <<<<<<<<<<<<<<
 *                         value_dict[stat[i]] = 0
 *                 except KeyError:
 */
          __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_value_dict), __pyx_n_s__has_key); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_stat, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_17);
          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_13 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_18 = (!__pyx_t_6);
          if (__pyx_t_18) {

            /* "MACS2/IO/cScoreTrack.pyx":2686
 *                 except IndexError:
 *                     if not value_dict.has_key(stat[i]):
 *                         value_dict[stat[i]] = 0             # <<<<<<<<<<<<<<
 *                 except KeyError:
 *                     value_dict[stat[i]] = pos[i] - pos[i - 1]
 */
            __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_stat, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2686; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_13);
            if (PyDict_SetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_13, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2686; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            goto __pyx_L18;
          }
          __pyx_L18:;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          goto __pyx_L9_exception_handled;
        }

        /* "MACS2/IO/cScoreTrack.pyx":2687
 *                     if not value_dict.has_key(stat[i]):
 *                         value_dict[stat[i]] = 0
 *                 except KeyError:             # <<<<<<<<<<<<<<
 *                     value_dict[stat[i]] = pos[i] - pos[i - 1]
 *                 prev_i = i
 */
        __pyx_t_16 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
        if (__pyx_t_16) {
          __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.compute_diff_qvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_14, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GOTREF(__pyx_t_1);

          /* "MACS2/IO/cScoreTrack.pyx":2688
 *                         value_dict[stat[i]] = 0
 *                 except KeyError:
 *                     value_dict[stat[i]] = pos[i] - pos[i - 1]             # <<<<<<<<<<<<<<
 *                 prev_i = i
 * 
 */
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_pos, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2688; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_9 = (__pyx_v_i - 1);
          __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_pos, __pyx_t_9, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2688; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_5 = PyNumber_Subtract(__pyx_t_13, __pyx_t_17); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2688; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_stat, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2688; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_17);
          if (PyDict_SetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_17, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2688; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L9_exception_handled;
        }
        __pyx_L10_except_error:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L1_error;
        __pyx_L9_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        __pyx_L15_try_end:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":2689
 *                 except KeyError:
 *                     value_dict[stat[i]] = pos[i] - pos[i - 1]
 *                 prev_i = i             # <<<<<<<<<<<<<<
 * 
 *         N = sum(value_dict.values())
 */
      __pyx_v_prev_i = __pyx_v_i;
    }
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2691
 *                 prev_i = i
 * 
 *         N = sum(value_dict.values())             # <<<<<<<<<<<<<<
 *         k = 1                           # rank
 *         f = -log10(N)
 */
  __pyx_t_2 = PyDict_Values(__pyx_v_value_dict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_7;

  /* "MACS2/IO/cScoreTrack.pyx":2692
 * 
 *         N = sum(value_dict.values())
 *         k = 1                           # rank             # <<<<<<<<<<<<<<
 *         f = -log10(N)
 *         pre_v = -2147483647
 */
  __pyx_v_k = 1;

  /* "MACS2/IO/cScoreTrack.pyx":2693
 *         N = sum(value_dict.values())
 *         k = 1                           # rank
 *         f = -log10(N)             # <<<<<<<<<<<<<<
 *         pre_v = -2147483647
 *         pre_l = 0
 */
  __pyx_v_f = (-log10(__pyx_v_N));

  /* "MACS2/IO/cScoreTrack.pyx":2694
 *         k = 1                           # rank
 *         f = -log10(N)
 *         pre_v = -2147483647             # <<<<<<<<<<<<<<
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 */
  __pyx_v_pre_v = -2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":2695
 *         f = -log10(N)
 *         pre_v = -2147483647
 *         pre_l = 0             # <<<<<<<<<<<<<<
 *         pre_q = 2147483647              # save the previous q-value
 *         pqtable = {}#Float64HashTable()
 */
  __pyx_v_pre_l = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2696
 *         pre_v = -2147483647
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value             # <<<<<<<<<<<<<<
 *         pqtable = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 */
  __pyx_v_pre_q = 2147483647.0;

  /* "MACS2/IO/cScoreTrack.pyx":2697
 *         pre_l = 0
 *         pre_q = 2147483647              # save the previous q-value
 *         pqtable = {}#Float64HashTable()             # <<<<<<<<<<<<<<
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_pqtable = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2698
 *         pre_q = 2147483647              # save the previous q-value
 *         pqtable = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)             # <<<<<<<<<<<<<<
 *         for i in range(len(unique_values)):
 *             unique_v = unique_values[i]
 */
  __pyx_t_2 = PyDict_Keys(__pyx_v_value_dict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_14 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__reverse), __pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_14)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_unique_values = ((PyObject*)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2699
 *         pqtable = {}#Float64HashTable()
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):             # <<<<<<<<<<<<<<
 *             unique_v = unique_values[i]
 *             l = value_dict[unique_v]
 */
  if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_unique_values)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":2700
 *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
 *         for i in range(len(unique_values)):
 *             unique_v = unique_values[i]             # <<<<<<<<<<<<<<
 *             l = value_dict[unique_v]
 *             q = unique_v + (log10(k) + f)
 */
    if (unlikely(((PyObject *)__pyx_v_unique_values) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_unique_values), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_14); if (unlikely((__pyx_t_19 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_v_unique_v = __pyx_t_19;

    /* "MACS2/IO/cScoreTrack.pyx":2701
 *         for i in range(len(unique_values)):
 *             unique_v = unique_values[i]
 *             l = value_dict[unique_v]             # <<<<<<<<<<<<<<
 *             q = unique_v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 */
    __pyx_t_14 = PyFloat_FromDouble(__pyx_v_unique_v); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_14); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_8 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_l = __pyx_t_8;

    /* "MACS2/IO/cScoreTrack.pyx":2702
 *             unique_v = unique_values[i]
 *             l = value_dict[unique_v]
 *             q = unique_v + (log10(k) + f)             # <<<<<<<<<<<<<<
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pqtable[ unique_v ] = q
 */
    __pyx_v_q = (__pyx_v_unique_v + (log10(__pyx_v_k) + __pyx_v_f));

    /* "MACS2/IO/cScoreTrack.pyx":2703
 *             l = value_dict[unique_v]
 *             q = unique_v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic             # <<<<<<<<<<<<<<
 *             pqtable[ unique_v ] = q
 *             pre_v = unique_v
 */
    __pyx_t_19 = __pyx_v_q;
    __pyx_t_20 = __pyx_v_pre_q;
    if ((__pyx_t_19 < __pyx_t_20)) {
      __pyx_t_21 = __pyx_t_19;
    } else {
      __pyx_t_21 = __pyx_t_20;
    }
    __pyx_t_19 = __pyx_t_21;
    __pyx_t_8 = 0;
    if ((__pyx_t_19 > __pyx_t_8)) {
      __pyx_t_21 = __pyx_t_19;
    } else {
      __pyx_t_21 = __pyx_t_8;
    }
    __pyx_v_q = __pyx_t_21;

    /* "MACS2/IO/cScoreTrack.pyx":2704
 *             q = unique_v + (log10(k) + f)
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pqtable[ unique_v ] = q             # <<<<<<<<<<<<<<
 *             pre_v = unique_v
 *             pre_q = q
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = PyFloat_FromDouble(__pyx_v_unique_v); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    if (PyDict_SetItem(((PyObject *)__pyx_v_pqtable), __pyx_t_14, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2705
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pqtable[ unique_v ] = q
 *             pre_v = unique_v             # <<<<<<<<<<<<<<
 *             pre_q = q
 *             k+=l
 */
    __pyx_v_pre_v = __pyx_v_unique_v;

    /* "MACS2/IO/cScoreTrack.pyx":2706
 *             pqtable[ unique_v ] = q
 *             pre_v = unique_v
 *             pre_q = q             # <<<<<<<<<<<<<<
 *             k+=l
 * 
 */
    __pyx_v_pre_q = __pyx_v_q;

    /* "MACS2/IO/cScoreTrack.pyx":2707
 *             pre_v = unique_v
 *             pre_q = q
 *             k+=l             # <<<<<<<<<<<<<<
 * 
 *         # convert p to q
 */
    __pyx_v_k = (__pyx_v_k + __pyx_v_l);
  }

  /* "MACS2/IO/cScoreTrack.pyx":2713
 *         # convert pvalue2qvalue to a simple dict based on khash
 *         # khash has big advantage while checking keys for millions of times.
 *         s_p2q = Float64HashTable()             # <<<<<<<<<<<<<<
 *         for pvalue in pqtable.keys():
 *             s_p2q.set_item(pvalue,pqtable[pvalue])
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__Float64HashTable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_14 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_s_p2q = __pyx_t_14;
  __pyx_t_14 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2714
 *         # khash has big advantage while checking keys for millions of times.
 *         s_p2q = Float64HashTable()
 *         for pvalue in pqtable.keys():             # <<<<<<<<<<<<<<
 *             s_p2q.set_item(pvalue,pqtable[pvalue])
 * 
 */
  __pyx_t_14 = PyDict_Keys(__pyx_v_pqtable); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  if (PyList_CheckExact(__pyx_t_14) || PyTuple_CheckExact(__pyx_t_14)) {
    __pyx_t_2 = __pyx_t_14; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_14 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_14); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_14 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_14); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_14 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_14 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_14)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_14);
    }
    __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_14); if (unlikely((__pyx_t_21 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_v_pvalue = __pyx_t_21;

    /* "MACS2/IO/cScoreTrack.pyx":2715
 *         s_p2q = Float64HashTable()
 *         for pvalue in pqtable.keys():
 *             s_p2q.set_item(pvalue,pqtable[pvalue])             # <<<<<<<<<<<<<<
 * 
 *         g = s_p2q.get_item
 */
    __pyx_t_14 = PyObject_GetAttr(__pyx_v_s_p2q, __pyx_n_s__set_item); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_pvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_15 = PyFloat_FromDouble(__pyx_v_pvalue); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pqtable), __pyx_t_15); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2717
 *             s_p2q.set_item(pvalue,pqtable[pvalue])
 * 
 *         g = s_p2q.get_item             # <<<<<<<<<<<<<<
 * 
 *         for chrom in self.t1vs2.keys():
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_s_p2q, __pyx_n_s__get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_g = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2719
 *         g = s_p2q.get_item
 * 
 *         for chrom in self.t1vs2.keys():             # <<<<<<<<<<<<<<
 *             v = self.t1vs2[chrom][self.where_peaks[chrom]]
 *             qvalues = v.copy()
 */
  if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyDict_Keys(__pyx_v_self->t1vs2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = Py_TYPE(__pyx_t_5)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_5)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_5)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_5);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2720
 * 
 *         for chrom in self.t1vs2.keys():
 *             v = self.t1vs2[chrom][self.where_peaks[chrom]]             # <<<<<<<<<<<<<<
 *             qvalues = v.copy()
 *             for i in range(v.size):
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->where_peaks), __pyx_v_chrom); if (!__pyx_t_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_14 = PyObject_GetItem(__pyx_t_2, __pyx_t_15); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((PyArrayObject *)__pyx_t_14);
    __pyx_t_14 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2721
 *         for chrom in self.t1vs2.keys():
 *             v = self.t1vs2[chrom][self.where_peaks[chrom]]
 *             qvalues = v.copy()             # <<<<<<<<<<<<<<
 *             for i in range(v.size):
 *                 qvalues[ i ] =  g(v[ i ])
 */
    __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_v), __pyx_n_s__copy); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_15 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_v_qvalues);
    __pyx_v_qvalues = __pyx_t_15;
    __pyx_t_15 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2722
 *             v = self.t1vs2[chrom][self.where_peaks[chrom]]
 *             qvalues = v.copy()
 *             for i in range(v.size):             # <<<<<<<<<<<<<<
 *                 qvalues[ i ] =  g(v[ i ])
 *             self.diff_qvalues[chrom] = qvalues
 */
    __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_v), __pyx_n_s__size); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_15); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":2723
 *             qvalues = v.copy()
 *             for i in range(v.size):
 *                 qvalues[ i ] =  g(v[ i ])             # <<<<<<<<<<<<<<
 *             self.diff_qvalues[chrom] = qvalues
 * 
 */
      __pyx_t_15 = __Pyx_GetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      __pyx_t_15 = 0;
      __pyx_t_15 = PyObject_Call(__pyx_v_g, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      if (__Pyx_SetItemInt(__pyx_v_qvalues, __pyx_v_i, __pyx_t_15, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    }

    /* "MACS2/IO/cScoreTrack.pyx":2724
 *             for i in range(v.size):
 *                 qvalues[ i ] =  g(v[ i ])
 *             self.diff_qvalues[chrom] = qvalues             # <<<<<<<<<<<<<<
 * 
 *         return
 */
    if (unlikely(((PyObject *)__pyx_v_self->diff_qvalues) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->diff_qvalues), __pyx_v_chrom, __pyx_v_qvalues) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2726
 *             self.diff_qvalues[chrom] = qvalues
 * 
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_data_by_chr (self, str chromosome):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.compute_diff_qvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value_dict);
  __Pyx_XDECREF(__pyx_v_pqtable);
  __Pyx_XDECREF(__pyx_v_unique_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_stat);
  __Pyx_XDECREF(__pyx_v_where_peaks);
  __Pyx_XDECREF(__pyx_v_s_p2q);
  __Pyx_XDECREF(__pyx_v_g);
  __Pyx_XDECREF(__pyx_v_qvalues);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_23compute_diff_qvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_22compute_diff_qvalues[] = "Compute -log_{10}(qvalue)\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_23compute_diff_qvalues(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_diff_qvalues (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_22compute_diff_qvalues(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2654
 *                 self.t1vs2[chrom] = -log10(sf(2 * v / LOG10_E)).astype('float32')
 * 
 *     cpdef compute_diff_qvalues ( self ):             # <<<<<<<<<<<<<<
 *         """Compute -log_{10}(qvalue)
 *         """
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_22compute_diff_qvalues(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_diff_qvalues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->compute_diff_qvalues(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.compute_diff_qvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2728
 *         return
 * 
 *     cpdef get_data_by_chr (self, str chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_25get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_get_data_by_chr(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data_by_chr", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_25get_data_by_chr)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chromosome));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chromosome));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2734
 *         ([end pos],[value])
 *         """
 *         if self.data.has_key(chromosome):             # <<<<<<<<<<<<<<
 *             return self.data[chromosome]
 *         else:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__has_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_chromosome));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chromosome));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chromosome));
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":2735
 *         """
 *         if self.data.has_key(chromosome):
 *             return self.data[chromosome]             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_v_chromosome)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":2737
 *             return self.data[chromosome]
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_chr_names (self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_25get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_24get_data_by_chr[] = "Return array of counts by chromosome.\n\n        The return value is a tuple:\n        ([end pos],[value])\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_25get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data_by_chr (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chromosome), (&PyString_Type), 1, "chromosome", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_24get_data_by_chr(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), ((PyObject*)__pyx_v_chromosome));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2728
 *         return
 * 
 *     cpdef get_data_by_chr (self, str chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_24get_data_by_chr(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_chromosome) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data_by_chr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->get_data_by_chr(__pyx_v_self, __pyx_v_chromosome, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2739
 *             return None
 * 
 *     cpdef get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_27get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_get_chr_names(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_chr_names", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_27get_chr_names)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2743
 * 
 *         """
 *         l = set(self.pos.keys())             # <<<<<<<<<<<<<<
 *         return l
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2744
 *         """
 *         l = set(self.pos.keys())
 *         return l             # <<<<<<<<<<<<<<
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_l));
  __pyx_r = ((PyObject *)__pyx_v_l);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_27get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_26get_chr_names[] = "Return all the chromosome names stored.\n        \n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_27get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_chr_names (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_26get_chr_names(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2739
 *             return None
 * 
 *     cpdef get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_26get_chr_names(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_chr_names", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2746
 *         return l
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in bedGraph Format.
 * 
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_29write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_write_bedGraph(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_write_bedGraph *__pyx_optional_args) {
  short __pyx_v_column = ((short)3);
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_l;
  int __pyx_v_pre;
  int __pyx_v_i;
  int __pyx_v_p;
  float __pyx_v_pre_v;
  float __pyx_v_v;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_value = 0;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  float __pyx_t_8;
  int __pyx_t_9;
  long __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_bedGraph", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_column = __pyx_optional_args->column;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_bedGraph); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_29write_bedGraph)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_column); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_fhd);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fhd);
      __Pyx_GIVEREF(__pyx_v_fhd);
      __Pyx_INCREF(((PyObject *)__pyx_v_name));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_name));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_name));
      __Pyx_INCREF(((PyObject *)__pyx_v_description));
      PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_description));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_description));
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2762
 *             np.ndarray pos, value
 * 
 *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."             # <<<<<<<<<<<<<<
 * 
 *         write = fhd.write
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyInt_FromLong(__pyx_v_column); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_k_tuple_58), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_12));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":2764
 *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."
 * 
 *         write = fhd.write             # <<<<<<<<<<<<<<
 * 
 *         if self.trackline:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_fhd, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_write = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2766
 *         write = fhd.write
 * 
 *         if self.trackline:             # <<<<<<<<<<<<<<
 *             # this line is REQUIRED by the wiggle format for UCSC browser
 *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name, description ) )
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__trackline); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "MACS2/IO/cScoreTrack.pyx":2768
 *         if self.trackline:
 *             # this line is REQUIRED by the wiggle format for UCSC browser
 *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name, description ) )             # <<<<<<<<<<<<<<
 * 
 *         chrs = self.get_chr_names()
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_name));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_name));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_name));
    __Pyx_INCREF(((PyObject *)__pyx_v_description));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_description));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_description));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "MACS2/IO/cScoreTrack.pyx":2770
 *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name, description ) )
 * 
 *         chrs = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2771
 * 
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_1 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_6(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __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 str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2772
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]             # <<<<<<<<<<<<<<
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2773
 *         for chrom in chrs:
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]             # <<<<<<<<<<<<<<
 *             l = self.datalength[ chrom ]
 *             pre = 0
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_column, sizeof(short), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_value));
    __pyx_v_value = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2774
 *             pos = self.data[ chrom ][ 0 ]
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]             # <<<<<<<<<<<<<<
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 */
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_l = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":2775
 *             value = self.data[ chrom ][ column ]
 *             l = self.datalength[ chrom ]
 *             pre = 0             # <<<<<<<<<<<<<<
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             pre_v = value[ 0 ]
 */
    __pyx_v_pre = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2776
 *             l = self.datalength[ chrom ]
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data             # <<<<<<<<<<<<<<
 *             pre_v = value[ 0 ]
 *             for i in range( 1, l ):
 */
    __pyx_t_4 = ((__pyx_v_pos->dimensions[0]) == 0);
    if (__pyx_t_4) {
      goto __pyx_L4_continue;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "MACS2/IO/cScoreTrack.pyx":2777
 *             pre = 0
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             pre_v = value[ 0 ]             # <<<<<<<<<<<<<<
 *             for i in range( 1, l ):
 *                 v = value[ i ]
 */
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_pre_v = __pyx_t_8;

    /* "MACS2/IO/cScoreTrack.pyx":2778
 *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
 *             pre_v = value[ 0 ]
 *             for i in range( 1, l ):             # <<<<<<<<<<<<<<
 *                 v = value[ i ]
 *                 p = pos[ i-1 ]
 */
    __pyx_t_7 = __pyx_v_l;
    for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_7; __pyx_t_9+=1) {
      __pyx_v_i = __pyx_t_9;

      /* "MACS2/IO/cScoreTrack.pyx":2779
 *             pre_v = value[ 0 ]
 *             for i in range( 1, l ):
 *                 v = value[ i ]             # <<<<<<<<<<<<<<
 *                 p = pos[ i-1 ]
 *                 if abs(pre_v - v)>=1e-6:
 */
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_v = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":2780
 *             for i in range( 1, l ):
 *                 v = value[ i ]
 *                 p = pos[ i-1 ]             # <<<<<<<<<<<<<<
 *                 if abs(pre_v - v)>=1e-6:
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 */
      __pyx_t_10 = (__pyx_v_i - 1);
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), __pyx_t_10, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_p = __pyx_t_11;

      /* "MACS2/IO/cScoreTrack.pyx":2781
 *                 v = value[ i ]
 *                 p = pos[ i-1 ]
 *                 if abs(pre_v - v)>=1e-6:             # <<<<<<<<<<<<<<
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 *                     pre_v = v
 */
      __pyx_t_4 = (fabsf((__pyx_v_pre_v - __pyx_v_v)) >= 1e-6);
      if (__pyx_t_4) {

        /* "MACS2/IO/cScoreTrack.pyx":2782
 *                 p = pos[ i-1 ]
 *                 if abs(pre_v - v)>=1e-6:
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )             # <<<<<<<<<<<<<<
 *                     pre_v = v
 *                     pre = p
 */
        __pyx_t_2 = PyInt_FromLong(__pyx_v_pre); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyInt_FromLong(__pyx_v_p); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_12 = PyFloat_FromDouble(__pyx_v_pre_v); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_chrom));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_12);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_12));
        __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
        __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_12));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_12));
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2783
 *                 if abs(pre_v - v)>=1e-6:
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 *                     pre_v = v             # <<<<<<<<<<<<<<
 *                     pre = p
 *             p = pos[ -1 ]
 */
        __pyx_v_pre_v = __pyx_v_v;

        /* "MACS2/IO/cScoreTrack.pyx":2784
 *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 *                     pre_v = v
 *                     pre = p             # <<<<<<<<<<<<<<
 *             p = pos[ -1 ]
 *             # last one
 */
        __pyx_v_pre = __pyx_v_p;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":2785
 *                     pre_v = v
 *                     pre = p
 *             p = pos[ -1 ]             # <<<<<<<<<<<<<<
 *             # last one
 *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 */
    __pyx_t_12 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_12); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_v_p = __pyx_t_7;

    /* "MACS2/IO/cScoreTrack.pyx":2787
 *             p = pos[ -1 ]
 *             # last one
 *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
    __pyx_t_12 = PyInt_FromLong(__pyx_v_pre); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = PyInt_FromLong(__pyx_v_p); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pre_v); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chrom));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_12 = 0;
    __pyx_t_13 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_L4_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2789
 *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom, pre, p, pre_v ) )
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 * #    cpdef write_matrix ( self, fhd, str name, str description ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_29write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_28write_bedGraph[] = "Write all data to fhd in bedGraph Format.\n\n        fhd: a filehandler to save bedGraph.\n\n        name/description: the name and description in track line.\n\n        colname: can be 1: chip, 2: control, 3: score\n\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_29write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fhd = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_description = 0;
  short __pyx_v_column;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_bedGraph (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fhd,&__pyx_n_s__name,&__pyx_n_s__description,&__pyx_n_s__column,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fhd)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__description)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__column);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bedGraph") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fhd = values[0];
    __pyx_v_name = ((PyObject*)values[1]);
    __pyx_v_description = ((PyObject*)values[2]);
    if (values[3]) {
      __pyx_v_column = __Pyx_PyInt_AsShort(values[3]); if (unlikely((__pyx_v_column == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_column = ((short)3);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_description), (&PyString_Type), 1, "description", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_28write_bedGraph(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_v_column);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2746
 *         return l
 * 
 *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in bedGraph Format.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_28write_bedGraph(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_write_bedGraph __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_bedGraph", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.column = __pyx_v_column;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->write_bedGraph(__pyx_v_self, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2830
 * 
 *     @cython.boundscheck(False)
 *     cpdef call_diff_peaks (self, float cutoff=2.0, int min_length=50,             # <<<<<<<<<<<<<<
 *                            str score_method='q'):
 *         """This function try to find regions within which, scores
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_31call_diff_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_diff_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_diff_peaks *__pyx_optional_args) {
  float __pyx_v_cutoff = ((float)2.0);
  int __pyx_v_min_length = ((int)50);
  PyObject *__pyx_v_score_method = ((PyObject*)__pyx_n_s__q);
  int __pyx_v_i;
  int __pyx_v_first_i;
  PyObject *__pyx_v_chrom = 0;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_above_cutoff = 0;
  PyArrayObject *__pyx_v_qpos = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_t1vst2 = 0;
  PyArrayObject *__pyx_v_diff_qvalues = 0;
  PyArrayObject *__pyx_v_diff_peaks = 0;
  int __pyx_v_max_gap;
  int __pyx_v_bigN;
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_v_n_diff_peaks = NULL;
  PyObject *__pyx_v_this_start = NULL;
  PyObject *__pyx_v_this_end = NULL;
  PyObject *__pyx_v_first_start = NULL;
  PyObject *__pyx_v_last_end = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_above_cutoff;
  __Pyx_Buffer __pyx_pybuffer_above_cutoff;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_diff_peaks;
  __Pyx_Buffer __pyx_pybuffer_diff_peaks;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_diff_qvalues;
  __Pyx_Buffer __pyx_pybuffer_diff_qvalues;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
  __Pyx_Buffer __pyx_pybuffer_pos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_qpos;
  __Pyx_Buffer __pyx_pybuffer_qpos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_t1vst2;
  __Pyx_Buffer __pyx_pybuffer_t1vst2;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyArrayObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyArrayObject *__pyx_t_15 = NULL;
  long __pyx_t_16;
  long __pyx_t_17;
  long __pyx_t_18;
  __pyx_t_5MACS2_2IO_5numpy_int32_t __pyx_t_19;
  long __pyx_t_20;
  int __pyx_t_21;
  long __pyx_t_22;
  int __pyx_t_23;
  __pyx_t_5MACS2_2IO_5numpy_int32_t __pyx_t_24;
  PyObject *__pyx_t_25 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call_diff_peaks", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cutoff = __pyx_optional_args->cutoff;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_min_length = __pyx_optional_args->min_length;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_score_method = __pyx_optional_args->score_method;
        }
      }
    }
  }
  __pyx_pybuffer_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_pos.refcount = 0;
  __pyx_pybuffernd_pos.data = NULL;
  __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
  __pyx_pybuffer_above_cutoff.pybuffer.buf = NULL;
  __pyx_pybuffer_above_cutoff.refcount = 0;
  __pyx_pybuffernd_above_cutoff.data = NULL;
  __pyx_pybuffernd_above_cutoff.rcbuffer = &__pyx_pybuffer_above_cutoff;
  __pyx_pybuffer_qpos.pybuffer.buf = NULL;
  __pyx_pybuffer_qpos.refcount = 0;
  __pyx_pybuffernd_qpos.data = NULL;
  __pyx_pybuffernd_qpos.rcbuffer = &__pyx_pybuffer_qpos;
  __pyx_pybuffer_t1vst2.pybuffer.buf = NULL;
  __pyx_pybuffer_t1vst2.refcount = 0;
  __pyx_pybuffernd_t1vst2.data = NULL;
  __pyx_pybuffernd_t1vst2.rcbuffer = &__pyx_pybuffer_t1vst2;
  __pyx_pybuffer_diff_qvalues.pybuffer.buf = NULL;
  __pyx_pybuffer_diff_qvalues.refcount = 0;
  __pyx_pybuffernd_diff_qvalues.data = NULL;
  __pyx_pybuffernd_diff_qvalues.rcbuffer = &__pyx_pybuffer_diff_qvalues;
  __pyx_pybuffer_diff_peaks.pybuffer.buf = NULL;
  __pyx_pybuffer_diff_peaks.refcount = 0;
  __pyx_pybuffernd_diff_peaks.data = NULL;
  __pyx_pybuffernd_diff_peaks.rcbuffer = &__pyx_pybuffer_diff_peaks;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__call_diff_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_31call_diff_peaks)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_score_method));
      PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_score_method));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_score_method));
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2854
 *             int max_gap
 *             int n_peaks, bigN
 *         max_gap = min_length / 4             # <<<<<<<<<<<<<<
 * 
 *         chrs  = self.get_chr_names()
 */
  __pyx_v_max_gap = __Pyx_div_long(__pyx_v_min_length, 4);

  /* "MACS2/IO/cScoreTrack.pyx":2856
 *         max_gap = min_length / 4
 * 
 *         chrs  = self.get_chr_names()             # <<<<<<<<<<<<<<
 * 
 *         self.cutoff = cutoff
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2858
 *         chrs  = self.get_chr_names()
 * 
 *         self.cutoff = cutoff             # <<<<<<<<<<<<<<
 * 
 *         # qvalue conversion for each category to improve statistical power
 */
  __pyx_v_self->cutoff = __pyx_v_cutoff;

  /* "MACS2/IO/cScoreTrack.pyx":2861
 * 
 *         # qvalue conversion for each category to improve statistical power
 *         self.compute_diff_pvalues()             # <<<<<<<<<<<<<<
 *         self.compute_diff_qvalues()
 *         self.diff_scoring_method = score_method
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->compute_diff_pvalues(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2862
 *         # qvalue conversion for each category to improve statistical power
 *         self.compute_diff_pvalues()
 *         self.compute_diff_qvalues()             # <<<<<<<<<<<<<<
 *         self.diff_scoring_method = score_method
 *         if not (score_method == 'q' or score_method == 'p'):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->compute_diff_qvalues(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2863
 *         self.compute_diff_pvalues()
 *         self.compute_diff_qvalues()
 *         self.diff_scoring_method = score_method             # <<<<<<<<<<<<<<
 *         if not (score_method == 'q' or score_method == 'p'):
 *             raise NotImplementedError
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_score_method));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_score_method));
  __Pyx_GOTREF(__pyx_v_self->diff_scoring_method);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->diff_scoring_method));
  __pyx_v_self->diff_scoring_method = __pyx_v_score_method;

  /* "MACS2/IO/cScoreTrack.pyx":2864
 *         self.compute_diff_qvalues()
 *         self.diff_scoring_method = score_method
 *         if not (score_method == 'q' or score_method == 'p'):             # <<<<<<<<<<<<<<
 *             raise NotImplementedError
 * 
 */
  __pyx_t_5 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_score_method), ((PyObject *)__pyx_n_s__q), Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_5) {
    __pyx_t_6 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_score_method), ((PyObject *)__pyx_n_s__p), Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = __pyx_t_6;
  } else {
    __pyx_t_7 = __pyx_t_5;
  }
  __pyx_t_5 = (!__pyx_t_7);
  if (__pyx_t_5) {

    /* "MACS2/IO/cScoreTrack.pyx":2865
 *         self.diff_scoring_method = score_method
 *         if not (score_method == 'q' or score_method == 'p'):
 *             raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *         bigN = 1
 */
    __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "MACS2/IO/cScoreTrack.pyx":2867
 *             raise NotImplementedError
 * 
 *         bigN = 1             # <<<<<<<<<<<<<<
 *         for chrom in sorted(chrs):
 *             n_diff_peaks = 0
 */
  __pyx_v_bigN = 1;

  /* "MACS2/IO/cScoreTrack.pyx":2868
 * 
 *         bigN = 1
 *         for chrom in sorted(chrs):             # <<<<<<<<<<<<<<
 *             n_diff_peaks = 0
 *             pos = self.pos[chrom]
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_chrs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrs);
  __Pyx_GIVEREF(__pyx_v_chrs);
  __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2869
 *         bigN = 1
 *         for chrom in sorted(chrs):
 *             n_diff_peaks = 0             # <<<<<<<<<<<<<<
 *             pos = self.pos[chrom]
 *             qpos = self.where_peaks[chrom]
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_n_diff_peaks);
    __pyx_v_n_diff_peaks = __pyx_int_0;

    /* "MACS2/IO/cScoreTrack.pyx":2870
 *         for chrom in sorted(chrs):
 *             n_diff_peaks = 0
 *             pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *             qpos = self.where_peaks[chrom]
 *             t1vst2 = self.t1vs2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
      __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_11 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        }
      }
      __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2871
 *             n_diff_peaks = 0
 *             pos = self.pos[chrom]
 *             qpos = self.where_peaks[chrom]             # <<<<<<<<<<<<<<
 *             t1vst2 = self.t1vs2[chrom]
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->where_peaks), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qpos.rcbuffer->pybuffer);
      __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qpos.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_11 < 0)) {
        PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qpos.rcbuffer->pybuffer, (PyObject*)__pyx_v_qpos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12);
        }
      }
      __pyx_pybuffernd_qpos.diminfo[0].strides = __pyx_pybuffernd_qpos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qpos.diminfo[0].shape = __pyx_pybuffernd_qpos.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_qpos));
    __pyx_v_qpos = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2872
 *             pos = self.pos[chrom]
 *             qpos = self.where_peaks[chrom]
 *             t1vst2 = self.t1vs2[chrom]             # <<<<<<<<<<<<<<
 * 
 *             if score_method == 'q':
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = ((PyArrayObject *)__pyx_t_3);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1vst2.rcbuffer->pybuffer);
      __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t1vst2.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_11 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t1vst2.rcbuffer->pybuffer, (PyObject*)__pyx_v_t1vst2, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        }
      }
      __pyx_pybuffernd_t1vst2.diminfo[0].strides = __pyx_pybuffernd_t1vst2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t1vst2.diminfo[0].shape = __pyx_pybuffernd_t1vst2.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_t1vst2));
    __pyx_v_t1vst2 = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2874
 *             t1vst2 = self.t1vs2[chrom]
 * 
 *             if score_method == 'q':             # <<<<<<<<<<<<<<
 *                 diff_qvalues = self.diff_qvalues[chrom]
 *             elif score_method == 'p':
 */
    __pyx_t_5 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_score_method), ((PyObject *)__pyx_n_s__q), Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "MACS2/IO/cScoreTrack.pyx":2875
 * 
 *             if score_method == 'q':
 *                 diff_qvalues = self.diff_qvalues[chrom]             # <<<<<<<<<<<<<<
 *             elif score_method == 'p':
 *                 diff_qvalues = self.t1vs2[chrom][self.where_peaks[chrom]]
 */
      if (unlikely(((PyObject *)__pyx_v_self->diff_qvalues) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_qvalues), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer);
        __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_11 < 0)) {
          PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_v_diff_qvalues, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12);
          }
        }
        __pyx_pybuffernd_diff_qvalues.diminfo[0].strides = __pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_diff_qvalues.diminfo[0].shape = __pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_diff_qvalues));
      __pyx_v_diff_qvalues = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L6;
    }

    /* "MACS2/IO/cScoreTrack.pyx":2876
 *             if score_method == 'q':
 *                 diff_qvalues = self.diff_qvalues[chrom]
 *             elif score_method == 'p':             # <<<<<<<<<<<<<<
 *                 diff_qvalues = self.t1vs2[chrom][self.where_peaks[chrom]]
 *             else:
 */
    __pyx_t_5 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_score_method), ((PyObject *)__pyx_n_s__p), Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "MACS2/IO/cScoreTrack.pyx":2877
 *                 diff_qvalues = self.diff_qvalues[chrom]
 *             elif score_method == 'p':
 *                 diff_qvalues = self.t1vs2[chrom][self.where_peaks[chrom]]             # <<<<<<<<<<<<<<
 *             else:
 *                 raise NotImplementedError
 */
      if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->where_peaks), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = ((PyArrayObject *)__pyx_t_2);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer);
        __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_11 < 0)) {
          PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_v_diff_qvalues, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          }
        }
        __pyx_pybuffernd_diff_qvalues.diminfo[0].strides = __pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_diff_qvalues.diminfo[0].shape = __pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_diff_qvalues));
      __pyx_v_diff_qvalues = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "MACS2/IO/cScoreTrack.pyx":2879
 *                 diff_qvalues = self.t1vs2[chrom][self.where_peaks[chrom]]
 *             else:
 *                 raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *             above_cutoff = qpos[np.nonzero(diff_qvalues >= cutoff)[0]]
 */
      __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;

    /* "MACS2/IO/cScoreTrack.pyx":2881
 *                 raise NotImplementedError
 * 
 *             above_cutoff = qpos[np.nonzero(diff_qvalues >= cutoff)[0]]             # <<<<<<<<<<<<<<
 *             # we're going to recalculate this a few times, hopefully it's fast
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__nonzero); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_v_diff_qvalues), __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_qpos), __pyx_t_2); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer);
      __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_11 < 0)) {
        PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer, (PyObject*)__pyx_v_above_cutoff, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12);
        }
      }
      __pyx_pybuffernd_above_cutoff.diminfo[0].strides = __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_above_cutoff.diminfo[0].shape = __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_above_cutoff));
    __pyx_v_above_cutoff = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2885
 * 
 *             # peaks are stored as start_i, end_i (0-based, genomic half-open)
 *             diff_peaks = np.ndarray((above_cutoff.size, 3), dtype='int32')             # <<<<<<<<<<<<<<
 *             if above_cutoff.size > 1:
 *                 # Do zero manually
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_above_cutoff), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_3);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_3);
    __Pyx_GIVEREF(__pyx_int_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__int32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5MACS2_2IO_5numpy_ndarray)), ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer);
      __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_11 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer, (PyObject*)__pyx_v_diff_peaks, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        }
      }
      __pyx_pybuffernd_diff_peaks.diminfo[0].strides = __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_diff_peaks.diminfo[0].shape = __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_diff_peaks.diminfo[1].strides = __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_diff_peaks.diminfo[1].shape = __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.shape[1];
      if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_XDECREF(((PyObject *)__pyx_v_diff_peaks));
    __pyx_v_diff_peaks = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2886
 *             # peaks are stored as start_i, end_i (0-based, genomic half-open)
 *             diff_peaks = np.ndarray((above_cutoff.size, 3), dtype='int32')
 *             if above_cutoff.size > 1:             # <<<<<<<<<<<<<<
 *                 # Do zero manually
 *                 first_i = 0
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_above_cutoff), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {

      /* "MACS2/IO/cScoreTrack.pyx":2888
 *             if above_cutoff.size > 1:
 *                 # Do zero manually
 *                 first_i = 0             # <<<<<<<<<<<<<<
 *                 this_start = pos[above_cutoff[0] - 1]
 *                 this_end = pos[above_cutoff[0]]
 */
      __pyx_v_first_i = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2889
 *                 # Do zero manually
 *                 first_i = 0
 *                 this_start = pos[above_cutoff[0] - 1]             # <<<<<<<<<<<<<<
 *                 this_end = pos[above_cutoff[0]]
 *                 if this_start > this_end:
 */
      __pyx_t_16 = 0;
      if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_above_cutoff.diminfo[0].shape;
      __pyx_t_17 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_above_cutoff.diminfo[0].strides)) - 1);
      if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_pos.diminfo[0].shape;
      __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_v_this_start);
      __pyx_v_this_start = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2890
 *                 first_i = 0
 *                 this_start = pos[above_cutoff[0] - 1]
 *                 this_end = pos[above_cutoff[0]]             # <<<<<<<<<<<<<<
 *                 if this_start > this_end:
 *                     this_start = 0
 */
      __pyx_t_18 = 0;
      if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_above_cutoff.diminfo[0].shape;
      __pyx_t_19 = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_above_cutoff.diminfo[0].strides));
      if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_pos.diminfo[0].shape;
      __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_v_this_end);
      __pyx_v_this_end = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2891
 *                 this_start = pos[above_cutoff[0] - 1]
 *                 this_end = pos[above_cutoff[0]]
 *                 if this_start > this_end:             # <<<<<<<<<<<<<<
 *                     this_start = 0
 *                 first_start = this_start
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_this_start, __pyx_v_this_end, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_5) {

        /* "MACS2/IO/cScoreTrack.pyx":2892
 *                 this_end = pos[above_cutoff[0]]
 *                 if this_start > this_end:
 *                     this_start = 0             # <<<<<<<<<<<<<<
 *                 first_start = this_start
 *                 last_end = this_end
 */
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_DECREF(__pyx_v_this_start);
        __pyx_v_this_start = __pyx_int_0;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "MACS2/IO/cScoreTrack.pyx":2893
 *                 if this_start > this_end:
 *                     this_start = 0
 *                 first_start = this_start             # <<<<<<<<<<<<<<
 *                 last_end = this_end
 * #                print "%d (%d), %d (%d)" %(this_end, i, first_start, first_i)
 */
      __Pyx_INCREF(__pyx_v_this_start);
      __Pyx_XDECREF(__pyx_v_first_start);
      __pyx_v_first_start = __pyx_v_this_start;

      /* "MACS2/IO/cScoreTrack.pyx":2894
 *                     this_start = 0
 *                 first_start = this_start
 *                 last_end = this_end             # <<<<<<<<<<<<<<
 * #                print "%d (%d), %d (%d)" %(this_end, i, first_start, first_i)
 *                 for i in range(1, above_cutoff.size):
 */
      __Pyx_INCREF(__pyx_v_this_end);
      __Pyx_XDECREF(__pyx_v_last_end);
      __pyx_v_last_end = __pyx_v_this_end;

      /* "MACS2/IO/cScoreTrack.pyx":2896
 *                 last_end = this_end
 * #                print "%d (%d), %d (%d)" %(this_end, i, first_start, first_i)
 *                 for i in range(1, above_cutoff.size):             # <<<<<<<<<<<<<<
 *                     this_start = pos[above_cutoff[i] - 1]
 *                     this_end = pos[above_cutoff[i]]
 */
      __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_above_cutoff), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_20 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_20 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_20; __pyx_t_11+=1) {
        __pyx_v_i = __pyx_t_11;

        /* "MACS2/IO/cScoreTrack.pyx":2897
 * #                print "%d (%d), %d (%d)" %(this_end, i, first_start, first_i)
 *                 for i in range(1, above_cutoff.size):
 *                     this_start = pos[above_cutoff[i] - 1]             # <<<<<<<<<<<<<<
 *                     this_end = pos[above_cutoff[i]]
 *                     if first_i == -1:
 */
        __pyx_t_21 = __pyx_v_i;
        if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_above_cutoff.diminfo[0].shape;
        __pyx_t_22 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_above_cutoff.diminfo[0].strides)) - 1);
        if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_pos.diminfo[0].shape;
        __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_v_this_start);
        __pyx_v_this_start = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2898
 *                 for i in range(1, above_cutoff.size):
 *                     this_start = pos[above_cutoff[i] - 1]
 *                     this_end = pos[above_cutoff[i]]             # <<<<<<<<<<<<<<
 *                     if first_i == -1:
 *                         first_i = i
 */
        __pyx_t_23 = __pyx_v_i;
        if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_above_cutoff.diminfo[0].shape;
        __pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_above_cutoff.diminfo[0].strides));
        if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_pybuffernd_pos.diminfo[0].shape;
        __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_v_this_end);
        __pyx_v_this_end = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":2899
 *                     this_start = pos[above_cutoff[i] - 1]
 *                     this_end = pos[above_cutoff[i]]
 *                     if first_i == -1:             # <<<<<<<<<<<<<<
 *                         first_i = i
 *                         first_start = this_start
 */
        __pyx_t_5 = (__pyx_v_first_i == -1);
        if (__pyx_t_5) {

          /* "MACS2/IO/cScoreTrack.pyx":2900
 *                     this_end = pos[above_cutoff[i]]
 *                     if first_i == -1:
 *                         first_i = i             # <<<<<<<<<<<<<<
 *                         first_start = this_start
 *                     elif (this_end - last_end) > max_gap:
 */
          __pyx_v_first_i = __pyx_v_i;

          /* "MACS2/IO/cScoreTrack.pyx":2901
 *                     if first_i == -1:
 *                         first_i = i
 *                         first_start = this_start             # <<<<<<<<<<<<<<
 *                     elif (this_end - last_end) > max_gap:
 *                         if (last_end - first_start) >= min_length:
 */
          __Pyx_INCREF(__pyx_v_this_start);
          __Pyx_DECREF(__pyx_v_first_start);
          __pyx_v_first_start = __pyx_v_this_start;
          goto __pyx_L11;
        }

        /* "MACS2/IO/cScoreTrack.pyx":2902
 *                         first_i = i
 *                         first_start = this_start
 *                     elif (this_end - last_end) > max_gap:             # <<<<<<<<<<<<<<
 *                         if (last_end - first_start) >= min_length:
 *                             diff_peaks[n_diff_peaks,0] = first_i
 */
        __pyx_t_2 = PyNumber_Subtract(__pyx_v_this_end, __pyx_v_last_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = PyInt_FromLong(__pyx_v_max_gap); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_5) {

          /* "MACS2/IO/cScoreTrack.pyx":2903
 *                         first_start = this_start
 *                     elif (this_end - last_end) > max_gap:
 *                         if (last_end - first_start) >= min_length:             # <<<<<<<<<<<<<<
 *                             diff_peaks[n_diff_peaks,0] = first_i
 *                             diff_peaks[n_diff_peaks,1] = i - 1
 */
          __pyx_t_3 = PyNumber_Subtract(__pyx_v_last_end, __pyx_v_first_start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_5) {

            /* "MACS2/IO/cScoreTrack.pyx":2904
 *                     elif (this_end - last_end) > max_gap:
 *                         if (last_end - first_start) >= min_length:
 *                             diff_peaks[n_diff_peaks,0] = first_i             # <<<<<<<<<<<<<<
 *                             diff_peaks[n_diff_peaks,1] = i - 1
 *                             diff_peaks[n_diff_peaks,2] = bigN + n_diff_peaks
 */
            __pyx_t_2 = PyInt_FromLong(__pyx_v_first_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_INCREF(__pyx_v_n_diff_peaks);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_diff_peaks);
            __Pyx_GIVEREF(__pyx_v_n_diff_peaks);
            __Pyx_INCREF(__pyx_int_0);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0);
            __Pyx_GIVEREF(__pyx_int_0);
            if (PyObject_SetItem(((PyObject *)__pyx_v_diff_peaks), ((PyObject *)__pyx_t_4), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":2905
 *                         if (last_end - first_start) >= min_length:
 *                             diff_peaks[n_diff_peaks,0] = first_i
 *                             diff_peaks[n_diff_peaks,1] = i - 1             # <<<<<<<<<<<<<<
 *                             diff_peaks[n_diff_peaks,2] = bigN + n_diff_peaks
 *                             n_diff_peaks += 1
 */
            __pyx_t_2 = PyInt_FromLong((__pyx_v_i - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_INCREF(__pyx_v_n_diff_peaks);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_diff_peaks);
            __Pyx_GIVEREF(__pyx_v_n_diff_peaks);
            __Pyx_INCREF(__pyx_int_1);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1);
            __Pyx_GIVEREF(__pyx_int_1);
            if (PyObject_SetItem(((PyObject *)__pyx_v_diff_peaks), ((PyObject *)__pyx_t_4), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":2906
 *                             diff_peaks[n_diff_peaks,0] = first_i
 *                             diff_peaks[n_diff_peaks,1] = i - 1
 *                             diff_peaks[n_diff_peaks,2] = bigN + n_diff_peaks             # <<<<<<<<<<<<<<
 *                             n_diff_peaks += 1
 * #                        else:
 */
            __pyx_t_2 = PyInt_FromLong(__pyx_v_bigN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_v_n_diff_peaks); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_v_n_diff_peaks);
            PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_n_diff_peaks);
            __Pyx_GIVEREF(__pyx_v_n_diff_peaks);
            __Pyx_INCREF(__pyx_int_2);
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_2);
            __Pyx_GIVEREF(__pyx_int_2);
            if (PyObject_SetItem(((PyObject *)__pyx_v_diff_peaks), ((PyObject *)__pyx_t_2), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":2907
 *                             diff_peaks[n_diff_peaks,1] = i - 1
 *                             diff_peaks[n_diff_peaks,2] = bigN + n_diff_peaks
 *                             n_diff_peaks += 1             # <<<<<<<<<<<<<<
 * #                        else:
 * #                            print "Rejectedd", pos[above_cutoff[first_i]-1], pos[above_cutoff[i - 1]]
 */
            __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_n_diff_peaks, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_v_n_diff_peaks);
            __pyx_v_n_diff_peaks = __pyx_t_4;
            __pyx_t_4 = 0;
            goto __pyx_L12;
          }
          __pyx_L12:;

          /* "MACS2/IO/cScoreTrack.pyx":2910
 * #                        else:
 * #                            print "Rejectedd", pos[above_cutoff[first_i]-1], pos[above_cutoff[i - 1]]
 *                         first_i = -1             # <<<<<<<<<<<<<<
 *                     last_end = this_end
 * 
 */
          __pyx_v_first_i = -1;
          goto __pyx_L11;
        }
        __pyx_L11:;

        /* "MACS2/IO/cScoreTrack.pyx":2911
 * #                            print "Rejectedd", pos[above_cutoff[first_i]-1], pos[above_cutoff[i - 1]]
 *                         first_i = -1
 *                     last_end = this_end             # <<<<<<<<<<<<<<
 * 
 *                 if not first_i == -1:
 */
        __Pyx_INCREF(__pyx_v_this_end);
        __Pyx_DECREF(__pyx_v_last_end);
        __pyx_v_last_end = __pyx_v_this_end;
      }

      /* "MACS2/IO/cScoreTrack.pyx":2913
 *                     last_end = this_end
 * 
 *                 if not first_i == -1:             # <<<<<<<<<<<<<<
 *                     if last_end - first_start >= min_length:
 *                         diff_peaks[n_diff_peaks,0] = first_i
 */
      __pyx_t_5 = (!(__pyx_v_first_i == -1));
      if (__pyx_t_5) {

        /* "MACS2/IO/cScoreTrack.pyx":2914
 * 
 *                 if not first_i == -1:
 *                     if last_end - first_start >= min_length:             # <<<<<<<<<<<<<<
 *                         diff_peaks[n_diff_peaks,0] = first_i
 *                         diff_peaks[n_diff_peaks,1] = i
 */
        __pyx_t_4 = PyNumber_Subtract(__pyx_v_last_end, __pyx_v_first_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyInt_FromLong(__pyx_v_min_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_5) {

          /* "MACS2/IO/cScoreTrack.pyx":2915
 *                 if not first_i == -1:
 *                     if last_end - first_start >= min_length:
 *                         diff_peaks[n_diff_peaks,0] = first_i             # <<<<<<<<<<<<<<
 *                         diff_peaks[n_diff_peaks,1] = i
 *                         diff_peaks[n_diff_peaks,2] = bigN + n_diff_peaks
 */
          __pyx_t_3 = PyInt_FromLong(__pyx_v_first_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_n_diff_peaks);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_n_diff_peaks);
          __Pyx_GIVEREF(__pyx_v_n_diff_peaks);
          __Pyx_INCREF(__pyx_int_0);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
          __Pyx_GIVEREF(__pyx_int_0);
          if (PyObject_SetItem(((PyObject *)__pyx_v_diff_peaks), ((PyObject *)__pyx_t_2), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":2916
 *                     if last_end - first_start >= min_length:
 *                         diff_peaks[n_diff_peaks,0] = first_i
 *                         diff_peaks[n_diff_peaks,1] = i             # <<<<<<<<<<<<<<
 *                         diff_peaks[n_diff_peaks,2] = bigN + n_diff_peaks
 *                         n_diff_peaks += 1
 */
          __pyx_t_3 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_n_diff_peaks);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_n_diff_peaks);
          __Pyx_GIVEREF(__pyx_v_n_diff_peaks);
          __Pyx_INCREF(__pyx_int_1);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1);
          __Pyx_GIVEREF(__pyx_int_1);
          if (PyObject_SetItem(((PyObject *)__pyx_v_diff_peaks), ((PyObject *)__pyx_t_2), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":2917
 *                         diff_peaks[n_diff_peaks,0] = first_i
 *                         diff_peaks[n_diff_peaks,1] = i
 *                         diff_peaks[n_diff_peaks,2] = bigN + n_diff_peaks             # <<<<<<<<<<<<<<
 *                         n_diff_peaks += 1
 * 
 */
          __pyx_t_3 = PyInt_FromLong(__pyx_v_bigN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_n_diff_peaks); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_v_n_diff_peaks);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n_diff_peaks);
          __Pyx_GIVEREF(__pyx_v_n_diff_peaks);
          __Pyx_INCREF(__pyx_int_2);
          PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_2);
          __Pyx_GIVEREF(__pyx_int_2);
          if (PyObject_SetItem(((PyObject *)__pyx_v_diff_peaks), ((PyObject *)__pyx_t_3), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":2918
 *                         diff_peaks[n_diff_peaks,1] = i
 *                         diff_peaks[n_diff_peaks,2] = bigN + n_diff_peaks
 *                         n_diff_peaks += 1             # <<<<<<<<<<<<<<
 * 
 *             bigN += n_diff_peaks
 */
          __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_n_diff_peaks, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_v_n_diff_peaks);
          __pyx_v_n_diff_peaks = __pyx_t_2;
          __pyx_t_2 = 0;
          goto __pyx_L14;
        }
        __pyx_L14:;
        goto __pyx_L13;
      }
      __pyx_L13:;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "MACS2/IO/cScoreTrack.pyx":2920
 *                         n_diff_peaks += 1
 * 
 *             bigN += n_diff_peaks             # <<<<<<<<<<<<<<
 *             diff_peaks.resize((n_diff_peaks, 3), refcheck=False)
 * #            print n_diff_peaks, "diff peaks"
 */
    __pyx_t_2 = PyInt_FromLong(__pyx_v_bigN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_n_diff_peaks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_bigN = __pyx_t_11;

    /* "MACS2/IO/cScoreTrack.pyx":2921
 * 
 *             bigN += n_diff_peaks
 *             diff_peaks.resize((n_diff_peaks, 3), refcheck=False)             # <<<<<<<<<<<<<<
 * #            print n_diff_peaks, "diff peaks"
 *             self.diff_peaks[chrom] = diff_peaks
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_diff_peaks), __pyx_n_s__resize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_n_diff_peaks);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_n_diff_peaks);
    __Pyx_GIVEREF(__pyx_v_n_diff_peaks);
    __Pyx_INCREF(__pyx_int_3);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_3);
    __Pyx_GIVEREF(__pyx_int_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_25 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_25);
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
    __pyx_t_25 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_25);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2923
 *             diff_peaks.resize((n_diff_peaks, 3), refcheck=False)
 * #            print n_diff_peaks, "diff peaks"
 *             self.diff_peaks[chrom] = diff_peaks             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_self->diff_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_self->diff_peaks), ((PyObject *)__pyx_v_chrom), ((PyObject *)__pyx_v_diff_peaks)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2924
 * #            print n_diff_peaks, "diff peaks"
 *             self.diff_peaks[chrom] = diff_peaks
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cpdef print_some_peaks(self, int max = 10):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_25);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qpos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1vst2.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.call_diff_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qpos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1vst2.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff);
  __Pyx_XDECREF((PyObject *)__pyx_v_qpos);
  __Pyx_XDECREF((PyObject *)__pyx_v_t1vst2);
  __Pyx_XDECREF((PyObject *)__pyx_v_diff_qvalues);
  __Pyx_XDECREF((PyObject *)__pyx_v_diff_peaks);
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF(__pyx_v_n_diff_peaks);
  __Pyx_XDECREF(__pyx_v_this_start);
  __Pyx_XDECREF(__pyx_v_this_end);
  __Pyx_XDECREF(__pyx_v_first_start);
  __Pyx_XDECREF(__pyx_v_last_end);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_31call_diff_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_30call_diff_peaks[] = "This function try to find regions within which, scores\n        are continuously higher than a given cutoff.\n\n        This function is NOT using sliding-windows. Instead, any\n        regions in bedGraph above certain cutoff will be detected,\n        then merged if the gap between nearby two regions are below\n        max_gap. After this, peak is reported if its length is above\n        min_length.\n\n        cutoff:  cutoff of value, default 3. For log10 LR, it means 1000 or -1000.\n        min_length :  minimum peak length, default 200.\n        gap   :  maximum gap to merge nearby peaks, default 50.\n        ptrack:  an optional track for pileup heights. If it's not None, use it to find summits. Otherwise, use self/scoreTrack.\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_31call_diff_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_cutoff;
  int __pyx_v_min_length;
  PyObject *__pyx_v_score_method = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_diff_peaks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cutoff,&__pyx_n_s__min_length,&__pyx_n_s__score_method,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject*)__pyx_n_s__q);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cutoff);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_length);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__score_method);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "call_diff_peaks") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_cutoff = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_cutoff == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "MACS2/IO/cScoreTrack.pyx":2830
 * 
 *     @cython.boundscheck(False)
 *     cpdef call_diff_peaks (self, float cutoff=2.0, int min_length=50,             # <<<<<<<<<<<<<<
 *                            str score_method='q'):
 *         """This function try to find regions within which, scores
 */
      __pyx_v_cutoff = ((float)2.0);
    }
    if (values[1]) {
      __pyx_v_min_length = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_min_length == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_length = ((int)50);
    }
    __pyx_v_score_method = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_diff_peaks", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.call_diff_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_score_method), (&PyString_Type), 1, "score_method", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_30call_diff_peaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_min_length, __pyx_v_score_method);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_30call_diff_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, float __pyx_v_cutoff, int __pyx_v_min_length, PyObject *__pyx_v_score_method) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_diff_peaks __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("call_diff_peaks", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.cutoff = __pyx_v_cutoff;
  __pyx_t_2.min_length = __pyx_v_min_length;
  __pyx_t_2.score_method = __pyx_v_score_method;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->call_diff_peaks(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.call_diff_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2926
 *         return
 * 
 *     cpdef print_some_peaks(self, int max = 10):             # <<<<<<<<<<<<<<
 *         """for testing only
 *         """
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_33print_some_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_print_some_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_print_some_peaks *__pyx_optional_args) {
  int __pyx_v_max = ((int)10);
  int __pyx_v_end;
  int __pyx_v_i;
  PyObject *__pyx_v_chrom = 0;
  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 *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_some_peaks", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_max = __pyx_optional_args->max;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_some_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_33print_some_peaks)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_max); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2932
 *             int start, end, i
 *             str chrom
 *         for chrom in sorted(self.diff_peaks.keys()):             # <<<<<<<<<<<<<<
 *             i = 0
 *             for end in self.where_peaks[chrom]:
 */
  if (unlikely(((PyObject *)__pyx_v_self->diff_peaks) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->diff_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2933
 *             str chrom
 *         for chrom in sorted(self.diff_peaks.keys()):
 *             i = 0             # <<<<<<<<<<<<<<
 *             for end in self.where_peaks[chrom]:
 *                 i += 1
 */
    __pyx_v_i = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2934
 *         for chrom in sorted(self.diff_peaks.keys()):
 *             i = 0
 *             for end in self.where_peaks[chrom]:             # <<<<<<<<<<<<<<
 *                 i += 1
 *                 if i == max: break
 */
    if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->where_peaks), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_end = __pyx_t_8;

      /* "MACS2/IO/cScoreTrack.pyx":2935
 *             i = 0
 *             for end in self.where_peaks[chrom]:
 *                 i += 1             # <<<<<<<<<<<<<<
 *                 if i == max: break
 *                 print '%s\t%d (%d)' % (chrom, self.pos[chrom][end], end)
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "MACS2/IO/cScoreTrack.pyx":2936
 *             for end in self.where_peaks[chrom]:
 *                 i += 1
 *                 if i == max: break             # <<<<<<<<<<<<<<
 *                 print '%s\t%d (%d)' % (chrom, self.pos[chrom][end], end)
 * #            i = self.pos[chrom].searchsorted(49551000)
 */
      __pyx_t_9 = (__pyx_v_i == __pyx_v_max);
      if (__pyx_t_9) {
        goto __pyx_L6_break;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "MACS2/IO/cScoreTrack.pyx":2937
 *                 i += 1
 *                 if i == max: break
 *                 print '%s\t%d (%d)' % (chrom, self.pos[chrom][end], end)             # <<<<<<<<<<<<<<
 * #            i = self.pos[chrom].searchsorted(49551000)
 * #            j = self.pos[chrom].searchsorted(49553000)
 */
      if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_end, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
      PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_chrom));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_10 = 0;
      __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_59), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    }
    __pyx_L6_break:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2944
 * #                print self.pos[chrom][x], self.t1[chrom][x], self.c1[chrom][x], self.tvsc1[chrom][x], \
 * #                self.t2[chrom][x], self.c2[chrom][x], self.tvsc2[chrom][x]
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cpdef print_diff_peaks(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.print_some_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_33print_some_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_32print_some_peaks[] = "for testing only\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_33print_some_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_max;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_some_peaks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__max,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "print_some_peaks") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_max = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_max == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_max = ((int)10);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("print_some_peaks", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.print_some_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_32print_some_peaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), __pyx_v_max);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2926
 *         return
 * 
 *     cpdef print_some_peaks(self, int max = 10):             # <<<<<<<<<<<<<<
 *         """for testing only
 *         """
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_32print_some_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_v_max) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_print_some_peaks __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_some_peaks", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.max = __pyx_v_max;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->print_some_peaks(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.print_some_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2946
 *         return
 * 
 *     cpdef print_diff_peaks(self):             # <<<<<<<<<<<<<<
 *         """ for testing only
 *         """
 */

static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_35print_diff_peaks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_print_diff_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_qpos = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_above_cutoff = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_diff_peaks", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_diff_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_35print_diff_peaks)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2952
 *             int start, end
 *             str chrom
 *         for chrom in sorted(self.diff_peaks.keys()):             # <<<<<<<<<<<<<<
 *             qpos = self.where_peaks[chrom]
 *             for i, j in self.diff_peaks[chrom]:
 */
  if (unlikely(((PyObject *)__pyx_v_self->diff_peaks) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->diff_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2953
 *             str chrom
 *         for chrom in sorted(self.diff_peaks.keys()):
 *             qpos = self.where_peaks[chrom]             # <<<<<<<<<<<<<<
 *             for i, j in self.diff_peaks[chrom]:
 *                 above_cutoff = qpos[np.nonzero(self.diff_qvalues[chrom] >= self.cutoff)[0]]
 */
    if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->where_peaks), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_qpos);
    __pyx_v_qpos = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2954
 *         for chrom in sorted(self.diff_peaks.keys()):
 *             qpos = self.where_peaks[chrom]
 *             for i, j in self.diff_peaks[chrom]:             # <<<<<<<<<<<<<<
 *                 above_cutoff = qpos[np.nonzero(self.diff_qvalues[chrom] >= self.cutoff)[0]]
 *                 print '%s\t%d\t%d' % (chrom,
 */
    if (unlikely(((PyObject *)__pyx_v_self->diff_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_peaks), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_1)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
        index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L8_unpacking_done;
        __pyx_L7_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L8_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_8;
      __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_v_j);
      __pyx_v_j = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2955
 *             qpos = self.where_peaks[chrom]
 *             for i, j in self.diff_peaks[chrom]:
 *                 above_cutoff = qpos[np.nonzero(self.diff_qvalues[chrom] >= self.cutoff)[0]]             # <<<<<<<<<<<<<<
 *                 print '%s\t%d\t%d' % (chrom,
 *                                       self.pos[chrom][above_cutoff[i]-1],
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__nonzero); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(((PyObject *)__pyx_v_self->diff_qvalues) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_qvalues), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_8, Py_GE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_10, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_GetItem(__pyx_v_qpos, __pyx_t_8); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_v_above_cutoff);
      __pyx_v_above_cutoff = __pyx_t_10;
      __pyx_t_10 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2957
 *                 above_cutoff = qpos[np.nonzero(self.diff_qvalues[chrom] >= self.cutoff)[0]]
 *                 print '%s\t%d\t%d' % (chrom,
 *                                       self.pos[chrom][above_cutoff[i]-1],             # <<<<<<<<<<<<<<
 *                                       self.pos[chrom][above_cutoff[j]] )
 *         return
 */
      if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_10 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_8 = PyObject_GetItem(__pyx_v_above_cutoff, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_GetItem(__pyx_t_10, __pyx_t_9); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2958
 *                 print '%s\t%d\t%d' % (chrom,
 *                                       self.pos[chrom][above_cutoff[i]-1],
 *                                       self.pos[chrom][above_cutoff[j]] )             # <<<<<<<<<<<<<<
 *         return
 * 
 */
      if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyObject_GetItem(__pyx_v_above_cutoff, __pyx_v_j); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = PyObject_GetItem(__pyx_t_9, __pyx_t_10); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
      PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_chrom));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_8 = 0;
      __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_60), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2959
 *                                       self.pos[chrom][above_cutoff[i]-1],
 *                                       self.pos[chrom][above_cutoff[j]] )
 *         return             # <<<<<<<<<<<<<<
 * 
 *     def write_peaks(self, xls=None, bed=None, name_prefix="%s_peak_", name="MACS",
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.print_diff_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_qpos);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_above_cutoff);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_35print_diff_peaks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_34print_diff_peaks[] = " for testing only\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_35print_diff_peaks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_diff_peaks (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_34print_diff_peaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":2946
 *         return
 * 
 *     cpdef print_diff_peaks(self):             # <<<<<<<<<<<<<<
 *         """ for testing only
 *         """
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_34print_diff_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_diff_peaks", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->print_diff_peaks(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.print_diff_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_37write_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_36write_peaks[] = "Save the peak results in a tab-delimited plain text file\n        with suffix .xls.\n        \n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_37write_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xls = 0;
  PyObject *__pyx_v_bed = 0;
  PyObject *__pyx_v_name_prefix = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_description = 0;
  PyObject *__pyx_v_trackline = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_peaks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__xls,&__pyx_n_s__bed,&__pyx_n_s__name_prefix,&__pyx_n_s__name,&__pyx_n_s__description,&__pyx_n_s__trackline,0};
    PyObject* values[6] = {0,0,0,0,0,0};

    /* "MACS2/IO/cScoreTrack.pyx":2961
 *         return
 * 
 *     def write_peaks(self, xls=None, bed=None, name_prefix="%s_peak_", name="MACS",             # <<<<<<<<<<<<<<
 *                     description='%s', trackline=True):
 *         """Save the peak results in a tab-delimited plain text file
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_kp_s_61);
    values[3] = ((PyObject *)__pyx_n_s__MACS);
    values[4] = ((PyObject *)__pyx_kp_s_62);
    values[5] = __pyx_k_63;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xls);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bed);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name_prefix);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__description);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__trackline);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_peaks") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2961; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xls = values[0];
    __pyx_v_bed = values[1];
    __pyx_v_name_prefix = values[2];
    __pyx_v_name = values[3];
    __pyx_v_description = values[4];
    __pyx_v_trackline = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_peaks", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2961; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_36write_peaks(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), __pyx_v_xls, __pyx_v_bed, __pyx_v_name_prefix, __pyx_v_name, __pyx_v_description, __pyx_v_trackline);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_36write_peaks(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_xls, PyObject *__pyx_v_bed, PyObject *__pyx_v_name_prefix, PyObject *__pyx_v_name, PyObject *__pyx_v_description, PyObject *__pyx_v_trackline) {
  PyObject *__pyx_v_xlswrite = NULL;
  PyObject *__pyx_v_bedwrite = NULL;
  PyObject *__pyx_v_tc_method = NULL;
  PyObject *__pyx_v_peakprefix = NULL;
  PyObject *__pyx_v_desc = NULL;
  PyObject *__pyx_v_trackcontents = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_log10 = NULL;
  PyObject *__pyx_v_log2 = NULL;
  PyObject *__pyx_v_median = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_t1 = NULL;
  PyObject *__pyx_v_t2 = NULL;
  PyObject *__pyx_v_c1 = NULL;
  PyObject *__pyx_v_c2 = NULL;
  PyObject *__pyx_v_tvsc1 = NULL;
  PyObject *__pyx_v_tvsc2 = NULL;
  PyObject *__pyx_v_diff_pvalues = NULL;
  PyObject *__pyx_v_diff_qvalues = NULL;
  PyObject *__pyx_v_diff_logLR = NULL;
  PyObject *__pyx_v_qpos = NULL;
  PyObject *__pyx_v_above_cutoff = NULL;
  PyObject *__pyx_v_first_i = NULL;
  PyObject *__pyx_v_last_i = NULL;
  PyObject *__pyx_v_n_peak = NULL;
  PyObject *__pyx_v_start_i = NULL;
  PyObject *__pyx_v_end_i = NULL;
  PyObject *__pyx_v_pos_start = NULL;
  PyObject *__pyx_v_pos_end = NULL;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_v_t1s = NULL;
  PyObject *__pyx_v_c1s = NULL;
  PyObject *__pyx_v_t2s = NULL;
  PyObject *__pyx_v_c2s = NULL;
  PyObject *__pyx_v_fold_changes = NULL;
  PyObject *__pyx_v_log2_fold_change = NULL;
  PyObject *__pyx_v_this_dpvalue = NULL;
  PyObject *__pyx_v_this_dqvalue = NULL;
  PyObject *__pyx_v_this_dlogLR = NULL;
  PyObject *__pyx_v_peakname = NULL;
  PyObject *__pyx_v_max_t1 = NULL;
  PyObject *__pyx_v_max_c1 = NULL;
  PyObject *__pyx_v_log2_fe1 = NULL;
  PyObject *__pyx_v_max_t2 = NULL;
  PyObject *__pyx_v_max_c2 = NULL;
  PyObject *__pyx_v_log2_fe2 = NULL;
  PyObject *__pyx_v_tc_value1 = NULL;
  PyObject *__pyx_v_tc_value2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *(*__pyx_t_16)(PyObject *);
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_peaks", 0);

  /* "MACS2/IO/cScoreTrack.pyx":2967
 * 
 *         """
 *         if self.has_peakio:             # <<<<<<<<<<<<<<
 *             return self.write_peaks2(xls=xls, bed=bed, name_prefix=name_prefix,
 *                               name=name, description=description,
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__has_peakio); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "MACS2/IO/cScoreTrack.pyx":2968
 *         """
 *         if self.has_peakio:
 *             return self.write_peaks2(xls=xls, bed=bed, name_prefix=name_prefix,             # <<<<<<<<<<<<<<
 *                               name=name, description=description,
 *                               trackline=trackline)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__write_peaks2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__xls), __pyx_v_xls) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__bed), __pyx_v_bed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__name_prefix), __pyx_v_name_prefix) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "MACS2/IO/cScoreTrack.pyx":2969
 *         if self.has_peakio:
 *             return self.write_peaks2(xls=xls, bed=bed, name_prefix=name_prefix,
 *                               name=name, description=description,             # <<<<<<<<<<<<<<
 *                               trackline=trackline)
 *         if xls is not None:
 */
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__name), __pyx_v_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__description), __pyx_v_description) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "MACS2/IO/cScoreTrack.pyx":2970
 *             return self.write_peaks2(xls=xls, bed=bed, name_prefix=name_prefix,
 *                               name=name, description=description,
 *                               trackline=trackline)             # <<<<<<<<<<<<<<
 *         if xls is not None:
 *             xlswrite = xls.write
 */
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__trackline), __pyx_v_trackline) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "MACS2/IO/cScoreTrack.pyx":2971
 *                               name=name, description=description,
 *                               trackline=trackline)
 *         if xls is not None:             # <<<<<<<<<<<<<<
 *             xlswrite = xls.write
 *         else:
 */
  __pyx_t_2 = (__pyx_v_xls != Py_None);
  if (__pyx_t_2) {

    /* "MACS2/IO/cScoreTrack.pyx":2972
 *                               trackline=trackline)
 *         if xls is not None:
 *             xlswrite = xls.write             # <<<<<<<<<<<<<<
 *         else:
 *             xlswrite = do_nothing
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_xls, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_xlswrite = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":2974
 *             xlswrite = xls.write
 *         else:
 *             xlswrite = do_nothing             # <<<<<<<<<<<<<<
 *         if bed is not None:
 *             bedwrite = bed.write
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__do_nothing); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_xlswrite = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L4:;

  /* "MACS2/IO/cScoreTrack.pyx":2975
 *         else:
 *             xlswrite = do_nothing
 *         if bed is not None:             # <<<<<<<<<<<<<<
 *             bedwrite = bed.write
 *         else:
 */
  __pyx_t_2 = (__pyx_v_bed != Py_None);
  if (__pyx_t_2) {

    /* "MACS2/IO/cScoreTrack.pyx":2976
 *             xlswrite = do_nothing
 *         if bed is not None:
 *             bedwrite = bed.write             # <<<<<<<<<<<<<<
 *         else:
 *             bedwrite = do_nothing
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_bed, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_bedwrite = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":2978
 *             bedwrite = bed.write
 *         else:
 *             bedwrite = do_nothing             # <<<<<<<<<<<<<<
 *         xlswrite("# values are maxmimum in region\n")
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__do_nothing); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_bedwrite = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L5:;

  /* "MACS2/IO/cScoreTrack.pyx":2979
 *         else:
 *             bedwrite = do_nothing
 *         xlswrite("# values are maxmimum in region\n")             # <<<<<<<<<<<<<<
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xlswrite("# log10_fold_change is positive if t1 > t2\n")
 */
  __pyx_t_4 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_65), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2980
 *             bedwrite = do_nothing
 *         xlswrite("# values are maxmimum in region\n")
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth             # <<<<<<<<<<<<<<
 *         xlswrite("# log10_fold_change is positive if t1 > t2\n")
 *         tc_method = self.track_scoring_method
 */
  __pyx_t_4 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_67), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->cond1_depth); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Remainder(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2981
 *         xlswrite("# values are maxmimum in region\n")
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xlswrite("# log10_fold_change is positive if t1 > t2\n")             # <<<<<<<<<<<<<<
 *         tc_method = self.track_scoring_method
 *         xlswrite("\t".join(("chr", "start", "end", "length",
 */
  __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_69), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2982
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xlswrite("# log10_fold_change is positive if t1 > t2\n")
 *         tc_method = self.track_scoring_method             # <<<<<<<<<<<<<<
 *         xlswrite("\t".join(("chr", "start", "end", "length",
 *                          "log2.fold.change", "-log10.diff.pvalue",
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->track_scoring_method);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_tc_method = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2983
 *         xlswrite("# log10_fold_change is positive if t1 > t2\n")
 *         tc_method = self.track_scoring_method
 *         xlswrite("\t".join(("chr", "start", "end", "length",             # <<<<<<<<<<<<<<
 *                          "log2.fold.change", "-log10.diff.pvalue",
 *                          "-log10.diff.qvalue",
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_70), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "MACS2/IO/cScoreTrack.pyx":2988
 *                          "diff.log10LR", "diff.peakname",
 *                          "treat1", "control1", "log2.fold.enrichment1",
 *                          "-log10.%svalue1" % tc_method,             # <<<<<<<<<<<<<<
 *                          "treat2", "control2", "log2.fold.enrichment2",
 *                          "-log10.%svalue2" % tc_method))+"\n")
 */
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_77), __pyx_v_tc_method); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));

  /* "MACS2/IO/cScoreTrack.pyx":2990
 *                          "-log10.%svalue1" % tc_method,
 *                          "treat2", "control2", "log2.fold.enrichment2",
 *                          "-log10.%svalue2" % tc_method))+"\n")             # <<<<<<<<<<<<<<
 * 
 *         try: peakprefix = name_prefix % name
 */
  __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_79), __pyx_v_tc_method); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_5 = PyTuple_New(17); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chr));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__chr));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chr));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__start));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_n_s__start));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__start));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__end));
  PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_n_s__end));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__end));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__length));
  PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_n_s__length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__length));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_71));
  PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_kp_s_71));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_71));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_72));
  PyTuple_SET_ITEM(__pyx_t_5, 5, ((PyObject *)__pyx_kp_s_72));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_72));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_73));
  PyTuple_SET_ITEM(__pyx_t_5, 6, ((PyObject *)__pyx_kp_s_73));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_73));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_74));
  PyTuple_SET_ITEM(__pyx_t_5, 7, ((PyObject *)__pyx_kp_s_74));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_74));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_75));
  PyTuple_SET_ITEM(__pyx_t_5, 8, ((PyObject *)__pyx_kp_s_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_75));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__treat1));
  PyTuple_SET_ITEM(__pyx_t_5, 9, ((PyObject *)__pyx_n_s__treat1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__treat1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__control1));
  PyTuple_SET_ITEM(__pyx_t_5, 10, ((PyObject *)__pyx_n_s__control1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__control1));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_76));
  PyTuple_SET_ITEM(__pyx_t_5, 11, ((PyObject *)__pyx_kp_s_76));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_76));
  PyTuple_SET_ITEM(__pyx_t_5, 12, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__treat2));
  PyTuple_SET_ITEM(__pyx_t_5, 13, ((PyObject *)__pyx_n_s__treat2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__treat2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__control2));
  PyTuple_SET_ITEM(__pyx_t_5, 14, ((PyObject *)__pyx_n_s__control2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__control2));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_78));
  PyTuple_SET_ITEM(__pyx_t_5, 15, ((PyObject *)__pyx_kp_s_78));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_78));
  PyTuple_SET_ITEM(__pyx_t_5, 16, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_kp_s_80)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2992
 *                          "-log10.%svalue2" % tc_method))+"\n")
 * 
 *         try: peakprefix = name_prefix % name             # <<<<<<<<<<<<<<
 *         except: peakprefix = name_prefix
 *         try: desc = description % name
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {
      __pyx_t_4 = PyNumber_Remainder(__pyx_v_name_prefix, __pyx_v_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2992; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_peakprefix = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L13_try_end;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2993
 * 
 *         try: peakprefix = name_prefix % name
 *         except: peakprefix = name_prefix             # <<<<<<<<<<<<<<
 *         try: desc = description % name
 *         except: desc = description
 */
    /*except:*/ {
      __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2993; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_name_prefix);
      __Pyx_XDECREF(__pyx_v_peakprefix);
      __pyx_v_peakprefix = __pyx_v_name_prefix;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L7_exception_handled;
    }
    __pyx_L8_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L7_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L13_try_end:;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2994
 *         try: peakprefix = name_prefix % name
 *         except: peakprefix = name_prefix
 *         try: desc = description % name             # <<<<<<<<<<<<<<
 *         except: desc = description
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {
      __pyx_t_1 = PyNumber_Remainder(__pyx_v_description, __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2994; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_desc = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L23_try_end;
    __pyx_L16_error:;
    __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;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":2995
 *         except: peakprefix = name_prefix
 *         try: desc = description % name
 *         except: desc = description             # <<<<<<<<<<<<<<
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))
 *         if trackline:
 */
    /*except:*/ {
      __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2995; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_description);
      __Pyx_XDECREF(__pyx_v_desc);
      __pyx_v_desc = __pyx_v_description;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L17_exception_handled;
    }
    __pyx_L18_except_error:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L17_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
    __pyx_L23_try_end:;
  }

  /* "MACS2/IO/cScoreTrack.pyx":2996
 *         try: desc = description % name
 *         except: desc = description
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))             # <<<<<<<<<<<<<<
 *         if trackline:
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_name, __pyx_n_s__replace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_83), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_desc, __pyx_n_s__replace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_84), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_5 = 0;
  __pyx_t_1 = 0;
  __pyx_v_trackcontents = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2997
 *         except: desc = description
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))
 *         if trackline:             # <<<<<<<<<<<<<<
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)
 *             except: bedwrite('track name=MACS description=Unknown\n')
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_trackline); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "MACS2/IO/cScoreTrack.pyx":2998
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))
 *         if trackline:
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)             # <<<<<<<<<<<<<<
 *             except: bedwrite('track name=MACS description=Unknown\n')
 * 
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {
        __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_85), ((PyObject *)__pyx_v_trackcontents)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2998; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_4));
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2998; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_v_bedwrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2998; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L34_try_end;
      __pyx_L27_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":2999
 *         if trackline:
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)
 *             except: bedwrite('track name=MACS description=Unknown\n')             # <<<<<<<<<<<<<<
 * 
 *         log10 = np.log10
 */
      /*except:*/ {
        __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2999; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyObject_Call(__pyx_v_bedwrite, ((PyObject *)__pyx_k_tuple_87), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2999; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L28_exception_handled;
      }
      __pyx_L29_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L28_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_L34_try_end:;
    }
    goto __pyx_L26;
  }
  __pyx_L26:;

  /* "MACS2/IO/cScoreTrack.pyx":3001
 *             except: bedwrite('track name=MACS description=Unknown\n')
 * 
 *         log10 = np.log10             # <<<<<<<<<<<<<<
 *         log2 = np.log2
 *         median = np.median
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__log10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_log10 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3002
 * 
 *         log10 = np.log10
 *         log2 = np.log2             # <<<<<<<<<<<<<<
 *         median = np.median
 *         for chrom in sorted(self.diff_peaks.keys()):
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__log2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_log2 = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3003
 *         log10 = np.log10
 *         log2 = np.log2
 *         median = np.median             # <<<<<<<<<<<<<<
 *         for chrom in sorted(self.diff_peaks.keys()):
 *             pos = self.pos[chrom]
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__median); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_median = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3004
 *         log2 = np.log2
 *         median = np.median
 *         for chrom in sorted(self.diff_peaks.keys()):             # <<<<<<<<<<<<<<
 *             pos = self.pos[chrom]
 *             t1 = self.t1[chrom]
 */
  if (unlikely(((PyObject *)__pyx_v_self->diff_peaks) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->diff_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_5)) {
      if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_5)) {
      if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_10(__pyx_t_5);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3005
 *         median = np.median
 *         for chrom in sorted(self.diff_peaks.keys()):
 *             pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *             t1 = self.t1[chrom]
 *             t2 = self.t2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_pos);
    __pyx_v_pos = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3006
 *         for chrom in sorted(self.diff_peaks.keys()):
 *             pos = self.pos[chrom]
 *             t1 = self.t1[chrom]             # <<<<<<<<<<<<<<
 *             t2 = self.t2[chrom]
 *             c1 = self.c1[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_t1);
    __pyx_v_t1 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3007
 *             pos = self.pos[chrom]
 *             t1 = self.t1[chrom]
 *             t2 = self.t2[chrom]             # <<<<<<<<<<<<<<
 *             c1 = self.c1[chrom]
 *             c2 = self.c2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t2), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_t2);
    __pyx_v_t2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3008
 *             t1 = self.t1[chrom]
 *             t2 = self.t2[chrom]
 *             c1 = self.c1[chrom]             # <<<<<<<<<<<<<<
 *             c2 = self.c2[chrom]
 *             tvsc1 = self.tvsc1[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->c1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c1), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_c1);
    __pyx_v_c1 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3009
 *             t2 = self.t2[chrom]
 *             c1 = self.c1[chrom]
 *             c2 = self.c2[chrom]             # <<<<<<<<<<<<<<
 *             tvsc1 = self.tvsc1[chrom]
 *             tvsc2 = self.tvsc2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->c2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c2), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_c2);
    __pyx_v_c2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3010
 *             c1 = self.c1[chrom]
 *             c2 = self.c2[chrom]
 *             tvsc1 = self.tvsc1[chrom]             # <<<<<<<<<<<<<<
 *             tvsc2 = self.tvsc2[chrom]
 *             diff_pvalues = self.t1vs2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->tvsc1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tvsc1), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_tvsc1);
    __pyx_v_tvsc1 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3011
 *             c2 = self.c2[chrom]
 *             tvsc1 = self.tvsc1[chrom]
 *             tvsc2 = self.tvsc2[chrom]             # <<<<<<<<<<<<<<
 *             diff_pvalues = self.t1vs2[chrom]
 *             diff_qvalues = self.diff_qvalues[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->tvsc2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tvsc2), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_tvsc2);
    __pyx_v_tvsc2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3012
 *             tvsc1 = self.tvsc1[chrom]
 *             tvsc2 = self.tvsc2[chrom]
 *             diff_pvalues = self.t1vs2[chrom]             # <<<<<<<<<<<<<<
 *             diff_qvalues = self.diff_qvalues[chrom]
 *             diff_logLR = self.tlogLR[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_diff_pvalues);
    __pyx_v_diff_pvalues = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3013
 *             tvsc2 = self.tvsc2[chrom]
 *             diff_pvalues = self.t1vs2[chrom]
 *             diff_qvalues = self.diff_qvalues[chrom]             # <<<<<<<<<<<<<<
 *             diff_logLR = self.tlogLR[chrom]
 *             qpos = self.where_peaks[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->diff_qvalues) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_qvalues), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_diff_qvalues);
    __pyx_v_diff_qvalues = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3014
 *             diff_pvalues = self.t1vs2[chrom]
 *             diff_qvalues = self.diff_qvalues[chrom]
 *             diff_logLR = self.tlogLR[chrom]             # <<<<<<<<<<<<<<
 *             qpos = self.where_peaks[chrom]
 * #            above_cutoff = np.where(diff_qvalues >= self.cutoff)[0]
 */
    if (unlikely(((PyObject *)__pyx_v_self->tlogLR) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tlogLR), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_diff_logLR);
    __pyx_v_diff_logLR = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3015
 *             diff_qvalues = self.diff_qvalues[chrom]
 *             diff_logLR = self.tlogLR[chrom]
 *             qpos = self.where_peaks[chrom]             # <<<<<<<<<<<<<<
 * #            above_cutoff = np.where(diff_qvalues >= self.cutoff)[0]
 *             if self.diff_scoring_method == 'q':
 */
    if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->where_peaks), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_qpos);
    __pyx_v_qpos = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3017
 *             qpos = self.where_peaks[chrom]
 * #            above_cutoff = np.where(diff_qvalues >= self.cutoff)[0]
 *             if self.diff_scoring_method == 'q':             # <<<<<<<<<<<<<<
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')
 */
    __pyx_t_2 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_self->diff_scoring_method), ((PyObject *)__pyx_n_s__q), Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "MACS2/IO/cScoreTrack.pyx":3018
 * #            above_cutoff = np.where(diff_qvalues >= self.cutoff)[0]
 *             if self.diff_scoring_method == 'q':
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=             # <<<<<<<<<<<<<<
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__where); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(((PyObject *)__pyx_v_self->diff_qvalues) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_qvalues), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);

      /* "MACS2/IO/cScoreTrack.pyx":3019
 *             if self.diff_scoring_method == 'q':
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')
 */
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_11, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_88), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_v_above_cutoff);
      __pyx_v_above_cutoff = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L39;
    }

    /* "MACS2/IO/cScoreTrack.pyx":3020
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':             # <<<<<<<<<<<<<<
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')
 *             for first_i, last_i, n_peak in self.diff_peaks[chrom]:
 */
    __pyx_t_2 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_self->diff_scoring_method), ((PyObject *)__pyx_n_s__p), Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "MACS2/IO/cScoreTrack.pyx":3021
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             for first_i, last_i, n_peak in self.diff_peaks[chrom]:
 *                 start_i = above_cutoff[first_i]
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__where); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), __pyx_v_chrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->where_peaks), __pyx_v_chrom); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__astype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_89), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_v_above_cutoff);
      __pyx_v_above_cutoff = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L39;
    }
    __pyx_L39:;

    /* "MACS2/IO/cScoreTrack.pyx":3022
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')
 *             for first_i, last_i, n_peak in self.diff_peaks[chrom]:             # <<<<<<<<<<<<<<
 *                 start_i = above_cutoff[first_i]
 *                 end_i = above_cutoff[last_i]
 */
    if (unlikely(((PyObject *)__pyx_v_self->diff_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_peaks), __pyx_v_chrom); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_4 = __pyx_t_13(__pyx_t_3);
        if (unlikely(!__pyx_t_4)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
        PyObject* sequence = __pyx_t_4;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_11 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_14 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_14);
        #else
        __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_14 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_15 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
        index = 0; __pyx_t_11 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_11)) goto __pyx_L42_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_11);
        index = 1; __pyx_t_1 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_1)) goto __pyx_L42_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        index = 2; __pyx_t_14 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L42_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_14);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_16 = NULL;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        goto __pyx_L43_unpacking_done;
        __pyx_L42_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_16 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L43_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_v_first_i);
      __pyx_v_first_i = __pyx_t_11;
      __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_v_last_i);
      __pyx_v_last_i = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_v_n_peak);
      __pyx_v_n_peak = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3023
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')
 *             for first_i, last_i, n_peak in self.diff_peaks[chrom]:
 *                 start_i = above_cutoff[first_i]             # <<<<<<<<<<<<<<
 *                 end_i = above_cutoff[last_i]
 *                 pos_start = qpos[start_i] - 1
 */
      if (unlikely(!__pyx_v_above_cutoff)) { __Pyx_RaiseUnboundLocalError("above_cutoff"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_4 = PyObject_GetItem(__pyx_v_above_cutoff, __pyx_v_first_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_v_start_i);
      __pyx_v_start_i = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3024
 *             for first_i, last_i, n_peak in self.diff_peaks[chrom]:
 *                 start_i = above_cutoff[first_i]
 *                 end_i = above_cutoff[last_i]             # <<<<<<<<<<<<<<
 *                 pos_start = qpos[start_i] - 1
 *                 pos_end = qpos[end_i]
 */
      __pyx_t_4 = PyObject_GetItem(__pyx_v_above_cutoff, __pyx_v_last_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_v_end_i);
      __pyx_v_end_i = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3025
 *                 start_i = above_cutoff[first_i]
 *                 end_i = above_cutoff[last_i]
 *                 pos_start = qpos[start_i] - 1             # <<<<<<<<<<<<<<
 *                 pos_end = qpos[end_i]
 * 
 */
      __pyx_t_4 = PyObject_GetItem(__pyx_v_qpos, __pyx_v_start_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_14 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_v_pos_start);
      __pyx_v_pos_start = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3026
 *                 end_i = above_cutoff[last_i]
 *                 pos_start = qpos[start_i] - 1
 *                 pos_end = qpos[end_i]             # <<<<<<<<<<<<<<
 * 
 *                 start = pos[pos_start]
 */
      __pyx_t_14 = PyObject_GetItem(__pyx_v_qpos, __pyx_v_end_i); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_v_pos_end);
      __pyx_v_pos_end = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3028
 *                 pos_end = qpos[end_i]
 * 
 *                 start = pos[pos_start]             # <<<<<<<<<<<<<<
 *                 end = pos[pos_end]
 *                 if start > end:
 */
      __pyx_t_14 = PyObject_GetItem(__pyx_v_pos, __pyx_v_pos_start); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_v_start);
      __pyx_v_start = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3029
 * 
 *                 start = pos[pos_start]
 *                 end = pos[pos_end]             # <<<<<<<<<<<<<<
 *                 if start > end:
 *                     start = 0
 */
      __pyx_t_14 = PyObject_GetItem(__pyx_v_pos, __pyx_v_pos_end); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_v_end);
      __pyx_v_end = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3030
 *                 start = pos[pos_start]
 *                 end = pos[pos_end]
 *                 if start > end:             # <<<<<<<<<<<<<<
 *                     start = 0
 *                     pos_start = 0
 */
      __pyx_t_14 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (__pyx_t_2) {

        /* "MACS2/IO/cScoreTrack.pyx":3031
 *                 end = pos[pos_end]
 *                 if start > end:
 *                     start = 0             # <<<<<<<<<<<<<<
 *                     pos_start = 0
 *                 t1s = t1[pos_start:(pos_end+1)]
 */
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_DECREF(__pyx_v_start);
        __pyx_v_start = __pyx_int_0;

        /* "MACS2/IO/cScoreTrack.pyx":3032
 *                 if start > end:
 *                     start = 0
 *                     pos_start = 0             # <<<<<<<<<<<<<<
 *                 t1s = t1[pos_start:(pos_end+1)]
 *                 c1s = c1[pos_start:(pos_end+1)]
 */
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_DECREF(__pyx_v_pos_start);
        __pyx_v_pos_start = __pyx_int_0;
        goto __pyx_L44;
      }
      __pyx_L44:;

      /* "MACS2/IO/cScoreTrack.pyx":3033
 *                     start = 0
 *                     pos_start = 0
 *                 t1s = t1[pos_start:(pos_end+1)]             # <<<<<<<<<<<<<<
 *                 c1s = c1[pos_start:(pos_end+1)]
 *                 t2s = t2[pos_start:(pos_end+1)]
 */
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_pos_start); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_14 = PyNumber_Add(__pyx_v_pos_end, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PySequence_GetSlice(__pyx_v_t1, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_v_t1s);
      __pyx_v_t1s = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3034
 *                     pos_start = 0
 *                 t1s = t1[pos_start:(pos_end+1)]
 *                 c1s = c1[pos_start:(pos_end+1)]             # <<<<<<<<<<<<<<
 *                 t2s = t2[pos_start:(pos_end+1)]
 *                 c2s = c2[pos_start:(pos_end+1)]
 */
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_pos_start); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_14 = PyNumber_Add(__pyx_v_pos_end, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PySequence_GetSlice(__pyx_v_c1, __pyx_t_18, __pyx_t_17); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_v_c1s);
      __pyx_v_c1s = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3035
 *                 t1s = t1[pos_start:(pos_end+1)]
 *                 c1s = c1[pos_start:(pos_end+1)]
 *                 t2s = t2[pos_start:(pos_end+1)]             # <<<<<<<<<<<<<<
 *                 c2s = c2[pos_start:(pos_end+1)]
 *                 fold_changes = t1s / t2s
 */
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_pos_start); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_14 = PyNumber_Add(__pyx_v_pos_end, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PySequence_GetSlice(__pyx_v_t2, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_v_t2s);
      __pyx_v_t2s = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3036
 *                 c1s = c1[pos_start:(pos_end+1)]
 *                 t2s = t2[pos_start:(pos_end+1)]
 *                 c2s = c2[pos_start:(pos_end+1)]             # <<<<<<<<<<<<<<
 *                 fold_changes = t1s / t2s
 *                 if log2(median(fold_changes)) > 0:
 */
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_pos_start); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_14 = PyNumber_Add(__pyx_v_pos_end, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PySequence_GetSlice(__pyx_v_c2, __pyx_t_18, __pyx_t_17); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_v_c2s);
      __pyx_v_c2s = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3037
 *                 t2s = t2[pos_start:(pos_end+1)]
 *                 c2s = c2[pos_start:(pos_end+1)]
 *                 fold_changes = t1s / t2s             # <<<<<<<<<<<<<<
 *                 if log2(median(fold_changes)) > 0:
 *                     log2_fold_change = log2(fold_changes).max()
 */
      __pyx_t_14 = __Pyx_PyNumber_Divide(__pyx_v_t1s, __pyx_v_t2s); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_v_fold_changes);
      __pyx_v_fold_changes = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3038
 *                 c2s = c2[pos_start:(pos_end+1)]
 *                 fold_changes = t1s / t2s
 *                 if log2(median(fold_changes)) > 0:             # <<<<<<<<<<<<<<
 *                     log2_fold_change = log2(fold_changes).max()
 *                 else:
 */
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_v_fold_changes);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_fold_changes);
      __Pyx_GIVEREF(__pyx_v_fold_changes);
      __pyx_t_4 = PyObject_Call(__pyx_v_median, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (__pyx_t_2) {

        /* "MACS2/IO/cScoreTrack.pyx":3039
 *                 fold_changes = t1s / t2s
 *                 if log2(median(fold_changes)) > 0:
 *                     log2_fold_change = log2(fold_changes).max()             # <<<<<<<<<<<<<<
 *                 else:
 *                     log2_fold_change = log2(fold_changes).min()
 */
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_INCREF(__pyx_v_fold_changes);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_fold_changes);
        __Pyx_GIVEREF(__pyx_v_fold_changes);
        __pyx_t_4 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__max); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_v_log2_fold_change);
        __pyx_v_log2_fold_change = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L45;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":3041
 *                     log2_fold_change = log2(fold_changes).max()
 *                 else:
 *                     log2_fold_change = log2(fold_changes).min()             # <<<<<<<<<<<<<<
 *                 this_dpvalue = diff_pvalues[pos_start:(pos_end+1)].max()
 *                 this_dqvalue = diff_qvalues[first_i:(last_i+1)].max()
 */
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_fold_changes);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fold_changes);
        __Pyx_GIVEREF(__pyx_v_fold_changes);
        __pyx_t_14 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_v_log2_fold_change);
        __pyx_v_log2_fold_change = __pyx_t_14;
        __pyx_t_14 = 0;
      }
      __pyx_L45:;

      /* "MACS2/IO/cScoreTrack.pyx":3042
 *                 else:
 *                     log2_fold_change = log2(fold_changes).min()
 *                 this_dpvalue = diff_pvalues[pos_start:(pos_end+1)].max()             # <<<<<<<<<<<<<<
 *                 this_dqvalue = diff_qvalues[first_i:(last_i+1)].max()
 *                 this_dlogLR = diff_logLR[pos_start:(pos_end+1)].max()
 */
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_pos_start); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_14 = PyNumber_Add(__pyx_v_pos_end, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PySequence_GetSlice(__pyx_v_diff_pvalues, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_v_this_dpvalue);
      __pyx_v_this_dpvalue = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3043
 *                     log2_fold_change = log2(fold_changes).min()
 *                 this_dpvalue = diff_pvalues[pos_start:(pos_end+1)].max()
 *                 this_dqvalue = diff_qvalues[first_i:(last_i+1)].max()             # <<<<<<<<<<<<<<
 *                 this_dlogLR = diff_logLR[pos_start:(pos_end+1)].max()
 *                 peakname = "%s%d" % (peakprefix, n_peak)
 */
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_first_i); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_14 = PyNumber_Add(__pyx_v_last_i, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PySequence_GetSlice(__pyx_v_diff_qvalues, __pyx_t_18, __pyx_t_17); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_v_this_dqvalue);
      __pyx_v_this_dqvalue = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3044
 *                 this_dpvalue = diff_pvalues[pos_start:(pos_end+1)].max()
 *                 this_dqvalue = diff_qvalues[first_i:(last_i+1)].max()
 *                 this_dlogLR = diff_logLR[pos_start:(pos_end+1)].max()             # <<<<<<<<<<<<<<
 *                 peakname = "%s%d" % (peakprefix, n_peak)
 *                 max_t1 = t1s.max()
 */
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_pos_start); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_14 = PyNumber_Add(__pyx_v_pos_end, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PySequence_GetSlice(__pyx_v_diff_logLR, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_v_this_dlogLR);
      __pyx_v_this_dlogLR = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3045
 *                 this_dqvalue = diff_qvalues[first_i:(last_i+1)].max()
 *                 this_dlogLR = diff_logLR[pos_start:(pos_end+1)].max()
 *                 peakname = "%s%d" % (peakprefix, n_peak)             # <<<<<<<<<<<<<<
 *                 max_t1 = t1s.max()
 *                 max_c1 = c1s.max()
 */
      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_v_peakprefix);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_peakprefix);
      __Pyx_GIVEREF(__pyx_v_peakprefix);
      __Pyx_INCREF(__pyx_v_n_peak);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_n_peak);
      __Pyx_GIVEREF(__pyx_v_n_peak);
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_90), ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_v_peakname);
      __pyx_v_peakname = ((PyObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3046
 *                 this_dlogLR = diff_logLR[pos_start:(pos_end+1)].max()
 *                 peakname = "%s%d" % (peakprefix, n_peak)
 *                 max_t1 = t1s.max()             # <<<<<<<<<<<<<<
 *                 max_c1 = c1s.max()
 *                 if max_t1 > max_c1: log2_fe1 = log2(t1s / c1s).max()
 */
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_t1s, __pyx_n_s__max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_14 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_v_max_t1);
      __pyx_v_max_t1 = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3047
 *                 peakname = "%s%d" % (peakprefix, n_peak)
 *                 max_t1 = t1s.max()
 *                 max_c1 = c1s.max()             # <<<<<<<<<<<<<<
 *                 if max_t1 > max_c1: log2_fe1 = log2(t1s / c1s).max()
 *                 else: log2_fe1 = log2(t1s / c1s).min()
 */
      __pyx_t_14 = PyObject_GetAttr(__pyx_v_c1s, __pyx_n_s__max); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_4 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_v_max_c1);
      __pyx_v_max_c1 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3048
 *                 max_t1 = t1s.max()
 *                 max_c1 = c1s.max()
 *                 if max_t1 > max_c1: log2_fe1 = log2(t1s / c1s).max()             # <<<<<<<<<<<<<<
 *                 else: log2_fe1 = log2(t1s / c1s).min()
 *                 max_t2 = t2s.max()
 */
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_max_t1, __pyx_v_max_c1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_t1s, __pyx_v_c1s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__max); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_v_log2_fe1);
        __pyx_v_log2_fe1 = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L46;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":3049
 *                 max_c1 = c1s.max()
 *                 if max_t1 > max_c1: log2_fe1 = log2(t1s / c1s).max()
 *                 else: log2_fe1 = log2(t1s / c1s).min()             # <<<<<<<<<<<<<<
 *                 max_t2 = t2s.max()
 *                 max_c2 = c2s.max()
 */
        __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_t1s, __pyx_v_c1s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__min); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_v_log2_fe1);
        __pyx_v_log2_fe1 = __pyx_t_4;
        __pyx_t_4 = 0;
      }
      __pyx_L46:;

      /* "MACS2/IO/cScoreTrack.pyx":3050
 *                 if max_t1 > max_c1: log2_fe1 = log2(t1s / c1s).max()
 *                 else: log2_fe1 = log2(t1s / c1s).min()
 *                 max_t2 = t2s.max()             # <<<<<<<<<<<<<<
 *                 max_c2 = c2s.max()
 *                 if max_t1 > max_c1: log2_fe2 = log2(t2s / c2s).max()
 */
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_t2s, __pyx_n_s__max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_14 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_v_max_t2);
      __pyx_v_max_t2 = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3051
 *                 else: log2_fe1 = log2(t1s / c1s).min()
 *                 max_t2 = t2s.max()
 *                 max_c2 = c2s.max()             # <<<<<<<<<<<<<<
 *                 if max_t1 > max_c1: log2_fe2 = log2(t2s / c2s).max()
 *                 else: log2_fe2 = log2(t2s / c2s).min()
 */
      __pyx_t_14 = PyObject_GetAttr(__pyx_v_c2s, __pyx_n_s__max); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_4 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_v_max_c2);
      __pyx_v_max_c2 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3052
 *                 max_t2 = t2s.max()
 *                 max_c2 = c2s.max()
 *                 if max_t1 > max_c1: log2_fe2 = log2(t2s / c2s).max()             # <<<<<<<<<<<<<<
 *                 else: log2_fe2 = log2(t2s / c2s).min()
 *                 tc_value1 = tvsc1[pos_start:(pos_end+1)].max()
 */
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_max_t1, __pyx_v_max_c1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_t2s, __pyx_v_c2s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__max); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_v_log2_fe2);
        __pyx_v_log2_fe2 = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L47;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":3053
 *                 max_c2 = c2s.max()
 *                 if max_t1 > max_c1: log2_fe2 = log2(t2s / c2s).max()
 *                 else: log2_fe2 = log2(t2s / c2s).min()             # <<<<<<<<<<<<<<
 *                 tc_value1 = tvsc1[pos_start:(pos_end+1)].max()
 *                 tc_value2 = tvsc2[pos_start:(pos_end+1)].max()
 */
        __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_t2s, __pyx_v_c2s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__min); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_v_log2_fe2);
        __pyx_v_log2_fe2 = __pyx_t_4;
        __pyx_t_4 = 0;
      }
      __pyx_L47:;

      /* "MACS2/IO/cScoreTrack.pyx":3054
 *                 if max_t1 > max_c1: log2_fe2 = log2(t2s / c2s).max()
 *                 else: log2_fe2 = log2(t2s / c2s).min()
 *                 tc_value1 = tvsc1[pos_start:(pos_end+1)].max()             # <<<<<<<<<<<<<<
 *                 tc_value2 = tvsc2[pos_start:(pos_end+1)].max()
 *                 #chr,start,end,length, log10fold_change, diff.pvalue, diff.qvalue,
 */
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_pos_start); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = PyNumber_Add(__pyx_v_pos_end, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_tvsc1, __pyx_t_18, __pyx_t_17); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_14 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__max); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_v_tc_value1);
      __pyx_v_tc_value1 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3055
 *                 else: log2_fe2 = log2(t2s / c2s).min()
 *                 tc_value1 = tvsc1[pos_start:(pos_end+1)].max()
 *                 tc_value2 = tvsc2[pos_start:(pos_end+1)].max()             # <<<<<<<<<<<<<<
 *                 #chr,start,end,length, log10fold_change, diff.pvalue, diff.qvalue,
 *                 #diff.logLR, name,
 */
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_pos_start); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = PyNumber_Add(__pyx_v_pos_end, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_tvsc2, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_14 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__max); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_v_tc_value2);
      __pyx_v_tc_value2 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3060
 *                 #treat1, control1, fold_enrichment1, -log10(p/qvalue1)
 *                 #treat2, control2, fold_enrichment2, -log10(p/qvalue2)
 *                 xlswrite("%s\t%d\t%d\t%d" % (chrom, start+1, end, end - start))             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % log2_fold_change)
 *                 xlswrite("\t%.5f" % this_dpvalue)
 */
      __pyx_t_4 = PyNumber_Add(__pyx_v_start, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_14 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_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_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_end);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end);
      __Pyx_GIVEREF(__pyx_v_end);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_t_4 = 0;
      __pyx_t_14 = 0;
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_91), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3061
 *                 #treat2, control2, fold_enrichment2, -log10(p/qvalue2)
 *                 xlswrite("%s\t%d\t%d\t%d" % (chrom, start+1, end, end - start))
 *                 xlswrite("\t%.5f" % log2_fold_change)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % this_dpvalue)
 *                 xlswrite("\t%.5f" % this_dqvalue)
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_log2_fold_change); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3062
 *                 xlswrite("%s\t%d\t%d\t%d" % (chrom, start+1, end, end - start))
 *                 xlswrite("\t%.5f" % log2_fold_change)
 *                 xlswrite("\t%.5f" % this_dpvalue)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % this_dqvalue)
 *                 xlswrite("\t%.5f" % this_dlogLR)
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_this_dpvalue); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3063
 *                 xlswrite("\t%.5f" % log2_fold_change)
 *                 xlswrite("\t%.5f" % this_dpvalue)
 *                 xlswrite("\t%.5f" % this_dqvalue)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % this_dlogLR)
 *                 xlswrite("\t%s" % peakname)
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_this_dqvalue); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3064
 *                 xlswrite("\t%.5f" % this_dpvalue)
 *                 xlswrite("\t%.5f" % this_dqvalue)
 *                 xlswrite("\t%.5f" % this_dlogLR)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%s" % peakname)
 *                 xlswrite("\t%.5f" % max_t1)
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_this_dlogLR); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3065
 *                 xlswrite("\t%.5f" % this_dqvalue)
 *                 xlswrite("\t%.5f" % this_dlogLR)
 *                 xlswrite("\t%s" % peakname)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % max_t1)
 *                 xlswrite("\t%.5f" % max_c1)
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), __pyx_v_peakname); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3066
 *                 xlswrite("\t%.5f" % this_dlogLR)
 *                 xlswrite("\t%s" % peakname)
 *                 xlswrite("\t%.5f" % max_t1)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % max_c1)
 *                 xlswrite("\t%.5f" % log2_fe1)
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_max_t1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3067
 *                 xlswrite("\t%s" % peakname)
 *                 xlswrite("\t%.5f" % max_t1)
 *                 xlswrite("\t%.5f" % max_c1)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % log2_fe1)
 *                 xlswrite("\t%.5f" % tc_value1)
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_max_c1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3068
 *                 xlswrite("\t%.5f" % max_t1)
 *                 xlswrite("\t%.5f" % max_c1)
 *                 xlswrite("\t%.5f" % log2_fe1)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % tc_value1)
 *                 xlswrite("\t%.5f" % max_t2)
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_log2_fe1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3069
 *                 xlswrite("\t%.5f" % max_c1)
 *                 xlswrite("\t%.5f" % log2_fe1)
 *                 xlswrite("\t%.5f" % tc_value1)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % max_t2)
 *                 xlswrite("\t%.5f" % max_c2)
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_tc_value1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3070
 *                 xlswrite("\t%.5f" % log2_fe1)
 *                 xlswrite("\t%.5f" % tc_value1)
 *                 xlswrite("\t%.5f" % max_t2)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % max_c2)
 *                 xlswrite("\t%.5f" % log2_fe2)
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_max_t2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3071
 *                 xlswrite("\t%.5f" % tc_value1)
 *                 xlswrite("\t%.5f" % max_t2)
 *                 xlswrite("\t%.5f" % max_c2)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % log2_fe2)
 *                 xlswrite("\t%.5f" % tc_value2)
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_max_c2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3072
 *                 xlswrite("\t%.5f" % max_t2)
 *                 xlswrite("\t%.5f" % max_c2)
 *                 xlswrite("\t%.5f" % log2_fe2)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % tc_value2)
 *                 xlswrite("\n")
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_log2_fe2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3073
 *                 xlswrite("\t%.5f" % max_c2)
 *                 xlswrite("\t%.5f" % log2_fe2)
 *                 xlswrite("\t%.5f" % tc_value2)             # <<<<<<<<<<<<<<
 *                 xlswrite("\n")
 *                 bedwrite("%s\t%d\t%d\t%s\t%.5f\n" %
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_tc_value2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3074
 *                 xlswrite("\t%.5f" % log2_fe2)
 *                 xlswrite("\t%.5f" % tc_value2)
 *                 xlswrite("\n")             # <<<<<<<<<<<<<<
 *                 bedwrite("%s\t%d\t%d\t%s\t%.5f\n" %
 *                          (chrom, start, end, peakname,
 */
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3077
 *                 bedwrite("%s\t%d\t%d\t%s\t%.5f\n" %
 *                          (chrom, start, end, peakname,
 *                           this_dqvalue))             # <<<<<<<<<<<<<<
 *         return
 * 
 */
      __pyx_t_14 = PyTuple_New(5); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      __Pyx_INCREF(__pyx_v_start);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_start);
      __Pyx_GIVEREF(__pyx_v_start);
      __Pyx_INCREF(__pyx_v_end);
      PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_end);
      __Pyx_GIVEREF(__pyx_v_end);
      __Pyx_INCREF(__pyx_v_peakname);
      PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_v_peakname);
      __Pyx_GIVEREF(__pyx_v_peakname);
      __Pyx_INCREF(__pyx_v_this_dqvalue);
      PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_v_this_dqvalue);
      __Pyx_GIVEREF(__pyx_v_this_dqvalue);
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_95), ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_v_bedwrite, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3078
 *                          (chrom, start, end, peakname,
 *                           this_dqvalue))
 *         return             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xlswrite);
  __Pyx_XDECREF(__pyx_v_bedwrite);
  __Pyx_XDECREF(__pyx_v_tc_method);
  __Pyx_XDECREF(__pyx_v_peakprefix);
  __Pyx_XDECREF(__pyx_v_desc);
  __Pyx_XDECREF(__pyx_v_trackcontents);
  __Pyx_XDECREF(__pyx_v_log10);
  __Pyx_XDECREF(__pyx_v_log2);
  __Pyx_XDECREF(__pyx_v_median);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_t1);
  __Pyx_XDECREF(__pyx_v_t2);
  __Pyx_XDECREF(__pyx_v_c1);
  __Pyx_XDECREF(__pyx_v_c2);
  __Pyx_XDECREF(__pyx_v_tvsc1);
  __Pyx_XDECREF(__pyx_v_tvsc2);
  __Pyx_XDECREF(__pyx_v_diff_pvalues);
  __Pyx_XDECREF(__pyx_v_diff_qvalues);
  __Pyx_XDECREF(__pyx_v_diff_logLR);
  __Pyx_XDECREF(__pyx_v_qpos);
  __Pyx_XDECREF(__pyx_v_above_cutoff);
  __Pyx_XDECREF(__pyx_v_first_i);
  __Pyx_XDECREF(__pyx_v_last_i);
  __Pyx_XDECREF(__pyx_v_n_peak);
  __Pyx_XDECREF(__pyx_v_start_i);
  __Pyx_XDECREF(__pyx_v_end_i);
  __Pyx_XDECREF(__pyx_v_pos_start);
  __Pyx_XDECREF(__pyx_v_pos_end);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XDECREF(__pyx_v_t1s);
  __Pyx_XDECREF(__pyx_v_c1s);
  __Pyx_XDECREF(__pyx_v_t2s);
  __Pyx_XDECREF(__pyx_v_c2s);
  __Pyx_XDECREF(__pyx_v_fold_changes);
  __Pyx_XDECREF(__pyx_v_log2_fold_change);
  __Pyx_XDECREF(__pyx_v_this_dpvalue);
  __Pyx_XDECREF(__pyx_v_this_dqvalue);
  __Pyx_XDECREF(__pyx_v_this_dlogLR);
  __Pyx_XDECREF(__pyx_v_peakname);
  __Pyx_XDECREF(__pyx_v_max_t1);
  __Pyx_XDECREF(__pyx_v_max_c1);
  __Pyx_XDECREF(__pyx_v_log2_fe1);
  __Pyx_XDECREF(__pyx_v_max_t2);
  __Pyx_XDECREF(__pyx_v_max_c2);
  __Pyx_XDECREF(__pyx_v_log2_fe2);
  __Pyx_XDECREF(__pyx_v_tc_value1);
  __Pyx_XDECREF(__pyx_v_tc_value2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_39write_peaks2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_38write_peaks2[] = "Save the peak results in a tab-delimited plain text file\n        with suffix .xls.\n        \n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_39write_peaks2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xls = 0;
  PyObject *__pyx_v_bed = 0;
  PyObject *__pyx_v_name_prefix = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_description = 0;
  PyObject *__pyx_v_trackline = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_peaks2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__xls,&__pyx_n_s__bed,&__pyx_n_s__name_prefix,&__pyx_n_s__name,&__pyx_n_s__description,&__pyx_n_s__trackline,0};
    PyObject* values[6] = {0,0,0,0,0,0};

    /* "MACS2/IO/cScoreTrack.pyx":3081
 * 
 * 
 *     def write_peaks2(self, xls=None, bed=None, name_prefix="%s_peak_", name="MACS",             # <<<<<<<<<<<<<<
 *                     description='%s', trackline=True):
 *         """Save the peak results in a tab-delimited plain text file
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_kp_s_61);
    values[3] = ((PyObject *)__pyx_n_s__MACS);
    values[4] = ((PyObject *)__pyx_kp_s_62);
    values[5] = __pyx_k_96;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xls);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bed);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name_prefix);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__description);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__trackline);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_peaks2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xls = values[0];
    __pyx_v_bed = values[1];
    __pyx_v_name_prefix = values[2];
    __pyx_v_name = values[3];
    __pyx_v_description = values[4];
    __pyx_v_trackline = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_peaks2", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_38write_peaks2(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), __pyx_v_xls, __pyx_v_bed, __pyx_v_name_prefix, __pyx_v_name, __pyx_v_description, __pyx_v_trackline);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_38write_peaks2(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_xls, PyObject *__pyx_v_bed, PyObject *__pyx_v_name_prefix, PyObject *__pyx_v_name, PyObject *__pyx_v_description, PyObject *__pyx_v_trackline) {
  PyObject *__pyx_v_peaks1 = 0;
  PyObject *__pyx_v_peaks2 = 0;
  PyObject *__pyx_v_peak1 = 0;
  PyObject *__pyx_v_peak2 = 0;
  PyArrayObject *__pyx_v_peaks1_selection = 0;
  PyArrayObject *__pyx_v_peaks2_selection = 0;
  PyArrayObject *__pyx_v_i_peaks1 = 0;
  PyArrayObject *__pyx_v_i_peaks2 = 0;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_which_peaks1 = 0;
  PyArrayObject *__pyx_v_which_peaks2 = 0;
  PyArrayObject *__pyx_v_t1 = 0;
  PyArrayObject *__pyx_v_c1 = 0;
  PyArrayObject *__pyx_v_t2 = 0;
  PyArrayObject *__pyx_v_c2 = 0;
  PyArrayObject *__pyx_v_diff_pvalues = 0;
  PyArrayObject *__pyx_v_diff_qvalues = 0;
  PyArrayObject *__pyx_v_diff_logLR = 0;
  PyArrayObject *__pyx_v_qpos = 0;
  PyArrayObject *__pyx_v_above_cutoff = 0;
  int __pyx_v_start_i;
  int __pyx_v_end_i;
  int __pyx_v_first_i;
  int __pyx_v_last_i;
  int __pyx_v_i1;
  int __pyx_v_i2;
  int __pyx_v_qpos_i;
  int __pyx_v_peak1_pos_i;
  int __pyx_v_peak2_pos_i;
  int __pyx_v_peak1_i;
  int __pyx_v_peak2_i;
  int __pyx_v_npeaks1;
  int __pyx_v_npeaks2;
  int __pyx_v_peak1_selection_i;
  int __pyx_v_peak2_selection_i;
  int __pyx_v_n_peak;
  PyBoolObject *__pyx_v_peak1_present = 0;
  PyBoolObject *__pyx_v_peak2_present = 0;
  float __pyx_v_this_dpvalue;
  float __pyx_v_this_dqvalue;
  float __pyx_v_this_dlogLR;
  float __pyx_v_pseudocount;
  PyObject *__pyx_v_xlswrite = NULL;
  PyObject *__pyx_v_bedwrite = NULL;
  PyObject *__pyx_v_peakprefix = NULL;
  PyObject *__pyx_v_desc = NULL;
  PyObject *__pyx_v_trackcontents = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_log10 = NULL;
  PyObject *__pyx_v_log2 = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_median = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_pos_start = NULL;
  PyObject *__pyx_v_pos_end = NULL;
  long __pyx_v_j;
  int __pyx_v_peak_pos_i;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_v_log2_fold_change = NULL;
  PyObject *__pyx_v_log2_fold_change_w_pc = NULL;
  PyObject *__pyx_v_peakname = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_above_cutoff;
  __Pyx_Buffer __pyx_pybuffer_above_cutoff;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_c1;
  __Pyx_Buffer __pyx_pybuffer_c1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_c2;
  __Pyx_Buffer __pyx_pybuffer_c2;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_diff_logLR;
  __Pyx_Buffer __pyx_pybuffer_diff_logLR;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_diff_pvalues;
  __Pyx_Buffer __pyx_pybuffer_diff_pvalues;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_diff_qvalues;
  __Pyx_Buffer __pyx_pybuffer_diff_qvalues;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_i_peaks1;
  __Pyx_Buffer __pyx_pybuffer_i_peaks1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_i_peaks2;
  __Pyx_Buffer __pyx_pybuffer_i_peaks2;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_peaks1_selection;
  __Pyx_Buffer __pyx_pybuffer_peaks1_selection;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_peaks2_selection;
  __Pyx_Buffer __pyx_pybuffer_peaks2_selection;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
  __Pyx_Buffer __pyx_pybuffer_pos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_qpos;
  __Pyx_Buffer __pyx_pybuffer_qpos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_t1;
  __Pyx_Buffer __pyx_pybuffer_t1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_t2;
  __Pyx_Buffer __pyx_pybuffer_t2;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_which_peaks1;
  __Pyx_Buffer __pyx_pybuffer_which_peaks1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_which_peaks2;
  __Pyx_Buffer __pyx_pybuffer_which_peaks2;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyArrayObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  PyArrayObject *__pyx_t_16 = NULL;
  PyArrayObject *__pyx_t_17 = NULL;
  PyObject *(*__pyx_t_18)(PyObject *);
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *(*__pyx_t_21)(PyObject *);
  int __pyx_t_22;
  int __pyx_t_23;
  int __pyx_t_24;
  int __pyx_t_25;
  PyArrayObject *__pyx_t_26 = NULL;
  long __pyx_t_27;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  PyObject *__pyx_t_30 = NULL;
  long __pyx_t_31;
  long __pyx_t_32;
  long __pyx_t_33;
  int __pyx_t_34;
  __pyx_t_5MACS2_2IO_5numpy_int32_t __pyx_t_35;
  int __pyx_t_36;
  long __pyx_t_37;
  int __pyx_t_38;
  int __pyx_t_39;
  int __pyx_t_40;
  int __pyx_t_41;
  int __pyx_t_42;
  int __pyx_t_43;
  int __pyx_t_44;
  int __pyx_t_45;
  int __pyx_t_46;
  int __pyx_t_47;
  int __pyx_t_48;
  int __pyx_t_49;
  int __pyx_t_50;
  int __pyx_t_51;
  int __pyx_t_52;
  int __pyx_t_53;
  int __pyx_t_54;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_peaks2", 0);
  __pyx_pybuffer_peaks1_selection.pybuffer.buf = NULL;
  __pyx_pybuffer_peaks1_selection.refcount = 0;
  __pyx_pybuffernd_peaks1_selection.data = NULL;
  __pyx_pybuffernd_peaks1_selection.rcbuffer = &__pyx_pybuffer_peaks1_selection;
  __pyx_pybuffer_peaks2_selection.pybuffer.buf = NULL;
  __pyx_pybuffer_peaks2_selection.refcount = 0;
  __pyx_pybuffernd_peaks2_selection.data = NULL;
  __pyx_pybuffernd_peaks2_selection.rcbuffer = &__pyx_pybuffer_peaks2_selection;
  __pyx_pybuffer_i_peaks1.pybuffer.buf = NULL;
  __pyx_pybuffer_i_peaks1.refcount = 0;
  __pyx_pybuffernd_i_peaks1.data = NULL;
  __pyx_pybuffernd_i_peaks1.rcbuffer = &__pyx_pybuffer_i_peaks1;
  __pyx_pybuffer_i_peaks2.pybuffer.buf = NULL;
  __pyx_pybuffer_i_peaks2.refcount = 0;
  __pyx_pybuffernd_i_peaks2.data = NULL;
  __pyx_pybuffernd_i_peaks2.rcbuffer = &__pyx_pybuffer_i_peaks2;
  __pyx_pybuffer_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_pos.refcount = 0;
  __pyx_pybuffernd_pos.data = NULL;
  __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
  __pyx_pybuffer_which_peaks1.pybuffer.buf = NULL;
  __pyx_pybuffer_which_peaks1.refcount = 0;
  __pyx_pybuffernd_which_peaks1.data = NULL;
  __pyx_pybuffernd_which_peaks1.rcbuffer = &__pyx_pybuffer_which_peaks1;
  __pyx_pybuffer_which_peaks2.pybuffer.buf = NULL;
  __pyx_pybuffer_which_peaks2.refcount = 0;
  __pyx_pybuffernd_which_peaks2.data = NULL;
  __pyx_pybuffernd_which_peaks2.rcbuffer = &__pyx_pybuffer_which_peaks2;
  __pyx_pybuffer_t1.pybuffer.buf = NULL;
  __pyx_pybuffer_t1.refcount = 0;
  __pyx_pybuffernd_t1.data = NULL;
  __pyx_pybuffernd_t1.rcbuffer = &__pyx_pybuffer_t1;
  __pyx_pybuffer_c1.pybuffer.buf = NULL;
  __pyx_pybuffer_c1.refcount = 0;
  __pyx_pybuffernd_c1.data = NULL;
  __pyx_pybuffernd_c1.rcbuffer = &__pyx_pybuffer_c1;
  __pyx_pybuffer_t2.pybuffer.buf = NULL;
  __pyx_pybuffer_t2.refcount = 0;
  __pyx_pybuffernd_t2.data = NULL;
  __pyx_pybuffernd_t2.rcbuffer = &__pyx_pybuffer_t2;
  __pyx_pybuffer_c2.pybuffer.buf = NULL;
  __pyx_pybuffer_c2.refcount = 0;
  __pyx_pybuffernd_c2.data = NULL;
  __pyx_pybuffernd_c2.rcbuffer = &__pyx_pybuffer_c2;
  __pyx_pybuffer_diff_pvalues.pybuffer.buf = NULL;
  __pyx_pybuffer_diff_pvalues.refcount = 0;
  __pyx_pybuffernd_diff_pvalues.data = NULL;
  __pyx_pybuffernd_diff_pvalues.rcbuffer = &__pyx_pybuffer_diff_pvalues;
  __pyx_pybuffer_diff_qvalues.pybuffer.buf = NULL;
  __pyx_pybuffer_diff_qvalues.refcount = 0;
  __pyx_pybuffernd_diff_qvalues.data = NULL;
  __pyx_pybuffernd_diff_qvalues.rcbuffer = &__pyx_pybuffer_diff_qvalues;
  __pyx_pybuffer_diff_logLR.pybuffer.buf = NULL;
  __pyx_pybuffer_diff_logLR.refcount = 0;
  __pyx_pybuffernd_diff_logLR.data = NULL;
  __pyx_pybuffernd_diff_logLR.rcbuffer = &__pyx_pybuffer_diff_logLR;
  __pyx_pybuffer_qpos.pybuffer.buf = NULL;
  __pyx_pybuffer_qpos.refcount = 0;
  __pyx_pybuffernd_qpos.data = NULL;
  __pyx_pybuffernd_qpos.rcbuffer = &__pyx_pybuffer_qpos;
  __pyx_pybuffer_above_cutoff.pybuffer.buf = NULL;
  __pyx_pybuffer_above_cutoff.refcount = 0;
  __pyx_pybuffernd_above_cutoff.data = NULL;
  __pyx_pybuffernd_above_cutoff.rcbuffer = &__pyx_pybuffer_above_cutoff;

  /* "MACS2/IO/cScoreTrack.pyx":3107
 *             float this_dpvalue, this_dqvalue, this_dlogLR
 *             float pseudocount
 *         assert self.has_peakio(), "No information on peaks"             # <<<<<<<<<<<<<<
 *         logging.captureWarnings(True)
 *         pseudocount = float(self.pseudocount)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__has_peakio); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_97));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":3108
 *             float pseudocount
 *         assert self.has_peakio(), "No information on peaks"
 *         logging.captureWarnings(True)             # <<<<<<<<<<<<<<
 *         pseudocount = float(self.pseudocount)
 *         if xls is not None:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__captureWarnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3109
 *         assert self.has_peakio(), "No information on peaks"
 *         logging.captureWarnings(True)
 *         pseudocount = float(self.pseudocount)             # <<<<<<<<<<<<<<
 *         if xls is not None:
 *             xlswrite = xls.write
 */
  __pyx_v_pseudocount = ((double)__pyx_v_self->pseudocount);

  /* "MACS2/IO/cScoreTrack.pyx":3110
 *         logging.captureWarnings(True)
 *         pseudocount = float(self.pseudocount)
 *         if xls is not None:             # <<<<<<<<<<<<<<
 *             xlswrite = xls.write
 *         else:
 */
  __pyx_t_3 = (__pyx_v_xls != Py_None);
  if (__pyx_t_3) {

    /* "MACS2/IO/cScoreTrack.pyx":3111
 *         pseudocount = float(self.pseudocount)
 *         if xls is not None:
 *             xlswrite = xls.write             # <<<<<<<<<<<<<<
 *         else:
 *             xlswrite = do_nothing
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_xls, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_xlswrite = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":3113
 *             xlswrite = xls.write
 *         else:
 *             xlswrite = do_nothing             # <<<<<<<<<<<<<<
 *         if bed is not None:
 *             bedwrite = bed.write
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__do_nothing); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_xlswrite = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "MACS2/IO/cScoreTrack.pyx":3114
 *         else:
 *             xlswrite = do_nothing
 *         if bed is not None:             # <<<<<<<<<<<<<<
 *             bedwrite = bed.write
 *         else:
 */
  __pyx_t_3 = (__pyx_v_bed != Py_None);
  if (__pyx_t_3) {

    /* "MACS2/IO/cScoreTrack.pyx":3115
 *             xlswrite = do_nothing
 *         if bed is not None:
 *             bedwrite = bed.write             # <<<<<<<<<<<<<<
 *         else:
 *             bedwrite = do_nothing
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_bed, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_bedwrite = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "MACS2/IO/cScoreTrack.pyx":3117
 *             bedwrite = bed.write
 *         else:
 *             bedwrite = do_nothing             # <<<<<<<<<<<<<<
 *         xlswrite("# summit is defined as greatest summit from greatest sample in region \n")
 *         xlswrite("# values are reported for the summit, except for \n")
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__do_nothing); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_bedwrite = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "MACS2/IO/cScoreTrack.pyx":3118
 *         else:
 *             bedwrite = do_nothing
 *         xlswrite("# summit is defined as greatest summit from greatest sample in region \n")             # <<<<<<<<<<<<<<
 *         xlswrite("# values are reported for the summit, except for \n")
 *         xlswrite("# fold_enrichment, sample/control qvalues, peaknames, which are copied from the peak info \n")
 */
  __pyx_t_2 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_99), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3119
 *             bedwrite = do_nothing
 *         xlswrite("# summit is defined as greatest summit from greatest sample in region \n")
 *         xlswrite("# values are reported for the summit, except for \n")             # <<<<<<<<<<<<<<
 *         xlswrite("# fold_enrichment, sample/control qvalues, peaknames, which are copied from the peak info \n")
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 */
  __pyx_t_2 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_101), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3120
 *         xlswrite("# summit is defined as greatest summit from greatest sample in region \n")
 *         xlswrite("# values are reported for the summit, except for \n")
 *         xlswrite("# fold_enrichment, sample/control qvalues, peaknames, which are copied from the peak info \n")             # <<<<<<<<<<<<<<
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xlswrite("# differential values are reported at the taller sample peak\n")
 */
  __pyx_t_2 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_103), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3121
 *         xlswrite("# values are reported for the summit, except for \n")
 *         xlswrite("# fold_enrichment, sample/control qvalues, peaknames, which are copied from the peak info \n")
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth             # <<<<<<<<<<<<<<
 *         xlswrite("# differential values are reported at the taller sample peak\n")
 *         xlswrite("# log2_fold_change is positive if t1 > t2\n")
 */
  __pyx_t_2 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_104), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->cond1_depth); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyNumber_Remainder(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3122
 *         xlswrite("# fold_enrichment, sample/control qvalues, peaknames, which are copied from the peak info \n")
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xlswrite("# differential values are reported at the taller sample peak\n")             # <<<<<<<<<<<<<<
 *         xlswrite("# log2_fold_change is positive if t1 > t2\n")
 *         xlswrite("\t".join(("chr", "start", "end", "length", "summit",
 */
  __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3123
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xlswrite("# differential values are reported at the taller sample peak\n")
 *         xlswrite("# log2_fold_change is positive if t1 > t2\n")             # <<<<<<<<<<<<<<
 *         xlswrite("\t".join(("chr", "start", "end", "length", "summit",
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 */
  __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3124
 *         xlswrite("# differential values are reported at the taller sample peak\n")
 *         xlswrite("# log2_fold_change is positive if t1 > t2\n")
 *         xlswrite("\t".join(("chr", "start", "end", "length", "summit",             # <<<<<<<<<<<<<<
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 *                          "-log10.diff.pvalue",
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_70), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_113), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_kp_s_80)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3135
 *                          ))+"\n")
 * 
 *         try: peakprefix = name_prefix % name             # <<<<<<<<<<<<<<
 *         except: peakprefix = name_prefix
 *         try: desc = description % name
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {
      __pyx_t_1 = PyNumber_Remainder(__pyx_v_name_prefix, __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3135; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_peakprefix = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3136
 * 
 *         try: peakprefix = name_prefix % name
 *         except: peakprefix = name_prefix             # <<<<<<<<<<<<<<
 *         try: desc = description % name
 *         except: desc = description
 */
    /*except:*/ {
      __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks2", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3136; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_name_prefix);
      __Pyx_XDECREF(__pyx_v_peakprefix);
      __pyx_v_peakprefix = __pyx_v_name_prefix;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L12_try_end:;
  }

  /* "MACS2/IO/cScoreTrack.pyx":3137
 *         try: peakprefix = name_prefix % name
 *         except: peakprefix = name_prefix
 *         try: desc = description % name             # <<<<<<<<<<<<<<
 *         except: desc = description
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {
      __pyx_t_2 = PyNumber_Remainder(__pyx_v_description, __pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3137; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_desc = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L22_try_end;
    __pyx_L15_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3138
 *         except: peakprefix = name_prefix
 *         try: desc = description % name
 *         except: desc = description             # <<<<<<<<<<<<<<
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))
 *         if trackline:
 */
    /*except:*/ {
      __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks2", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3138; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_description);
      __Pyx_XDECREF(__pyx_v_desc);
      __pyx_v_desc = __pyx_v_description;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L16_exception_handled;
    }
    __pyx_L17_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L16_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
    __pyx_L22_try_end:;
  }

  /* "MACS2/IO/cScoreTrack.pyx":3139
 *         try: desc = description % name
 *         except: desc = description
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))             # <<<<<<<<<<<<<<
 *         if trackline:
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_name, __pyx_n_s__replace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_desc, __pyx_n_s__replace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_115), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;
  __pyx_v_trackcontents = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3140
 *         except: desc = description
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))
 *         if trackline:             # <<<<<<<<<<<<<<
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)
 *             except: bedwrite('track name=MACS description=Unknown\n')
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_trackline); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

    /* "MACS2/IO/cScoreTrack.pyx":3141
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))
 *         if trackline:
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)             # <<<<<<<<<<<<<<
 *             except: bedwrite('track name=MACS description=Unknown\n')
 * 
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {
        __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_85), ((PyObject *)__pyx_v_trackcontents)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3141; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3141; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_v_bedwrite, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3141; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L33_try_end;
      __pyx_L26_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3142
 *         if trackline:
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)
 *             except: bedwrite('track name=MACS description=Unknown\n')             # <<<<<<<<<<<<<<
 * 
 *         log10 = np.log10
 */
      /*except:*/ {
        __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks2", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3142; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = PyObject_Call(__pyx_v_bedwrite, ((PyObject *)__pyx_k_tuple_116), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3142; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L27_exception_handled;
      }
      __pyx_L28_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L27_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      __pyx_L33_try_end:;
    }
    goto __pyx_L25;
  }
  __pyx_L25:;

  /* "MACS2/IO/cScoreTrack.pyx":3144
 *             except: bedwrite('track name=MACS description=Unknown\n')
 * 
 *         log10 = np.log10             # <<<<<<<<<<<<<<
 *         log2 = np.log2
 *         median = np.median
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__log10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_log10 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3145
 * 
 *         log10 = np.log10
 *         log2 = np.log2             # <<<<<<<<<<<<<<
 *         median = np.median
 *         for chrom in sorted(self.diff_peaks.keys()):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__log2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_log2 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3146
 *         log10 = np.log10
 *         log2 = np.log2
 *         median = np.median             # <<<<<<<<<<<<<<
 *         for chrom in sorted(self.diff_peaks.keys()):
 *             peak1_pos_i = 0
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__median); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_median = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3147
 *         log2 = np.log2
 *         median = np.median
 *         for chrom in sorted(self.diff_peaks.keys()):             # <<<<<<<<<<<<<<
 *             peak1_pos_i = 0
 *             peak2_pos_i = 0
 */
  if (unlikely(((PyObject *)__pyx_v_self->diff_peaks) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyDict_Keys(__pyx_v_self->diff_peaks); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_4)) {
      if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_4)) {
      if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_10(__pyx_t_4);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3148
 *         median = np.median
 *         for chrom in sorted(self.diff_peaks.keys()):
 *             peak1_pos_i = 0             # <<<<<<<<<<<<<<
 *             peak2_pos_i = 0
 *             qpos_i = 0
 */
    __pyx_v_peak1_pos_i = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3149
 *         for chrom in sorted(self.diff_peaks.keys()):
 *             peak1_pos_i = 0
 *             peak2_pos_i = 0             # <<<<<<<<<<<<<<
 *             qpos_i = 0
 *             pos = self.pos[chrom]
 */
    __pyx_v_peak2_pos_i = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3150
 *             peak1_pos_i = 0
 *             peak2_pos_i = 0
 *             qpos_i = 0             # <<<<<<<<<<<<<<
 *             pos = self.pos[chrom]
 *             qpos = self.where_peaks[chrom]
 */
    __pyx_v_qpos_i = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3151
 *             peak2_pos_i = 0
 *             qpos_i = 0
 *             pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *             qpos = self.where_peaks[chrom]
 *             which_peaks1 = self.which_peaks1[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        }
      }
      __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3152
 *             qpos_i = 0
 *             pos = self.pos[chrom]
 *             qpos = self.where_peaks[chrom]             # <<<<<<<<<<<<<<
 *             which_peaks1 = self.which_peaks1[chrom]
 *             which_peaks2 = self.which_peaks2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->where_peaks), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qpos.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qpos.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_qpos.rcbuffer->pybuffer, (PyObject*)__pyx_v_qpos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_qpos.diminfo[0].strides = __pyx_pybuffernd_qpos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qpos.diminfo[0].shape = __pyx_pybuffernd_qpos.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_qpos));
    __pyx_v_qpos = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3153
 *             pos = self.pos[chrom]
 *             qpos = self.where_peaks[chrom]
 *             which_peaks1 = self.which_peaks1[chrom]             # <<<<<<<<<<<<<<
 *             which_peaks2 = self.which_peaks2[chrom]
 *             try: peaks1 = self.p1io.get_data_from_chrom(chrom)
 */
    if (unlikely(((PyObject *)__pyx_v_self->which_peaks1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->which_peaks1), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer, (PyObject*)__pyx_v_which_peaks1, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        }
      }
      __pyx_pybuffernd_which_peaks1.diminfo[0].strides = __pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_which_peaks1.diminfo[0].shape = __pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_which_peaks1));
    __pyx_v_which_peaks1 = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3154
 *             qpos = self.where_peaks[chrom]
 *             which_peaks1 = self.which_peaks1[chrom]
 *             which_peaks2 = self.which_peaks2[chrom]             # <<<<<<<<<<<<<<
 *             try: peaks1 = self.p1io.get_data_from_chrom(chrom)
 *             except KeyError: peaks1 = []
 */
    if (unlikely(((PyObject *)__pyx_v_self->which_peaks2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->which_peaks2), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer, (PyObject*)__pyx_v_which_peaks2, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_which_peaks2.diminfo[0].strides = __pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_which_peaks2.diminfo[0].shape = __pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_which_peaks2));
    __pyx_v_which_peaks2 = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3155
 *             which_peaks1 = self.which_peaks1[chrom]
 *             which_peaks2 = self.which_peaks2[chrom]
 *             try: peaks1 = self.p1io.get_data_from_chrom(chrom)             # <<<<<<<<<<<<<<
 *             except KeyError: peaks1 = []
 *             npeaks1 = len(peaks1)
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->p1io, __pyx_n_s__get_data_from_chrom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3155; __pyx_clineno = __LINE__; goto __pyx_L38_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3155; __pyx_clineno = __LINE__; goto __pyx_L38_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);
        __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3155; __pyx_clineno = __LINE__; goto __pyx_L38_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        if (!(likely(PyList_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3155; __pyx_clineno = __LINE__; goto __pyx_L38_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_peaks1));
        __pyx_v_peaks1 = ((PyObject*)__pyx_t_8);
        __pyx_t_8 = 0;
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L45_try_end;
      __pyx_L38_error:;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3156
 *             which_peaks2 = self.which_peaks2[chrom]
 *             try: peaks1 = self.p1io.get_data_from_chrom(chrom)
 *             except KeyError: peaks1 = []             # <<<<<<<<<<<<<<
 *             npeaks1 = len(peaks1)
 *             try: peaks2 = self.p2io.get_data_from_chrom(chrom)
 */
      __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_12) {
        __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks2", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L40_except_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L40_except_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_XDECREF(((PyObject *)__pyx_v_peaks1));
        __pyx_v_peaks1 = ((PyObject*)__pyx_t_14);
        __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L39_exception_handled;
      }
      __pyx_L40_except_error:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L39_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
      __pyx_L45_try_end:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":3157
 *             try: peaks1 = self.p1io.get_data_from_chrom(chrom)
 *             except KeyError: peaks1 = []
 *             npeaks1 = len(peaks1)             # <<<<<<<<<<<<<<
 *             try: peaks2 = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []
 */
    if (unlikely(((PyObject *)__pyx_v_peaks1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = PyList_GET_SIZE(((PyObject *)__pyx_v_peaks1)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_npeaks1 = __pyx_t_15;

    /* "MACS2/IO/cScoreTrack.pyx":3158
 *             except KeyError: peaks1 = []
 *             npeaks1 = len(peaks1)
 *             try: peaks2 = self.p2io.get_data_from_chrom(chrom)             # <<<<<<<<<<<<<<
 *             except KeyError: peaks2 = []
 *             npeaks2 = len(peaks2)
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->p2io, __pyx_n_s__get_data_from_chrom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L48_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);
        __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        if (!(likely(PyList_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_peaks2));
        __pyx_v_peaks2 = ((PyObject*)__pyx_t_8);
        __pyx_t_8 = 0;
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L55_try_end;
      __pyx_L48_error:;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3159
 *             npeaks1 = len(peaks1)
 *             try: peaks2 = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []             # <<<<<<<<<<<<<<
 *             npeaks2 = len(peaks2)
 *             t1 = self.t1[chrom]
 */
      __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_12) {
        __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks2", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3159; __pyx_clineno = __LINE__; goto __pyx_L50_except_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3159; __pyx_clineno = __LINE__; goto __pyx_L50_except_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_XDECREF(((PyObject *)__pyx_v_peaks2));
        __pyx_v_peaks2 = ((PyObject*)__pyx_t_14);
        __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L49_exception_handled;
      }
      __pyx_L50_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L49_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      __pyx_L55_try_end:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":3160
 *             try: peaks2 = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []
 *             npeaks2 = len(peaks2)             # <<<<<<<<<<<<<<
 *             t1 = self.t1[chrom]
 *             t2 = self.t2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_peaks2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = PyList_GET_SIZE(((PyObject *)__pyx_v_peaks2)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_npeaks2 = __pyx_t_15;

    /* "MACS2/IO/cScoreTrack.pyx":3161
 *             except KeyError: peaks2 = []
 *             npeaks2 = len(peaks2)
 *             t1 = self.t1[chrom]             # <<<<<<<<<<<<<<
 *             t2 = self.t2[chrom]
 *             c1 = self.c1[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t1.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t1.rcbuffer->pybuffer, (PyObject*)__pyx_v_t1, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        }
      }
      __pyx_pybuffernd_t1.diminfo[0].strides = __pyx_pybuffernd_t1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t1.diminfo[0].shape = __pyx_pybuffernd_t1.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_t1));
    __pyx_v_t1 = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3162
 *             npeaks2 = len(peaks2)
 *             t1 = self.t1[chrom]
 *             t2 = self.t2[chrom]             # <<<<<<<<<<<<<<
 *             c1 = self.c1[chrom]
 *             c2 = self.c2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t2), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t2.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t2.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t2.rcbuffer->pybuffer, (PyObject*)__pyx_v_t2, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_t2.diminfo[0].strides = __pyx_pybuffernd_t2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t2.diminfo[0].shape = __pyx_pybuffernd_t2.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_t2));
    __pyx_v_t2 = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3163
 *             t1 = self.t1[chrom]
 *             t2 = self.t2[chrom]
 *             c1 = self.c1[chrom]             # <<<<<<<<<<<<<<
 *             c2 = self.c2[chrom]
 *             diff_pvalues = self.t1vs2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->c1) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c1), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c1.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c1.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c1.rcbuffer->pybuffer, (PyObject*)__pyx_v_c1, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        }
      }
      __pyx_pybuffernd_c1.diminfo[0].strides = __pyx_pybuffernd_c1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c1.diminfo[0].shape = __pyx_pybuffernd_c1.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_c1));
    __pyx_v_c1 = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3164
 *             t2 = self.t2[chrom]
 *             c1 = self.c1[chrom]
 *             c2 = self.c2[chrom]             # <<<<<<<<<<<<<<
 *             diff_pvalues = self.t1vs2[chrom]
 *             diff_qvalues = self.diff_qvalues[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->c2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->c2), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c2.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c2.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c2.rcbuffer->pybuffer, (PyObject*)__pyx_v_c2, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_c2.diminfo[0].strides = __pyx_pybuffernd_c2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c2.diminfo[0].shape = __pyx_pybuffernd_c2.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_c2));
    __pyx_v_c2 = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3165
 *             c1 = self.c1[chrom]
 *             c2 = self.c2[chrom]
 *             diff_pvalues = self.t1vs2[chrom]             # <<<<<<<<<<<<<<
 *             diff_qvalues = self.diff_qvalues[chrom]
 *             diff_logLR = self.tlogLR[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_17 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer, (PyObject*)__pyx_v_diff_pvalues, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        }
      }
      __pyx_pybuffernd_diff_pvalues.diminfo[0].strides = __pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_diff_pvalues.diminfo[0].shape = __pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_17 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_diff_pvalues));
    __pyx_v_diff_pvalues = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3166
 *             c2 = self.c2[chrom]
 *             diff_pvalues = self.t1vs2[chrom]
 *             diff_qvalues = self.diff_qvalues[chrom]             # <<<<<<<<<<<<<<
 *             diff_logLR = self.tlogLR[chrom]
 *             if self.diff_scoring_method == 'q':
 */
    if (unlikely(((PyObject *)__pyx_v_self->diff_qvalues) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_qvalues), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_17 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_v_diff_qvalues, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_diff_qvalues.diminfo[0].strides = __pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_diff_qvalues.diminfo[0].shape = __pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_17 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_diff_qvalues));
    __pyx_v_diff_qvalues = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3167
 *             diff_pvalues = self.t1vs2[chrom]
 *             diff_qvalues = self.diff_qvalues[chrom]
 *             diff_logLR = self.tlogLR[chrom]             # <<<<<<<<<<<<<<
 *             if self.diff_scoring_method == 'q':
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 */
    if (unlikely(((PyObject *)__pyx_v_self->tlogLR) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tlogLR), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_17 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer, (PyObject*)__pyx_v_diff_logLR, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        }
      }
      __pyx_pybuffernd_diff_logLR.diminfo[0].strides = __pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_diff_logLR.diminfo[0].shape = __pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_17 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_diff_logLR));
    __pyx_v_diff_logLR = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3168
 *             diff_qvalues = self.diff_qvalues[chrom]
 *             diff_logLR = self.tlogLR[chrom]
 *             if self.diff_scoring_method == 'q':             # <<<<<<<<<<<<<<
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')
 */
    __pyx_t_3 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_self->diff_scoring_method), ((PyObject *)__pyx_n_s__q), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "MACS2/IO/cScoreTrack.pyx":3169
 *             diff_logLR = self.tlogLR[chrom]
 *             if self.diff_scoring_method == 'q':
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=             # <<<<<<<<<<<<<<
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__where); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(((PyObject *)__pyx_v_self->diff_qvalues) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_qvalues), __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);

      /* "MACS2/IO/cScoreTrack.pyx":3170
 *             if self.diff_scoring_method == 'q':
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')
 */
      __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_14 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GE); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_14, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__astype); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_k_tuple_117), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = ((PyArrayObject *)__pyx_t_8);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer);
        __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_12 < 0)) {
          PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer, (PyObject*)__pyx_v_above_cutoff, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
          }
        }
        __pyx_pybuffernd_above_cutoff.diminfo[0].strides = __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_above_cutoff.diminfo[0].shape = __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_above_cutoff));
      __pyx_v_above_cutoff = ((PyArrayObject *)__pyx_t_8);
      __pyx_t_8 = 0;
      goto __pyx_L58;
    }

    /* "MACS2/IO/cScoreTrack.pyx":3171
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':             # <<<<<<<<<<<<<<
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')
 *             # use some extra memory so we don't have to reallocate every time
 */
    __pyx_t_3 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_self->diff_scoring_method), ((PyObject *)__pyx_n_s__p), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "MACS2/IO/cScoreTrack.pyx":3172
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             # use some extra memory so we don't have to reallocate every time
 *             peaks1_selection = np.ndarray(npeaks1, 'int32')
 */
      __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_14 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__where); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), __pyx_v_chrom); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->where_peaks), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetItem(__pyx_t_8, __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_118), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer);
        __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_12 < 0)) {
          PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer, (PyObject*)__pyx_v_above_cutoff, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
          }
        }
        __pyx_pybuffernd_above_cutoff.diminfo[0].strides = __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_above_cutoff.diminfo[0].shape = __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_above_cutoff));
      __pyx_v_above_cutoff = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L58;
    }
    __pyx_L58:;

    /* "MACS2/IO/cScoreTrack.pyx":3174
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')
 *             # use some extra memory so we don't have to reallocate every time
 *             peaks1_selection = np.ndarray(npeaks1, 'int32')             # <<<<<<<<<<<<<<
 *             peaks2_selection = np.ndarray(npeaks2, 'int32')
 *             for first_i, last_i, n_peak in self.diff_peaks[chrom]:
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_npeaks1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__int32));
    PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_n_s__int32));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5MACS2_2IO_5numpy_ndarray)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peaks1_selection.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peaks1_selection.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peaks1_selection.rcbuffer->pybuffer, (PyObject*)__pyx_v_peaks1_selection, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        }
      }
      __pyx_pybuffernd_peaks1_selection.diminfo[0].strides = __pyx_pybuffernd_peaks1_selection.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_peaks1_selection.diminfo[0].shape = __pyx_pybuffernd_peaks1_selection.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_XDECREF(((PyObject *)__pyx_v_peaks1_selection));
    __pyx_v_peaks1_selection = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3175
 *             # use some extra memory so we don't have to reallocate every time
 *             peaks1_selection = np.ndarray(npeaks1, 'int32')
 *             peaks2_selection = np.ndarray(npeaks2, 'int32')             # <<<<<<<<<<<<<<
 *             for first_i, last_i, n_peak in self.diff_peaks[chrom]:
 *                 # this is going to be one entry
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_npeaks2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__int32));
    PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_n_s__int32));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5MACS2_2IO_5numpy_ndarray)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peaks2_selection.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peaks2_selection.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peaks2_selection.rcbuffer->pybuffer, (PyObject*)__pyx_v_peaks2_selection, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        }
      }
      __pyx_pybuffernd_peaks2_selection.diminfo[0].strides = __pyx_pybuffernd_peaks2_selection.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_peaks2_selection.diminfo[0].shape = __pyx_pybuffernd_peaks2_selection.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_XDECREF(((PyObject *)__pyx_v_peaks2_selection));
    __pyx_v_peaks2_selection = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3176
 *             peaks1_selection = np.ndarray(npeaks1, 'int32')
 *             peaks2_selection = np.ndarray(npeaks2, 'int32')
 *             for first_i, last_i, n_peak in self.diff_peaks[chrom]:             # <<<<<<<<<<<<<<
 *                 # this is going to be one entry
 *                 start_i = above_cutoff[first_i]
 */
    if (unlikely(((PyObject *)__pyx_v_self->diff_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_peaks), __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
      __pyx_t_18 = NULL;
    } else {
      __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_18 = Py_TYPE(__pyx_t_8)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_18 && PyList_CheckExact(__pyx_t_8)) {
        if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_18 && PyTuple_CheckExact(__pyx_t_8)) {
        if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_18(__pyx_t_8);
        if (unlikely(!__pyx_t_1)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_19 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_14 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_19 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_19);
        #else
        __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_19 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_20 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_21 = Py_TYPE(__pyx_t_20)->tp_iternext;
        index = 0; __pyx_t_14 = __pyx_t_21(__pyx_t_20); if (unlikely(!__pyx_t_14)) goto __pyx_L61_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_14);
        index = 1; __pyx_t_2 = __pyx_t_21(__pyx_t_20); if (unlikely(!__pyx_t_2)) goto __pyx_L61_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        index = 2; __pyx_t_19 = __pyx_t_21(__pyx_t_20); if (unlikely(!__pyx_t_19)) goto __pyx_L61_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_19);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_20), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_21 = NULL;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        goto __pyx_L62_unpacking_done;
        __pyx_L61_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_21 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L62_unpacking_done:;
      }
      __pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_t_14); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_22 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_23 = __Pyx_PyInt_AsInt(__pyx_t_19); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_v_first_i = __pyx_t_12;
      __pyx_v_last_i = __pyx_t_22;
      __pyx_v_n_peak = __pyx_t_23;

      /* "MACS2/IO/cScoreTrack.pyx":3178
 *             for first_i, last_i, n_peak in self.diff_peaks[chrom]:
 *                 # this is going to be one entry
 *                 start_i = above_cutoff[first_i]             # <<<<<<<<<<<<<<
 *                 end_i = above_cutoff[last_i]
 *                 pos_start = qpos[start_i] - 1
 */
      __pyx_t_23 = __pyx_v_first_i;
      __pyx_t_22 = -1;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_pybuffernd_above_cutoff.diminfo[0].shape;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_22 = 0;
      } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_above_cutoff.diminfo[0].shape)) __pyx_t_22 = 0;
      if (unlikely(__pyx_t_22 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_22);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_start_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_above_cutoff.diminfo[0].strides));

      /* "MACS2/IO/cScoreTrack.pyx":3179
 *                 # this is going to be one entry
 *                 start_i = above_cutoff[first_i]
 *                 end_i = above_cutoff[last_i]             # <<<<<<<<<<<<<<
 *                 pos_start = qpos[start_i] - 1
 *                 pos_end = qpos[end_i]
 */
      __pyx_t_22 = __pyx_v_last_i;
      __pyx_t_12 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_pybuffernd_above_cutoff.diminfo[0].shape;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_12 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_above_cutoff.diminfo[0].shape)) __pyx_t_12 = 0;
      if (unlikely(__pyx_t_12 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_12);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_end_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_above_cutoff.diminfo[0].strides));

      /* "MACS2/IO/cScoreTrack.pyx":3180
 *                 start_i = above_cutoff[first_i]
 *                 end_i = above_cutoff[last_i]
 *                 pos_start = qpos[start_i] - 1             # <<<<<<<<<<<<<<
 *                 pos_end = qpos[end_i]
 *                 i_peaks1 = np.unique(which_peaks1[start_i:(end_i + 1)]).astype('int32')
 */
      __pyx_t_12 = __pyx_v_start_i;
      __pyx_t_24 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_pybuffernd_qpos.diminfo[0].shape;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_24 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_qpos.diminfo[0].shape)) __pyx_t_24 = 0;
      if (unlikely(__pyx_t_24 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_24);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_qpos.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_qpos.diminfo[0].strides)) - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_v_pos_start);
      __pyx_v_pos_start = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3181
 *                 end_i = above_cutoff[last_i]
 *                 pos_start = qpos[start_i] - 1
 *                 pos_end = qpos[end_i]             # <<<<<<<<<<<<<<
 *                 i_peaks1 = np.unique(which_peaks1[start_i:(end_i + 1)]).astype('int32')
 *                 try:
 */
      __pyx_t_24 = __pyx_v_end_i;
      __pyx_t_25 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_qpos.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_25 = 0;
      } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_qpos.diminfo[0].shape)) __pyx_t_25 = 0;
      if (unlikely(__pyx_t_25 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_25);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_qpos.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_qpos.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_v_pos_end);
      __pyx_v_pos_end = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3182
 *                 pos_start = qpos[start_i] - 1
 *                 pos_end = qpos[end_i]
 *                 i_peaks1 = np.unique(which_peaks1[start_i:(end_i + 1)]).astype('int32')             # <<<<<<<<<<<<<<
 *                 try:
 *                     if i_peaks1[0] == -1: i_peaks1 = i_peaks1[1:]
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_19 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__unique); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_which_peaks1), __pyx_v_start_i, (__pyx_v_end_i + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_119), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_26 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer);
        __pyx_t_25 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_25 < 0)) {
          PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer, (PyObject*)__pyx_v_i_peaks1, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
          }
        }
        __pyx_pybuffernd_i_peaks1.diminfo[0].strides = __pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_i_peaks1.diminfo[0].shape = __pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_25 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_26 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_i_peaks1));
      __pyx_v_i_peaks1 = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3183
 *                 pos_end = qpos[end_i]
 *                 i_peaks1 = np.unique(which_peaks1[start_i:(end_i + 1)]).astype('int32')
 *                 try:             # <<<<<<<<<<<<<<
 *                     if i_peaks1[0] == -1: i_peaks1 = i_peaks1[1:]
 *                 except IndexError: pass
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_5);
        /*try:*/ {

          /* "MACS2/IO/cScoreTrack.pyx":3184
 *                 i_peaks1 = np.unique(which_peaks1[start_i:(end_i + 1)]).astype('int32')
 *                 try:
 *                     if i_peaks1[0] == -1: i_peaks1 = i_peaks1[1:]             # <<<<<<<<<<<<<<
 *                 except IndexError: pass
 *                 i_peaks2 = np.unique(which_peaks2[start_i:(end_i + 1)]).astype('int32')
 */
          __pyx_t_27 = 0;
          __pyx_t_25 = -1;
          if (__pyx_t_27 < 0) {
            __pyx_t_27 += __pyx_pybuffernd_i_peaks1.diminfo[0].shape;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_25 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_i_peaks1.diminfo[0].shape)) __pyx_t_25 = 0;
          if (unlikely(__pyx_t_25 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_25);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3184; __pyx_clineno = __LINE__; goto __pyx_L63_error;}
          }
          __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_i_peaks1.diminfo[0].strides)) == -1);
          if (__pyx_t_3) {
            __pyx_t_1 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_i_peaks1), 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3184; __pyx_clineno = __LINE__; goto __pyx_L63_error;}
            __Pyx_GOTREF(__pyx_t_1);
            if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3184; __pyx_clineno = __LINE__; goto __pyx_L63_error;}
            __pyx_t_26 = ((PyArrayObject *)__pyx_t_1);
            {
              __Pyx_BufFmt_StackElem __pyx_stack[1];
              __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer);
              __pyx_t_25 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
              if (unlikely(__pyx_t_25 < 0)) {
                PyErr_Fetch(&__pyx_t_28, &__pyx_t_29, &__pyx_t_30);
                if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer, (PyObject*)__pyx_v_i_peaks1, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
                  Py_XDECREF(__pyx_t_28); Py_XDECREF(__pyx_t_29); Py_XDECREF(__pyx_t_30);
                  __Pyx_RaiseBufferFallbackError();
                } else {
                  PyErr_Restore(__pyx_t_28, __pyx_t_29, __pyx_t_30);
                }
              }
              __pyx_pybuffernd_i_peaks1.diminfo[0].strides = __pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_i_peaks1.diminfo[0].shape = __pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer.shape[0];
              if (unlikely(__pyx_t_25 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3184; __pyx_clineno = __LINE__; goto __pyx_L63_error;}
            }
            __pyx_t_26 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_v_i_peaks1));
            __pyx_v_i_peaks1 = ((PyArrayObject *)__pyx_t_1);
            __pyx_t_1 = 0;
            goto __pyx_L71;
          }
          __pyx_L71:;
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L70_try_end;
        __pyx_L63_error:;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3185
 *                 try:
 *                     if i_peaks1[0] == -1: i_peaks1 = i_peaks1[1:]
 *                 except IndexError: pass             # <<<<<<<<<<<<<<
 *                 i_peaks2 = np.unique(which_peaks2[start_i:(end_i + 1)]).astype('int32')
 *                 try:
 */
        __pyx_t_25 = PyErr_ExceptionMatches(__pyx_builtin_IndexError);
        if (__pyx_t_25) {
          PyErr_Restore(0,0,0);
          goto __pyx_L64_exception_handled;
        }
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        goto __pyx_L1_error;
        __pyx_L64_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        __pyx_L70_try_end:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":3186
 *                     if i_peaks1[0] == -1: i_peaks1 = i_peaks1[1:]
 *                 except IndexError: pass
 *                 i_peaks2 = np.unique(which_peaks2[start_i:(end_i + 1)]).astype('int32')             # <<<<<<<<<<<<<<
 *                 try:
 *                     if i_peaks2[0] == -1: i_peaks2 = i_peaks2[1:]
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__unique); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_which_peaks2), __pyx_v_start_i, (__pyx_v_end_i + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
      __pyx_t_19 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_26 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer);
        __pyx_t_25 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_25 < 0)) {
          PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer, (PyObject*)__pyx_v_i_peaks2, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
          }
        }
        __pyx_pybuffernd_i_peaks2.diminfo[0].strides = __pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_i_peaks2.diminfo[0].shape = __pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_25 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_26 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_i_peaks2));
      __pyx_v_i_peaks2 = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3187
 *                 except IndexError: pass
 *                 i_peaks2 = np.unique(which_peaks2[start_i:(end_i + 1)]).astype('int32')
 *                 try:             # <<<<<<<<<<<<<<
 *                     if i_peaks2[0] == -1: i_peaks2 = i_peaks2[1:]
 *                 except IndexError: pass
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_5);
        /*try:*/ {

          /* "MACS2/IO/cScoreTrack.pyx":3188
 *                 i_peaks2 = np.unique(which_peaks2[start_i:(end_i + 1)]).astype('int32')
 *                 try:
 *                     if i_peaks2[0] == -1: i_peaks2 = i_peaks2[1:]             # <<<<<<<<<<<<<<
 *                 except IndexError: pass
 * 
 */
          __pyx_t_31 = 0;
          __pyx_t_25 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_i_peaks2.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_25 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_i_peaks2.diminfo[0].shape)) __pyx_t_25 = 0;
          if (unlikely(__pyx_t_25 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_25);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
          }
          __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_i_peaks2.diminfo[0].strides)) == -1);
          if (__pyx_t_3) {
            __pyx_t_1 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_i_peaks2), 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
            __Pyx_GOTREF(__pyx_t_1);
            if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
            __pyx_t_26 = ((PyArrayObject *)__pyx_t_1);
            {
              __Pyx_BufFmt_StackElem __pyx_stack[1];
              __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer);
              __pyx_t_25 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
              if (unlikely(__pyx_t_25 < 0)) {
                PyErr_Fetch(&__pyx_t_30, &__pyx_t_29, &__pyx_t_28);
                if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer, (PyObject*)__pyx_v_i_peaks2, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
                  Py_XDECREF(__pyx_t_30); Py_XDECREF(__pyx_t_29); Py_XDECREF(__pyx_t_28);
                  __Pyx_RaiseBufferFallbackError();
                } else {
                  PyErr_Restore(__pyx_t_30, __pyx_t_29, __pyx_t_28);
                }
              }
              __pyx_pybuffernd_i_peaks2.diminfo[0].strides = __pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_i_peaks2.diminfo[0].shape = __pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer.shape[0];
              if (unlikely(__pyx_t_25 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L72_error;}
            }
            __pyx_t_26 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_v_i_peaks2));
            __pyx_v_i_peaks2 = ((PyArrayObject *)__pyx_t_1);
            __pyx_t_1 = 0;
            goto __pyx_L80;
          }
          __pyx_L80:;
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L79_try_end;
        __pyx_L72_error:;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3189
 *                 try:
 *                     if i_peaks2[0] == -1: i_peaks2 = i_peaks2[1:]
 *                 except IndexError: pass             # <<<<<<<<<<<<<<
 * 
 *                 # get additional subpeaks as needed
 */
        __pyx_t_25 = PyErr_ExceptionMatches(__pyx_builtin_IndexError);
        if (__pyx_t_25) {
          PyErr_Restore(0,0,0);
          goto __pyx_L73_exception_handled;
        }
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        goto __pyx_L1_error;
        __pyx_L73_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        __pyx_L79_try_end:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":3193
 *                 # get additional subpeaks as needed
 *                 # i1 is the number of subpeaks in peaks1
 *                 i1 = _get_all_subpeaks(peaks1, i_peaks1, peaks1_selection)             # <<<<<<<<<<<<<<
 * #                i1 = peaks1_selection
 *                 i2 = _get_all_subpeaks(peaks2, i_peaks2, peaks2_selection)
 */
      __pyx_v_i1 = __pyx_f_5MACS2_2IO_11cScoreTrack__get_all_subpeaks(__pyx_v_peaks1, ((PyArrayObject *)__pyx_v_i_peaks1), ((PyArrayObject *)__pyx_v_peaks1_selection));

      /* "MACS2/IO/cScoreTrack.pyx":3195
 *                 i1 = _get_all_subpeaks(peaks1, i_peaks1, peaks1_selection)
 * #                i1 = peaks1_selection
 *                 i2 = _get_all_subpeaks(peaks2, i_peaks2, peaks2_selection)             # <<<<<<<<<<<<<<
 * #                i2 = peaks2_selection.size
 * #                i2 = 0
 */
      __pyx_v_i2 = __pyx_f_5MACS2_2IO_11cScoreTrack__get_all_subpeaks(__pyx_v_peaks2, ((PyArrayObject *)__pyx_v_i_peaks2), ((PyArrayObject *)__pyx_v_peaks2_selection));

      /* "MACS2/IO/cScoreTrack.pyx":3210
 * #                        else: break
 *                 # find the best overlapping subpeak
 *                 if i1 > 0:             # <<<<<<<<<<<<<<
 *                     peak1_present = True
 *                     peak1_selection_i = 0
 */
      __pyx_t_3 = (__pyx_v_i1 > 0);
      if (__pyx_t_3) {

        /* "MACS2/IO/cScoreTrack.pyx":3211
 *                 # find the best overlapping subpeak
 *                 if i1 > 0:
 *                     peak1_present = True             # <<<<<<<<<<<<<<
 *                     peak1_selection_i = 0
 *                     for j in range(1, i1):
 */
        __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_peak1_present));
        __pyx_v_peak1_present = ((PyBoolObject *)__pyx_t_1);
        __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3212
 *                 if i1 > 0:
 *                     peak1_present = True
 *                     peak1_selection_i = 0             # <<<<<<<<<<<<<<
 *                     for j in range(1, i1):
 *                         if peaks1[peaks1_selection[j]]["pileup"] > \
 */
        __pyx_v_peak1_selection_i = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3213
 *                     peak1_present = True
 *                     peak1_selection_i = 0
 *                     for j in range(1, i1):             # <<<<<<<<<<<<<<
 *                         if peaks1[peaks1_selection[j]]["pileup"] > \
 *                            peaks1[peaks1_selection[peak1_selection_i]]["pileup"]:
 */
        __pyx_t_25 = __pyx_v_i1;
        for (__pyx_t_32 = 1; __pyx_t_32 < __pyx_t_25; __pyx_t_32+=1) {
          __pyx_v_j = __pyx_t_32;

          /* "MACS2/IO/cScoreTrack.pyx":3214
 *                     peak1_selection_i = 0
 *                     for j in range(1, i1):
 *                         if peaks1[peaks1_selection[j]]["pileup"] > \             # <<<<<<<<<<<<<<
 *                            peaks1[peaks1_selection[peak1_selection_i]]["pileup"]:
 *                             peak1_selection_i = j
 */
          if (unlikely(((PyObject *)__pyx_v_peaks1) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_33 = __pyx_v_j;
          __pyx_t_34 = -1;
          if (__pyx_t_33 < 0) {
            __pyx_t_33 += __pyx_pybuffernd_peaks1_selection.diminfo[0].shape;
            if (unlikely(__pyx_t_33 < 0)) __pyx_t_34 = 0;
          } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_peaks1_selection.diminfo[0].shape)) __pyx_t_34 = 0;
          if (unlikely(__pyx_t_34 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_34);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_35 = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_peaks1_selection.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_peaks1_selection.diminfo[0].strides));
          __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks1), __pyx_t_35, sizeof(__pyx_t_5MACS2_2IO_5numpy_int32_t), __Pyx_PyInt_to_py_npy_int32); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_19 = PyObject_GetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__pileup)); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3215
 *                     for j in range(1, i1):
 *                         if peaks1[peaks1_selection[j]]["pileup"] > \
 *                            peaks1[peaks1_selection[peak1_selection_i]]["pileup"]:             # <<<<<<<<<<<<<<
 *                             peak1_selection_i = j
 *                     peak1_i = peaks1_selection[peak1_selection_i]
 */
          if (unlikely(((PyObject *)__pyx_v_peaks1) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_34 = __pyx_v_peak1_selection_i;
          __pyx_t_36 = -1;
          if (__pyx_t_34 < 0) {
            __pyx_t_34 += __pyx_pybuffernd_peaks1_selection.diminfo[0].shape;
            if (unlikely(__pyx_t_34 < 0)) __pyx_t_36 = 0;
          } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_peaks1_selection.diminfo[0].shape)) __pyx_t_36 = 0;
          if (unlikely(__pyx_t_36 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_36);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_35 = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_peaks1_selection.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_peaks1_selection.diminfo[0].strides));
          __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks1), __pyx_t_35, sizeof(__pyx_t_5MACS2_2IO_5numpy_int32_t), __Pyx_PyInt_to_py_npy_int32); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyObject_GetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__pileup)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_RichCompare(__pyx_t_19, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_3) {

            /* "MACS2/IO/cScoreTrack.pyx":3216
 *                         if peaks1[peaks1_selection[j]]["pileup"] > \
 *                            peaks1[peaks1_selection[peak1_selection_i]]["pileup"]:
 *                             peak1_selection_i = j             # <<<<<<<<<<<<<<
 *                     peak1_i = peaks1_selection[peak1_selection_i]
 *                     peak1 = peaks1[peak1_i]
 */
            __pyx_v_peak1_selection_i = __pyx_v_j;
            goto __pyx_L84;
          }
          __pyx_L84:;
        }

        /* "MACS2/IO/cScoreTrack.pyx":3217
 *                            peaks1[peaks1_selection[peak1_selection_i]]["pileup"]:
 *                             peak1_selection_i = j
 *                     peak1_i = peaks1_selection[peak1_selection_i]             # <<<<<<<<<<<<<<
 *                     peak1 = peaks1[peak1_i]
 *                     peak1_pos_i = peak1_pos_i + pos[peak1_pos_i:].searchsorted(peak1["summit"])
 */
        __pyx_t_25 = __pyx_v_peak1_selection_i;
        __pyx_t_36 = -1;
        if (__pyx_t_25 < 0) {
          __pyx_t_25 += __pyx_pybuffernd_peaks1_selection.diminfo[0].shape;
          if (unlikely(__pyx_t_25 < 0)) __pyx_t_36 = 0;
        } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_peaks1_selection.diminfo[0].shape)) __pyx_t_36 = 0;
        if (unlikely(__pyx_t_36 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_36);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_peak1_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_peaks1_selection.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_peaks1_selection.diminfo[0].strides));

        /* "MACS2/IO/cScoreTrack.pyx":3218
 *                             peak1_selection_i = j
 *                     peak1_i = peaks1_selection[peak1_selection_i]
 *                     peak1 = peaks1[peak1_i]             # <<<<<<<<<<<<<<
 *                     peak1_pos_i = peak1_pos_i + pos[peak1_pos_i:].searchsorted(peak1["summit"])
 *                 else: peak1_present = False
 */
        if (unlikely(((PyObject *)__pyx_v_peaks1) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks1), __pyx_v_peak1_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_peak1));
        __pyx_v_peak1 = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3219
 *                     peak1_i = peaks1_selection[peak1_selection_i]
 *                     peak1 = peaks1[peak1_i]
 *                     peak1_pos_i = peak1_pos_i + pos[peak1_pos_i:].searchsorted(peak1["summit"])             # <<<<<<<<<<<<<<
 *                 else: peak1_present = False
 * 
 */
        __pyx_t_1 = PyInt_FromLong(__pyx_v_peak1_pos_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_pos), __pyx_v_peak1_pos_i, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_19 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(((PyObject *)__pyx_v_peak1) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_peak1), ((PyObject *)__pyx_n_s__summit)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __pyx_t_14 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_36 = __Pyx_PyInt_AsInt(__pyx_t_14); if (unlikely((__pyx_t_36 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_v_peak1_pos_i = __pyx_t_36;
        goto __pyx_L81;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":3220
 *                     peak1 = peaks1[peak1_i]
 *                     peak1_pos_i = peak1_pos_i + pos[peak1_pos_i:].searchsorted(peak1["summit"])
 *                 else: peak1_present = False             # <<<<<<<<<<<<<<
 * 
 *                 if i2 > 0:
 */
        __pyx_t_14 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        if (!(likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_peak1_present));
        __pyx_v_peak1_present = ((PyBoolObject *)__pyx_t_14);
        __pyx_t_14 = 0;
      }
      __pyx_L81:;

      /* "MACS2/IO/cScoreTrack.pyx":3222
 *                 else: peak1_present = False
 * 
 *                 if i2 > 0:             # <<<<<<<<<<<<<<
 *                     peak2_present = True
 *                     peak2_selection_i = 0
 */
      __pyx_t_3 = (__pyx_v_i2 > 0);
      if (__pyx_t_3) {

        /* "MACS2/IO/cScoreTrack.pyx":3223
 * 
 *                 if i2 > 0:
 *                     peak2_present = True             # <<<<<<<<<<<<<<
 *                     peak2_selection_i = 0
 *                     for j in range(1, i2):
 */
        __pyx_t_14 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        if (!(likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_peak2_present));
        __pyx_v_peak2_present = ((PyBoolObject *)__pyx_t_14);
        __pyx_t_14 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3224
 *                 if i2 > 0:
 *                     peak2_present = True
 *                     peak2_selection_i = 0             # <<<<<<<<<<<<<<
 *                     for j in range(1, i2):
 *                         if peaks2[peaks2_selection[j]]["pileup"] > \
 */
        __pyx_v_peak2_selection_i = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3225
 *                     peak2_present = True
 *                     peak2_selection_i = 0
 *                     for j in range(1, i2):             # <<<<<<<<<<<<<<
 *                         if peaks2[peaks2_selection[j]]["pileup"] > \
 *                            peaks2[peaks2_selection[peak2_selection_i]]["pileup"]:
 */
        __pyx_t_36 = __pyx_v_i2;
        for (__pyx_t_32 = 1; __pyx_t_32 < __pyx_t_36; __pyx_t_32+=1) {
          __pyx_v_j = __pyx_t_32;

          /* "MACS2/IO/cScoreTrack.pyx":3226
 *                     peak2_selection_i = 0
 *                     for j in range(1, i2):
 *                         if peaks2[peaks2_selection[j]]["pileup"] > \             # <<<<<<<<<<<<<<
 *                            peaks2[peaks2_selection[peak2_selection_i]]["pileup"]:
 *                             peak2_selection_i = j
 */
          if (unlikely(((PyObject *)__pyx_v_peaks2) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_37 = __pyx_v_j;
          __pyx_t_38 = -1;
          if (__pyx_t_37 < 0) {
            __pyx_t_37 += __pyx_pybuffernd_peaks2_selection.diminfo[0].shape;
            if (unlikely(__pyx_t_37 < 0)) __pyx_t_38 = 0;
          } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_peaks2_selection.diminfo[0].shape)) __pyx_t_38 = 0;
          if (unlikely(__pyx_t_38 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_38);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_35 = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_peaks2_selection.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_peaks2_selection.diminfo[0].strides));
          __pyx_t_14 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks2), __pyx_t_35, sizeof(__pyx_t_5MACS2_2IO_5numpy_int32_t), __Pyx_PyInt_to_py_npy_int32); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_2 = PyObject_GetItem(__pyx_t_14, ((PyObject *)__pyx_n_s__pileup)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3227
 *                     for j in range(1, i2):
 *                         if peaks2[peaks2_selection[j]]["pileup"] > \
 *                            peaks2[peaks2_selection[peak2_selection_i]]["pileup"]:             # <<<<<<<<<<<<<<
 *                             peak2_selection_i = j
 *                     peak2_i = peaks2_selection[peak2_selection_i]
 */
          if (unlikely(((PyObject *)__pyx_v_peaks2) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_38 = __pyx_v_peak2_selection_i;
          __pyx_t_39 = -1;
          if (__pyx_t_38 < 0) {
            __pyx_t_38 += __pyx_pybuffernd_peaks2_selection.diminfo[0].shape;
            if (unlikely(__pyx_t_38 < 0)) __pyx_t_39 = 0;
          } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_peaks2_selection.diminfo[0].shape)) __pyx_t_39 = 0;
          if (unlikely(__pyx_t_39 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_39);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_35 = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_peaks2_selection.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_peaks2_selection.diminfo[0].strides));
          __pyx_t_14 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks2), __pyx_t_35, sizeof(__pyx_t_5MACS2_2IO_5numpy_int32_t), __Pyx_PyInt_to_py_npy_int32); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_1 = PyObject_GetItem(__pyx_t_14, ((PyObject *)__pyx_n_s__pileup)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (__pyx_t_3) {

            /* "MACS2/IO/cScoreTrack.pyx":3228
 *                         if peaks2[peaks2_selection[j]]["pileup"] > \
 *                            peaks2[peaks2_selection[peak2_selection_i]]["pileup"]:
 *                             peak2_selection_i = j             # <<<<<<<<<<<<<<
 *                     peak2_i = peaks2_selection[peak2_selection_i]
 *                     peak2 = peaks2[peak2_i]
 */
            __pyx_v_peak2_selection_i = __pyx_v_j;
            goto __pyx_L88;
          }
          __pyx_L88:;
        }

        /* "MACS2/IO/cScoreTrack.pyx":3229
 *                            peaks2[peaks2_selection[peak2_selection_i]]["pileup"]:
 *                             peak2_selection_i = j
 *                     peak2_i = peaks2_selection[peak2_selection_i]             # <<<<<<<<<<<<<<
 *                     peak2 = peaks2[peak2_i]
 *                     peak2_pos_i = peak2_pos_i + pos[peak2_pos_i:].searchsorted(peak2["summit"])
 */
        __pyx_t_36 = __pyx_v_peak2_selection_i;
        __pyx_t_39 = -1;
        if (__pyx_t_36 < 0) {
          __pyx_t_36 += __pyx_pybuffernd_peaks2_selection.diminfo[0].shape;
          if (unlikely(__pyx_t_36 < 0)) __pyx_t_39 = 0;
        } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_peaks2_selection.diminfo[0].shape)) __pyx_t_39 = 0;
        if (unlikely(__pyx_t_39 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_39);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_peak2_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_peaks2_selection.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_peaks2_selection.diminfo[0].strides));

        /* "MACS2/IO/cScoreTrack.pyx":3230
 *                             peak2_selection_i = j
 *                     peak2_i = peaks2_selection[peak2_selection_i]
 *                     peak2 = peaks2[peak2_i]             # <<<<<<<<<<<<<<
 *                     peak2_pos_i = peak2_pos_i + pos[peak2_pos_i:].searchsorted(peak2["summit"])
 *                 else: peak2_present = False
 */
        if (unlikely(((PyObject *)__pyx_v_peaks2) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_14 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks2), __pyx_v_peak2_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        if (!(likely(PyDict_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_14)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_peak2));
        __pyx_v_peak2 = ((PyObject*)__pyx_t_14);
        __pyx_t_14 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3231
 *                     peak2_i = peaks2_selection[peak2_selection_i]
 *                     peak2 = peaks2[peak2_i]
 *                     peak2_pos_i = peak2_pos_i + pos[peak2_pos_i:].searchsorted(peak2["summit"])             # <<<<<<<<<<<<<<
 *                 else: peak2_present = False
 * 
 */
        __pyx_t_14 = PyInt_FromLong(__pyx_v_peak2_pos_i); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_1 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_pos), __pyx_v_peak2_pos_i, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(((PyObject *)__pyx_v_peak2) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_peak2), ((PyObject *)__pyx_n_s__summit)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
        __pyx_t_19 = PyNumber_Add(__pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_39 = __Pyx_PyInt_AsInt(__pyx_t_19); if (unlikely((__pyx_t_39 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_v_peak2_pos_i = __pyx_t_39;
        goto __pyx_L85;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":3232
 *                     peak2 = peaks2[peak2_i]
 *                     peak2_pos_i = peak2_pos_i + pos[peak2_pos_i:].searchsorted(peak2["summit"])
 *                 else: peak2_present = False             # <<<<<<<<<<<<<<
 * 
 *                 if not peak1_present:
 */
        __pyx_t_19 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        if (!(likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_peak2_present));
        __pyx_v_peak2_present = ((PyBoolObject *)__pyx_t_19);
        __pyx_t_19 = 0;
      }
      __pyx_L85:;

      /* "MACS2/IO/cScoreTrack.pyx":3234
 *                 else: peak2_present = False
 * 
 *                 if not peak1_present:             # <<<<<<<<<<<<<<
 *                     peak_pos_i = peak2_pos_i
 *                 elif not peak2_present:
 */
      __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_peak1_present)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_40 = (!__pyx_t_3);
      if (__pyx_t_40) {

        /* "MACS2/IO/cScoreTrack.pyx":3235
 * 
 *                 if not peak1_present:
 *                     peak_pos_i = peak2_pos_i             # <<<<<<<<<<<<<<
 *                 elif not peak2_present:
 *                     peak_pos_i = peak1_pos_i
 */
        __pyx_v_peak_pos_i = __pyx_v_peak2_pos_i;
        goto __pyx_L89;
      }

      /* "MACS2/IO/cScoreTrack.pyx":3236
 *                 if not peak1_present:
 *                     peak_pos_i = peak2_pos_i
 *                 elif not peak2_present:             # <<<<<<<<<<<<<<
 *                     peak_pos_i = peak1_pos_i
 *                 else: # peak in both samples
 */
      __pyx_t_40 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_peak2_present)); if (unlikely(__pyx_t_40 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = (!__pyx_t_40);
      if (__pyx_t_3) {

        /* "MACS2/IO/cScoreTrack.pyx":3237
 *                     peak_pos_i = peak2_pos_i
 *                 elif not peak2_present:
 *                     peak_pos_i = peak1_pos_i             # <<<<<<<<<<<<<<
 *                 else: # peak in both samples
 *                     if t1[peak1_pos_i] > t2[peak2_pos_i]:
 */
        __pyx_v_peak_pos_i = __pyx_v_peak1_pos_i;
        goto __pyx_L89;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":3239
 *                     peak_pos_i = peak1_pos_i
 *                 else: # peak in both samples
 *                     if t1[peak1_pos_i] > t2[peak2_pos_i]:             # <<<<<<<<<<<<<<
 *                         peak_pos_i = peak1_pos_i
 *                     else:
 */
        __pyx_t_39 = __pyx_v_peak1_pos_i;
        __pyx_t_41 = -1;
        if (__pyx_t_39 < 0) {
          __pyx_t_39 += __pyx_pybuffernd_t1.diminfo[0].shape;
          if (unlikely(__pyx_t_39 < 0)) __pyx_t_41 = 0;
        } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_t1.diminfo[0].shape)) __pyx_t_41 = 0;
        if (unlikely(__pyx_t_41 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_41);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_41 = __pyx_v_peak2_pos_i;
        __pyx_t_42 = -1;
        if (__pyx_t_41 < 0) {
          __pyx_t_41 += __pyx_pybuffernd_t2.diminfo[0].shape;
          if (unlikely(__pyx_t_41 < 0)) __pyx_t_42 = 0;
        } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_t2.diminfo[0].shape)) __pyx_t_42 = 0;
        if (unlikely(__pyx_t_42 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_42);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t1.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_t1.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t2.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_t2.diminfo[0].strides)));
        if (__pyx_t_3) {

          /* "MACS2/IO/cScoreTrack.pyx":3240
 *                 else: # peak in both samples
 *                     if t1[peak1_pos_i] > t2[peak2_pos_i]:
 *                         peak_pos_i = peak1_pos_i             # <<<<<<<<<<<<<<
 *                     else:
 *                         peak_pos_i = peak2_pos_i
 */
          __pyx_v_peak_pos_i = __pyx_v_peak1_pos_i;
          goto __pyx_L90;
        }
        /*else*/ {

          /* "MACS2/IO/cScoreTrack.pyx":3242
 *                         peak_pos_i = peak1_pos_i
 *                     else:
 *                         peak_pos_i = peak2_pos_i             # <<<<<<<<<<<<<<
 * 
 *                 # back to differential peak region
 */
          __pyx_v_peak_pos_i = __pyx_v_peak2_pos_i;
        }
        __pyx_L90:;
      }
      __pyx_L89:;

      /* "MACS2/IO/cScoreTrack.pyx":3245
 * 
 *                 # back to differential peak region
 *                 start = pos[pos_start]             # <<<<<<<<<<<<<<
 *                 end = pos[pos_end]
 *                 if start > end:
 */
      __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_v_pos_start); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_XDECREF(__pyx_v_start);
      __pyx_v_start = __pyx_t_19;
      __pyx_t_19 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3246
 *                 # back to differential peak region
 *                 start = pos[pos_start]
 *                 end = pos[pos_end]             # <<<<<<<<<<<<<<
 *                 if start > end:
 *                     start = 0
 */
      __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_v_pos_end); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_XDECREF(__pyx_v_end);
      __pyx_v_end = __pyx_t_19;
      __pyx_t_19 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3247
 *                 start = pos[pos_start]
 *                 end = pos[pos_end]
 *                 if start > end:             # <<<<<<<<<<<<<<
 *                     start = 0
 *                     pos_start = 0
 */
      __pyx_t_19 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_GT); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      if (__pyx_t_3) {

        /* "MACS2/IO/cScoreTrack.pyx":3248
 *                 end = pos[pos_end]
 *                 if start > end:
 *                     start = 0             # <<<<<<<<<<<<<<
 *                     pos_start = 0
 *                 log2_fold_change = log2(t1[peak_pos_i]) - log2(t2[peak_pos_i])
 */
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_DECREF(__pyx_v_start);
        __pyx_v_start = __pyx_int_0;

        /* "MACS2/IO/cScoreTrack.pyx":3249
 *                 if start > end:
 *                     start = 0
 *                     pos_start = 0             # <<<<<<<<<<<<<<
 *                 log2_fold_change = log2(t1[peak_pos_i]) - log2(t2[peak_pos_i])
 *                 log2_fold_change_w_pc = log2(t1[peak_pos_i] + pseudocount) - \
 */
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_DECREF(__pyx_v_pos_start);
        __pyx_v_pos_start = __pyx_int_0;
        goto __pyx_L91;
      }
      __pyx_L91:;

      /* "MACS2/IO/cScoreTrack.pyx":3250
 *                     start = 0
 *                     pos_start = 0
 *                 log2_fold_change = log2(t1[peak_pos_i]) - log2(t2[peak_pos_i])             # <<<<<<<<<<<<<<
 *                 log2_fold_change_w_pc = log2(t1[peak_pos_i] + pseudocount) - \
 *                                         log2(t2[peak_pos_i] + pseudocount)
 */
      __pyx_t_42 = __pyx_v_peak_pos_i;
      __pyx_t_43 = -1;
      if (__pyx_t_42 < 0) {
        __pyx_t_42 += __pyx_pybuffernd_t1.diminfo[0].shape;
        if (unlikely(__pyx_t_42 < 0)) __pyx_t_43 = 0;
      } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_t1.diminfo[0].shape)) __pyx_t_43 = 0;
      if (unlikely(__pyx_t_43 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_43);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_19 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t1.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_t1.diminfo[0].strides))); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      __pyx_t_19 = 0;
      __pyx_t_19 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_43 = __pyx_v_peak_pos_i;
      __pyx_t_44 = -1;
      if (__pyx_t_43 < 0) {
        __pyx_t_43 += __pyx_pybuffernd_t2.diminfo[0].shape;
        if (unlikely(__pyx_t_43 < 0)) __pyx_t_44 = 0;
      } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_t2.diminfo[0].shape)) __pyx_t_44 = 0;
      if (unlikely(__pyx_t_44 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_44);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t2.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_t2.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __pyx_t_14 = PyNumber_Subtract(__pyx_t_19, __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_v_log2_fold_change);
      __pyx_v_log2_fold_change = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3251
 *                     pos_start = 0
 *                 log2_fold_change = log2(t1[peak_pos_i]) - log2(t2[peak_pos_i])
 *                 log2_fold_change_w_pc = log2(t1[peak_pos_i] + pseudocount) - \             # <<<<<<<<<<<<<<
 *                                         log2(t2[peak_pos_i] + pseudocount)
 *                 this_dpvalue = diff_pvalues[peak_pos_i]
 */
      __pyx_t_44 = __pyx_v_peak_pos_i;
      __pyx_t_45 = -1;
      if (__pyx_t_44 < 0) {
        __pyx_t_44 += __pyx_pybuffernd_t1.diminfo[0].shape;
        if (unlikely(__pyx_t_44 < 0)) __pyx_t_45 = 0;
      } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_t1.diminfo[0].shape)) __pyx_t_45 = 0;
      if (unlikely(__pyx_t_45 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_45);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_14 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t1.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_t1.diminfo[0].strides)) + __pyx_v_pseudocount)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3252
 *                 log2_fold_change = log2(t1[peak_pos_i]) - log2(t2[peak_pos_i])
 *                 log2_fold_change_w_pc = log2(t1[peak_pos_i] + pseudocount) - \
 *                                         log2(t2[peak_pos_i] + pseudocount)             # <<<<<<<<<<<<<<
 *                 this_dpvalue = diff_pvalues[peak_pos_i]
 *                 qpos_i = qpos[qpos_i:].searchsorted(peak_pos_i)
 */
      __pyx_t_45 = __pyx_v_peak_pos_i;
      __pyx_t_46 = -1;
      if (__pyx_t_45 < 0) {
        __pyx_t_45 += __pyx_pybuffernd_t2.diminfo[0].shape;
        if (unlikely(__pyx_t_45 < 0)) __pyx_t_46 = 0;
      } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_t2.diminfo[0].shape)) __pyx_t_46 = 0;
      if (unlikely(__pyx_t_46 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_46);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t2.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_t2.diminfo[0].strides)) + __pyx_v_pseudocount)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
      __pyx_t_19 = PyNumber_Subtract(__pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_v_log2_fold_change_w_pc);
      __pyx_v_log2_fold_change_w_pc = __pyx_t_19;
      __pyx_t_19 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3253
 *                 log2_fold_change_w_pc = log2(t1[peak_pos_i] + pseudocount) - \
 *                                         log2(t2[peak_pos_i] + pseudocount)
 *                 this_dpvalue = diff_pvalues[peak_pos_i]             # <<<<<<<<<<<<<<
 *                 qpos_i = qpos[qpos_i:].searchsorted(peak_pos_i)
 *                 this_dqvalue = diff_qvalues[qpos_i]
 */
      __pyx_t_46 = __pyx_v_peak_pos_i;
      __pyx_t_47 = -1;
      if (__pyx_t_46 < 0) {
        __pyx_t_46 += __pyx_pybuffernd_diff_pvalues.diminfo[0].shape;
        if (unlikely(__pyx_t_46 < 0)) __pyx_t_47 = 0;
      } else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_diff_pvalues.diminfo[0].shape)) __pyx_t_47 = 0;
      if (unlikely(__pyx_t_47 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_47);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_this_dpvalue = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_diff_pvalues.diminfo[0].strides));

      /* "MACS2/IO/cScoreTrack.pyx":3254
 *                                         log2(t2[peak_pos_i] + pseudocount)
 *                 this_dpvalue = diff_pvalues[peak_pos_i]
 *                 qpos_i = qpos[qpos_i:].searchsorted(peak_pos_i)             # <<<<<<<<<<<<<<
 *                 this_dqvalue = diff_qvalues[qpos_i]
 * #                this_dqvalue = diff_qvalues[qpos.searchsorted(peak_pos_i)]
 */
      __pyx_t_19 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_qpos), __pyx_v_qpos_i, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_19, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = PyInt_FromLong(__pyx_v_peak_pos_i); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      __pyx_t_19 = 0;
      __pyx_t_19 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __pyx_t_47 = __Pyx_PyInt_AsInt(__pyx_t_19); if (unlikely((__pyx_t_47 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_v_qpos_i = __pyx_t_47;

      /* "MACS2/IO/cScoreTrack.pyx":3255
 *                 this_dpvalue = diff_pvalues[peak_pos_i]
 *                 qpos_i = qpos[qpos_i:].searchsorted(peak_pos_i)
 *                 this_dqvalue = diff_qvalues[qpos_i]             # <<<<<<<<<<<<<<
 * #                this_dqvalue = diff_qvalues[qpos.searchsorted(peak_pos_i)]
 *                 this_dlogLR = diff_logLR[peak_pos_i]
 */
      __pyx_t_47 = __pyx_v_qpos_i;
      __pyx_t_48 = -1;
      if (__pyx_t_47 < 0) {
        __pyx_t_47 += __pyx_pybuffernd_diff_qvalues.diminfo[0].shape;
        if (unlikely(__pyx_t_47 < 0)) __pyx_t_48 = 0;
      } else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_diff_qvalues.diminfo[0].shape)) __pyx_t_48 = 0;
      if (unlikely(__pyx_t_48 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_48);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_this_dqvalue = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_diff_qvalues.diminfo[0].strides));

      /* "MACS2/IO/cScoreTrack.pyx":3257
 *                 this_dqvalue = diff_qvalues[qpos_i]
 * #                this_dqvalue = diff_qvalues[qpos.searchsorted(peak_pos_i)]
 *                 this_dlogLR = diff_logLR[peak_pos_i]             # <<<<<<<<<<<<<<
 * #                fold_changes = t1s / t2s
 * #                if log2(median(fold_changes)) > 0:
 */
      __pyx_t_48 = __pyx_v_peak_pos_i;
      __pyx_t_49 = -1;
      if (__pyx_t_48 < 0) {
        __pyx_t_48 += __pyx_pybuffernd_diff_logLR.diminfo[0].shape;
        if (unlikely(__pyx_t_48 < 0)) __pyx_t_49 = 0;
      } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_diff_logLR.diminfo[0].shape)) __pyx_t_49 = 0;
      if (unlikely(__pyx_t_49 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_49);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_this_dlogLR = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_diff_logLR.diminfo[0].strides));

      /* "MACS2/IO/cScoreTrack.pyx":3266
 * #                this_dqvalue = diff_qvalues[first_i:(last_i+1)].max()
 * #                this_dlogLR = diff_logLR[pos_start:(pos_end+1)].max()
 *                 peakname = "%s%d" % (peakprefix, n_peak)             # <<<<<<<<<<<<<<
 * 
 * #                max_t1 = t1s.max()
 */
      __pyx_t_19 = PyInt_FromLong(__pyx_v_n_peak); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_v_peakprefix);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_peakprefix);
      __Pyx_GIVEREF(__pyx_v_peakprefix);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      __pyx_t_19 = 0;
      __pyx_t_19 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_90), ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_19));
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_v_peakname);
      __pyx_v_peakname = ((PyObject *)__pyx_t_19);
      __pyx_t_19 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3282
 *                 #treat1, control1, fold_enrichment1, -log10(p/qvalue1)
 *                 #treat2, control2, fold_enrichment2, -log10(p/qvalue2)
 *                 xlswrite("%s\t%d\t%d\t%d" % (chrom, start+1, end, end - start))             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%d" % pos[peak_pos_i])
 *                 xlswrite("\t%.5f" % log2_fold_change)
 */
      __pyx_t_19 = PyNumber_Add(__pyx_v_start, __pyx_int_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_14 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3282; __pyx_clineno = __LINE__; goto __pyx_L1_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_19);
      __Pyx_GIVEREF(__pyx_t_19);
      __Pyx_INCREF(__pyx_v_end);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end);
      __Pyx_GIVEREF(__pyx_v_end);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_t_19 = 0;
      __pyx_t_14 = 0;
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_91), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3283
 *                 #treat2, control2, fold_enrichment2, -log10(p/qvalue2)
 *                 xlswrite("%s\t%d\t%d\t%d" % (chrom, start+1, end, end - start))
 *                 xlswrite("\t%d" % pos[peak_pos_i])             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % log2_fold_change)
 *                 xlswrite("\t%.5f" % log2_fold_change_w_pc)
 */
      __pyx_t_49 = __pyx_v_peak_pos_i;
      __pyx_t_50 = -1;
      if (__pyx_t_49 < 0) {
        __pyx_t_49 += __pyx_pybuffernd_pos.diminfo[0].shape;
        if (unlikely(__pyx_t_49 < 0)) __pyx_t_50 = 0;
      } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_50 = 0;
      if (unlikely(__pyx_t_50 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_50);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_14 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_121), __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3284
 *                 xlswrite("%s\t%d\t%d\t%d" % (chrom, start+1, end, end - start))
 *                 xlswrite("\t%d" % pos[peak_pos_i])
 *                 xlswrite("\t%.5f" % log2_fold_change)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % log2_fold_change_w_pc)
 *                 xlswrite("\t%.5f" % this_dpvalue)
 */
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_log2_fold_change); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3285
 *                 xlswrite("\t%d" % pos[peak_pos_i])
 *                 xlswrite("\t%.5f" % log2_fold_change)
 *                 xlswrite("\t%.5f" % log2_fold_change_w_pc)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % this_dpvalue)
 *                 xlswrite("\t%.5f" % this_dqvalue)
 */
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_v_log2_fold_change_w_pc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3286
 *                 xlswrite("\t%.5f" % log2_fold_change)
 *                 xlswrite("\t%.5f" % log2_fold_change_w_pc)
 *                 xlswrite("\t%.5f" % this_dpvalue)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % this_dqvalue)
 *                 xlswrite("\t%.5f" % this_dlogLR)
 */
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_this_dpvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3287
 *                 xlswrite("\t%.5f" % log2_fold_change_w_pc)
 *                 xlswrite("\t%.5f" % this_dpvalue)
 *                 xlswrite("\t%.5f" % this_dqvalue)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % this_dlogLR)
 *                 xlswrite("\t%s" % peakname)
 */
      __pyx_t_14 = PyFloat_FromDouble(__pyx_v_this_dqvalue); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3288
 *                 xlswrite("\t%.5f" % this_dpvalue)
 *                 xlswrite("\t%.5f" % this_dqvalue)
 *                 xlswrite("\t%.5f" % this_dlogLR)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%s" % peakname)
 *                 xlswrite("\t%.5f" % t1[peak_pos_i])
 */
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_this_dlogLR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3289
 *                 xlswrite("\t%.5f" % this_dqvalue)
 *                 xlswrite("\t%.5f" % this_dlogLR)
 *                 xlswrite("\t%s" % peakname)             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % t1[peak_pos_i])
 *                 xlswrite("\t%.5f" % c1[peak_pos_i])
 */
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), __pyx_v_peakname); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3290
 *                 xlswrite("\t%.5f" % this_dlogLR)
 *                 xlswrite("\t%s" % peakname)
 *                 xlswrite("\t%.5f" % t1[peak_pos_i])             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % c1[peak_pos_i])
 *                 if peak1_present:
 */
      __pyx_t_50 = __pyx_v_peak_pos_i;
      __pyx_t_51 = -1;
      if (__pyx_t_50 < 0) {
        __pyx_t_50 += __pyx_pybuffernd_t1.diminfo[0].shape;
        if (unlikely(__pyx_t_50 < 0)) __pyx_t_51 = 0;
      } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_t1.diminfo[0].shape)) __pyx_t_51 = 0;
      if (unlikely(__pyx_t_51 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_51);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_14 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t1.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_t1.diminfo[0].strides))); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3291
 *                 xlswrite("\t%s" % peakname)
 *                 xlswrite("\t%.5f" % t1[peak_pos_i])
 *                 xlswrite("\t%.5f" % c1[peak_pos_i])             # <<<<<<<<<<<<<<
 *                 if peak1_present:
 *                     xlswrite("\t%.5f" % log2(peak1["fc"]))
 */
      __pyx_t_51 = __pyx_v_peak_pos_i;
      __pyx_t_52 = -1;
      if (__pyx_t_51 < 0) {
        __pyx_t_51 += __pyx_pybuffernd_c1.diminfo[0].shape;
        if (unlikely(__pyx_t_51 < 0)) __pyx_t_52 = 0;
      } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_c1.diminfo[0].shape)) __pyx_t_52 = 0;
      if (unlikely(__pyx_t_52 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_52);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_c1.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_c1.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3292
 *                 xlswrite("\t%.5f" % t1[peak_pos_i])
 *                 xlswrite("\t%.5f" % c1[peak_pos_i])
 *                 if peak1_present:             # <<<<<<<<<<<<<<
 *                     xlswrite("\t%.5f" % log2(peak1["fc"]))
 *                     xlswrite("\t%.5f" % peak1["qscore"])
 */
      __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_peak1_present)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_3) {

        /* "MACS2/IO/cScoreTrack.pyx":3293
 *                 xlswrite("\t%.5f" % c1[peak_pos_i])
 *                 if peak1_present:
 *                     xlswrite("\t%.5f" % log2(peak1["fc"]))             # <<<<<<<<<<<<<<
 *                     xlswrite("\t%.5f" % peak1["qscore"])
 *                     xlswrite("\t%s" % peak1["name"])
 */
        if (unlikely(!__pyx_v_peak1)) { __Pyx_RaiseUnboundLocalError("peak1"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        if (unlikely(((PyObject *)__pyx_v_peak1) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_peak1), ((PyObject *)__pyx_n_s__fc)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_14);
        __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_1));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3294
 *                 if peak1_present:
 *                     xlswrite("\t%.5f" % log2(peak1["fc"]))
 *                     xlswrite("\t%.5f" % peak1["qscore"])             # <<<<<<<<<<<<<<
 *                     xlswrite("\t%s" % peak1["name"])
 *                     xlswrite("\t%d" % peak1["summit"])
 */
        if (unlikely(((PyObject *)__pyx_v_peak1) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_peak1), ((PyObject *)__pyx_n_s__qscore)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_14));
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
        __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3295
 *                     xlswrite("\t%.5f" % log2(peak1["fc"]))
 *                     xlswrite("\t%.5f" % peak1["qscore"])
 *                     xlswrite("\t%s" % peak1["name"])             # <<<<<<<<<<<<<<
 *                     xlswrite("\t%d" % peak1["summit"])
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")
 */
        if (unlikely(((PyObject *)__pyx_v_peak1) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_peak1), ((PyObject *)__pyx_n_s__name)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_1));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3296
 *                     xlswrite("\t%.5f" % peak1["qscore"])
 *                     xlswrite("\t%s" % peak1["name"])
 *                     xlswrite("\t%d" % peak1["summit"])             # <<<<<<<<<<<<<<
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")
 *                 xlswrite("\t%.5f" % t2[peak_pos_i])
 */
        if (unlikely(((PyObject *)__pyx_v_peak1) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_peak1), ((PyObject *)__pyx_n_s__summit)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_121), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_14));
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
        __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L92;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":3297
 *                     xlswrite("\t%s" % peak1["name"])
 *                     xlswrite("\t%d" % peak1["summit"])
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % t2[peak_pos_i])
 *                 xlswrite("\t%.5f" % c2[peak_pos_i])
 */
        __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_123), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __pyx_L92:;

      /* "MACS2/IO/cScoreTrack.pyx":3298
 *                     xlswrite("\t%d" % peak1["summit"])
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")
 *                 xlswrite("\t%.5f" % t2[peak_pos_i])             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % c2[peak_pos_i])
 *                 if peak2_present:
 */
      __pyx_t_52 = __pyx_v_peak_pos_i;
      __pyx_t_53 = -1;
      if (__pyx_t_52 < 0) {
        __pyx_t_52 += __pyx_pybuffernd_t2.diminfo[0].shape;
        if (unlikely(__pyx_t_52 < 0)) __pyx_t_53 = 0;
      } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_t2.diminfo[0].shape)) __pyx_t_53 = 0;
      if (unlikely(__pyx_t_53 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_53);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_14 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t2.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_t2.diminfo[0].strides))); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3299
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")
 *                 xlswrite("\t%.5f" % t2[peak_pos_i])
 *                 xlswrite("\t%.5f" % c2[peak_pos_i])             # <<<<<<<<<<<<<<
 *                 if peak2_present:
 *                     xlswrite("\t%.5f" % log2(peak2["fc"]))
 */
      __pyx_t_53 = __pyx_v_peak_pos_i;
      __pyx_t_54 = -1;
      if (__pyx_t_53 < 0) {
        __pyx_t_53 += __pyx_pybuffernd_c2.diminfo[0].shape;
        if (unlikely(__pyx_t_53 < 0)) __pyx_t_54 = 0;
      } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_c2.diminfo[0].shape)) __pyx_t_54 = 0;
      if (unlikely(__pyx_t_54 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_54);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_c2.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_c2.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3300
 *                 xlswrite("\t%.5f" % t2[peak_pos_i])
 *                 xlswrite("\t%.5f" % c2[peak_pos_i])
 *                 if peak2_present:             # <<<<<<<<<<<<<<
 *                     xlswrite("\t%.5f" % log2(peak2["fc"]))
 *                     xlswrite("\t%.5f" % peak2["qscore"])
 */
      __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_peak2_present)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_3) {

        /* "MACS2/IO/cScoreTrack.pyx":3301
 *                 xlswrite("\t%.5f" % c2[peak_pos_i])
 *                 if peak2_present:
 *                     xlswrite("\t%.5f" % log2(peak2["fc"]))             # <<<<<<<<<<<<<<
 *                     xlswrite("\t%.5f" % peak2["qscore"])
 *                     xlswrite("\t%s" % peak2["name"])
 */
        if (unlikely(!__pyx_v_peak2)) { __Pyx_RaiseUnboundLocalError("peak2"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        if (unlikely(((PyObject *)__pyx_v_peak2) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_peak2), ((PyObject *)__pyx_n_s__fc)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_14);
        __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_1));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3302
 *                 if peak2_present:
 *                     xlswrite("\t%.5f" % log2(peak2["fc"]))
 *                     xlswrite("\t%.5f" % peak2["qscore"])             # <<<<<<<<<<<<<<
 *                     xlswrite("\t%s" % peak2["name"])
 *                     xlswrite("\t%d" % peak2["summit"])
 */
        if (unlikely(((PyObject *)__pyx_v_peak2) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_peak2), ((PyObject *)__pyx_n_s__qscore)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_14));
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
        __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3303
 *                     xlswrite("\t%.5f" % log2(peak2["fc"]))
 *                     xlswrite("\t%.5f" % peak2["qscore"])
 *                     xlswrite("\t%s" % peak2["name"])             # <<<<<<<<<<<<<<
 *                     xlswrite("\t%d" % peak2["summit"])
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")
 */
        if (unlikely(((PyObject *)__pyx_v_peak2) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_peak2), ((PyObject *)__pyx_n_s__name)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_1));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3304
 *                     xlswrite("\t%.5f" % peak2["qscore"])
 *                     xlswrite("\t%s" % peak2["name"])
 *                     xlswrite("\t%d" % peak2["summit"])             # <<<<<<<<<<<<<<
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")
 *                 xlswrite("\n")
 */
        if (unlikely(((PyObject *)__pyx_v_peak2) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_peak2), ((PyObject *)__pyx_n_s__summit)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_121), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_14));
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
        __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L93;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":3305
 *                     xlswrite("\t%s" % peak2["name"])
 *                     xlswrite("\t%d" % peak2["summit"])
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")             # <<<<<<<<<<<<<<
 *                 xlswrite("\n")
 *                 bedwrite("%s\t%d\t%d\t%s\t%.5f\n" %
 */
        __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __pyx_L93:;

      /* "MACS2/IO/cScoreTrack.pyx":3306
 *                     xlswrite("\t%d" % peak2["summit"])
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")
 *                 xlswrite("\n")             # <<<<<<<<<<<<<<
 *                 bedwrite("%s\t%d\t%d\t%s\t%.5f\n" %
 *                          (chrom, start, end, peakname,
 */
      __pyx_t_14 = PyObject_Call(__pyx_v_xlswrite, ((PyObject *)__pyx_k_tuple_125), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3309
 *                 bedwrite("%s\t%d\t%d\t%s\t%.5f\n" %
 *                          (chrom, start, end, peakname,
 *                           this_dqvalue))             # <<<<<<<<<<<<<<
 *         logging.captureWarnings(False)
 *         return
 */
      __pyx_t_14 = PyFloat_FromDouble(__pyx_v_this_dqvalue); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_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);
      __Pyx_INCREF(__pyx_v_start);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start);
      __Pyx_GIVEREF(__pyx_v_start);
      __Pyx_INCREF(__pyx_v_end);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end);
      __Pyx_GIVEREF(__pyx_v_end);
      __Pyx_INCREF(__pyx_v_peakname);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_peakname);
      __Pyx_GIVEREF(__pyx_v_peakname);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_t_14 = 0;
      __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_95), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_14));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_v_bedwrite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3310
 *                          (chrom, start, end, peakname,
 *                           this_dqvalue))
 *         logging.captureWarnings(False)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__captureWarnings); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3311
 *                           this_dqvalue))
 *         logging.captureWarnings(False)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     def has_peakio(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c2.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peaks1_selection.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peaks2_selection.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qpos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t2.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_above_cutoff.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c2.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_peaks1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_peaks2.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peaks1_selection.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peaks2_selection.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_qpos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t2.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks2.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_peaks1);
  __Pyx_XDECREF(__pyx_v_peaks2);
  __Pyx_XDECREF(__pyx_v_peak1);
  __Pyx_XDECREF(__pyx_v_peak2);
  __Pyx_XDECREF((PyObject *)__pyx_v_peaks1_selection);
  __Pyx_XDECREF((PyObject *)__pyx_v_peaks2_selection);
  __Pyx_XDECREF((PyObject *)__pyx_v_i_peaks1);
  __Pyx_XDECREF((PyObject *)__pyx_v_i_peaks2);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_which_peaks1);
  __Pyx_XDECREF((PyObject *)__pyx_v_which_peaks2);
  __Pyx_XDECREF((PyObject *)__pyx_v_t1);
  __Pyx_XDECREF((PyObject *)__pyx_v_c1);
  __Pyx_XDECREF((PyObject *)__pyx_v_t2);
  __Pyx_XDECREF((PyObject *)__pyx_v_c2);
  __Pyx_XDECREF((PyObject *)__pyx_v_diff_pvalues);
  __Pyx_XDECREF((PyObject *)__pyx_v_diff_qvalues);
  __Pyx_XDECREF((PyObject *)__pyx_v_diff_logLR);
  __Pyx_XDECREF((PyObject *)__pyx_v_qpos);
  __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff);
  __Pyx_XDECREF((PyObject *)__pyx_v_peak1_present);
  __Pyx_XDECREF((PyObject *)__pyx_v_peak2_present);
  __Pyx_XDECREF(__pyx_v_xlswrite);
  __Pyx_XDECREF(__pyx_v_bedwrite);
  __Pyx_XDECREF(__pyx_v_peakprefix);
  __Pyx_XDECREF(__pyx_v_desc);
  __Pyx_XDECREF(__pyx_v_trackcontents);
  __Pyx_XDECREF(__pyx_v_log10);
  __Pyx_XDECREF(__pyx_v_log2);
  __Pyx_XDECREF(__pyx_v_median);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_pos_start);
  __Pyx_XDECREF(__pyx_v_pos_end);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XDECREF(__pyx_v_log2_fold_change);
  __Pyx_XDECREF(__pyx_v_log2_fold_change_w_pc);
  __Pyx_XDECREF(__pyx_v_peakname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_41has_peakio(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_40has_peakio[] = "see whether peaks1 or peaks2 are stored";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_41has_peakio(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("has_peakio (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_40has_peakio(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":3313
 *         return
 * 
 *     def has_peakio(self):             # <<<<<<<<<<<<<<
 *         """see whether peaks1 or peaks2 are stored"""
 *         return (len(self.which_peaks1.keys()) + len(self.which_peaks2.keys())) > 0
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_40has_peakio(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("has_peakio", 0);

  /* "MACS2/IO/cScoreTrack.pyx":3315
 *     def has_peakio(self):
 *         """see whether peaks1 or peaks2 are stored"""
 *         return (len(self.which_peaks1.keys()) + len(self.which_peaks2.keys())) > 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self->which_peaks1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->which_peaks1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(((PyObject *)__pyx_v_self->which_peaks2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyDict_Keys(__pyx_v_self->which_peaks2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(((__pyx_t_2 + __pyx_t_3) > 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.has_peakio", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_43write_peaks_by_summit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_42write_peaks_by_summit[] = "write a file with information about each summit and differential\n        occupancy (separately for condition 1 and condition 2)\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_43write_peaks_by_summit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xls1 = 0;
  PyObject *__pyx_v_xls2 = 0;
  PyObject *__pyx_v_name_prefix = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_peaks_by_summit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__xls1,&__pyx_n_s__xls2,&__pyx_n_s__name_prefix,&__pyx_n_s__name,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_kp_s_61);
    values[3] = ((PyObject *)__pyx_n_s__MACS);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xls1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xls2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_peaks_by_summit", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name_prefix);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_peaks_by_summit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xls1 = values[0];
    __pyx_v_xls2 = values[1];
    __pyx_v_name_prefix = values[2];
    __pyx_v_name = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_peaks_by_summit", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks_by_summit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_42write_peaks_by_summit(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), __pyx_v_xls1, __pyx_v_xls2, __pyx_v_name_prefix, __pyx_v_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":3318
 * 
 * 
 *     def write_peaks_by_summit(self, xls1, xls2,             # <<<<<<<<<<<<<<
 *                                 name_prefix="%s_peak_", name="MACS"):
 *         """write a file with information about each summit and differential
 */

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_42write_peaks_by_summit(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_xls1, PyObject *__pyx_v_xls2, PyObject *__pyx_v_name_prefix, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_peakprefix = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_peaks_by_summit", 0);

  /* "MACS2/IO/cScoreTrack.pyx":3323
 *         occupancy (separately for condition 1 and condition 2)
 *         """
 *         assert self.has_peakio(), "No information on peaks"             # <<<<<<<<<<<<<<
 *         try: peakprefix = name_prefix % name
 *         except: peakprefix = name_prefix
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__has_peakio); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_97));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cScoreTrack.pyx":3324
 *         """
 *         assert self.has_peakio(), "No information on peaks"
 *         try: peakprefix = name_prefix % name             # <<<<<<<<<<<<<<
 *         except: peakprefix = name_prefix
 *         xls1.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {
      __pyx_t_2 = PyNumber_Remainder(__pyx_v_name_prefix, __pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_peakprefix = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3325
 *         assert self.has_peakio(), "No information on peaks"
 *         try: peakprefix = name_prefix % name
 *         except: peakprefix = name_prefix             # <<<<<<<<<<<<<<
 *         xls1.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xls1.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 */
    /*except:*/ {
      __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks_by_summit", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3325; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_name_prefix);
      __Pyx_XDECREF(__pyx_v_peakprefix);
      __pyx_v_peakprefix = __pyx_v_name_prefix;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_L10_try_end:;
  }

  /* "MACS2/IO/cScoreTrack.pyx":3326
 *         try: peakprefix = name_prefix % name
 *         except: peakprefix = name_prefix
 *         xls1.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth             # <<<<<<<<<<<<<<
 *         xls1.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls1.write("# log2_fold_change is positive if t1 > t2\n")
 */
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_xls1, __pyx_n_s__write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_126), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->cond1_depth); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyNumber_Remainder(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3327
 *         except: peakprefix = name_prefix
 *         xls1.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xls1.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")             # <<<<<<<<<<<<<<
 *         xls1.write("# log2_fold_change is positive if t1 > t2\n")
 *         xls2.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond2_depth
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_xls1, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_128), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3328
 *         xls1.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xls1.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls1.write("# log2_fold_change is positive if t1 > t2\n")             # <<<<<<<<<<<<<<
 *         xls2.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond2_depth
 *         xls2.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 */
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_xls1, __pyx_n_s__write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_129), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3329
 *         xls1.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls1.write("# log2_fold_change is positive if t1 > t2\n")
 *         xls2.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond2_depth             # <<<<<<<<<<<<<<
 *         xls2.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls2.write("# log2_fold_change is positive if t2 > t1\n")
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_xls2, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_130), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->cond2_depth); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Remainder(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3330
 *         xls1.write("# log2_fold_change is positive if t1 > t2\n")
 *         xls2.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond2_depth
 *         xls2.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")             # <<<<<<<<<<<<<<
 *         xls2.write("# log2_fold_change is positive if t2 > t1\n")
 *         xls1.write("\t".join(("chr", "start", "end", "length", "summit",
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_xls2, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_131), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3331
 *         xls2.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond2_depth
 *         xls2.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls2.write("# log2_fold_change is positive if t2 > t1\n")             # <<<<<<<<<<<<<<
 *         xls1.write("\t".join(("chr", "start", "end", "length", "summit",
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_xls2, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_133), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3332
 *         xls2.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls2.write("# log2_fold_change is positive if t2 > t1\n")
 *         xls1.write("\t".join(("chr", "start", "end", "length", "summit",             # <<<<<<<<<<<<<<
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 *                          "-log10.diff.pvalue",
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_xls1, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "MACS2/IO/cScoreTrack.pyx":3341
 *                          "treat2", "control2", "log2.fold.enrichment2",
 *                          "-log10.qvalue2", "peakname2", "summit2",
 *                          ))+"\n")             # <<<<<<<<<<<<<<
 *         xls2.write("\t".join(("chr", "start", "end", "length", "summit",
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_70), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "MACS2/IO/cScoreTrack.pyx":3332
 *         xls2.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls2.write("# log2_fold_change is positive if t2 > t1\n")
 *         xls1.write("\t".join(("chr", "start", "end", "length", "summit",             # <<<<<<<<<<<<<<
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 *                          "-log10.diff.pvalue",
 */
  __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_135), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_7, ((PyObject *)__pyx_kp_s_80)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3342
 *                          "-log10.qvalue2", "peakname2", "summit2",
 *                          ))+"\n")
 *         xls2.write("\t".join(("chr", "start", "end", "length", "summit",             # <<<<<<<<<<<<<<
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 *                          "-log10.diff.pvalue",
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_xls2, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "MACS2/IO/cScoreTrack.pyx":3351
 *                          "treat1", "control1", "log2.fold.enrichment1",
 *                          "-log10.qvalue1", "peakname1", "summit1",
 *                          ))+"\n")             # <<<<<<<<<<<<<<
 *         self._write_peaks_by_summit(xls1, self.p1io, self.p2io,
 *                                     self.which_peaks2, False,
 */
  __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_70), __pyx_n_s__join); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);

  /* "MACS2/IO/cScoreTrack.pyx":3342
 *                          "-log10.qvalue2", "peakname2", "summit2",
 *                          ))+"\n")
 *         xls2.write("\t".join(("chr", "start", "end", "length", "summit",             # <<<<<<<<<<<<<<
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 *                          "-log10.diff.pvalue",
 */
  __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_137), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_80)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3352
 *                          "-log10.qvalue1", "peakname1", "summit1",
 *                          ))+"\n")
 *         self._write_peaks_by_summit(xls1, self.p1io, self.p2io,             # <<<<<<<<<<<<<<
 *                                     self.which_peaks2, False,
 *                                     self.t1, self.c1,
 */
  __pyx_t_7 = __pyx_v_self->p1io;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_1 = __pyx_v_self->p2io;
  __Pyx_INCREF(__pyx_t_1);

  /* "MACS2/IO/cScoreTrack.pyx":3353
 *                          ))+"\n")
 *         self._write_peaks_by_summit(xls1, self.p1io, self.p2io,
 *                                     self.which_peaks2, False,             # <<<<<<<<<<<<<<
 *                                     self.t1, self.c1,
 *                                     self.t2, self.c2, peakprefix)
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->which_peaks2);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":3354
 *         self._write_peaks_by_summit(xls1, self.p1io, self.p2io,
 *                                     self.which_peaks2, False,
 *                                     self.t1, self.c1,             # <<<<<<<<<<<<<<
 *                                     self.t2, self.c2, peakprefix)
 *         self._write_peaks_by_summit(xls2, self.p2io, self.p1io,
 */
  __pyx_t_9 = ((PyObject *)__pyx_v_self->t1);
  __Pyx_INCREF(__pyx_t_9);
  __pyx_t_10 = ((PyObject *)__pyx_v_self->c1);
  __Pyx_INCREF(__pyx_t_10);

  /* "MACS2/IO/cScoreTrack.pyx":3355
 *                                     self.which_peaks2, False,
 *                                     self.t1, self.c1,
 *                                     self.t2, self.c2, peakprefix)             # <<<<<<<<<<<<<<
 *         self._write_peaks_by_summit(xls2, self.p2io, self.p1io,
 *                                     self.which_peaks1, True,
 */
  __pyx_t_11 = ((PyObject *)__pyx_v_self->t2);
  __Pyx_INCREF(__pyx_t_11);
  __pyx_t_12 = ((PyObject *)__pyx_v_self->c2);
  __Pyx_INCREF(__pyx_t_12);
  if (!(likely(PyString_CheckExact(__pyx_v_peakprefix))||((__pyx_v_peakprefix) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_v_peakprefix)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->_write_peaks_by_summit(__pyx_v_self, __pyx_v_xls1, __pyx_t_7, __pyx_t_1, ((PyObject*)__pyx_t_2), ((PyBoolObject *)__pyx_t_8), ((PyObject*)__pyx_t_9), ((PyObject*)__pyx_t_10), ((PyObject*)__pyx_t_11), ((PyObject*)__pyx_t_12), ((PyObject*)__pyx_v_peakprefix)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3356
 *                                     self.t1, self.c1,
 *                                     self.t2, self.c2, peakprefix)
 *         self._write_peaks_by_summit(xls2, self.p2io, self.p1io,             # <<<<<<<<<<<<<<
 *                                     self.which_peaks1, True,
 *                                     self.t2, self.c2,
 */
  __pyx_t_13 = __pyx_v_self->p2io;
  __Pyx_INCREF(__pyx_t_13);
  __pyx_t_12 = __pyx_v_self->p1io;
  __Pyx_INCREF(__pyx_t_12);

  /* "MACS2/IO/cScoreTrack.pyx":3357
 *                                     self.t2, self.c2, peakprefix)
 *         self._write_peaks_by_summit(xls2, self.p2io, self.p1io,
 *                                     self.which_peaks1, True,             # <<<<<<<<<<<<<<
 *                                     self.t2, self.c2,
 *                                     self.t1, self.c1, peakprefix)
 */
  __pyx_t_11 = ((PyObject *)__pyx_v_self->which_peaks1);
  __Pyx_INCREF(__pyx_t_11);
  __pyx_t_10 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (!(likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":3358
 *         self._write_peaks_by_summit(xls2, self.p2io, self.p1io,
 *                                     self.which_peaks1, True,
 *                                     self.t2, self.c2,             # <<<<<<<<<<<<<<
 *                                     self.t1, self.c1, peakprefix)
 * 
 */
  __pyx_t_9 = ((PyObject *)__pyx_v_self->t2);
  __Pyx_INCREF(__pyx_t_9);
  __pyx_t_8 = ((PyObject *)__pyx_v_self->c2);
  __Pyx_INCREF(__pyx_t_8);

  /* "MACS2/IO/cScoreTrack.pyx":3359
 *                                     self.which_peaks1, True,
 *                                     self.t2, self.c2,
 *                                     self.t1, self.c1, peakprefix)             # <<<<<<<<<<<<<<
 * 
 *     cdef _write_peaks_by_summit(self, xls, p1io, p2io,
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->t1);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->c1);
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyString_CheckExact(__pyx_v_peakprefix))||((__pyx_v_peakprefix) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_v_peakprefix)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self->__pyx_vtab)->_write_peaks_by_summit(__pyx_v_self, __pyx_v_xls2, __pyx_t_13, __pyx_t_12, ((PyObject*)__pyx_t_11), ((PyBoolObject *)__pyx_t_10), ((PyObject*)__pyx_t_9), ((PyObject*)__pyx_t_8), ((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_v_peakprefix)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_peaks_by_summit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_peakprefix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":3361
 *                                     self.t1, self.c1, peakprefix)
 * 
 *     cdef _write_peaks_by_summit(self, xls, p1io, p2io,             # <<<<<<<<<<<<<<
 *                                 dict which_peaks2,
 *                                 bool flip_fc,
 */

static PyObject *__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI__write_peaks_by_summit(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_xls, PyObject *__pyx_v_p1io, PyObject *__pyx_v_p2io, PyObject *__pyx_v_which_peaks2, PyBoolObject *__pyx_v_flip_fc, PyObject *__pyx_v_t1_by_chrom, PyObject *__pyx_v_c1_by_chrom, PyObject *__pyx_v_t2_by_chrom, PyObject *__pyx_v_c2_by_chrom, PyObject *__pyx_v_peakprefix) {
  PyObject *__pyx_v_peaks1 = 0;
  PyObject *__pyx_v_peaks2 = 0;
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_d;
  int __pyx_v_w;
  int __pyx_v_d_max;
  int __pyx_v_w_max;
  int __pyx_v_n_peaks;
  int __pyx_v_datalength;
  int __pyx_v_peak_i;
  int __pyx_v_peak_j;
  int __pyx_v_summit;
  int __pyx_v_start;
  int __pyx_v_end;
  int __pyx_v_length;
  float __pyx_v_this_dpvalue;
  float __pyx_v_this_dqvalue;
  float __pyx_v_this_dlogLR;
  float __pyx_v_score_value;
  float __pyx_v_pseudocount;
  float __pyx_v_log2_fold_change;
  float __pyx_v_log2_fold_change_w_pc;
  PyArrayObject *__pyx_v_t1 = 0;
  PyArrayObject *__pyx_v_t2 = 0;
  PyArrayObject *__pyx_v_c1 = 0;
  PyArrayObject *__pyx_v_c2 = 0;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_which_peaks = 0;
  PyArrayObject *__pyx_v_summits1 = 0;
  PyArrayObject *__pyx_v_diff_pvalues = 0;
  PyArrayObject *__pyx_v_diff_qvalues = 0;
  PyArrayObject *__pyx_v_diff_logLR = 0;
  PyArrayObject *__pyx_v_diff_peaks = 0;
  PyObject *__pyx_v_log2 = NULL;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_peak = NULL;
  PyObject *__pyx_v_where_peaks = NULL;
  PyObject *__pyx_v_above_cutoff = NULL;
  PyObject *__pyx_v_diffpeakname = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_peak2_summit = NULL;
  PyObject *__pyx_v_peak2_summits = NULL;
  PyObject *__pyx_v_peak2 = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_c1;
  __Pyx_Buffer __pyx_pybuffer_c1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_c2;
  __Pyx_Buffer __pyx_pybuffer_c2;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_diff_logLR;
  __Pyx_Buffer __pyx_pybuffer_diff_logLR;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_diff_peaks;
  __Pyx_Buffer __pyx_pybuffer_diff_peaks;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_diff_pvalues;
  __Pyx_Buffer __pyx_pybuffer_diff_pvalues;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_diff_qvalues;
  __Pyx_Buffer __pyx_pybuffer_diff_qvalues;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
  __Pyx_Buffer __pyx_pybuffer_pos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_summits1;
  __Pyx_Buffer __pyx_pybuffer_summits1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_t1;
  __Pyx_Buffer __pyx_pybuffer_t1;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_t2;
  __Pyx_Buffer __pyx_pybuffer_t2;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_which_peaks;
  __Pyx_Buffer __pyx_pybuffer_which_peaks;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyArrayObject *__pyx_t_15 = NULL;
  PyArrayObject *__pyx_t_16 = NULL;
  PyArrayObject *__pyx_t_17 = NULL;
  PyArrayObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_t_20;
  long __pyx_t_21;
  int __pyx_t_22;
  long __pyx_t_23;
  int __pyx_t_24;
  __pyx_t_5MACS2_2IO_5numpy_int32_t __pyx_t_25;
  long __pyx_t_26;
  int __pyx_t_27;
  long __pyx_t_28;
  int __pyx_t_29;
  long __pyx_t_30;
  long __pyx_t_31;
  long __pyx_t_32;
  long __pyx_t_33;
  long __pyx_t_34;
  long __pyx_t_35;
  long __pyx_t_36;
  int __pyx_t_37;
  int __pyx_t_38;
  int __pyx_t_39;
  int __pyx_t_40;
  int __pyx_t_41;
  float __pyx_t_42;
  int __pyx_t_43;
  int __pyx_t_44;
  int __pyx_t_45;
  int __pyx_t_46;
  int __pyx_t_47;
  long __pyx_t_48;
  int __pyx_t_49;
  long __pyx_t_50;
  int __pyx_t_51;
  long __pyx_t_52;
  int __pyx_t_53;
  int __pyx_t_54;
  int __pyx_t_55;
  int __pyx_t_56;
  int __pyx_t_57;
  int __pyx_t_58;
  int __pyx_t_59;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_write_peaks_by_summit", 0);
  __pyx_pybuffer_t1.pybuffer.buf = NULL;
  __pyx_pybuffer_t1.refcount = 0;
  __pyx_pybuffernd_t1.data = NULL;
  __pyx_pybuffernd_t1.rcbuffer = &__pyx_pybuffer_t1;
  __pyx_pybuffer_t2.pybuffer.buf = NULL;
  __pyx_pybuffer_t2.refcount = 0;
  __pyx_pybuffernd_t2.data = NULL;
  __pyx_pybuffernd_t2.rcbuffer = &__pyx_pybuffer_t2;
  __pyx_pybuffer_c1.pybuffer.buf = NULL;
  __pyx_pybuffer_c1.refcount = 0;
  __pyx_pybuffernd_c1.data = NULL;
  __pyx_pybuffernd_c1.rcbuffer = &__pyx_pybuffer_c1;
  __pyx_pybuffer_c2.pybuffer.buf = NULL;
  __pyx_pybuffer_c2.refcount = 0;
  __pyx_pybuffernd_c2.data = NULL;
  __pyx_pybuffernd_c2.rcbuffer = &__pyx_pybuffer_c2;
  __pyx_pybuffer_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_pos.refcount = 0;
  __pyx_pybuffernd_pos.data = NULL;
  __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
  __pyx_pybuffer_which_peaks.pybuffer.buf = NULL;
  __pyx_pybuffer_which_peaks.refcount = 0;
  __pyx_pybuffernd_which_peaks.data = NULL;
  __pyx_pybuffernd_which_peaks.rcbuffer = &__pyx_pybuffer_which_peaks;
  __pyx_pybuffer_summits1.pybuffer.buf = NULL;
  __pyx_pybuffer_summits1.refcount = 0;
  __pyx_pybuffernd_summits1.data = NULL;
  __pyx_pybuffernd_summits1.rcbuffer = &__pyx_pybuffer_summits1;
  __pyx_pybuffer_diff_pvalues.pybuffer.buf = NULL;
  __pyx_pybuffer_diff_pvalues.refcount = 0;
  __pyx_pybuffernd_diff_pvalues.data = NULL;
  __pyx_pybuffernd_diff_pvalues.rcbuffer = &__pyx_pybuffer_diff_pvalues;
  __pyx_pybuffer_diff_qvalues.pybuffer.buf = NULL;
  __pyx_pybuffer_diff_qvalues.refcount = 0;
  __pyx_pybuffernd_diff_qvalues.data = NULL;
  __pyx_pybuffernd_diff_qvalues.rcbuffer = &__pyx_pybuffer_diff_qvalues;
  __pyx_pybuffer_diff_logLR.pybuffer.buf = NULL;
  __pyx_pybuffer_diff_logLR.refcount = 0;
  __pyx_pybuffernd_diff_logLR.data = NULL;
  __pyx_pybuffernd_diff_logLR.rcbuffer = &__pyx_pybuffer_diff_logLR;
  __pyx_pybuffer_diff_peaks.pybuffer.buf = NULL;
  __pyx_pybuffer_diff_peaks.refcount = 0;
  __pyx_pybuffernd_diff_peaks.data = NULL;
  __pyx_pybuffernd_diff_peaks.rcbuffer = &__pyx_pybuffer_diff_peaks;

  /* "MACS2/IO/cScoreTrack.pyx":3383
 *             np.ndarray[np.float32_t] diff_pvalues, diff_qvalues, diff_logLR
 *             np.ndarray[np.int32_t, ndim=2] diff_peaks
 *         log2 = np.log2             # <<<<<<<<<<<<<<
 *         logging.captureWarnings(True)
 *         pseudocount = float(self.pseudocount)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__log2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_log2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3384
 *             np.ndarray[np.int32_t, ndim=2] diff_peaks
 *         log2 = np.log2
 *         logging.captureWarnings(True)             # <<<<<<<<<<<<<<
 *         pseudocount = float(self.pseudocount)
 *         for chrom in sorted(p1io.get_chr_names()):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__captureWarnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3385
 *         log2 = np.log2
 *         logging.captureWarnings(True)
 *         pseudocount = float(self.pseudocount)             # <<<<<<<<<<<<<<
 *         for chrom in sorted(p1io.get_chr_names()):
 *             write = xls.write
 */
  __pyx_v_pseudocount = ((double)__pyx_v_self->pseudocount);

  /* "MACS2/IO/cScoreTrack.pyx":3386
 *         logging.captureWarnings(True)
 *         pseudocount = float(self.pseudocount)
 *         for chrom in sorted(p1io.get_chr_names()):             # <<<<<<<<<<<<<<
 *             write = xls.write
 *             try: datalength = self.datalength[chrom]
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_p1io, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3387
 *         pseudocount = float(self.pseudocount)
 *         for chrom in sorted(p1io.get_chr_names()):
 *             write = xls.write             # <<<<<<<<<<<<<<
 *             try: datalength = self.datalength[chrom]
 *             except KeyError: datalength = 0
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_xls, __pyx_n_s__write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_v_write);
    __pyx_v_write = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3388
 *         for chrom in sorted(p1io.get_chr_names()):
 *             write = xls.write
 *             try: datalength = self.datalength[chrom]             # <<<<<<<<<<<<<<
 *             except KeyError: datalength = 0
 *             if datalength < 2:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {
        if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3388; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        }
        __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3388; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3388; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_datalength = __pyx_t_9;
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3389
 *             write = xls.write
 *             try: datalength = self.datalength[chrom]
 *             except KeyError: datalength = 0             # <<<<<<<<<<<<<<
 *             if datalength < 2:
 *                 # we are missing data on this chromosome, just write original peaks
 */
      __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI._write_peaks_by_summit", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_v_datalength = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L6_exception_handled;
      }
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_L12_try_end:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":3390
 *             try: datalength = self.datalength[chrom]
 *             except KeyError: datalength = 0
 *             if datalength < 2:             # <<<<<<<<<<<<<<
 *                 # we are missing data on this chromosome, just write original peaks
 *                 peaks1 = p1io.get_data_from_chrom(chrom)
 */
    __pyx_t_11 = (__pyx_v_datalength < 2);
    if (__pyx_t_11) {

      /* "MACS2/IO/cScoreTrack.pyx":3392
 *             if datalength < 2:
 *                 # we are missing data on this chromosome, just write original peaks
 *                 peaks1 = p1io.get_data_from_chrom(chrom)             # <<<<<<<<<<<<<<
 *                 for peak in peaks1:
 *                     start = peak["start"] + 1
 */
      __pyx_t_10 = PyObject_GetAttr(__pyx_v_p1io, __pyx_n_s__get_data_from_chrom); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chrom));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
      __pyx_t_3 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_peaks1));
      __pyx_v_peaks1 = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3393
 *                 # we are missing data on this chromosome, just write original peaks
 *                 peaks1 = p1io.get_data_from_chrom(chrom)
 *                 for peak in peaks1:             # <<<<<<<<<<<<<<
 *                     start = peak["start"] + 1
 *                     end = peak["end"]
 */
      if (unlikely(((PyObject *)__pyx_v_peaks1) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = ((PyObject *)__pyx_v_peaks1); __Pyx_INCREF(__pyx_t_3); __pyx_t_12 = 0;
      for (;;) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
        __Pyx_XDECREF(__pyx_v_peak);
        __pyx_v_peak = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3394
 *                 peaks1 = p1io.get_data_from_chrom(chrom)
 *                 for peak in peaks1:
 *                     start = peak["start"] + 1             # <<<<<<<<<<<<<<
 *                     end = peak["end"]
 *                     length = peak["length"]
 */
        __pyx_t_1 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_v_start = __pyx_t_9;

        /* "MACS2/IO/cScoreTrack.pyx":3395
 *                 for peak in peaks1:
 *                     start = peak["start"] + 1
 *                     end = peak["end"]             # <<<<<<<<<<<<<<
 *                     length = peak["length"]
 *                     write("%s\t%d\t%d\t%d" % (chrom,start,end,length))
 */
        __pyx_t_10 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_v_end = __pyx_t_9;

        /* "MACS2/IO/cScoreTrack.pyx":3396
 *                     start = peak["start"] + 1
 *                     end = peak["end"]
 *                     length = peak["length"]             # <<<<<<<<<<<<<<
 *                     write("%s\t%d\t%d\t%d" % (chrom,start,end,length))
 *                     write("\t%d" % peak["summit"] + 1) # summit position
 */
        __pyx_t_10 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__length)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_v_length = __pyx_t_9;

        /* "MACS2/IO/cScoreTrack.pyx":3397
 *                     end = peak["end"]
 *                     length = peak["length"]
 *                     write("%s\t%d\t%d\t%d" % (chrom,start,end,length))             # <<<<<<<<<<<<<<
 *                     write("\t%d" % peak["summit"] + 1) # summit position
 *                     write("\tNA\tNA\tNA\tNA\tNA\tNA")
 */
        __pyx_t_10 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_1 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_13 = PyInt_FromLong(__pyx_v_length); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_chrom));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_13);
        __pyx_t_10 = 0;
        __pyx_t_1 = 0;
        __pyx_t_13 = 0;
        __pyx_t_13 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_91), ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_13));
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_13));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
        __pyx_t_13 = 0;
        __pyx_t_13 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3398
 *                     length = peak["length"]
 *                     write("%s\t%d\t%d\t%d" % (chrom,start,end,length))
 *                     write("\t%d" % peak["summit"] + 1) # summit position             # <<<<<<<<<<<<<<
 *                     write("\tNA\tNA\tNA\tNA\tNA\tNA")
 *                     # this part spits out stuff for sample 1
 */
        __pyx_t_13 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__summit)); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_121), __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_14));
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyNumber_Add(((PyObject *)__pyx_t_14), __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_13);
        __pyx_t_13 = 0;
        __pyx_t_13 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3399
 *                     write("%s\t%d\t%d\t%d" % (chrom,start,end,length))
 *                     write("\t%d" % peak["summit"] + 1) # summit position
 *                     write("\tNA\tNA\tNA\tNA\tNA\tNA")             # <<<<<<<<<<<<<<
 *                     # this part spits out stuff for sample 1
 *                     write("\t%.5f" % peak["pileup"])
 */
        __pyx_t_13 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_k_tuple_139), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3401
 *                     write("\tNA\tNA\tNA\tNA\tNA\tNA")
 *                     # this part spits out stuff for sample 1
 *                     write("\t%.5f" % peak["pileup"])             # <<<<<<<<<<<<<<
 *                     write("\tNA")
 *                     write("\t%.5f" % log2(peak["fc"]))
 */
        __pyx_t_13 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__pileup)); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_14));
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_14));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
        __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3402
 *                     # this part spits out stuff for sample 1
 *                     write("\t%.5f" % peak["pileup"])
 *                     write("\tNA")             # <<<<<<<<<<<<<<
 *                     write("\t%.5f" % log2(peak["fc"]))
 *                     write("\t%.5f" % peak["qscore"])
 */
        __pyx_t_14 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_k_tuple_141), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3403
 *                     write("\t%.5f" % peak["pileup"])
 *                     write("\tNA")
 *                     write("\t%.5f" % log2(peak["fc"]))             # <<<<<<<<<<<<<<
 *                     write("\t%.5f" % peak["qscore"])
 *                     write("\t%s" % peak["name"])
 */
        __pyx_t_14 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__fc)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_14);
        __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
        __pyx_t_13 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_13));
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_13));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
        __pyx_t_13 = 0;
        __pyx_t_13 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3404
 *                     write("\tNA")
 *                     write("\t%.5f" % log2(peak["fc"]))
 *                     write("\t%.5f" % peak["qscore"])             # <<<<<<<<<<<<<<
 *                     write("\t%s" % peak["name"])
 *                     write("\t%d" % peak["summit"] + 1)
 */
        __pyx_t_13 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__qscore)); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_14));
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_14));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
        __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3405
 *                     write("\t%.5f" % log2(peak["fc"]))
 *                     write("\t%.5f" % peak["qscore"])
 *                     write("\t%s" % peak["name"])             # <<<<<<<<<<<<<<
 *                     write("\t%d" % peak["summit"] + 1)
 *                     # this stuff for peak 2
 */
        __pyx_t_14 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__name)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_13 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_13));
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_13));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
        __pyx_t_13 = 0;
        __pyx_t_13 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3406
 *                     write("\t%.5f" % peak["qscore"])
 *                     write("\t%s" % peak["name"])
 *                     write("\t%d" % peak["summit"] + 1)             # <<<<<<<<<<<<<<
 *                     # this stuff for peak 2
 *                     write("\tNA\tNA\tNA\tNA\tNA\tNA")
 */
        __pyx_t_13 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__summit)); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_121), __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_14));
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyNumber_Add(((PyObject *)__pyx_t_14), __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_13);
        __pyx_t_13 = 0;
        __pyx_t_13 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3408
 *                     write("\t%d" % peak["summit"] + 1)
 *                     # this stuff for peak 2
 *                     write("\tNA\tNA\tNA\tNA\tNA\tNA")             # <<<<<<<<<<<<<<
 *                     write("\n")
 *                 continue
 */
        __pyx_t_13 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_k_tuple_142), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3409
 *                     # this stuff for peak 2
 *                     write("\tNA\tNA\tNA\tNA\tNA\tNA")
 *                     write("\n")             # <<<<<<<<<<<<<<
 *                 continue
 *             peaks1 = p1io.get_data_from_chrom(chrom)
 */
        __pyx_t_13 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_k_tuple_143), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3410
 *                     write("\tNA\tNA\tNA\tNA\tNA\tNA")
 *                     write("\n")
 *                 continue             # <<<<<<<<<<<<<<
 *             peaks1 = p1io.get_data_from_chrom(chrom)
 *             try: peaks2 = p2io.get_data_from_chrom(chrom)
 */
      goto __pyx_L3_continue;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "MACS2/IO/cScoreTrack.pyx":3411
 *                     write("\n")
 *                 continue
 *             peaks1 = p1io.get_data_from_chrom(chrom)             # <<<<<<<<<<<<<<
 *             try: peaks2 = p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_p1io, __pyx_n_s__get_data_from_chrom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
    PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_chrom));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
    __pyx_t_14 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
    if (!(likely(PyList_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_14)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_peaks1));
    __pyx_v_peaks1 = ((PyObject*)__pyx_t_14);
    __pyx_t_14 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3412
 *                 continue
 *             peaks1 = p1io.get_data_from_chrom(chrom)
 *             try: peaks2 = p2io.get_data_from_chrom(chrom)             # <<<<<<<<<<<<<<
 *             except KeyError: peaks2 = []
 *             summits1 = np.array(map(itemgetter('summit'), peaks1),
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {
        __pyx_t_14 = PyObject_GetAttr(__pyx_v_p2io, __pyx_n_s__get_data_from_chrom); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3412; __pyx_clineno = __LINE__; goto __pyx_L18_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3412; __pyx_clineno = __LINE__; goto __pyx_L18_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
        PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_chrom));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
        __pyx_t_3 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3412; __pyx_clineno = __LINE__; goto __pyx_L18_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
        if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3412; __pyx_clineno = __LINE__; goto __pyx_L18_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_peaks2));
        __pyx_v_peaks2 = ((PyObject*)__pyx_t_3);
        __pyx_t_3 = 0;
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L25_try_end;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3413
 *             peaks1 = p1io.get_data_from_chrom(chrom)
 *             try: peaks2 = p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []             # <<<<<<<<<<<<<<
 *             summits1 = np.array(map(itemgetter('summit'), peaks1),
 *                                 dtype='int32')
 */
      __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI._write_peaks_by_summit", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_13, &__pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(((PyObject *)__pyx_v_peaks2));
        __pyx_v_peaks2 = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L19_exception_handled;
      }
      __pyx_L20_except_error:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L19_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      __pyx_L25_try_end:;
    }

    /* "MACS2/IO/cScoreTrack.pyx":3414
 *             try: peaks2 = p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []
 *             summits1 = np.array(map(itemgetter('summit'), peaks1),             # <<<<<<<<<<<<<<
 *                                 dtype='int32')
 *             # note, summits should be unique and should be in order
 */
    __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_13 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__array); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_3 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_k_tuple_144), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_peaks1));
    PyTuple_SET_ITEM(__pyx_t_14, 1, ((PyObject *)__pyx_v_peaks1));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_peaks1));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
    __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__int32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summits1.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summits1.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summits1.rcbuffer->pybuffer, (PyObject*)__pyx_v_summits1, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_summits1.diminfo[0].strides = __pyx_pybuffernd_summits1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_summits1.diminfo[0].shape = __pyx_pybuffernd_summits1.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_summits1));
    __pyx_v_summits1 = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3417
 *                                 dtype='int32')
 *             # note, summits should be unique and should be in order
 *             pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *             where_peaks = self.where_peaks[chrom]
 *             w = 0
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
        }
      }
      __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
    __pyx_v_pos = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3418
 *             # note, summits should be unique and should be in order
 *             pos = self.pos[chrom]
 *             where_peaks = self.where_peaks[chrom]             # <<<<<<<<<<<<<<
 *             w = 0
 *             w_max = where_peaks.size
 */
    if (unlikely(((PyObject *)__pyx_v_self->where_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->where_peaks), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_where_peaks);
    __pyx_v_where_peaks = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3419
 *             pos = self.pos[chrom]
 *             where_peaks = self.where_peaks[chrom]
 *             w = 0             # <<<<<<<<<<<<<<
 *             w_max = where_peaks.size
 *             which_peaks = which_peaks2[chrom]
 */
    __pyx_v_w = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3420
 *             where_peaks = self.where_peaks[chrom]
 *             w = 0
 *             w_max = where_peaks.size             # <<<<<<<<<<<<<<
 *             which_peaks = which_peaks2[chrom]
 *             n_peaks = len(peaks2)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_where_peaks, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_w_max = __pyx_t_9;

    /* "MACS2/IO/cScoreTrack.pyx":3421
 *             w = 0
 *             w_max = where_peaks.size
 *             which_peaks = which_peaks2[chrom]             # <<<<<<<<<<<<<<
 *             n_peaks = len(peaks2)
 *             t1 = t1_by_chrom[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_which_peaks2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_which_peaks2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_which_peaks.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_which_peaks.rcbuffer->pybuffer, (PyObject*)__pyx_v_which_peaks, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_which_peaks.diminfo[0].strides = __pyx_pybuffernd_which_peaks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_which_peaks.diminfo[0].shape = __pyx_pybuffernd_which_peaks.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_which_peaks));
    __pyx_v_which_peaks = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3422
 *             w_max = where_peaks.size
 *             which_peaks = which_peaks2[chrom]
 *             n_peaks = len(peaks2)             # <<<<<<<<<<<<<<
 *             t1 = t1_by_chrom[chrom]
 *             t2 = t2_by_chrom[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_peaks2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = PyList_GET_SIZE(((PyObject *)__pyx_v_peaks2)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_n_peaks = __pyx_t_12;

    /* "MACS2/IO/cScoreTrack.pyx":3423
 *             which_peaks = which_peaks2[chrom]
 *             n_peaks = len(peaks2)
 *             t1 = t1_by_chrom[chrom]             # <<<<<<<<<<<<<<
 *             t2 = t2_by_chrom[chrom]
 *             c1 = c1_by_chrom[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_t1_by_chrom) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_t1_by_chrom), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t1.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t1.rcbuffer->pybuffer, (PyObject*)__pyx_v_t1, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
        }
      }
      __pyx_pybuffernd_t1.diminfo[0].strides = __pyx_pybuffernd_t1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t1.diminfo[0].shape = __pyx_pybuffernd_t1.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_t1));
    __pyx_v_t1 = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3424
 *             n_peaks = len(peaks2)
 *             t1 = t1_by_chrom[chrom]
 *             t2 = t2_by_chrom[chrom]             # <<<<<<<<<<<<<<
 *             c1 = c1_by_chrom[chrom]
 *             c2 = c2_by_chrom[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_t2_by_chrom) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_t2_by_chrom), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t2.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t2.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_t2.rcbuffer->pybuffer, (PyObject*)__pyx_v_t2, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_t2.diminfo[0].strides = __pyx_pybuffernd_t2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_t2.diminfo[0].shape = __pyx_pybuffernd_t2.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_t2));
    __pyx_v_t2 = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3425
 *             t1 = t1_by_chrom[chrom]
 *             t2 = t2_by_chrom[chrom]
 *             c1 = c1_by_chrom[chrom]             # <<<<<<<<<<<<<<
 *             c2 = c2_by_chrom[chrom]
 *             diff_peaks = self.diff_peaks[chrom].copy()
 */
    if (unlikely(((PyObject *)__pyx_v_c1_by_chrom) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_c1_by_chrom), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c1.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c1.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c1.rcbuffer->pybuffer, (PyObject*)__pyx_v_c1, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
        }
      }
      __pyx_pybuffernd_c1.diminfo[0].strides = __pyx_pybuffernd_c1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c1.diminfo[0].shape = __pyx_pybuffernd_c1.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_c1));
    __pyx_v_c1 = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3426
 *             t2 = t2_by_chrom[chrom]
 *             c1 = c1_by_chrom[chrom]
 *             c2 = c2_by_chrom[chrom]             # <<<<<<<<<<<<<<
 *             diff_peaks = self.diff_peaks[chrom].copy()
 *             d_max = diff_peaks.shape[0]
 */
    if (unlikely(((PyObject *)__pyx_v_c2_by_chrom) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_c2_by_chrom), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c2.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c2.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c2.rcbuffer->pybuffer, (PyObject*)__pyx_v_c2, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_c2.diminfo[0].strides = __pyx_pybuffernd_c2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c2.diminfo[0].shape = __pyx_pybuffernd_c2.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_c2));
    __pyx_v_c2 = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3427
 *             c1 = c1_by_chrom[chrom]
 *             c2 = c2_by_chrom[chrom]
 *             diff_peaks = self.diff_peaks[chrom].copy()             # <<<<<<<<<<<<<<
 *             d_max = diff_peaks.shape[0]
 *             diff_pvalues = self.t1vs2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->diff_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_peaks), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_17 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer, (PyObject*)__pyx_v_diff_peaks, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
        }
      }
      __pyx_pybuffernd_diff_peaks.diminfo[0].strides = __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_diff_peaks.diminfo[0].shape = __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_diff_peaks.diminfo[1].strides = __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_diff_peaks.diminfo[1].shape = __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.shape[1];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_17 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_diff_peaks));
    __pyx_v_diff_peaks = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3428
 *             c2 = c2_by_chrom[chrom]
 *             diff_peaks = self.diff_peaks[chrom].copy()
 *             d_max = diff_peaks.shape[0]             # <<<<<<<<<<<<<<
 *             diff_pvalues = self.t1vs2[chrom]
 *             diff_qvalues = self.diff_qvalues[chrom]
 */
    __pyx_v_d_max = (__pyx_v_diff_peaks->dimensions[0]);

    /* "MACS2/IO/cScoreTrack.pyx":3429
 *             diff_peaks = self.diff_peaks[chrom].copy()
 *             d_max = diff_peaks.shape[0]
 *             diff_pvalues = self.t1vs2[chrom]             # <<<<<<<<<<<<<<
 *             diff_qvalues = self.diff_qvalues[chrom]
 *             diff_logLR = self.tlogLR[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_18 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer, (PyObject*)__pyx_v_diff_pvalues, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_diff_pvalues.diminfo[0].strides = __pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_diff_pvalues.diminfo[0].shape = __pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_18 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_diff_pvalues));
    __pyx_v_diff_pvalues = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3430
 *             d_max = diff_peaks.shape[0]
 *             diff_pvalues = self.t1vs2[chrom]
 *             diff_qvalues = self.diff_qvalues[chrom]             # <<<<<<<<<<<<<<
 *             diff_logLR = self.tlogLR[chrom]
 *             if self.diff_scoring_method == 'q':
 */
    if (unlikely(((PyObject *)__pyx_v_self->diff_qvalues) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_qvalues), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_18 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer, (PyObject*)__pyx_v_diff_qvalues, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
        }
      }
      __pyx_pybuffernd_diff_qvalues.diminfo[0].strides = __pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_diff_qvalues.diminfo[0].shape = __pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_18 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_diff_qvalues));
    __pyx_v_diff_qvalues = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3431
 *             diff_pvalues = self.t1vs2[chrom]
 *             diff_qvalues = self.diff_qvalues[chrom]
 *             diff_logLR = self.tlogLR[chrom]             # <<<<<<<<<<<<<<
 *             if self.diff_scoring_method == 'q':
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 */
    if (unlikely(((PyObject *)__pyx_v_self->tlogLR) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tlogLR), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_18 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer, (PyObject*)__pyx_v_diff_logLR, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        }
      }
      __pyx_pybuffernd_diff_logLR.diminfo[0].strides = __pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_diff_logLR.diminfo[0].shape = __pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_18 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_diff_logLR));
    __pyx_v_diff_logLR = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3432
 *             diff_qvalues = self.diff_qvalues[chrom]
 *             diff_logLR = self.tlogLR[chrom]
 *             if self.diff_scoring_method == 'q':             # <<<<<<<<<<<<<<
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')
 */
    __pyx_t_11 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_self->diff_scoring_method), ((PyObject *)__pyx_n_s__q), Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_11) {

      /* "MACS2/IO/cScoreTrack.pyx":3433
 *             diff_logLR = self.tlogLR[chrom]
 *             if self.diff_scoring_method == 'q':
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=             # <<<<<<<<<<<<<<
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__where); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(((PyObject *)__pyx_v_self->diff_qvalues) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->diff_qvalues), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);

      /* "MACS2/IO/cScoreTrack.pyx":3434
 *             if self.diff_scoring_method == 'q':
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][where_peaks] >= self.cutoff)[0].astype('int32')
 */
      __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_t_14, Py_GE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_13 = 0;
      __pyx_t_13 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__astype); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_k_tuple_145), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_v_above_cutoff);
      __pyx_v_above_cutoff = __pyx_t_14;
      __pyx_t_14 = 0;
      goto __pyx_L28;
    }

    /* "MACS2/IO/cScoreTrack.pyx":3435
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':             # <<<<<<<<<<<<<<
 *                 above_cutoff = np.where(self.t1vs2[chrom][where_peaks] >= self.cutoff)[0].astype('int32')
 *             # change to coordinates for diff peak now
 */
    __pyx_t_11 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_self->diff_scoring_method), ((PyObject *)__pyx_n_s__p), Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_11) {

      /* "MACS2/IO/cScoreTrack.pyx":3436
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][where_peaks] >= self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             # change to coordinates for diff peak now
 *             for d in range(d_max):
 */
      __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_13 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__where); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_3 = PyObject_GetItem(__pyx_t_14, __pyx_v_where_peaks); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_14, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_146), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_v_above_cutoff);
      __pyx_v_above_cutoff = __pyx_t_14;
      __pyx_t_14 = 0;
      goto __pyx_L28;
    }
    __pyx_L28:;

    /* "MACS2/IO/cScoreTrack.pyx":3438
 *                 above_cutoff = np.where(self.t1vs2[chrom][where_peaks] >= self.cutoff)[0].astype('int32')
 *             # change to coordinates for diff peak now
 *             for d in range(d_max):             # <<<<<<<<<<<<<<
 *                 start = diff_peaks[d, 0]
 *                 end = diff_peaks[d, 1]
 */
    __pyx_t_9 = __pyx_v_d_max;
    for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_9; __pyx_t_19+=1) {
      __pyx_v_d = __pyx_t_19;

      /* "MACS2/IO/cScoreTrack.pyx":3439
 *             # change to coordinates for diff peak now
 *             for d in range(d_max):
 *                 start = diff_peaks[d, 0]             # <<<<<<<<<<<<<<
 *                 end = diff_peaks[d, 1]
 *                 diff_peaks[d, 0] = pos[where_peaks[above_cutoff[start]] - 1]
 */
      __pyx_t_20 = __pyx_v_d;
      __pyx_t_21 = 0;
      __pyx_t_22 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_pybuffernd_diff_peaks.diminfo[0].shape;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_22 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_diff_peaks.diminfo[0].shape)) __pyx_t_22 = 0;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_pybuffernd_diff_peaks.diminfo[1].shape;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 1;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_diff_peaks.diminfo[1].shape)) __pyx_t_22 = 1;
      if (unlikely(__pyx_t_22 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_22);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_start = (*__Pyx_BufPtrStrided2d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_diff_peaks.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_diff_peaks.diminfo[1].strides));

      /* "MACS2/IO/cScoreTrack.pyx":3440
 *             for d in range(d_max):
 *                 start = diff_peaks[d, 0]
 *                 end = diff_peaks[d, 1]             # <<<<<<<<<<<<<<
 *                 diff_peaks[d, 0] = pos[where_peaks[above_cutoff[start]] - 1]
 *                 diff_peaks[d, 1] = pos[where_peaks[above_cutoff[end]]]
 */
      __pyx_t_22 = __pyx_v_d;
      __pyx_t_23 = 1;
      __pyx_t_24 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_pybuffernd_diff_peaks.diminfo[0].shape;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_24 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_diff_peaks.diminfo[0].shape)) __pyx_t_24 = 0;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_pybuffernd_diff_peaks.diminfo[1].shape;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_24 = 1;
      } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_diff_peaks.diminfo[1].shape)) __pyx_t_24 = 1;
      if (unlikely(__pyx_t_24 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_24);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_end = (*__Pyx_BufPtrStrided2d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_diff_peaks.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_diff_peaks.diminfo[1].strides));

      /* "MACS2/IO/cScoreTrack.pyx":3441
 *                 start = diff_peaks[d, 0]
 *                 end = diff_peaks[d, 1]
 *                 diff_peaks[d, 0] = pos[where_peaks[above_cutoff[start]] - 1]             # <<<<<<<<<<<<<<
 *                 diff_peaks[d, 1] = pos[where_peaks[above_cutoff[end]]]
 *             if d_max > 0:
 */
      if (unlikely(!__pyx_v_above_cutoff)) { __Pyx_RaiseUnboundLocalError("above_cutoff"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_above_cutoff, __pyx_v_start, sizeof(int), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyObject_GetItem(__pyx_v_where_peaks, __pyx_t_14); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_14); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_25 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_25 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_24 = __pyx_v_d;
      __pyx_t_26 = 0;
      __pyx_t_27 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_diff_peaks.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_27 = 0;
      } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_diff_peaks.diminfo[0].shape)) __pyx_t_27 = 0;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_pybuffernd_diff_peaks.diminfo[1].shape;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_27 = 1;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_diff_peaks.diminfo[1].shape)) __pyx_t_27 = 1;
      if (unlikely(__pyx_t_27 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_27);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_diff_peaks.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_diff_peaks.diminfo[1].strides) = __pyx_t_25;

      /* "MACS2/IO/cScoreTrack.pyx":3442
 *                 end = diff_peaks[d, 1]
 *                 diff_peaks[d, 0] = pos[where_peaks[above_cutoff[start]] - 1]
 *                 diff_peaks[d, 1] = pos[where_peaks[above_cutoff[end]]]             # <<<<<<<<<<<<<<
 *             if d_max > 0:
 *                 if diff_peaks[0, 0] > diff_peaks[0, 1]:
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_above_cutoff, __pyx_v_end, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = PyObject_GetItem(__pyx_v_where_peaks, __pyx_t_1); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_14); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_25 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_25 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_27 = __pyx_v_d;
      __pyx_t_28 = 1;
      __pyx_t_29 = -1;
      if (__pyx_t_27 < 0) {
        __pyx_t_27 += __pyx_pybuffernd_diff_peaks.diminfo[0].shape;
        if (unlikely(__pyx_t_27 < 0)) __pyx_t_29 = 0;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_diff_peaks.diminfo[0].shape)) __pyx_t_29 = 0;
      if (__pyx_t_28 < 0) {
        __pyx_t_28 += __pyx_pybuffernd_diff_peaks.diminfo[1].shape;
        if (unlikely(__pyx_t_28 < 0)) __pyx_t_29 = 1;
      } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_diff_peaks.diminfo[1].shape)) __pyx_t_29 = 1;
      if (unlikely(__pyx_t_29 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_29);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_diff_peaks.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_diff_peaks.diminfo[1].strides) = __pyx_t_25;
    }

    /* "MACS2/IO/cScoreTrack.pyx":3443
 *                 diff_peaks[d, 0] = pos[where_peaks[above_cutoff[start]] - 1]
 *                 diff_peaks[d, 1] = pos[where_peaks[above_cutoff[end]]]
 *             if d_max > 0:             # <<<<<<<<<<<<<<
 *                 if diff_peaks[0, 0] > diff_peaks[0, 1]:
 *                     diff_peaks[0, 0] = 0
 */
    __pyx_t_11 = (__pyx_v_d_max > 0);
    if (__pyx_t_11) {

      /* "MACS2/IO/cScoreTrack.pyx":3444
 *                 diff_peaks[d, 1] = pos[where_peaks[above_cutoff[end]]]
 *             if d_max > 0:
 *                 if diff_peaks[0, 0] > diff_peaks[0, 1]:             # <<<<<<<<<<<<<<
 *                     diff_peaks[0, 0] = 0
 *             d = 0
 */
      __pyx_t_30 = 0;
      __pyx_t_31 = 0;
      __pyx_t_9 = -1;
      if (__pyx_t_30 < 0) {
        __pyx_t_30 += __pyx_pybuffernd_diff_peaks.diminfo[0].shape;
        if (unlikely(__pyx_t_30 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_diff_peaks.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_31 < 0) {
        __pyx_t_31 += __pyx_pybuffernd_diff_peaks.diminfo[1].shape;
        if (unlikely(__pyx_t_31 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_diff_peaks.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_32 = 0;
      __pyx_t_33 = 1;
      __pyx_t_9 = -1;
      if (__pyx_t_32 < 0) {
        __pyx_t_32 += __pyx_pybuffernd_diff_peaks.diminfo[0].shape;
        if (unlikely(__pyx_t_32 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_diff_peaks.diminfo[0].shape)) __pyx_t_9 = 0;
      if (__pyx_t_33 < 0) {
        __pyx_t_33 += __pyx_pybuffernd_diff_peaks.diminfo[1].shape;
        if (unlikely(__pyx_t_33 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_diff_peaks.diminfo[1].shape)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_11 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_diff_peaks.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_diff_peaks.diminfo[1].strides)) > (*__Pyx_BufPtrStrided2d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_diff_peaks.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_diff_peaks.diminfo[1].strides)));
      if (__pyx_t_11) {

        /* "MACS2/IO/cScoreTrack.pyx":3445
 *             if d_max > 0:
 *                 if diff_peaks[0, 0] > diff_peaks[0, 1]:
 *                     diff_peaks[0, 0] = 0             # <<<<<<<<<<<<<<
 *             d = 0
 *             i = 0
 */
        __pyx_t_34 = 0;
        __pyx_t_35 = 0;
        __pyx_t_9 = -1;
        if (__pyx_t_34 < 0) {
          __pyx_t_34 += __pyx_pybuffernd_diff_peaks.diminfo[0].shape;
          if (unlikely(__pyx_t_34 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_diff_peaks.diminfo[0].shape)) __pyx_t_9 = 0;
        if (__pyx_t_35 < 0) {
          __pyx_t_35 += __pyx_pybuffernd_diff_peaks.diminfo[1].shape;
          if (unlikely(__pyx_t_35 < 0)) __pyx_t_9 = 1;
        } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_diff_peaks.diminfo[1].shape)) __pyx_t_9 = 1;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_diff_peaks.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_diff_peaks.diminfo[1].strides) = 0;
        goto __pyx_L32;
      }
      __pyx_L32:;
      goto __pyx_L31;
    }
    __pyx_L31:;

    /* "MACS2/IO/cScoreTrack.pyx":3446
 *                 if diff_peaks[0, 0] > diff_peaks[0, 1]:
 *                     diff_peaks[0, 0] = 0
 *             d = 0             # <<<<<<<<<<<<<<
 *             i = 0
 *             for j in range(summits1.size):
 */
    __pyx_v_d = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3447
 *                     diff_peaks[0, 0] = 0
 *             d = 0
 *             i = 0             # <<<<<<<<<<<<<<
 *             for j in range(summits1.size):
 *                 if i == datalength: break #shouldn't happen
 */
    __pyx_v_i = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3448
 *             d = 0
 *             i = 0
 *             for j in range(summits1.size):             # <<<<<<<<<<<<<<
 *                 if i == datalength: break #shouldn't happen
 *                 summit = summits1[j]
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_summits1), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_36 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_36 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_36; __pyx_t_9+=1) {
      __pyx_v_j = __pyx_t_9;

      /* "MACS2/IO/cScoreTrack.pyx":3449
 *             i = 0
 *             for j in range(summits1.size):
 *                 if i == datalength: break #shouldn't happen             # <<<<<<<<<<<<<<
 *                 summit = summits1[j]
 *                 while True:
 */
      __pyx_t_11 = (__pyx_v_i == __pyx_v_datalength);
      if (__pyx_t_11) {
        goto __pyx_L34_break;
        goto __pyx_L35;
      }
      __pyx_L35:;

      /* "MACS2/IO/cScoreTrack.pyx":3450
 *             for j in range(summits1.size):
 *                 if i == datalength: break #shouldn't happen
 *                 summit = summits1[j]             # <<<<<<<<<<<<<<
 *                 while True:
 *                     if i == datalength: break # shouldn't happen
 */
      __pyx_t_19 = __pyx_v_j;
      __pyx_t_29 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_summits1.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_29 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_summits1.diminfo[0].shape)) __pyx_t_29 = 0;
      if (unlikely(__pyx_t_29 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_29);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_summit = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_summits1.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_summits1.diminfo[0].strides));

      /* "MACS2/IO/cScoreTrack.pyx":3451
 *                 if i == datalength: break #shouldn't happen
 *                 summit = summits1[j]
 *                 while True:             # <<<<<<<<<<<<<<
 *                     if i == datalength: break # shouldn't happen
 *                     elif summit >= pos[i]: i += 1
 */
      while (1) {
        if (!1) break;

        /* "MACS2/IO/cScoreTrack.pyx":3452
 *                 summit = summits1[j]
 *                 while True:
 *                     if i == datalength: break # shouldn't happen             # <<<<<<<<<<<<<<
 *                     elif summit >= pos[i]: i += 1
 *                     else:
 */
        __pyx_t_11 = (__pyx_v_i == __pyx_v_datalength);
        if (__pyx_t_11) {
          goto __pyx_L37_break;
          goto __pyx_L38;
        }

        /* "MACS2/IO/cScoreTrack.pyx":3453
 *                 while True:
 *                     if i == datalength: break # shouldn't happen
 *                     elif summit >= pos[i]: i += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         # write record
 */
        __pyx_t_29 = __pyx_v_i;
        __pyx_t_37 = -1;
        if (__pyx_t_29 < 0) {
          __pyx_t_29 += __pyx_pybuffernd_pos.diminfo[0].shape;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_37 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_37 = 0;
        if (unlikely(__pyx_t_37 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_37);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_11 = (__pyx_v_summit >= (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_pos.diminfo[0].strides)));
        if (__pyx_t_11) {
          __pyx_v_i = (__pyx_v_i + 1);
          goto __pyx_L38;
        }
        /*else*/ {

          /* "MACS2/IO/cScoreTrack.pyx":3456
 *                     else:
 *                         # write record
 *                         peak = peaks1[j]             # <<<<<<<<<<<<<<
 *                         # check if this is a differentially occupied peak
 *                         while True:
 */
          if (unlikely(((PyObject *)__pyx_v_peaks1) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks1), __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_XDECREF(__pyx_v_peak);
          __pyx_v_peak = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3458
 *                         peak = peaks1[j]
 *                         # check if this is a differentially occupied peak
 *                         while True:             # <<<<<<<<<<<<<<
 *                             if w == w_max - 1: break
 *                             elif summit < pos[where_peaks[w]]:
 */
          while (1) {
            if (!1) break;

            /* "MACS2/IO/cScoreTrack.pyx":3459
 *                         # check if this is a differentially occupied peak
 *                         while True:
 *                             if w == w_max - 1: break             # <<<<<<<<<<<<<<
 *                             elif summit < pos[where_peaks[w]]:
 *                                 break
 */
            __pyx_t_11 = (__pyx_v_w == (__pyx_v_w_max - 1));
            if (__pyx_t_11) {
              goto __pyx_L40_break;
              goto __pyx_L41;
            }

            /* "MACS2/IO/cScoreTrack.pyx":3460
 *                         while True:
 *                             if w == w_max - 1: break
 *                             elif summit < pos[where_peaks[w]]:             # <<<<<<<<<<<<<<
 *                                 break
 *                             else:
 */
            __pyx_t_1 = PyInt_FromLong(__pyx_v_summit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_where_peaks, __pyx_v_w, sizeof(int), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_13 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_14); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = PyObject_RichCompare(__pyx_t_1, __pyx_t_13, Py_LT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (__pyx_t_11) {

              /* "MACS2/IO/cScoreTrack.pyx":3461
 *                             if w == w_max - 1: break
 *                             elif summit < pos[where_peaks[w]]:
 *                                 break             # <<<<<<<<<<<<<<
 *                             else:
 *                                 w += 1
 */
              goto __pyx_L40_break;
              goto __pyx_L41;
            }
            /*else*/ {

              /* "MACS2/IO/cScoreTrack.pyx":3463
 *                                 break
 *                             else:
 *                                 w += 1             # <<<<<<<<<<<<<<
 * #                        print w, where_peaks[w], summit
 *                         start = peak["start"] + 1
 */
              __pyx_v_w = (__pyx_v_w + 1);
            }
            __pyx_L41:;
          }
          __pyx_L40_break:;

          /* "MACS2/IO/cScoreTrack.pyx":3465
 *                                 w += 1
 * #                        print w, where_peaks[w], summit
 *                         start = peak["start"] + 1             # <<<<<<<<<<<<<<
 *                         end = peak["end"]
 *                         length = peak["length"]
 */
          __pyx_t_14 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_13 = PyNumber_Add(__pyx_t_14, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_37 = __Pyx_PyInt_AsInt(__pyx_t_13); if (unlikely((__pyx_t_37 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_v_start = __pyx_t_37;

          /* "MACS2/IO/cScoreTrack.pyx":3466
 * #                        print w, where_peaks[w], summit
 *                         start = peak["start"] + 1
 *                         end = peak["end"]             # <<<<<<<<<<<<<<
 *                         length = peak["length"]
 *                         write("%s\t%d\t%d\t%d" % (chrom,start,end,length))
 */
          __pyx_t_13 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_37 = __Pyx_PyInt_AsInt(__pyx_t_13); if (unlikely((__pyx_t_37 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_v_end = __pyx_t_37;

          /* "MACS2/IO/cScoreTrack.pyx":3467
 *                         start = peak["start"] + 1
 *                         end = peak["end"]
 *                         length = peak["length"]             # <<<<<<<<<<<<<<
 *                         write("%s\t%d\t%d\t%d" % (chrom,start,end,length))
 *                         write("\t%d" % (summit + 1)) # summit position
 */
          __pyx_t_13 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__length)); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_37 = __Pyx_PyInt_AsInt(__pyx_t_13); if (unlikely((__pyx_t_37 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_v_length = __pyx_t_37;

          /* "MACS2/IO/cScoreTrack.pyx":3468
 *                         end = peak["end"]
 *                         length = peak["length"]
 *                         write("%s\t%d\t%d\t%d" % (chrom,start,end,length))             # <<<<<<<<<<<<<<
 *                         write("\t%d" % (summit + 1)) # summit position
 *                         # only if summit >= diff_peaks[d, 0] and
 */
          __pyx_t_13 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_1 = PyInt_FromLong(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
          PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_chrom));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
          PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_14);
          PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_13 = 0;
          __pyx_t_14 = 0;
          __pyx_t_1 = 0;
          __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_91), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_1));
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3469
 *                         length = peak["length"]
 *                         write("%s\t%d\t%d\t%d" % (chrom,start,end,length))
 *                         write("\t%d" % (summit + 1)) # summit position             # <<<<<<<<<<<<<<
 *                         # only if summit >= diff_peaks[d, 0] and
 *                         # summit < diff_peaks[d, 1]
 */
          __pyx_t_1 = PyInt_FromLong((__pyx_v_summit + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_121), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_3));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
          __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3472
 *                         # only if summit >= diff_peaks[d, 0] and
 *                         # summit < diff_peaks[d, 1]
 *                         this_dpvalue = diff_pvalues[i]             # <<<<<<<<<<<<<<
 *                         this_dqvalue = diff_qvalues[w]
 *                         if self.diff_scoring_method == 'p':
 */
          __pyx_t_37 = __pyx_v_i;
          __pyx_t_38 = -1;
          if (__pyx_t_37 < 0) {
            __pyx_t_37 += __pyx_pybuffernd_diff_pvalues.diminfo[0].shape;
            if (unlikely(__pyx_t_37 < 0)) __pyx_t_38 = 0;
          } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_diff_pvalues.diminfo[0].shape)) __pyx_t_38 = 0;
          if (unlikely(__pyx_t_38 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_38);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_v_this_dpvalue = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_diff_pvalues.diminfo[0].strides));

          /* "MACS2/IO/cScoreTrack.pyx":3473
 *                         # summit < diff_peaks[d, 1]
 *                         this_dpvalue = diff_pvalues[i]
 *                         this_dqvalue = diff_qvalues[w]             # <<<<<<<<<<<<<<
 *                         if self.diff_scoring_method == 'p':
 *                             score_value = this_dpvalue
 */
          __pyx_t_38 = __pyx_v_w;
          __pyx_t_39 = -1;
          if (__pyx_t_38 < 0) {
            __pyx_t_38 += __pyx_pybuffernd_diff_qvalues.diminfo[0].shape;
            if (unlikely(__pyx_t_38 < 0)) __pyx_t_39 = 0;
          } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_diff_qvalues.diminfo[0].shape)) __pyx_t_39 = 0;
          if (unlikely(__pyx_t_39 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_39);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_v_this_dqvalue = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_diff_qvalues.diminfo[0].strides));

          /* "MACS2/IO/cScoreTrack.pyx":3474
 *                         this_dpvalue = diff_pvalues[i]
 *                         this_dqvalue = diff_qvalues[w]
 *                         if self.diff_scoring_method == 'p':             # <<<<<<<<<<<<<<
 *                             score_value = this_dpvalue
 *                         elif self.diff_scoring_method == 'q':
 */
          __pyx_t_11 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_self->diff_scoring_method), ((PyObject *)__pyx_n_s__p), Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (__pyx_t_11) {

            /* "MACS2/IO/cScoreTrack.pyx":3475
 *                         this_dqvalue = diff_qvalues[w]
 *                         if self.diff_scoring_method == 'p':
 *                             score_value = this_dpvalue             # <<<<<<<<<<<<<<
 *                         elif self.diff_scoring_method == 'q':
 *                             score_value = this_dqvalue
 */
            __pyx_v_score_value = __pyx_v_this_dpvalue;
            goto __pyx_L42;
          }

          /* "MACS2/IO/cScoreTrack.pyx":3476
 *                         if self.diff_scoring_method == 'p':
 *                             score_value = this_dpvalue
 *                         elif self.diff_scoring_method == 'q':             # <<<<<<<<<<<<<<
 *                             score_value = this_dqvalue
 *                         log2_fold_change = log2(t1[i]) - log2(t2[i])
 */
          __pyx_t_11 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_self->diff_scoring_method), ((PyObject *)__pyx_n_s__q), Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (__pyx_t_11) {

            /* "MACS2/IO/cScoreTrack.pyx":3477
 *                             score_value = this_dpvalue
 *                         elif self.diff_scoring_method == 'q':
 *                             score_value = this_dqvalue             # <<<<<<<<<<<<<<
 *                         log2_fold_change = log2(t1[i]) - log2(t2[i])
 *                         log2_fold_change_w_pc = log2(t1[i] + pseudocount) - \
 */
            __pyx_v_score_value = __pyx_v_this_dqvalue;
            goto __pyx_L42;
          }
          __pyx_L42:;

          /* "MACS2/IO/cScoreTrack.pyx":3478
 *                         elif self.diff_scoring_method == 'q':
 *                             score_value = this_dqvalue
 *                         log2_fold_change = log2(t1[i]) - log2(t2[i])             # <<<<<<<<<<<<<<
 *                         log2_fold_change_w_pc = log2(t1[i] + pseudocount) - \
 *                                                 log2(t2[i] + pseudocount)
 */
          __pyx_t_39 = __pyx_v_i;
          __pyx_t_40 = -1;
          if (__pyx_t_39 < 0) {
            __pyx_t_39 += __pyx_pybuffernd_t1.diminfo[0].shape;
            if (unlikely(__pyx_t_39 < 0)) __pyx_t_40 = 0;
          } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_t1.diminfo[0].shape)) __pyx_t_40 = 0;
          if (unlikely(__pyx_t_40 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_40);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t1.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_t1.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __pyx_t_40 = __pyx_v_i;
          __pyx_t_41 = -1;
          if (__pyx_t_40 < 0) {
            __pyx_t_40 += __pyx_pybuffernd_t2.diminfo[0].shape;
            if (unlikely(__pyx_t_40 < 0)) __pyx_t_41 = 0;
          } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_t2.diminfo[0].shape)) __pyx_t_41 = 0;
          if (unlikely(__pyx_t_41 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_41);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t2.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_t2.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
          __pyx_t_14 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_42 = __pyx_PyFloat_AsFloat(__pyx_t_14); if (unlikely((__pyx_t_42 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_v_log2_fold_change = __pyx_t_42;

          /* "MACS2/IO/cScoreTrack.pyx":3479
 *                             score_value = this_dqvalue
 *                         log2_fold_change = log2(t1[i]) - log2(t2[i])
 *                         log2_fold_change_w_pc = log2(t1[i] + pseudocount) - \             # <<<<<<<<<<<<<<
 *                                                 log2(t2[i] + pseudocount)
 *                         this_dlogLR = diff_logLR[i]
 */
          __pyx_t_41 = __pyx_v_i;
          __pyx_t_43 = -1;
          if (__pyx_t_41 < 0) {
            __pyx_t_41 += __pyx_pybuffernd_t1.diminfo[0].shape;
            if (unlikely(__pyx_t_41 < 0)) __pyx_t_43 = 0;
          } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_t1.diminfo[0].shape)) __pyx_t_43 = 0;
          if (unlikely(__pyx_t_43 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_43);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_14 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t1.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_t1.diminfo[0].strides)) + __pyx_v_pseudocount)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_14);
          __pyx_t_14 = 0;
          __pyx_t_14 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3480
 *                         log2_fold_change = log2(t1[i]) - log2(t2[i])
 *                         log2_fold_change_w_pc = log2(t1[i] + pseudocount) - \
 *                                                 log2(t2[i] + pseudocount)             # <<<<<<<<<<<<<<
 *                         this_dlogLR = diff_logLR[i]
 *                         if flip_fc:
 */
          __pyx_t_43 = __pyx_v_i;
          __pyx_t_44 = -1;
          if (__pyx_t_43 < 0) {
            __pyx_t_43 += __pyx_pybuffernd_t2.diminfo[0].shape;
            if (unlikely(__pyx_t_43 < 0)) __pyx_t_44 = 0;
          } else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_t2.diminfo[0].shape)) __pyx_t_44 = 0;
          if (unlikely(__pyx_t_44 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_44);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_1 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t2.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_t2.diminfo[0].strides)) + __pyx_v_pseudocount)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __pyx_t_3 = PyNumber_Subtract(__pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_42 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_42 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_log2_fold_change_w_pc = __pyx_t_42;

          /* "MACS2/IO/cScoreTrack.pyx":3481
 *                         log2_fold_change_w_pc = log2(t1[i] + pseudocount) - \
 *                                                 log2(t2[i] + pseudocount)
 *                         this_dlogLR = diff_logLR[i]             # <<<<<<<<<<<<<<
 *                         if flip_fc:
 *                             write("\t%.5f" % -log2_fold_change)
 */
          __pyx_t_44 = __pyx_v_i;
          __pyx_t_45 = -1;
          if (__pyx_t_44 < 0) {
            __pyx_t_44 += __pyx_pybuffernd_diff_logLR.diminfo[0].shape;
            if (unlikely(__pyx_t_44 < 0)) __pyx_t_45 = 0;
          } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_diff_logLR.diminfo[0].shape)) __pyx_t_45 = 0;
          if (unlikely(__pyx_t_45 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_45);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_v_this_dlogLR = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_diff_logLR.diminfo[0].strides));

          /* "MACS2/IO/cScoreTrack.pyx":3482
 *                                                 log2(t2[i] + pseudocount)
 *                         this_dlogLR = diff_logLR[i]
 *                         if flip_fc:             # <<<<<<<<<<<<<<
 *                             write("\t%.5f" % -log2_fold_change)
 *                             write("\t%.5f" % -log2_fold_change_w_pc)
 */
          __pyx_t_11 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_flip_fc)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (__pyx_t_11) {

            /* "MACS2/IO/cScoreTrack.pyx":3483
 *                         this_dlogLR = diff_logLR[i]
 *                         if flip_fc:
 *                             write("\t%.5f" % -log2_fold_change)             # <<<<<<<<<<<<<<
 *                             write("\t%.5f" % -log2_fold_change_w_pc)
 *                         else:
 */
            __pyx_t_3 = PyFloat_FromDouble((-__pyx_v_log2_fold_change)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_1));
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
            __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":3484
 *                         if flip_fc:
 *                             write("\t%.5f" % -log2_fold_change)
 *                             write("\t%.5f" % -log2_fold_change_w_pc)             # <<<<<<<<<<<<<<
 *                         else:
 *                             write("\t%.5f" % log2_fold_change)
 */
            __pyx_t_1 = PyFloat_FromDouble((-__pyx_v_log2_fold_change_w_pc)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_3));
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
            __pyx_t_3 = 0;
            __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L43;
          }
          /*else*/ {

            /* "MACS2/IO/cScoreTrack.pyx":3486
 *                             write("\t%.5f" % -log2_fold_change_w_pc)
 *                         else:
 *                             write("\t%.5f" % log2_fold_change)             # <<<<<<<<<<<<<<
 *                             write("\t%.5f" % log2_fold_change_w_pc)
 *                         write("\t%.5f" % this_dpvalue)
 */
            __pyx_t_3 = PyFloat_FromDouble(__pyx_v_log2_fold_change); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_1));
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
            __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":3487
 *                         else:
 *                             write("\t%.5f" % log2_fold_change)
 *                             write("\t%.5f" % log2_fold_change_w_pc)             # <<<<<<<<<<<<<<
 *                         write("\t%.5f" % this_dpvalue)
 *                         write("\t%.5f" % this_dqvalue)
 */
            __pyx_t_1 = PyFloat_FromDouble(__pyx_v_log2_fold_change_w_pc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_3));
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
            __pyx_t_3 = 0;
            __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __pyx_L43:;

          /* "MACS2/IO/cScoreTrack.pyx":3488
 *                             write("\t%.5f" % log2_fold_change)
 *                             write("\t%.5f" % log2_fold_change_w_pc)
 *                         write("\t%.5f" % this_dpvalue)             # <<<<<<<<<<<<<<
 *                         write("\t%.5f" % this_dqvalue)
 *                         write("\t%.5f" % this_dlogLR)
 */
          __pyx_t_3 = PyFloat_FromDouble(__pyx_v_this_dpvalue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_1));
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3489
 *                             write("\t%.5f" % log2_fold_change_w_pc)
 *                         write("\t%.5f" % this_dpvalue)
 *                         write("\t%.5f" % this_dqvalue)             # <<<<<<<<<<<<<<
 *                         write("\t%.5f" % this_dlogLR)
 * #                        print i, w, w_max, d, d_max
 */
          __pyx_t_1 = PyFloat_FromDouble(__pyx_v_this_dqvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_3));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
          __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3490
 *                         write("\t%.5f" % this_dpvalue)
 *                         write("\t%.5f" % this_dqvalue)
 *                         write("\t%.5f" % this_dlogLR)             # <<<<<<<<<<<<<<
 * #                        print i, w, w_max, d, d_max
 *                         # this part to figure out which differential peak
 */
          __pyx_t_3 = PyFloat_FromDouble(__pyx_v_this_dlogLR); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_1));
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3493
 * #                        print i, w, w_max, d, d_max
 *                         # this part to figure out which differential peak
 *                         while True:             # <<<<<<<<<<<<<<
 *                             if d == d_max - 1 or d_max == 0: break
 *                             elif summit < diff_peaks[d, 1]:
 */
          while (1) {
            if (!1) break;

            /* "MACS2/IO/cScoreTrack.pyx":3494
 *                         # this part to figure out which differential peak
 *                         while True:
 *                             if d == d_max - 1 or d_max == 0: break             # <<<<<<<<<<<<<<
 *                             elif summit < diff_peaks[d, 1]:
 *                                 break
 */
            __pyx_t_11 = (__pyx_v_d == (__pyx_v_d_max - 1));
            if (!__pyx_t_11) {
              __pyx_t_46 = (__pyx_v_d_max == 0);
              __pyx_t_47 = __pyx_t_46;
            } else {
              __pyx_t_47 = __pyx_t_11;
            }
            if (__pyx_t_47) {
              goto __pyx_L45_break;
              goto __pyx_L46;
            }

            /* "MACS2/IO/cScoreTrack.pyx":3495
 *                         while True:
 *                             if d == d_max - 1 or d_max == 0: break
 *                             elif summit < diff_peaks[d, 1]:             # <<<<<<<<<<<<<<
 *                                 break
 *                             else:
 */
            __pyx_t_45 = __pyx_v_d;
            __pyx_t_48 = 1;
            __pyx_t_49 = -1;
            if (__pyx_t_45 < 0) {
              __pyx_t_45 += __pyx_pybuffernd_diff_peaks.diminfo[0].shape;
              if (unlikely(__pyx_t_45 < 0)) __pyx_t_49 = 0;
            } else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_diff_peaks.diminfo[0].shape)) __pyx_t_49 = 0;
            if (__pyx_t_48 < 0) {
              __pyx_t_48 += __pyx_pybuffernd_diff_peaks.diminfo[1].shape;
              if (unlikely(__pyx_t_48 < 0)) __pyx_t_49 = 1;
            } else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_diff_peaks.diminfo[1].shape)) __pyx_t_49 = 1;
            if (unlikely(__pyx_t_49 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_49);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_47 = (__pyx_v_summit < (*__Pyx_BufPtrStrided2d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_diff_peaks.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_diff_peaks.diminfo[1].strides)));
            if (__pyx_t_47) {

              /* "MACS2/IO/cScoreTrack.pyx":3496
 *                             if d == d_max - 1 or d_max == 0: break
 *                             elif summit < diff_peaks[d, 1]:
 *                                 break             # <<<<<<<<<<<<<<
 *                             else:
 *                                 d += 1
 */
              goto __pyx_L45_break;
              goto __pyx_L46;
            }
            /*else*/ {

              /* "MACS2/IO/cScoreTrack.pyx":3498
 *                                 break
 *                             else:
 *                                 d += 1             # <<<<<<<<<<<<<<
 * #                        print d, d_max, diff_peaks[d,:], summit
 *                         if score_value >= self.cutoff:
 */
              __pyx_v_d = (__pyx_v_d + 1);
            }
            __pyx_L46:;
          }
          __pyx_L45_break:;

          /* "MACS2/IO/cScoreTrack.pyx":3500
 *                                 d += 1
 * #                        print d, d_max, diff_peaks[d,:], summit
 *                         if score_value >= self.cutoff:             # <<<<<<<<<<<<<<
 *                             if d_max == 0:
 *                                 write("\tNA")
 */
          __pyx_t_47 = (__pyx_v_score_value >= __pyx_v_self->cutoff);
          if (__pyx_t_47) {

            /* "MACS2/IO/cScoreTrack.pyx":3501
 * #                        print d, d_max, diff_peaks[d,:], summit
 *                         if score_value >= self.cutoff:
 *                             if d_max == 0:             # <<<<<<<<<<<<<<
 *                                 write("\tNA")
 *                             elif summit >= diff_peaks[d, 0]:
 */
            __pyx_t_47 = (__pyx_v_d_max == 0);
            if (__pyx_t_47) {

              /* "MACS2/IO/cScoreTrack.pyx":3502
 *                         if score_value >= self.cutoff:
 *                             if d_max == 0:
 *                                 write("\tNA")             # <<<<<<<<<<<<<<
 *                             elif summit >= diff_peaks[d, 0]:
 *                                 diffpeakname = "%s%d" % (peakprefix,
 */
              __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              goto __pyx_L48;
            }

            /* "MACS2/IO/cScoreTrack.pyx":3503
 *                             if d_max == 0:
 *                                 write("\tNA")
 *                             elif summit >= diff_peaks[d, 0]:             # <<<<<<<<<<<<<<
 *                                 diffpeakname = "%s%d" % (peakprefix,
 *                                                          diff_peaks[d, 2])
 */
            __pyx_t_49 = __pyx_v_d;
            __pyx_t_50 = 0;
            __pyx_t_51 = -1;
            if (__pyx_t_49 < 0) {
              __pyx_t_49 += __pyx_pybuffernd_diff_peaks.diminfo[0].shape;
              if (unlikely(__pyx_t_49 < 0)) __pyx_t_51 = 0;
            } else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_diff_peaks.diminfo[0].shape)) __pyx_t_51 = 0;
            if (__pyx_t_50 < 0) {
              __pyx_t_50 += __pyx_pybuffernd_diff_peaks.diminfo[1].shape;
              if (unlikely(__pyx_t_50 < 0)) __pyx_t_51 = 1;
            } else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_diff_peaks.diminfo[1].shape)) __pyx_t_51 = 1;
            if (unlikely(__pyx_t_51 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_51);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_47 = (__pyx_v_summit >= (*__Pyx_BufPtrStrided2d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_diff_peaks.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_diff_peaks.diminfo[1].strides)));
            if (__pyx_t_47) {

              /* "MACS2/IO/cScoreTrack.pyx":3505
 *                             elif summit >= diff_peaks[d, 0]:
 *                                 diffpeakname = "%s%d" % (peakprefix,
 *                                                          diff_peaks[d, 2])             # <<<<<<<<<<<<<<
 *                                 write("\t%s" % diffpeakname)
 *                             else:
 */
              __pyx_t_51 = __pyx_v_d;
              __pyx_t_52 = 2;
              __pyx_t_53 = -1;
              if (__pyx_t_51 < 0) {
                __pyx_t_51 += __pyx_pybuffernd_diff_peaks.diminfo[0].shape;
                if (unlikely(__pyx_t_51 < 0)) __pyx_t_53 = 0;
              } else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_diff_peaks.diminfo[0].shape)) __pyx_t_53 = 0;
              if (__pyx_t_52 < 0) {
                __pyx_t_52 += __pyx_pybuffernd_diff_peaks.diminfo[1].shape;
                if (unlikely(__pyx_t_52 < 0)) __pyx_t_53 = 1;
              } else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_diff_peaks.diminfo[1].shape)) __pyx_t_53 = 1;
              if (unlikely(__pyx_t_53 != -1)) {
                __Pyx_RaiseBufferIndexError(__pyx_t_53);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              __pyx_t_1 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided2d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_diff_peaks.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_diff_peaks.diminfo[1].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_INCREF(((PyObject *)__pyx_v_peakprefix));
              PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_peakprefix));
              __Pyx_GIVEREF(((PyObject *)__pyx_v_peakprefix));
              PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_1);
              __pyx_t_1 = 0;
              __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_90), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(((PyObject *)__pyx_t_1));
              __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_v_diffpeakname);
              __pyx_v_diffpeakname = ((PyObject *)__pyx_t_1);
              __pyx_t_1 = 0;

              /* "MACS2/IO/cScoreTrack.pyx":3506
 *                                 diffpeakname = "%s%d" % (peakprefix,
 *                                                          diff_peaks[d, 2])
 *                                 write("\t%s" % diffpeakname)             # <<<<<<<<<<<<<<
 *                             else:
 *                                 write("\tNA")
 */
              __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), __pyx_v_diffpeakname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(((PyObject *)__pyx_t_1));
              __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
              __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
              __pyx_t_1 = 0;
              __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              goto __pyx_L48;
            }
            /*else*/ {

              /* "MACS2/IO/cScoreTrack.pyx":3508
 *                                 write("\t%s" % diffpeakname)
 *                             else:
 *                                 write("\tNA")             # <<<<<<<<<<<<<<
 *                         else:
 *                             write("\tNA")
 */
              __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_k_tuple_148), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
            __pyx_L48:;
            goto __pyx_L47;
          }
          /*else*/ {

            /* "MACS2/IO/cScoreTrack.pyx":3510
 *                                 write("\tNA")
 *                         else:
 *                             write("\tNA")             # <<<<<<<<<<<<<<
 *                         # this part spits out stuff for sample 1
 *                         write("\t%.5f" % t1[i])
 */
            __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_k_tuple_149), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_L47:;

          /* "MACS2/IO/cScoreTrack.pyx":3512
 *                             write("\tNA")
 *                         # this part spits out stuff for sample 1
 *                         write("\t%.5f" % t1[i])             # <<<<<<<<<<<<<<
 *                         write("\t%.5f" % c1[i])
 *                         write("\t%.5f" % log2(peak["fc"]))
 */
          __pyx_t_53 = __pyx_v_i;
          __pyx_t_54 = -1;
          if (__pyx_t_53 < 0) {
            __pyx_t_53 += __pyx_pybuffernd_t1.diminfo[0].shape;
            if (unlikely(__pyx_t_53 < 0)) __pyx_t_54 = 0;
          } else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_t1.diminfo[0].shape)) __pyx_t_54 = 0;
          if (unlikely(__pyx_t_54 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_54);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t1.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_t1.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_3));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
          __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3513
 *                         # this part spits out stuff for sample 1
 *                         write("\t%.5f" % t1[i])
 *                         write("\t%.5f" % c1[i])             # <<<<<<<<<<<<<<
 *                         write("\t%.5f" % log2(peak["fc"]))
 *                         write("\t%.5f" % peak["qscore"])
 */
          __pyx_t_54 = __pyx_v_i;
          __pyx_t_55 = -1;
          if (__pyx_t_54 < 0) {
            __pyx_t_54 += __pyx_pybuffernd_c1.diminfo[0].shape;
            if (unlikely(__pyx_t_54 < 0)) __pyx_t_55 = 0;
          } else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_c1.diminfo[0].shape)) __pyx_t_55 = 0;
          if (unlikely(__pyx_t_55 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_55);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_c1.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_c1.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_1));
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3514
 *                         write("\t%.5f" % t1[i])
 *                         write("\t%.5f" % c1[i])
 *                         write("\t%.5f" % log2(peak["fc"]))             # <<<<<<<<<<<<<<
 *                         write("\t%.5f" % peak["qscore"])
 *                         write("\t%s" % peak["name"])
 */
          __pyx_t_1 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__fc)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_3));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
          __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3515
 *                         write("\t%.5f" % c1[i])
 *                         write("\t%.5f" % log2(peak["fc"]))
 *                         write("\t%.5f" % peak["qscore"])             # <<<<<<<<<<<<<<
 *                         write("\t%s" % peak["name"])
 *                         write("\t%d" % (summit + 1))
 */
          __pyx_t_3 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__qscore)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_1));
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3516
 *                         write("\t%.5f" % log2(peak["fc"]))
 *                         write("\t%.5f" % peak["qscore"])
 *                         write("\t%s" % peak["name"])             # <<<<<<<<<<<<<<
 *                         write("\t%d" % (summit + 1))
 *                         # this stuff for peak 2
 */
          __pyx_t_1 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__name)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_3));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
          __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3517
 *                         write("\t%.5f" % peak["qscore"])
 *                         write("\t%s" % peak["name"])
 *                         write("\t%d" % (summit + 1))             # <<<<<<<<<<<<<<
 *                         # this stuff for peak 2
 *                         write("\t%.5f" % t2[i])
 */
          __pyx_t_3 = PyInt_FromLong((__pyx_v_summit + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_121), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_1));
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3519
 *                         write("\t%d" % (summit + 1))
 *                         # this stuff for peak 2
 *                         write("\t%.5f" % t2[i])             # <<<<<<<<<<<<<<
 *                         write("\t%.5f" % c2[i])
 *                         if pos[where_peaks[w]] > end:
 */
          __pyx_t_55 = __pyx_v_i;
          __pyx_t_56 = -1;
          if (__pyx_t_55 < 0) {
            __pyx_t_55 += __pyx_pybuffernd_t2.diminfo[0].shape;
            if (unlikely(__pyx_t_55 < 0)) __pyx_t_56 = 0;
          } else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_t2.diminfo[0].shape)) __pyx_t_56 = 0;
          if (unlikely(__pyx_t_56 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_56);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_t2.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_t2.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_3));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
          __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3520
 *                         # this stuff for peak 2
 *                         write("\t%.5f" % t2[i])
 *                         write("\t%.5f" % c2[i])             # <<<<<<<<<<<<<<
 *                         if pos[where_peaks[w]] > end:
 *                             peak_i = -1
 */
          __pyx_t_56 = __pyx_v_i;
          __pyx_t_57 = -1;
          if (__pyx_t_56 < 0) {
            __pyx_t_56 += __pyx_pybuffernd_c2.diminfo[0].shape;
            if (unlikely(__pyx_t_56 < 0)) __pyx_t_57 = 0;
          } else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_c2.diminfo[0].shape)) __pyx_t_57 = 0;
          if (unlikely(__pyx_t_57 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_57);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_c2.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_c2.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_1));
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3521
 *                         write("\t%.5f" % t2[i])
 *                         write("\t%.5f" % c2[i])
 *                         if pos[where_peaks[w]] > end:             # <<<<<<<<<<<<<<
 *                             peak_i = -1
 *                         else:
 */
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_where_peaks, __pyx_v_w, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_14 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_47 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_47 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (__pyx_t_47) {

            /* "MACS2/IO/cScoreTrack.pyx":3522
 *                         write("\t%.5f" % c2[i])
 *                         if pos[where_peaks[w]] > end:
 *                             peak_i = -1             # <<<<<<<<<<<<<<
 *                         else:
 *                             peak_i = which_peaks[w]
 */
            __pyx_v_peak_i = -1;
            goto __pyx_L49;
          }
          /*else*/ {

            /* "MACS2/IO/cScoreTrack.pyx":3524
 *                             peak_i = -1
 *                         else:
 *                             peak_i = which_peaks[w]             # <<<<<<<<<<<<<<
 *                         if peak_i == -1:
 *                             write("\tNA\tNA\tNA\tNA")
 */
            __pyx_t_57 = __pyx_v_w;
            __pyx_t_58 = -1;
            if (__pyx_t_57 < 0) {
              __pyx_t_57 += __pyx_pybuffernd_which_peaks.diminfo[0].shape;
              if (unlikely(__pyx_t_57 < 0)) __pyx_t_58 = 0;
            } else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_which_peaks.diminfo[0].shape)) __pyx_t_58 = 0;
            if (unlikely(__pyx_t_58 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_58);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_v_peak_i = (*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_which_peaks.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_which_peaks.diminfo[0].strides));
          }
          __pyx_L49:;

          /* "MACS2/IO/cScoreTrack.pyx":3525
 *                         else:
 *                             peak_i = which_peaks[w]
 *                         if peak_i == -1:             # <<<<<<<<<<<<<<
 *                             write("\tNA\tNA\tNA\tNA")
 *                         else:
 */
          __pyx_t_47 = (__pyx_v_peak_i == -1);
          if (__pyx_t_47) {

            /* "MACS2/IO/cScoreTrack.pyx":3526
 *                             peak_i = which_peaks[w]
 *                         if peak_i == -1:
 *                             write("\tNA\tNA\tNA\tNA")             # <<<<<<<<<<<<<<
 *                         else:
 *                             # find the closest summit2 to this region
 */
            __pyx_t_14 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_k_tuple_150), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            goto __pyx_L50;
          }
          /*else*/ {

            /* "MACS2/IO/cScoreTrack.pyx":3529
 *                         else:
 *                             # find the closest summit2 to this region
 *                             peak2_summit = peaks2[peak_i]["summit"]             # <<<<<<<<<<<<<<
 *                             peak_j = peak_i + 1
 *                             for peak_j in range(peak_i + 1, n_peaks):
 */
            if (unlikely(((PyObject *)__pyx_v_peaks2) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_14 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks2), __pyx_v_peak_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_1 = PyObject_GetItem(__pyx_t_14, ((PyObject *)__pyx_n_s__summit)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_v_peak2_summit);
            __pyx_v_peak2_summit = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":3530
 *                             # find the closest summit2 to this region
 *                             peak2_summit = peaks2[peak_i]["summit"]
 *                             peak_j = peak_i + 1             # <<<<<<<<<<<<<<
 *                             for peak_j in range(peak_i + 1, n_peaks):
 *                                 if peaks2[peak_j]["end"] != end: break
 */
            __pyx_v_peak_j = (__pyx_v_peak_i + 1);

            /* "MACS2/IO/cScoreTrack.pyx":3531
 *                             peak2_summit = peaks2[peak_i]["summit"]
 *                             peak_j = peak_i + 1
 *                             for peak_j in range(peak_i + 1, n_peaks):             # <<<<<<<<<<<<<<
 *                                 if peaks2[peak_j]["end"] != end: break
 *                             peak2_summits = np.array(map(itemgetter("summit"),
 */
            __pyx_t_58 = __pyx_v_n_peaks;
            for (__pyx_t_59 = (__pyx_v_peak_i + 1); __pyx_t_59 < __pyx_t_58; __pyx_t_59+=1) {
              __pyx_v_peak_j = __pyx_t_59;

              /* "MACS2/IO/cScoreTrack.pyx":3532
 *                             peak_j = peak_i + 1
 *                             for peak_j in range(peak_i + 1, n_peaks):
 *                                 if peaks2[peak_j]["end"] != end: break             # <<<<<<<<<<<<<<
 *                             peak2_summits = np.array(map(itemgetter("summit"),
 *                                                          peaks2[peak_i:peak_j]),
 */
              if (unlikely(((PyObject *)__pyx_v_peaks2) == Py_None)) {
                PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks2), __pyx_v_peak_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_14 = PyObject_GetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_1 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_3 = PyObject_RichCompare(__pyx_t_14, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_47 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_47 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (__pyx_t_47) {
                goto __pyx_L52_break;
                goto __pyx_L53;
              }
              __pyx_L53:;
            }
            __pyx_L52_break:;

            /* "MACS2/IO/cScoreTrack.pyx":3533
 *                             for peak_j in range(peak_i + 1, n_peaks):
 *                                 if peaks2[peak_j]["end"] != end: break
 *                             peak2_summits = np.array(map(itemgetter("summit"),             # <<<<<<<<<<<<<<
 *                                                          peaks2[peak_i:peak_j]),
 *                                                      dtype='int32')
 */
            __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_14 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_151), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":3534
 *                                 if peaks2[peak_j]["end"] != end: break
 *                             peak2_summits = np.array(map(itemgetter("summit"),
 *                                                          peaks2[peak_i:peak_j]),             # <<<<<<<<<<<<<<
 *                                                      dtype='int32')
 *                             peak_i += np.abs(peak2_summits - summit).argmin()
 */
            __pyx_t_3 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_peaks2), __pyx_v_peak_i, __pyx_v_peak_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_3));
            __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_t_3));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
            __pyx_t_14 = 0;
            __pyx_t_3 = 0;
            __pyx_t_3 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
            __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            __pyx_t_3 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":3533
 *                             for peak_j in range(peak_i + 1, n_peaks):
 *                                 if peaks2[peak_j]["end"] != end: break
 *                             peak2_summits = np.array(map(itemgetter("summit"),             # <<<<<<<<<<<<<<
 *                                                          peaks2[peak_i:peak_j]),
 *                                                      dtype='int32')
 */
            __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_3));
            if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__int32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_14 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_13), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_v_peak2_summits);
            __pyx_v_peak2_summits = __pyx_t_14;
            __pyx_t_14 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":3536
 *                                                          peaks2[peak_i:peak_j]),
 *                                                      dtype='int32')
 *                             peak_i += np.abs(peak2_summits - summit).argmin()             # <<<<<<<<<<<<<<
 *                             peak2 = peaks2[peak_i]
 *                             write("\t%.5f" % log2(peak2["fc"]))
 */
            __pyx_t_14 = PyInt_FromLong(__pyx_v_peak_i); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_13 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__abs); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = PyInt_FromLong(__pyx_v_summit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = PyNumber_Subtract(__pyx_v_peak2_summits, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__argmin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_58 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_58 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_v_peak_i = __pyx_t_58;

            /* "MACS2/IO/cScoreTrack.pyx":3537
 *                                                      dtype='int32')
 *                             peak_i += np.abs(peak2_summits - summit).argmin()
 *                             peak2 = peaks2[peak_i]             # <<<<<<<<<<<<<<
 *                             write("\t%.5f" % log2(peak2["fc"]))
 *                             write("\t%.5f" % peak2["qscore"])
 */
            if (unlikely(((PyObject *)__pyx_v_peaks2) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks2), __pyx_v_peak_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_XDECREF(__pyx_v_peak2);
            __pyx_v_peak2 = __pyx_t_3;
            __pyx_t_3 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":3538
 *                             peak_i += np.abs(peak2_summits - summit).argmin()
 *                             peak2 = peaks2[peak_i]
 *                             write("\t%.5f" % log2(peak2["fc"]))             # <<<<<<<<<<<<<<
 *                             write("\t%.5f" % peak2["qscore"])
 *                             write("\t%s" % peak2["name"])
 */
            __pyx_t_3 = PyObject_GetItem(__pyx_v_peak2, ((PyObject *)__pyx_n_s__fc)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            __pyx_t_3 = 0;
            __pyx_t_3 = PyObject_Call(__pyx_v_log2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
            __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_1));
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
            __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":3539
 *                             peak2 = peaks2[peak_i]
 *                             write("\t%.5f" % log2(peak2["fc"]))
 *                             write("\t%.5f" % peak2["qscore"])             # <<<<<<<<<<<<<<
 *                             write("\t%s" % peak2["name"])
 *                             write("\t%d" % (peak2["summit"] + 1))
 */
            __pyx_t_1 = PyObject_GetItem(__pyx_v_peak2, ((PyObject *)__pyx_n_s__qscore)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_92), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_3));
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
            __pyx_t_3 = 0;
            __pyx_t_3 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":3540
 *                             write("\t%.5f" % log2(peak2["fc"]))
 *                             write("\t%.5f" % peak2["qscore"])
 *                             write("\t%s" % peak2["name"])             # <<<<<<<<<<<<<<
 *                             write("\t%d" % (peak2["summit"] + 1))
 * 
 */
            __pyx_t_3 = PyObject_GetItem(__pyx_v_peak2, ((PyObject *)__pyx_n_s__name)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_1));
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
            __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "MACS2/IO/cScoreTrack.pyx":3541
 *                             write("\t%.5f" % peak2["qscore"])
 *                             write("\t%s" % peak2["name"])
 *                             write("\t%d" % (peak2["summit"] + 1))             # <<<<<<<<<<<<<<
 * 
 *                         write("\n")
 */
            __pyx_t_1 = PyObject_GetItem(__pyx_v_peak2, ((PyObject *)__pyx_n_s__summit)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_121), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_1));
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
            __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_L50:;

          /* "MACS2/IO/cScoreTrack.pyx":3543
 *                             write("\t%d" % (peak2["summit"] + 1))
 * 
 *                         write("\n")             # <<<<<<<<<<<<<<
 *                         break
 * 
 */
          __pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_k_tuple_152), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "MACS2/IO/cScoreTrack.pyx":3544
 * 
 *                         write("\n")
 *                         break             # <<<<<<<<<<<<<<
 * 
 * 
 */
          goto __pyx_L37_break;
        }
        __pyx_L38:;
      }
      __pyx_L37_break:;
    }
    __pyx_L34_break:;
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c2.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summits1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t2.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI._write_peaks_by_summit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c2.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_logLR.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_peaks.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_pvalues.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_diff_qvalues.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summits1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t1.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_t2.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_which_peaks.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_peaks1);
  __Pyx_XDECREF(__pyx_v_peaks2);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_t1);
  __Pyx_XDECREF((PyObject *)__pyx_v_t2);
  __Pyx_XDECREF((PyObject *)__pyx_v_c1);
  __Pyx_XDECREF((PyObject *)__pyx_v_c2);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_which_peaks);
  __Pyx_XDECREF((PyObject *)__pyx_v_summits1);
  __Pyx_XDECREF((PyObject *)__pyx_v_diff_pvalues);
  __Pyx_XDECREF((PyObject *)__pyx_v_diff_qvalues);
  __Pyx_XDECREF((PyObject *)__pyx_v_diff_logLR);
  __Pyx_XDECREF((PyObject *)__pyx_v_diff_peaks);
  __Pyx_XDECREF(__pyx_v_log2);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_peak);
  __Pyx_XDECREF(__pyx_v_where_peaks);
  __Pyx_XDECREF(__pyx_v_above_cutoff);
  __Pyx_XDECREF(__pyx_v_diffpeakname);
  __Pyx_XDECREF(__pyx_v_peak2_summit);
  __Pyx_XDECREF(__pyx_v_peak2_summits);
  __Pyx_XDECREF(__pyx_v_peak2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_45write_bedgraphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_44write_bedgraphs[] = "Write logLR and diff pvalue data to in Wiggle Format.\n\n        fhd: a filehandler to save bedGraph.\n        name/description: the name and description in track line.\n\n        shift will be used to shift the coordinates. default: 0\n        ";
static PyObject *__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_45write_bedgraphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_logLR = 0;
  PyObject *__pyx_v_pvalue = 0;
  PyObject *__pyx_v_logFC = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_description = 0;
  PyBoolObject *__pyx_v_trackline = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_bedgraphs (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__logLR,&__pyx_n_s__pvalue,&__pyx_n_s__logFC,&__pyx_n_s__name,&__pyx_n_s__description,&__pyx_n_s__trackline,0};
    PyObject* values[6] = {0,0,0,0,0,0};

    /* "MACS2/IO/cScoreTrack.pyx":3547
 * 
 * 
 *     def write_bedgraphs(self, logLR=None, pvalue=None, logFC=None,             # <<<<<<<<<<<<<<
 *                           str name="MACS",
 *                           str description='%s', bool trackline=True):
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject*)__pyx_n_s__MACS);
    values[4] = ((PyObject*)__pyx_kp_s_62);
    values[5] = (PyObject *)__pyx_k_153;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__logLR);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pvalue);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__logFC);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__description);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__trackline);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bedgraphs") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3547; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_logLR = values[0];
    __pyx_v_pvalue = values[1];
    __pyx_v_logFC = values[2];
    __pyx_v_name = ((PyObject*)values[3]);
    __pyx_v_description = ((PyObject*)values[4]);
    __pyx_v_trackline = ((PyBoolObject *)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_bedgraphs", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3547; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_bedgraphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_description), (&PyString_Type), 1, "description", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_trackline), __pyx_ptype_7cpython_4bool_bool, 1, "trackline", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_44write_bedgraphs(((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)__pyx_v_self), __pyx_v_logLR, __pyx_v_pvalue, __pyx_v_logFC, __pyx_v_name, __pyx_v_description, __pyx_v_trackline);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_44write_bedgraphs(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self, PyObject *__pyx_v_logLR, PyObject *__pyx_v_pvalue, PyObject *__pyx_v_logFC, PyObject *__pyx_v_name, PyObject *__pyx_v_description, PyBoolObject *__pyx_v_trackline) {
  int __pyx_v_i;
  PyObject *__pyx_v_chrom = 0;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_value = 0;
  PyObject *__pyx_v_isfinite = NULL;
  PyObject *__pyx_v_trackcontents = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
  __Pyx_Buffer __pyx_pybuffer_pos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value;
  __Pyx_Buffer __pyx_pybuffer_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  long __pyx_t_13;
  long __pyx_t_14;
  long __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  long __pyx_t_18;
  int __pyx_t_19;
  int __pyx_t_20;
  long __pyx_t_21;
  int __pyx_t_22;
  int __pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  long __pyx_t_25;
  long __pyx_t_26;
  long __pyx_t_27;
  int __pyx_t_28;
  long __pyx_t_29;
  int __pyx_t_30;
  int __pyx_t_31;
  long __pyx_t_32;
  long __pyx_t_33;
  long __pyx_t_34;
  int __pyx_t_35;
  long __pyx_t_36;
  int __pyx_t_37;
  int __pyx_t_38;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_bedgraphs", 0);
  __pyx_pybuffer_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_pos.refcount = 0;
  __pyx_pybuffernd_pos.data = NULL;
  __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
  __pyx_pybuffer_value.pybuffer.buf = NULL;
  __pyx_pybuffer_value.refcount = 0;
  __pyx_pybuffernd_value.data = NULL;
  __pyx_pybuffernd_value.rcbuffer = &__pyx_pybuffer_value;

  /* "MACS2/IO/cScoreTrack.pyx":3563
 *             np.ndarray[np.float32_t] value
 * 
 *         isfinite = np.isfinite             # <<<<<<<<<<<<<<
 *         if trackline:
 *             trackcontents = (name.replace("\"", "\\\""), description.replace("\"", "\\\""))
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__isfinite); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_isfinite = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3564
 * 
 *         isfinite = np.isfinite
 *         if trackline:             # <<<<<<<<<<<<<<
 *             trackcontents = (name.replace("\"", "\\\""), description.replace("\"", "\\\""))
 *             if logLR is not None:
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_trackline)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

    /* "MACS2/IO/cScoreTrack.pyx":3565
 *         isfinite = np.isfinite
 *         if trackline:
 *             trackcontents = (name.replace("\"", "\\\""), description.replace("\"", "\\\""))             # <<<<<<<<<<<<<<
 *             if logLR is not None:
 *                 logLR.write("track type=bedGraph name=\"%s\" description=\"log10-likelihood ratio %s\" visibility=2 alwaysZero=on\n" % trackcontents)
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_name), __pyx_n_s__replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_154), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_description), __pyx_n_s__replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_155), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_4 = 0;
    __pyx_v_trackcontents = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3566
 *         if trackline:
 *             trackcontents = (name.replace("\"", "\\\""), description.replace("\"", "\\\""))
 *             if logLR is not None:             # <<<<<<<<<<<<<<
 *                 logLR.write("track type=bedGraph name=\"%s\" description=\"log10-likelihood ratio %s\" visibility=2 alwaysZero=on\n" % trackcontents)
 *             if pvalue is not None:
 */
    __pyx_t_3 = (__pyx_v_logLR != Py_None);
    if (__pyx_t_3) {

      /* "MACS2/IO/cScoreTrack.pyx":3567
 *             trackcontents = (name.replace("\"", "\\\""), description.replace("\"", "\\\""))
 *             if logLR is not None:
 *                 logLR.write("track type=bedGraph name=\"%s\" description=\"log10-likelihood ratio %s\" visibility=2 alwaysZero=on\n" % trackcontents)             # <<<<<<<<<<<<<<
 *             if pvalue is not None:
 *                 pvalue.write("track type=bedGraph name=\"%s\" description=\"-log10(pvalue)%s\" visibility=2 alwaysZero=on\n" % trackcontents)
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_logLR, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_156), ((PyObject *)__pyx_v_trackcontents)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "MACS2/IO/cScoreTrack.pyx":3568
 *             if logLR is not None:
 *                 logLR.write("track type=bedGraph name=\"%s\" description=\"log10-likelihood ratio %s\" visibility=2 alwaysZero=on\n" % trackcontents)
 *             if pvalue is not None:             # <<<<<<<<<<<<<<
 *                 pvalue.write("track type=bedGraph name=\"%s\" description=\"-log10(pvalue)%s\" visibility=2 alwaysZero=on\n" % trackcontents)
 *             if logFC is not None:
 */
    __pyx_t_3 = (__pyx_v_pvalue != Py_None);
    if (__pyx_t_3) {

      /* "MACS2/IO/cScoreTrack.pyx":3569
 *                 logLR.write("track type=bedGraph name=\"%s\" description=\"log10-likelihood ratio %s\" visibility=2 alwaysZero=on\n" % trackcontents)
 *             if pvalue is not None:
 *                 pvalue.write("track type=bedGraph name=\"%s\" description=\"-log10(pvalue)%s\" visibility=2 alwaysZero=on\n" % trackcontents)             # <<<<<<<<<<<<<<
 *             if logFC is not None:
 *                 logFC.write("track type=bedGraph name=\"%s\" description=\"log10(sample1/sample2) %s\" visibility=2 alwaysZero=on\n" % trackcontents)
 */
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_pvalue, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_157), ((PyObject *)__pyx_v_trackcontents)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "MACS2/IO/cScoreTrack.pyx":3570
 *             if pvalue is not None:
 *                 pvalue.write("track type=bedGraph name=\"%s\" description=\"-log10(pvalue)%s\" visibility=2 alwaysZero=on\n" % trackcontents)
 *             if logFC is not None:             # <<<<<<<<<<<<<<
 *                 logFC.write("track type=bedGraph name=\"%s\" description=\"log10(sample1/sample2) %s\" visibility=2 alwaysZero=on\n" % trackcontents)
 * 
 */
    __pyx_t_3 = (__pyx_v_logFC != Py_None);
    if (__pyx_t_3) {

      /* "MACS2/IO/cScoreTrack.pyx":3571
 *                 pvalue.write("track type=bedGraph name=\"%s\" description=\"-log10(pvalue)%s\" visibility=2 alwaysZero=on\n" % trackcontents)
 *             if logFC is not None:
 *                 logFC.write("track type=bedGraph name=\"%s\" description=\"log10(sample1/sample2) %s\" visibility=2 alwaysZero=on\n" % trackcontents)             # <<<<<<<<<<<<<<
 * 
 *         if logLR is not None:
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_logFC, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_158), ((PyObject *)__pyx_v_trackcontents)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "MACS2/IO/cScoreTrack.pyx":3573
 *                 logFC.write("track type=bedGraph name=\"%s\" description=\"log10(sample1/sample2) %s\" visibility=2 alwaysZero=on\n" % trackcontents)
 * 
 *         if logLR is not None:             # <<<<<<<<<<<<<<
 *             for chrom in sorted(self.tlogLR.keys()):
 *                 pos = self.pos[chrom]
 */
  __pyx_t_3 = (__pyx_v_logLR != Py_None);
  if (__pyx_t_3) {

    /* "MACS2/IO/cScoreTrack.pyx":3574
 * 
 *         if logLR is not None:
 *             for chrom in sorted(self.tlogLR.keys()):             # <<<<<<<<<<<<<<
 *                 pos = self.pos[chrom]
 *                 value = self.tlogLR[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->tlogLR) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyDict_Keys(__pyx_v_self->tlogLR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_2 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_2)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __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 str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
      __pyx_v_chrom = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3575
 *         if logLR is not None:
 *             for chrom in sorted(self.tlogLR.keys()):
 *                 pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *                 value = self.tlogLR[chrom]
 *                 if pos.size > 0:
 */
      if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = ((PyArrayObject *)__pyx_t_2);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
        __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_8 < 0)) {
          PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          }
        }
        __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
      __pyx_v_pos = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3576
 *             for chrom in sorted(self.tlogLR.keys()):
 *                 pos = self.pos[chrom]
 *                 value = self.tlogLR[chrom]             # <<<<<<<<<<<<<<
 *                 if pos.size > 0:
 *                     if isfinite(value[0]):
 */
      if (unlikely(((PyObject *)__pyx_v_self->tlogLR) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->tlogLR), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value.rcbuffer->pybuffer);
        __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_8 < 0)) {
          PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_v_value, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
          }
        }
        __pyx_pybuffernd_value.diminfo[0].strides = __pyx_pybuffernd_value.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value.diminfo[0].shape = __pyx_pybuffernd_value.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_value));
      __pyx_v_value = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3577
 *                 pos = self.pos[chrom]
 *                 value = self.tlogLR[chrom]
 *                 if pos.size > 0:             # <<<<<<<<<<<<<<
 *                     if isfinite(value[0]):
 *                         logLR.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 */
      __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_pos), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_3) {

        /* "MACS2/IO/cScoreTrack.pyx":3578
 *                 value = self.tlogLR[chrom]
 *                 if pos.size > 0:
 *                     if isfinite(value[0]):             # <<<<<<<<<<<<<<
 *                         logLR.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 *                                                       value[0]))
 */
        __pyx_t_13 = 0;
        __pyx_t_8 = -1;
        if (__pyx_t_13 < 0) {
          __pyx_t_13 += __pyx_pybuffernd_value.diminfo[0].shape;
          if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
        } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_8 = 0;
        if (unlikely(__pyx_t_8 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_8);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_v_isfinite, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_3) {

          /* "MACS2/IO/cScoreTrack.pyx":3579
 *                 if pos.size > 0:
 *                     if isfinite(value[0]):
 *                         logLR.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],             # <<<<<<<<<<<<<<
 *                                                       value[0]))
 *                     for i in range(1, pos.size):
 */
          __pyx_t_1 = PyObject_GetAttr(__pyx_v_logLR, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_14 = 0;
          __pyx_t_8 = -1;
          if (__pyx_t_14 < 0) {
            __pyx_t_14 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
          } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_8 = 0;
          if (unlikely(__pyx_t_8 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_8);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);

          /* "MACS2/IO/cScoreTrack.pyx":3580
 *                     if isfinite(value[0]):
 *                         logLR.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 *                                                       value[0]))             # <<<<<<<<<<<<<<
 *                     for i in range(1, pos.size):
 *                         if isfinite(value[i]):
 */
          __pyx_t_15 = 0;
          __pyx_t_8 = -1;
          if (__pyx_t_15 < 0) {
            __pyx_t_15 += __pyx_pybuffernd_value.diminfo[0].shape;
            if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
          } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_8 = 0;
          if (unlikely(__pyx_t_8 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_8);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_16 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_17 = PyTuple_New(4); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
          PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_v_chrom));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
          __Pyx_INCREF(__pyx_int_0);
          PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_int_0);
          __Pyx_GIVEREF(__pyx_int_0);
          PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_16);
          __Pyx_GIVEREF(__pyx_t_16);
          __pyx_t_2 = 0;
          __pyx_t_16 = 0;
          __pyx_t_16 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_17)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_16));
          __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
          __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_t_16));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_16));
          __pyx_t_16 = 0;
          __pyx_t_16 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          goto __pyx_L11;
        }
        __pyx_L11:;

        /* "MACS2/IO/cScoreTrack.pyx":3581
 *                         logLR.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 *                                                       value[0]))
 *                     for i in range(1, pos.size):             # <<<<<<<<<<<<<<
 *                         if isfinite(value[i]):
 *                             logLR.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],
 */
        __pyx_t_16 = PyObject_GetAttr(((PyObject *)__pyx_v_pos), __pyx_n_s__size); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_18 = __Pyx_PyInt_AsLong(__pyx_t_16); if (unlikely((__pyx_t_18 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_18; __pyx_t_8+=1) {
          __pyx_v_i = __pyx_t_8;

          /* "MACS2/IO/cScoreTrack.pyx":3582
 *                                                       value[0]))
 *                     for i in range(1, pos.size):
 *                         if isfinite(value[i]):             # <<<<<<<<<<<<<<
 *                             logLR.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],
 *                                                           value[i]))
 */
          __pyx_t_19 = __pyx_v_i;
          __pyx_t_20 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_pybuffernd_value.diminfo[0].shape;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 0;
          } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_20 = 0;
          if (unlikely(__pyx_t_20 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_20);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_16 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16);
          __Pyx_GIVEREF(__pyx_t_16);
          __pyx_t_16 = 0;
          __pyx_t_16 = PyObject_Call(__pyx_v_isfinite, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (__pyx_t_3) {

            /* "MACS2/IO/cScoreTrack.pyx":3583
 *                     for i in range(1, pos.size):
 *                         if isfinite(value[i]):
 *                             logLR.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],             # <<<<<<<<<<<<<<
 *                                                           value[i]))
 * 
 */
            __pyx_t_16 = PyObject_GetAttr(__pyx_v_logLR, __pyx_n_s__write); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_21 = (__pyx_v_i - 1);
            __pyx_t_20 = -1;
            if (__pyx_t_21 < 0) {
              __pyx_t_21 += __pyx_pybuffernd_pos.diminfo[0].shape;
              if (unlikely(__pyx_t_21 < 0)) __pyx_t_20 = 0;
            } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_20 = 0;
            if (unlikely(__pyx_t_20 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_20);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_17 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_20 = __pyx_v_i;
            __pyx_t_22 = -1;
            if (__pyx_t_20 < 0) {
              __pyx_t_20 += __pyx_pybuffernd_pos.diminfo[0].shape;
              if (unlikely(__pyx_t_20 < 0)) __pyx_t_22 = 0;
            } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_22 = 0;
            if (unlikely(__pyx_t_22 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_22);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_1 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);

            /* "MACS2/IO/cScoreTrack.pyx":3584
 *                         if isfinite(value[i]):
 *                             logLR.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],
 *                                                           value[i]))             # <<<<<<<<<<<<<<
 * 
 *         if pvalue is not None:
 */
            __pyx_t_22 = __pyx_v_i;
            __pyx_t_23 = -1;
            if (__pyx_t_22 < 0) {
              __pyx_t_22 += __pyx_pybuffernd_value.diminfo[0].shape;
              if (unlikely(__pyx_t_22 < 0)) __pyx_t_23 = 0;
            } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_23 = 0;
            if (unlikely(__pyx_t_23 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_23);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_24 = PyTuple_New(4); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_24);
            __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_24, 0, ((PyObject *)__pyx_v_chrom));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_17);
            __Pyx_GIVEREF(__pyx_t_17);
            PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_24, 3, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            __pyx_t_17 = 0;
            __pyx_t_1 = 0;
            __pyx_t_2 = 0;
            __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_24)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_2));
            __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
            __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_24);
            PyTuple_SET_ITEM(__pyx_t_24, 0, ((PyObject *)__pyx_t_2));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
            __pyx_t_2 = 0;
            __pyx_t_2 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_24), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            goto __pyx_L14;
          }
          __pyx_L14:;
        }
        goto __pyx_L10;
      }
      __pyx_L10:;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "MACS2/IO/cScoreTrack.pyx":3586
 *                                                           value[i]))
 * 
 *         if pvalue is not None:             # <<<<<<<<<<<<<<
 *             for chrom in sorted(self.t1vs2.keys()):
 *                 pos = self.pos[chrom]
 */
  __pyx_t_3 = (__pyx_v_pvalue != Py_None);
  if (__pyx_t_3) {

    /* "MACS2/IO/cScoreTrack.pyx":3587
 * 
 *         if pvalue is not None:
 *             for chrom in sorted(self.t1vs2.keys()):             # <<<<<<<<<<<<<<
 *                 pos = self.pos[chrom]
 *                 value = self.t1vs2[chrom]
 */
    if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = PyDict_Keys(__pyx_v_self->t1vs2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_4 = __pyx_t_6(__pyx_t_2);
        if (unlikely(!__pyx_t_4)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
      __pyx_v_chrom = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3588
 *         if pvalue is not None:
 *             for chrom in sorted(self.t1vs2.keys()):
 *                 pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *                 value = self.t1vs2[chrom]
 *                 if pos.size > 0:
 */
      if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
        __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_8 < 0)) {
          PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          }
        }
        __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
      __pyx_v_pos = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3589
 *             for chrom in sorted(self.t1vs2.keys()):
 *                 pos = self.pos[chrom]
 *                 value = self.t1vs2[chrom]             # <<<<<<<<<<<<<<
 *                 if pos.size > 0:
 *                     if isfinite(value[0]):
 */
      if (unlikely(((PyObject *)__pyx_v_self->t1vs2) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1vs2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value.rcbuffer->pybuffer);
        __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_8 < 0)) {
          PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_v_value, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
          }
        }
        __pyx_pybuffernd_value.diminfo[0].strides = __pyx_pybuffernd_value.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value.diminfo[0].shape = __pyx_pybuffernd_value.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_value));
      __pyx_v_value = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3590
 *                 pos = self.pos[chrom]
 *                 value = self.t1vs2[chrom]
 *                 if pos.size > 0:             # <<<<<<<<<<<<<<
 *                     if isfinite(value[0]):
 *                         pvalue.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 */
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_pos), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_24 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_24); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_24); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
      if (__pyx_t_3) {

        /* "MACS2/IO/cScoreTrack.pyx":3591
 *                 value = self.t1vs2[chrom]
 *                 if pos.size > 0:
 *                     if isfinite(value[0]):             # <<<<<<<<<<<<<<
 *                         pvalue.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 *                                                       value[0]))
 */
        __pyx_t_18 = 0;
        __pyx_t_8 = -1;
        if (__pyx_t_18 < 0) {
          __pyx_t_18 += __pyx_pybuffernd_value.diminfo[0].shape;
          if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
        } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_8 = 0;
        if (unlikely(__pyx_t_8 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_8);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_24 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_24);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_24);
        __Pyx_GIVEREF(__pyx_t_24);
        __pyx_t_24 = 0;
        __pyx_t_24 = PyObject_Call(__pyx_v_isfinite, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_24);
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_24); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
        if (__pyx_t_3) {

          /* "MACS2/IO/cScoreTrack.pyx":3592
 *                 if pos.size > 0:
 *                     if isfinite(value[0]):
 *                         pvalue.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],             # <<<<<<<<<<<<<<
 *                                                       value[0]))
 *                     for i in range(1, pos.size):
 */
          __pyx_t_24 = PyObject_GetAttr(__pyx_v_pvalue, __pyx_n_s__write); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_24);
          __pyx_t_25 = 0;
          __pyx_t_8 = -1;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_8 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_8 = 0;
          if (unlikely(__pyx_t_8 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_8);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_4 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);

          /* "MACS2/IO/cScoreTrack.pyx":3593
 *                     if isfinite(value[0]):
 *                         pvalue.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 *                                                       value[0]))             # <<<<<<<<<<<<<<
 *                     for i in range(1, pos.size):
 *                         if isfinite(value[i]):
 */
          __pyx_t_26 = 0;
          __pyx_t_8 = -1;
          if (__pyx_t_26 < 0) {
            __pyx_t_26 += __pyx_pybuffernd_value.diminfo[0].shape;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_8 = 0;
          } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_8 = 0;
          if (unlikely(__pyx_t_8 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_8);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_16 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
          PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chrom));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
          __Pyx_INCREF(__pyx_int_0);
          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
          __Pyx_GIVEREF(__pyx_int_0);
          PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_16);
          __Pyx_GIVEREF(__pyx_t_16);
          __pyx_t_4 = 0;
          __pyx_t_16 = 0;
          __pyx_t_16 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_16));
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_16));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_16));
          __pyx_t_16 = 0;
          __pyx_t_16 = PyObject_Call(__pyx_t_24, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          goto __pyx_L19;
        }
        __pyx_L19:;

        /* "MACS2/IO/cScoreTrack.pyx":3594
 *                         pvalue.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 *                                                       value[0]))
 *                     for i in range(1, pos.size):             # <<<<<<<<<<<<<<
 *                         if isfinite(value[i]):
 *                             pvalue.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],
 */
        __pyx_t_16 = PyObject_GetAttr(((PyObject *)__pyx_v_pos), __pyx_n_s__size); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_27 = __Pyx_PyInt_AsLong(__pyx_t_16); if (unlikely((__pyx_t_27 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_27; __pyx_t_8+=1) {
          __pyx_v_i = __pyx_t_8;

          /* "MACS2/IO/cScoreTrack.pyx":3595
 *                                                       value[0]))
 *                     for i in range(1, pos.size):
 *                         if isfinite(value[i]):             # <<<<<<<<<<<<<<
 *                             pvalue.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],
 *                                                                  value[i]))
 */
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_28 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_pybuffernd_value.diminfo[0].shape;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_28 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_28 = 0;
          if (unlikely(__pyx_t_28 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_28);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_16 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_16);
          __Pyx_GIVEREF(__pyx_t_16);
          __pyx_t_16 = 0;
          __pyx_t_16 = PyObject_Call(__pyx_v_isfinite, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (__pyx_t_3) {

            /* "MACS2/IO/cScoreTrack.pyx":3596
 *                     for i in range(1, pos.size):
 *                         if isfinite(value[i]):
 *                             pvalue.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],             # <<<<<<<<<<<<<<
 *                                                                  value[i]))
 * 
 */
            __pyx_t_16 = PyObject_GetAttr(__pyx_v_pvalue, __pyx_n_s__write); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_29 = (__pyx_v_i - 1);
            __pyx_t_28 = -1;
            if (__pyx_t_29 < 0) {
              __pyx_t_29 += __pyx_pybuffernd_pos.diminfo[0].shape;
              if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
            } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_28 = 0;
            if (unlikely(__pyx_t_28 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_28);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_1 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_28 = __pyx_v_i;
            __pyx_t_30 = -1;
            if (__pyx_t_28 < 0) {
              __pyx_t_28 += __pyx_pybuffernd_pos.diminfo[0].shape;
              if (unlikely(__pyx_t_28 < 0)) __pyx_t_30 = 0;
            } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_30 = 0;
            if (unlikely(__pyx_t_30 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_30);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_24 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_24);

            /* "MACS2/IO/cScoreTrack.pyx":3597
 *                         if isfinite(value[i]):
 *                             pvalue.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],
 *                                                                  value[i]))             # <<<<<<<<<<<<<<
 * 
 *         if logFC is not None:
 */
            __pyx_t_30 = __pyx_v_i;
            __pyx_t_31 = -1;
            if (__pyx_t_30 < 0) {
              __pyx_t_30 += __pyx_pybuffernd_value.diminfo[0].shape;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_31 = 0;
            } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_31 = 0;
            if (unlikely(__pyx_t_31 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_31);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_4 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_17 = PyTuple_New(4); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_v_chrom));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_24);
            __Pyx_GIVEREF(__pyx_t_24);
            PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_4);
            __pyx_t_1 = 0;
            __pyx_t_24 = 0;
            __pyx_t_4 = 0;
            __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_17)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_4));
            __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
            __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_t_4));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
            __pyx_t_4 = 0;
            __pyx_t_4 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L22;
          }
          __pyx_L22:;
        }
        goto __pyx_L18;
      }
      __pyx_L18:;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L15;
  }
  __pyx_L15:;

  /* "MACS2/IO/cScoreTrack.pyx":3599
 *                                                                  value[i]))
 * 
 *         if logFC is not None:             # <<<<<<<<<<<<<<
 *             for chrom in sorted(self.pos.keys()):
 *                 pos = self.pos[chrom]
 */
  __pyx_t_3 = (__pyx_v_logFC != Py_None);
  if (__pyx_t_3) {

    /* "MACS2/IO/cScoreTrack.pyx":3600
 * 
 *         if logFC is not None:
 *             for chrom in sorted(self.pos.keys()):             # <<<<<<<<<<<<<<
 *                 pos = self.pos[chrom]
 *                 value = np.log2(self.t1[chrom] / self.t2[chrom])
 */
    if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyDict_Keys(__pyx_v_self->pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_2 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_2)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __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 str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
      __pyx_v_chrom = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3601
 *         if logFC is not None:
 *             for chrom in sorted(self.pos.keys()):
 *                 pos = self.pos[chrom]             # <<<<<<<<<<<<<<
 *                 value = np.log2(self.t1[chrom] / self.t2[chrom])
 *                 if pos.size > 0:
 */
      if (unlikely(((PyObject *)__pyx_v_self->pos) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->pos), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = ((PyArrayObject *)__pyx_t_2);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
        __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_8 < 0)) {
          PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          }
        }
        __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_pos));
      __pyx_v_pos = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3602
 *             for chrom in sorted(self.pos.keys()):
 *                 pos = self.pos[chrom]
 *                 value = np.log2(self.t1[chrom] / self.t2[chrom])             # <<<<<<<<<<<<<<
 *                 if pos.size > 0:
 *                     if isfinite(value[0]):
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_17 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__log2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(((PyObject *)__pyx_v_self->t1) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t1), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(((PyObject *)__pyx_v_self->t2) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->t2), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_24 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_16); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_24);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_24);
      __Pyx_GIVEREF(__pyx_t_24);
      __pyx_t_24 = 0;
      __pyx_t_24 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_24);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
      if (!(likely(((__pyx_t_24) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_24, __pyx_ptype_5MACS2_2IO_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = ((PyArrayObject *)__pyx_t_24);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value.rcbuffer->pybuffer);
        __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_8 < 0)) {
          PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_v_value, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
          }
        }
        __pyx_pybuffernd_value.diminfo[0].strides = __pyx_pybuffernd_value.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value.diminfo[0].shape = __pyx_pybuffernd_value.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_value));
      __pyx_v_value = ((PyArrayObject *)__pyx_t_24);
      __pyx_t_24 = 0;

      /* "MACS2/IO/cScoreTrack.pyx":3603
 *                 pos = self.pos[chrom]
 *                 value = np.log2(self.t1[chrom] / self.t2[chrom])
 *                 if pos.size > 0:             # <<<<<<<<<<<<<<
 *                     if isfinite(value[0]):
 *                         logFC.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 */
      __pyx_t_24 = PyObject_GetAttr(((PyObject *)__pyx_v_pos), __pyx_n_s__size); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_24);
      __pyx_t_16 = PyObject_RichCompare(__pyx_t_24, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      if (__pyx_t_3) {

        /* "MACS2/IO/cScoreTrack.pyx":3604
 *                 value = np.log2(self.t1[chrom] / self.t2[chrom])
 *                 if pos.size > 0:
 *                     if isfinite(value[0]):             # <<<<<<<<<<<<<<
 *                         logFC.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 *                                                       value[0]))
 */
        __pyx_t_27 = 0;
        __pyx_t_8 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_pybuffernd_value.diminfo[0].shape;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_8 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_8 = 0;
        if (unlikely(__pyx_t_8 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_8);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_16 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_24);
        PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_16);
        __Pyx_GIVEREF(__pyx_t_16);
        __pyx_t_16 = 0;
        __pyx_t_16 = PyObject_Call(__pyx_v_isfinite, ((PyObject *)__pyx_t_24), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        if (__pyx_t_3) {

          /* "MACS2/IO/cScoreTrack.pyx":3605
 *                 if pos.size > 0:
 *                     if isfinite(value[0]):
 *                         logFC.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],             # <<<<<<<<<<<<<<
 *                                                       value[0]))
 *                     for i in range(1, pos.size):
 */
          __pyx_t_16 = PyObject_GetAttr(__pyx_v_logFC, __pyx_n_s__write); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_32 = 0;
          __pyx_t_8 = -1;
          if (__pyx_t_32 < 0) {
            __pyx_t_32 += __pyx_pybuffernd_pos.diminfo[0].shape;
            if (unlikely(__pyx_t_32 < 0)) __pyx_t_8 = 0;
          } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_8 = 0;
          if (unlikely(__pyx_t_8 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_8);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_24 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_24);

          /* "MACS2/IO/cScoreTrack.pyx":3606
 *                     if isfinite(value[0]):
 *                         logFC.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 *                                                       value[0]))             # <<<<<<<<<<<<<<
 *                     for i in range(1, pos.size):
 *                         if isfinite(value[i]):
 */
          __pyx_t_33 = 0;
          __pyx_t_8 = -1;
          if (__pyx_t_33 < 0) {
            __pyx_t_33 += __pyx_pybuffernd_value.diminfo[0].shape;
            if (unlikely(__pyx_t_33 < 0)) __pyx_t_8 = 0;
          } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_8 = 0;
          if (unlikely(__pyx_t_8 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_8);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_17 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
          PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_chrom));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
          __Pyx_INCREF(__pyx_int_0);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
          __Pyx_GIVEREF(__pyx_int_0);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_24);
          __Pyx_GIVEREF(__pyx_t_24);
          PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_17);
          __Pyx_GIVEREF(__pyx_t_17);
          __pyx_t_24 = 0;
          __pyx_t_17 = 0;
          __pyx_t_17 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_17));
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_17));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
          __pyx_t_17 = 0;
          __pyx_t_17 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          goto __pyx_L27;
        }
        __pyx_L27:;

        /* "MACS2/IO/cScoreTrack.pyx":3607
 *                         logFC.write("%s\t%d\t%d\t%.5f\n" % (chrom, 0, pos[0],
 *                                                       value[0]))
 *                     for i in range(1, pos.size):             # <<<<<<<<<<<<<<
 *                         if isfinite(value[i]):
 *                             logFC.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],
 */
        __pyx_t_17 = PyObject_GetAttr(((PyObject *)__pyx_v_pos), __pyx_n_s__size); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_34 = __Pyx_PyInt_AsLong(__pyx_t_17); if (unlikely((__pyx_t_34 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_34; __pyx_t_8+=1) {
          __pyx_v_i = __pyx_t_8;

          /* "MACS2/IO/cScoreTrack.pyx":3608
 *                                                       value[0]))
 *                     for i in range(1, pos.size):
 *                         if isfinite(value[i]):             # <<<<<<<<<<<<<<
 *                             logFC.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],
 *                                                           value[i]))
 */
          __pyx_t_31 = __pyx_v_i;
          __pyx_t_35 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_pybuffernd_value.diminfo[0].shape;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_35 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_35 = 0;
          if (unlikely(__pyx_t_35 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_35);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_17 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_17);
          __Pyx_GIVEREF(__pyx_t_17);
          __pyx_t_17 = 0;
          __pyx_t_17 = PyObject_Call(__pyx_v_isfinite, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (__pyx_t_3) {

            /* "MACS2/IO/cScoreTrack.pyx":3609
 *                     for i in range(1, pos.size):
 *                         if isfinite(value[i]):
 *                             logFC.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],             # <<<<<<<<<<<<<<
 *                                                           value[i]))
 * 
 */
            __pyx_t_17 = PyObject_GetAttr(__pyx_v_logFC, __pyx_n_s__write); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_36 = (__pyx_v_i - 1);
            __pyx_t_35 = -1;
            if (__pyx_t_36 < 0) {
              __pyx_t_36 += __pyx_pybuffernd_pos.diminfo[0].shape;
              if (unlikely(__pyx_t_36 < 0)) __pyx_t_35 = 0;
            } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_35 = 0;
            if (unlikely(__pyx_t_35 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_35);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_35 = __pyx_v_i;
            __pyx_t_37 = -1;
            if (__pyx_t_35 < 0) {
              __pyx_t_35 += __pyx_pybuffernd_pos.diminfo[0].shape;
              if (unlikely(__pyx_t_35 < 0)) __pyx_t_37 = 0;
            } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_37 = 0;
            if (unlikely(__pyx_t_37 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_37);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_16 = __Pyx_PyInt_to_py_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_16);

            /* "MACS2/IO/cScoreTrack.pyx":3610
 *                         if isfinite(value[i]):
 *                             logFC.write("%s\t%d\t%d\t%.5f\n" % (chrom, pos[i-1], pos[i],
 *                                                           value[i]))             # <<<<<<<<<<<<<<
 * 
 *     cdef long total ( self ):
 */
            __pyx_t_37 = __pyx_v_i;
            __pyx_t_38 = -1;
            if (__pyx_t_37 < 0) {
              __pyx_t_37 += __pyx_pybuffernd_value.diminfo[0].shape;
              if (unlikely(__pyx_t_37 < 0)) __pyx_t_38 = 0;
            } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_38 = 0;
            if (unlikely(__pyx_t_38 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_38);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_24 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_24);
            __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chrom));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
            PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_16);
            __Pyx_GIVEREF(__pyx_t_16);
            PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_24);
            __Pyx_GIVEREF(__pyx_t_24);
            __pyx_t_2 = 0;
            __pyx_t_16 = 0;
            __pyx_t_24 = 0;
            __pyx_t_24 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_24));
            __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
            __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_24));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_24));
            __pyx_t_24 = 0;
            __pyx_t_24 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_24);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
            goto __pyx_L30;
          }
          __pyx_L30:;
        }
        goto __pyx_L26;
      }
      __pyx_L26:;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L23;
  }
  __pyx_L23:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_24);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("MACS2.IO.cScoreTrack.DiffScoreTrackI.write_bedgraphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_isfinite);
  __Pyx_XDECREF(__pyx_v_trackcontents);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":3612
 *                                                           value[i]))
 * 
 *     cdef long total ( self ):             # <<<<<<<<<<<<<<
 *         """Return the number of regions in this object.
 * 
 */

static long __pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_total(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *__pyx_v_self) {
  long __pyx_v_t;
  PyObject *__pyx_v_chrom = 0;
  long __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  long __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("total", 0);

  /* "MACS2/IO/cScoreTrack.pyx":3620
 *             str chrom
 * 
 *         t = 0             # <<<<<<<<<<<<<<
 *         for chrom in self.data.keys():
 *             t += self.datalength[chrom]
 */
  __pyx_v_t = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3621
 * 
 *         t = 0
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             t += self.datalength[chrom]
 *         return t
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_chrom));
    __pyx_v_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "MACS2/IO/cScoreTrack.pyx":3622
 *         t = 0
 *         for chrom in self.data.keys():
 *             t += self.datalength[chrom]             # <<<<<<<<<<<<<<
 *         return t
 * 
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(((PyObject *)__pyx_v_self->datalength) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->datalength), ((PyObject *)__pyx_v_chrom)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_6); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_t = __pyx_t_7;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3623
 *         for chrom in self.data.keys():
 *             t += self.datalength[chrom]
 *         return t             # <<<<<<<<<<<<<<
 * 
 * cdef inline int _get_all_subpeaks(list peaks,
 */
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("MACS2.IO.cScoreTrack.DiffScoreTrackI.total", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cScoreTrack.pyx":3625
 *         return t
 * 
 * cdef inline int _get_all_subpeaks(list peaks,             # <<<<<<<<<<<<<<
 *                                   np.ndarray[np.int32_t] i_peaks,
 *                                   np.ndarray[np.int32_t] peaks_selection):
 */

static CYTHON_INLINE int __pyx_f_5MACS2_2IO_11cScoreTrack__get_all_subpeaks(PyObject *__pyx_v_peaks, PyArrayObject *__pyx_v_i_peaks, PyArrayObject *__pyx_v_peaks_selection) {
  int __pyx_v_i;
  int __pyx_v_peak_i;
  int __pyx_v_peak_ii;
  int __pyx_v_start;
  int __pyx_v_start2;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_i_peaks;
  __Pyx_Buffer __pyx_pybuffer_i_peaks;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_peaks_selection;
  __Pyx_Buffer __pyx_pybuffer_peaks_selection;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_all_subpeaks", 0);
  __pyx_pybuffer_i_peaks.pybuffer.buf = NULL;
  __pyx_pybuffer_i_peaks.refcount = 0;
  __pyx_pybuffernd_i_peaks.data = NULL;
  __pyx_pybuffernd_i_peaks.rcbuffer = &__pyx_pybuffer_i_peaks;
  __pyx_pybuffer_peaks_selection.pybuffer.buf = NULL;
  __pyx_pybuffer_peaks_selection.refcount = 0;
  __pyx_pybuffernd_peaks_selection.data = NULL;
  __pyx_pybuffernd_peaks_selection.rcbuffer = &__pyx_pybuffer_peaks_selection;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_i_peaks.rcbuffer->pybuffer, (PyObject*)__pyx_v_i_peaks, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_i_peaks.diminfo[0].strides = __pyx_pybuffernd_i_peaks.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_i_peaks.diminfo[0].shape = __pyx_pybuffernd_i_peaks.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peaks_selection.rcbuffer->pybuffer, (PyObject*)__pyx_v_peaks_selection, &__Pyx_TypeInfo_nn___pyx_t_5MACS2_2IO_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_peaks_selection.diminfo[0].strides = __pyx_pybuffernd_peaks_selection.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_peaks_selection.diminfo[0].shape = __pyx_pybuffernd_peaks_selection.rcbuffer->pybuffer.shape[0];

  /* "MACS2/IO/cScoreTrack.pyx":3633
 *         int peak_i, peak_ii
 *         int start, start2
 *     i = 0             # <<<<<<<<<<<<<<
 *     for peak_i in i_peaks:
 *         start = peaks[peak_i]["start"]
 */
  __pyx_v_i = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3634
 *         int start, start2
 *     i = 0
 *     for peak_i in i_peaks:             # <<<<<<<<<<<<<<
 *         start = peaks[peak_i]["start"]
 *         #these_peaks1.append( peaks1[peak_i] )
 */
  if (PyList_CheckExact(((PyObject *)__pyx_v_i_peaks)) || PyTuple_CheckExact(((PyObject *)__pyx_v_i_peaks))) {
    __pyx_t_1 = ((PyObject *)__pyx_v_i_peaks); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_i_peaks)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_peak_i = __pyx_t_5;

    /* "MACS2/IO/cScoreTrack.pyx":3635
 *     i = 0
 *     for peak_i in i_peaks:
 *         start = peaks[peak_i]["start"]             # <<<<<<<<<<<<<<
 *         #these_peaks1.append( peaks1[peak_i] )
 *         peaks_selection[i] = peak_i
 */
    if (unlikely(((PyObject *)__pyx_v_peaks) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks), __pyx_v_peak_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyObject_GetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_start = __pyx_t_5;

    /* "MACS2/IO/cScoreTrack.pyx":3637
 *         start = peaks[peak_i]["start"]
 *         #these_peaks1.append( peaks1[peak_i] )
 *         peaks_selection[i] = peak_i             # <<<<<<<<<<<<<<
 *         i += 1
 *         peak_ii = peak_i + 1
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_5 < 0) {
      __pyx_t_5 += __pyx_pybuffernd_peaks_selection.diminfo[0].shape;
      if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_peaks_selection.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_peaks_selection.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_peaks_selection.diminfo[0].strides) = __pyx_v_peak_i;

    /* "MACS2/IO/cScoreTrack.pyx":3638
 *         #these_peaks1.append( peaks1[peak_i] )
 *         peaks_selection[i] = peak_i
 *         i += 1             # <<<<<<<<<<<<<<
 *         peak_ii = peak_i + 1
 *         while True:
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "MACS2/IO/cScoreTrack.pyx":3639
 *         peaks_selection[i] = peak_i
 *         i += 1
 *         peak_ii = peak_i + 1             # <<<<<<<<<<<<<<
 *         while True:
 *             try: start2 = peaks[peak_ii]["start"]
 */
    __pyx_v_peak_ii = (__pyx_v_peak_i + 1);

    /* "MACS2/IO/cScoreTrack.pyx":3640
 *         i += 1
 *         peak_ii = peak_i + 1
 *         while True:             # <<<<<<<<<<<<<<
 *             try: start2 = peaks[peak_ii]["start"]
 *             except IndexError: break
 */
    while (1) {
      if (!1) break;

      /* "MACS2/IO/cScoreTrack.pyx":3641
 *         peak_ii = peak_i + 1
 *         while True:
 *             try: start2 = peaks[peak_ii]["start"]             # <<<<<<<<<<<<<<
 *             except IndexError: break
 *             if start == start2:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {
          if (unlikely(((PyObject *)__pyx_v_peaks) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3641; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          __pyx_t_6 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peaks), __pyx_v_peak_ii, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3641; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = PyObject_GetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3641; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3641; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_start2 = __pyx_t_7;
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "MACS2/IO/cScoreTrack.pyx":3642
 *         while True:
 *             try: start2 = peaks[peak_ii]["start"]
 *             except IndexError: break             # <<<<<<<<<<<<<<
 *             if start == start2:
 *                 peaks_selection[i] = peak_ii
 */
        __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_IndexError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("MACS2.IO.cScoreTrack._get_all_subpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_11);
          goto __pyx_L15_except_break;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L8_exception_handled;
          __pyx_L15_except_break:;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L12_try_break;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L12_try_break:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L6_break;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L14_try_end:;
      }

      /* "MACS2/IO/cScoreTrack.pyx":3643
 *             try: start2 = peaks[peak_ii]["start"]
 *             except IndexError: break
 *             if start == start2:             # <<<<<<<<<<<<<<
 *                 peaks_selection[i] = peak_ii
 *                 i += 1
 */
      __pyx_t_12 = (__pyx_v_start == __pyx_v_start2);
      if (__pyx_t_12) {

        /* "MACS2/IO/cScoreTrack.pyx":3644
 *             except IndexError: break
 *             if start == start2:
 *                 peaks_selection[i] = peak_ii             # <<<<<<<<<<<<<<
 *                 i += 1
 *                 peak_ii += 1
 */
        __pyx_t_7 = __pyx_v_i;
        __pyx_t_13 = -1;
        if (__pyx_t_7 < 0) {
          __pyx_t_7 += __pyx_pybuffernd_peaks_selection.diminfo[0].shape;
          if (unlikely(__pyx_t_7 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_peaks_selection.diminfo[0].shape)) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5MACS2_2IO_5numpy_int32_t *, __pyx_pybuffernd_peaks_selection.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_peaks_selection.diminfo[0].strides) = __pyx_v_peak_ii;

        /* "MACS2/IO/cScoreTrack.pyx":3645
 *             if start == start2:
 *                 peaks_selection[i] = peak_ii
 *                 i += 1             # <<<<<<<<<<<<<<
 *                 peak_ii += 1
 *             else: break
 */
        __pyx_v_i = (__pyx_v_i + 1);

        /* "MACS2/IO/cScoreTrack.pyx":3646
 *                 peaks_selection[i] = peak_ii
 *                 i += 1
 *                 peak_ii += 1             # <<<<<<<<<<<<<<
 *             else: break
 *     return i
 */
        __pyx_v_peak_ii = (__pyx_v_peak_ii + 1);
        goto __pyx_L17;
      }
      /*else*/ {

        /* "MACS2/IO/cScoreTrack.pyx":3647
 *                 i += 1
 *                 peak_ii += 1
 *             else: break             # <<<<<<<<<<<<<<
 *     return i
 */
        goto __pyx_L6_break;
      }
      __pyx_L17:;
    }
    __pyx_L6_break:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3648
 *                 peak_ii += 1
 *             else: break
 *     return i             # <<<<<<<<<<<<<<
 */
  __pyx_r = __pyx_v_i;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_peaks.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peaks_selection.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_WriteUnraisable("MACS2.IO.cScoreTrack._get_all_subpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_i_peaks.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peaks_selection.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5MACS2_2IO_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5MACS2_2IO_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5MACS2_2IO_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* "numpy.pxd":200
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = (__pyx_v_info == NULL);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "numpy.pxd":203
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":204
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "numpy.pxd":206
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "numpy.pxd":208
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "numpy.pxd":209
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "numpy.pxd":211
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "numpy.pxd":213
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
  if (__pyx_t_1) {

    /* "numpy.pxd":214
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
    __pyx_t_2 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS));
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "numpy.pxd":215
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_160), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "numpy.pxd":217
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
  if (__pyx_t_3) {

    /* "numpy.pxd":218
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
    __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS));
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "numpy.pxd":219
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_162), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "numpy.pxd":221
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "numpy.pxd":222
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "numpy.pxd":223
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  if (__pyx_v_copy_shape) {

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

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

    /* "numpy.pxd":228
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_5 = __pyx_v_ndim;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "numpy.pxd":229
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "numpy.pxd":230
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }
    goto __pyx_L7;
  }
  /*else*/ {

    /* "numpy.pxd":232
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "numpy.pxd":233
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L7:;

  /* "numpy.pxd":234
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "numpy.pxd":235
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "numpy.pxd":236
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(__pyx_v_self));

  /* "numpy.pxd":239
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "numpy.pxd":240
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "numpy.pxd":244
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "numpy.pxd":246
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __pyx_t_2 = (!__pyx_v_hasfields);
  if (__pyx_t_2) {
    __pyx_t_3 = (!__pyx_v_copy_shape);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_t_2;
  }
  if (__pyx_t_1) {

    /* "numpy.pxd":248
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;
    goto __pyx_L10;
  }
  /*else*/ {

    /* "numpy.pxd":251
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  }
  __pyx_L10:;

  /* "numpy.pxd":253
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __pyx_t_1 = (!__pyx_v_hasfields);
  if (__pyx_t_1) {

    /* "numpy.pxd":254
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __pyx_t_5 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_5;

    /* "numpy.pxd":255
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
    if (__pyx_t_1) {
      __pyx_t_2 = __pyx_v_little_endian;
    } else {
      __pyx_t_2 = __pyx_t_1;
    }
    if (!__pyx_t_2) {

      /* "numpy.pxd":256
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
      if (__pyx_t_1) {
        __pyx_t_3 = (!__pyx_v_little_endian);
        __pyx_t_7 = __pyx_t_3;
      } else {
        __pyx_t_7 = __pyx_t_1;
      }
      __pyx_t_1 = __pyx_t_7;
    } else {
      __pyx_t_1 = __pyx_t_2;
    }
    if (__pyx_t_1) {

      /* "numpy.pxd":257
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_164), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "numpy.pxd":258
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__b;
      goto __pyx_L13;
    }

    /* "numpy.pxd":259
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__B;
      goto __pyx_L13;
    }

    /* "numpy.pxd":260
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__h;
      goto __pyx_L13;
    }

    /* "numpy.pxd":261
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__H;
      goto __pyx_L13;
    }

    /* "numpy.pxd":262
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_INT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__i;
      goto __pyx_L13;
    }

    /* "numpy.pxd":263
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__I;
      goto __pyx_L13;
    }

    /* "numpy.pxd":264
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__l;
      goto __pyx_L13;
    }

    /* "numpy.pxd":265
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__L;
      goto __pyx_L13;
    }

    /* "numpy.pxd":266
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__q;
      goto __pyx_L13;
    }

    /* "numpy.pxd":267
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Q;
      goto __pyx_L13;
    }

    /* "numpy.pxd":268
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__f;
      goto __pyx_L13;
    }

    /* "numpy.pxd":269
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__d;
      goto __pyx_L13;
    }

    /* "numpy.pxd":270
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__g;
      goto __pyx_L13;
    }

    /* "numpy.pxd":271
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zf;
      goto __pyx_L13;
    }

    /* "numpy.pxd":272
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zd;
      goto __pyx_L13;
    }

    /* "numpy.pxd":273
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zg;
      goto __pyx_L13;
    }

    /* "numpy.pxd":274
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__O;
      goto __pyx_L13;
    }
    /*else*/ {

      /* "numpy.pxd":276
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_165), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L13:;

    /* "numpy.pxd":277
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "numpy.pxd":278
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "numpy.pxd":280
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
    __pyx_v_info->format = ((char *)malloc(255));

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

    /* "numpy.pxd":282
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "numpy.pxd":285
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)             # <<<<<<<<<<<<<<
 *                 f[0] = c'\0' # Terminate format string
 * 
 */
    __pyx_t_9 = __pyx_f_5MACS2_2IO_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_9;

    /* "numpy.pxd":286
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = '\x00';
  }
  __pyx_L11:;

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

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5MACS2_2IO_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5MACS2_2IO_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5MACS2_2IO_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":288
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

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

  /* "numpy.pxd":289
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = PyArray_HASFIELDS(__pyx_v_self);
  if (__pyx_t_1) {

    /* "numpy.pxd":290
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "numpy.pxd":291
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "numpy.pxd":292
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":770
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

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

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":773
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

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

  /* "numpy.pxd":774
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":776
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

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

  /* "numpy.pxd":777
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":779
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

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

  /* "numpy.pxd":780
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":782
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5MACS2_2IO_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "numpy.pxd":783
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("MACS2.IO.numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":785
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5MACS2_2IO_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  long __pyx_t_11;
  char *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "numpy.pxd":792
 *     cdef int delta_offset
 *     cdef tuple i
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":793
 *     cdef tuple i
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "numpy.pxd":796
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF(__pyx_v_childname);
    __pyx_v_childname = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "numpy.pxd":797
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
    __pyx_v_fields = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "numpy.pxd":798
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 */
    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
      PyObject* sequence = ((PyObject *)__pyx_v_fields);
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else if (1) {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5MACS2_2IO_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_child));
    __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_new_offset);
    __pyx_v_new_offset = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "numpy.pxd":800
 *         child, new_offset = fields
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_7) {

      /* "numpy.pxd":801
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_167), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "numpy.pxd":803
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_7 = (__pyx_v_child->byteorder == '>');
    if (__pyx_t_7) {
      __pyx_t_8 = __pyx_v_little_endian;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    if (!__pyx_t_8) {

      /* "numpy.pxd":804
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
      __pyx_t_7 = (__pyx_v_child->byteorder == '<');
      if (__pyx_t_7) {
        __pyx_t_9 = (!__pyx_v_little_endian);
        __pyx_t_10 = __pyx_t_9;
      } else {
        __pyx_t_10 = __pyx_t_7;
      }
      __pyx_t_7 = __pyx_t_10;
    } else {
      __pyx_t_7 = __pyx_t_8;
    }
    if (__pyx_t_7) {

      /* "numpy.pxd":805
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_168), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "numpy.pxd":815
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_7) break;

      /* "numpy.pxd":816
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 120;

      /* "numpy.pxd":817
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "numpy.pxd":818
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_11 = 0;
      (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
    }

    /* "numpy.pxd":820
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_11 = 0;
    (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);

    /* "numpy.pxd":822
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_7 = (!PyDataType_HASFIELDS(__pyx_v_child));
    if (__pyx_t_7) {

      /* "numpy.pxd":823
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_v_t);
      __pyx_v_t = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "numpy.pxd":824
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_7 = ((__pyx_v_end - __pyx_v_f) < 5);
      if (__pyx_t_7) {

        /* "numpy.pxd":825
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_170), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L12;
      }
      __pyx_L12:;

      /* "numpy.pxd":828
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L13;
      }

      /* "numpy.pxd":829
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L13;
      }

      /* "numpy.pxd":830
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 104;
        goto __pyx_L13;
      }

      /* "numpy.pxd":831
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L13;
      }

      /* "numpy.pxd":832
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 105;
        goto __pyx_L13;
      }

      /* "numpy.pxd":833
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L13;
      }

      /* "numpy.pxd":834
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 108;
        goto __pyx_L13;
      }

      /* "numpy.pxd":835
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L13;
      }

      /* "numpy.pxd":836
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 113;
        goto __pyx_L13;
      }

      /* "numpy.pxd":837
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L13;
      }

      /* "numpy.pxd":838
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 102;
        goto __pyx_L13;
      }

      /* "numpy.pxd":839
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 100;
        goto __pyx_L13;
      }

      /* "numpy.pxd":840
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 103;
        goto __pyx_L13;
      }

      /* "numpy.pxd":841
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L13;
      }

      /* "numpy.pxd":842
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 100;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L13;
      }

      /* "numpy.pxd":843
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L13;
      }

      /* "numpy.pxd":844
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L13;
      }
      /*else*/ {

        /* "numpy.pxd":846
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_165), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
        __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L13:;

      /* "numpy.pxd":847
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);
      goto __pyx_L11;
    }
    /*else*/ {

      /* "numpy.pxd":851
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
      __pyx_t_12 = __pyx_f_5MACS2_2IO_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_12;
    }
    __pyx_L11:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "numpy.pxd":852
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("MACS2.IO.numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":967
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

static CYTHON_INLINE void __pyx_f_5MACS2_2IO_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_baseptr;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "numpy.pxd":969
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
  __pyx_t_1 = (__pyx_v_base == Py_None);
  if (__pyx_t_1) {

    /* "numpy.pxd":970
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "numpy.pxd":972
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
    Py_INCREF(__pyx_v_base);

    /* "numpy.pxd":973
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr
 */
    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "numpy.pxd":974
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
 *      arr.base = baseptr
 * 
 */
  Py_XDECREF(__pyx_v_arr->base);

  /* "numpy.pxd":975
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_v_arr->base = __pyx_v_baseptr;

  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":977
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

static CYTHON_INLINE PyObject *__pyx_f_5MACS2_2IO_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "numpy.pxd":978
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr->base == NULL);
  if (__pyx_t_1) {

    /* "numpy.pxd":979
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <object>arr.base
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "numpy.pxd":981
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_shape = 0;
  Py_ssize_t __pyx_v_itemsize;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_mode = 0;
  int __pyx_v_allocate_buffer;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__shape,&__pyx_n_s__itemsize,&__pyx_n_s__format,&__pyx_n_s__mode,&__pyx_n_s__allocate_buffer,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_n_u__c);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shape)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__itemsize)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__allocate_buffer);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_shape = ((PyObject*)values[0]);
    __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_format = values[2];
    __pyx_v_mode = values[3];
    if (values[4]) {
      __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "View.MemoryView":114
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
 *                   mode=u"c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
 * 
 *         cdef int idx
 */
      __pyx_v_allocate_buffer = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument 'format' must not be None"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_r = __pyx_array_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":113
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode=u"c", bint allocate_buffer=True):
 * 
 */

static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_v_i;
  PyObject **__pyx_v_p;
  PyObject *__pyx_v_encode = NULL;
  PyObject *__pyx_v_dim = NULL;
  char __pyx_v_order;
  PyObject *__pyx_v_decode = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_format);
  __Pyx_INCREF(__pyx_v_mode);

  /* "View.MemoryView":120
 *         cdef PyObject **p
 * 
 *         self.ndim = len(shape)             # <<<<<<<<<<<<<<
 *         self.itemsize = itemsize
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_shape) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_shape)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->ndim = __pyx_t_1;

  /* "View.MemoryView":121
 * 
 *         self.ndim = len(shape)
 *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not self.ndim:
 */
  __pyx_v_self->itemsize = __pyx_v_itemsize;

  /* "View.MemoryView":123
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 */
  __pyx_t_2 = (!__pyx_v_self->ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":124
 * 
 *         if not self.ndim:
 *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if self.itemsize <= 0:
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_172), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":126
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 *         if self.itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 */
  __pyx_t_2 = (__pyx_v_self->itemsize <= 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":127
 * 
 *         if self.itemsize <= 0:
 *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         encode = getattr(format, 'encode', None)
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_174), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "View.MemoryView":129
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 *         encode = getattr(format, 'encode', None)             # <<<<<<<<<<<<<<
 *         if encode:
 *             format = encode('ASCII')
 */
  __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_format, ((PyObject *)__pyx_n_s__encode), Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_encode = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "View.MemoryView":130
 * 
 *         encode = getattr(format, 'encode', None)
 *         if encode:             # <<<<<<<<<<<<<<
 *             format = encode('ASCII')
 *         self._format = format
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_encode); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "View.MemoryView":131
 *         encode = getattr(format, 'encode', None)
 *         if encode:
 *             format = encode('ASCII')             # <<<<<<<<<<<<<<
 *         self._format = format
 *         self.format = self._format
 */
    __pyx_t_3 = PyObject_Call(__pyx_v_encode, ((PyObject *)__pyx_k_tuple_175), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_v_format);
    __pyx_v_format = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "View.MemoryView":132
 *         if encode:
 *             format = encode('ASCII')
 *         self._format = format             # <<<<<<<<<<<<<<
 *         self.format = self._format
 * 
 */
  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_format)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_format);
  __Pyx_GIVEREF(__pyx_v_format);
  __Pyx_GOTREF(__pyx_v_self->_format);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_format));
  __pyx_v_self->_format = ((PyObject*)__pyx_v_format);

  /* "View.MemoryView":133
 *             format = encode('ASCII')
 *         self._format = format
 *         self.format = self._format             # <<<<<<<<<<<<<<
 * 
 *         self._shape = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
 */
  __pyx_t_4 = PyBytes_AsString(((PyObject *)__pyx_v_self->_format)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->format = __pyx_t_4;

  /* "View.MemoryView":135
 *         self.format = self._format
 * 
 *         self._shape = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)             # <<<<<<<<<<<<<<
 *         self._strides = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
 * 
 */
  __pyx_v_self->_shape = ((Py_ssize_t *)malloc(((sizeof(Py_ssize_t)) * __pyx_v_self->ndim)));

  /* "View.MemoryView":136
 * 
 *         self._shape = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
 *         self._strides = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)             # <<<<<<<<<<<<<<
 * 
 *         if not self._shape or not self._strides:
 */
  __pyx_v_self->_strides = ((Py_ssize_t *)malloc(((sizeof(Py_ssize_t)) * __pyx_v_self->ndim)));

  /* "View.MemoryView":138
 *         self._strides = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
 * 
 *         if not self._shape or not self._strides:             # <<<<<<<<<<<<<<
 *             free(self._shape)
 *             free(self._strides)
 */
  __pyx_t_2 = (!(__pyx_v_self->_shape != 0));
  if (!__pyx_t_2) {
    __pyx_t_5 = (!(__pyx_v_self->_strides != 0));
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_2;
  }
  if (__pyx_t_6) {

    /* "View.MemoryView":139
 * 
 *         if not self._shape or not self._strides:
 *             free(self._shape)             # <<<<<<<<<<<<<<
 *             free(self._strides)
 *             raise MemoryError("unable to allocate shape or strides.")
 */
    free(__pyx_v_self->_shape);

    /* "View.MemoryView":140
 *         if not self._shape or not self._strides:
 *             free(self._shape)
 *             free(self._strides)             # <<<<<<<<<<<<<<
 *             raise MemoryError("unable to allocate shape or strides.")
 * 
 */
    free(__pyx_v_self->_strides);

    /* "View.MemoryView":141
 *             free(self._shape)
 *             free(self._strides)
 *             raise MemoryError("unable to allocate shape or strides.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_177), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "View.MemoryView":144
 * 
 * 
 *         idx = 0             # <<<<<<<<<<<<<<
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:
 */
  __pyx_v_idx = 0;

  /* "View.MemoryView":145
 * 
 *         idx = 0
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 */
  __pyx_t_7 = 0;
  __pyx_t_3 = ((PyObject *)__pyx_v_shape); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF(__pyx_v_dim);
    __pyx_v_dim = __pyx_t_8;
    __pyx_t_8 = 0;
    __pyx_v_idx = __pyx_t_7;
    __pyx_t_7 = (__pyx_t_7 + 1);

    /* "View.MemoryView":146
 *         idx = 0
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 * 
 */
    __pyx_t_8 = PyObject_RichCompare(__pyx_v_dim, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_6) {

      /* "View.MemoryView":147
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
 * 
 *             self._shape[idx] = dim
 */
      __pyx_t_8 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_dim);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dim);
      __Pyx_GIVEREF(__pyx_v_dim);
      __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_178), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_8));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "View.MemoryView":149
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 * 
 *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
 *             idx += 1
 * 
 */
    __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_t_10;

    /* "View.MemoryView":150
 * 
 *             self._shape[idx] = dim
 *             idx += 1             # <<<<<<<<<<<<<<
 * 
 *         if mode not in ("fortran", "c"):
 */
    __pyx_v_idx = (__pyx_v_idx + 1);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":152
 *             idx += 1
 * 
 *         if mode not in ("fortran", "c"):             # <<<<<<<<<<<<<<
 *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
 * 
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_3 = __pyx_v_mode;
  __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__fortran), Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (((int)__pyx_t_6)) {
    __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__c), Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_5 = ((int)__pyx_t_2);
  } else {
    __pyx_t_5 = ((int)__pyx_t_6);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __pyx_t_5;
  if (__pyx_t_6) {

    /* "View.MemoryView":153
 * 
 *         if mode not in ("fortran", "c"):
 *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
 * 
 *         cdef char order
 */
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_179), __pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "View.MemoryView":156
 * 
 *         cdef char order
 *         if mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = 'F'
 *         else:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_mode, ((PyObject *)__pyx_n_s__fortran), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "View.MemoryView":157
 *         cdef char order
 *         if mode == 'fortran':
 *             order = 'F'             # <<<<<<<<<<<<<<
 *         else:
 *             order = 'C'
 */
    __pyx_v_order = 'F';
    goto __pyx_L11;
  }
  /*else*/ {

    /* "View.MemoryView":159
 *             order = 'F'
 *         else:
 *             order = 'C'             # <<<<<<<<<<<<<<
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides,
 */
    __pyx_v_order = 'C';
  }
  __pyx_L11:;

  /* "View.MemoryView":161
 *             order = 'C'
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
 *                                              itemsize, self.ndim, order)
 * 
 */
  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);

  /* "View.MemoryView":164
 *                                              itemsize, self.ndim, order)
 * 
 *         decode = getattr(mode, 'decode', None)             # <<<<<<<<<<<<<<
 *         if decode:
 *             mode = decode('ASCII')
 */
  __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_mode, ((PyObject *)__pyx_n_s__decode), Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_decode = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "View.MemoryView":165
 * 
 *         decode = getattr(mode, 'decode', None)
 *         if decode:             # <<<<<<<<<<<<<<
 *             mode = decode('ASCII')
 *         self.mode = mode
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_decode); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "View.MemoryView":166
 *         decode = getattr(mode, 'decode', None)
 *         if decode:
 *             mode = decode('ASCII')             # <<<<<<<<<<<<<<
 *         self.mode = mode
 * 
 */
    __pyx_t_3 = PyObject_Call(__pyx_v_decode, ((PyObject *)__pyx_k_tuple_180), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_v_mode);
    __pyx_v_mode = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "View.MemoryView":167
 *         if decode:
 *             mode = decode('ASCII')
 *         self.mode = mode             # <<<<<<<<<<<<<<
 * 
 *         self.free_data = allocate_buffer
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_v_mode))||((__pyx_v_mode) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(__pyx_v_mode)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_mode);
  __Pyx_GIVEREF(__pyx_v_mode);
  __Pyx_GOTREF(__pyx_v_self->mode);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->mode));
  __pyx_v_self->mode = ((PyObject*)__pyx_v_mode);

  /* "View.MemoryView":169
 *         self.mode = mode
 * 
 *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
 *         self.dtype_is_object = format == b'O'
 *         if allocate_buffer:
 */
  __pyx_v_self->free_data = __pyx_v_allocate_buffer;

  /* "View.MemoryView":170
 * 
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
 *         if allocate_buffer:
 *             self.data = <char *>malloc(self.len)
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, ((PyObject *)__pyx_n_b__O), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->dtype_is_object = __pyx_t_6;

  /* "View.MemoryView":171
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:
 */
  if (__pyx_v_allocate_buffer) {

    /* "View.MemoryView":172
 *         self.dtype_is_object = format == b'O'
 *         if allocate_buffer:
 *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")
 */
    __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));

    /* "View.MemoryView":173
 *         if allocate_buffer:
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:             # <<<<<<<<<<<<<<
 *                 raise MemoryError("unable to allocate array data.")
 * 
 */
    __pyx_t_6 = (!(__pyx_v_self->data != 0));
    if (__pyx_t_6) {

      /* "View.MemoryView":174
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_is_object:
 */
      __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_182), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "View.MemoryView":176
 *                 raise MemoryError("unable to allocate array data.")
 * 
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):
 */
    if (__pyx_v_self->dtype_is_object) {

      /* "View.MemoryView":177
 * 
 *             if self.dtype_is_object:
 *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None
 */
      __pyx_v_p = ((PyObject **)__pyx_v_self->data);

      /* "View.MemoryView":178
 *             if self.dtype_is_object:
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
 *                     p[i] = Py_None
 *                     Py_INCREF(Py_None)
 */
      if (unlikely(__pyx_v_itemsize == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
        PyErr_Format(PyExc_OverflowError, "value too large to perform division");
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
      for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) {
        __pyx_v_i = __pyx_t_10;

        /* "View.MemoryView":179
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None             # <<<<<<<<<<<<<<
 *                     Py_INCREF(Py_None)
 * 
 */
        (__pyx_v_p[__pyx_v_i]) = Py_None;

        /* "View.MemoryView":180
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None
 *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
        Py_INCREF(Py_None);
      }
      goto __pyx_L15;
    }
    __pyx_L15:;
    goto __pyx_L13;
  }
  __pyx_L13:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_encode);
  __Pyx_XDECREF(__pyx_v_dim);
  __Pyx_XDECREF(__pyx_v_decode);
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_XDECREF(__pyx_v_mode);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":183
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         cdef int bufmode = -1
 *         if self.mode == b"c":
 */

static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_bufmode;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  char *__pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "View.MemoryView":184
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
 *         if self.mode == b"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 */
  __pyx_v_bufmode = -1;

  /* "View.MemoryView":185
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if self.mode == b"c":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == b"fortran":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(((PyObject *)__pyx_v_self->mode), ((PyObject *)__pyx_n_b__c), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "View.MemoryView":186
 *         cdef int bufmode = -1
 *         if self.mode == b"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *         elif self.mode == b"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 */
    __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
    goto __pyx_L3;
  }

  /* "View.MemoryView":187
 *         if self.mode == b"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == b"fortran":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(((PyObject *)__pyx_v_self->mode), ((PyObject *)__pyx_n_b__fortran), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "View.MemoryView":188
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == b"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 */
    __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":189
 *         elif self.mode == b"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data
 */
  __pyx_t_1 = (!(__pyx_v_flags & __pyx_v_bufmode));
  if (__pyx_t_1) {

    /* "View.MemoryView":190
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
 *         info.buf = self.data
 *         info.len = self.len
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_184), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "View.MemoryView":191
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data             # <<<<<<<<<<<<<<
 *         info.len = self.len
 *         info.ndim = self.ndim
 */
  __pyx_t_3 = __pyx_v_self->data;
  __pyx_v_info->buf = __pyx_t_3;

  /* "View.MemoryView":192
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data
 *         info.len = self.len             # <<<<<<<<<<<<<<
 *         info.ndim = self.ndim
 *         info.shape = self._shape
 */
  __pyx_t_4 = __pyx_v_self->len;
  __pyx_v_info->len = __pyx_t_4;

  /* "View.MemoryView":193
 *         info.buf = self.data
 *         info.len = self.len
 *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
 *         info.shape = self._shape
 *         info.strides = self._strides
 */
  __pyx_t_5 = __pyx_v_self->ndim;
  __pyx_v_info->ndim = __pyx_t_5;

  /* "View.MemoryView":194
 *         info.len = self.len
 *         info.ndim = self.ndim
 *         info.shape = self._shape             # <<<<<<<<<<<<<<
 *         info.strides = self._strides
 *         info.suboffsets = NULL
 */
  __pyx_t_6 = __pyx_v_self->_shape;
  __pyx_v_info->shape = __pyx_t_6;

  /* "View.MemoryView":195
 *         info.ndim = self.ndim
 *         info.shape = self._shape
 *         info.strides = self._strides             # <<<<<<<<<<<<<<
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize
 */
  __pyx_t_6 = __pyx_v_self->_strides;
  __pyx_v_info->strides = __pyx_t_6;

  /* "View.MemoryView":196
 *         info.shape = self._shape
 *         info.strides = self._strides
 *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         info.itemsize = self.itemsize
 *         info.readonly = 0
 */
  __pyx_v_info->suboffsets = NULL;

  /* "View.MemoryView":197
 *         info.strides = self._strides
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
 *         info.readonly = 0
 * 
 */
  __pyx_t_4 = __pyx_v_self->itemsize;
  __pyx_v_info->itemsize = __pyx_t_4;

  /* "View.MemoryView":198
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize
 *         info.readonly = 0             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
  __pyx_v_info->readonly = 0;

  /* "View.MemoryView":200
 *         info.readonly = 0
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.format
 *         else:
 */
  __pyx_t_5 = (__pyx_v_flags & PyBUF_FORMAT);
  if (__pyx_t_5) {

    /* "View.MemoryView":201
 * 
 *         if flags & PyBUF_FORMAT:
 *             info.format = self.format             # <<<<<<<<<<<<<<
 *         else:
 *             info.format = NULL
 */
    __pyx_t_3 = __pyx_v_self->format;
    __pyx_v_info->format = __pyx_t_3;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "View.MemoryView":203
 *             info.format = self.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.obj = self
 */
    __pyx_v_info->format = NULL;
  }
  __pyx_L5:;

  /* "View.MemoryView":205
 *             info.format = NULL
 * 
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_array_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":209
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 */

static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":210
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 */
  __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":211
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
 *         elif self.free_data:
 *             if self.dtype_is_object:
 */
    __pyx_v_self->callback_free_data(__pyx_v_self->data);
    goto __pyx_L3;
  }

  /* "View.MemoryView":212
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape,
 */
  if (__pyx_v_self->free_data) {

    /* "View.MemoryView":213
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape,
 *                                           self._strides, self.ndim, False)
 */
    if (__pyx_v_self->dtype_is_object) {

      /* "View.MemoryView":215
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape,
 *                                           self._strides, self.ndim, False)             # <<<<<<<<<<<<<<
 *             free(self.data)
 * 
 */
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "View.MemoryView":216
 *                 refcount_objects_in_slice(self.data, self._shape,
 *                                           self._strides, self.ndim, False)
 *             free(self.data)             # <<<<<<<<<<<<<<
 * 
 *         free(self._strides)
 */
    free(__pyx_v_self->data);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":218
 *             free(self.data)
 * 
 *         free(self._strides)             # <<<<<<<<<<<<<<
 *         free(self._shape)
 * 
 */
  free(__pyx_v_self->_strides);

  /* "View.MemoryView":219
 * 
 *         free(self._strides)
 *         free(self._shape)             # <<<<<<<<<<<<<<
 * 
 *     property memview:
 */
  free(__pyx_v_self->_shape);

  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
static PyObject *get_memview(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = get_memview_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":223
 *     property memview:
 *         @cname('get_memview')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 * 
 *             flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 */

static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":225
 *         def __get__(self):
 * 
 *             flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
 *             return  memoryview(self, flags, self.dtype_is_object)
 * 
 */
  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);

  /* "View.MemoryView":226
 * 
 *             flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *             return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  __pyx_r = __pyx_array_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":229
 * 
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
 */

static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "View.MemoryView":230
 * 
 *     def __getattr__(self, attr):
 *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_array_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":232
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
 */

static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "View.MemoryView":233
 * 
 *     def __getitem__(self, item):
 *         return self.memview[item]             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, item, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (!__pyx_t_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_array_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":235
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
 */

static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "View.MemoryView":236
 * 
 *     def __setitem__(self, item, value):
 *         self.memview[item] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":240
 * 
 * @cname("__pyx_array_new")
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
 *                           char *mode, char *buf):
 *     cdef array result
 */

static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
  struct __pyx_array_obj *__pyx_v_result = 0;
  struct __pyx_array_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("array_cwrapper", 0);

  /* "View.MemoryView":244
 *     cdef array result
 * 
 *     if buf == NULL:             # <<<<<<<<<<<<<<
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 */
  __pyx_t_1 = (__pyx_v_buf == NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":245
 * 
 *     if buf == NULL:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_v_shape));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_shape));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_shape));
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":247
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
 *                        allocate_buffer=False)
 *         result.data = buf
 */
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_3 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_shape));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_shape));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_shape));
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));

    /* "View.MemoryView":248
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
 *         result.data = buf
 * 
 */
    __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__allocate_buffer), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "View.MemoryView":249
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 *                        allocate_buffer=False)
 *         result.data = buf             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_v_result->data = __pyx_v_buf;
  }
  __pyx_L3:;

  /* "View.MemoryView":251
 *         result.data = buf
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_array_obj *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":277
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
 */

static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "View.MemoryView":278
 *     cdef object name
 *     def __init__(self, name):
 *         self.name = name             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return self.name
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

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

/* Python wrapper */
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":279
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
 */

static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":280
 *         self.name = name
 *     def __repr__(self):
 *         return self.name             # <<<<<<<<<<<<<<
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":294
 * 
 * @cname('__pyx_align_pointer')
 * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
 *     "Align pointer memory on a given boundary"
 *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
 */

static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
  Py_intptr_t __pyx_v_aligned_p;
  size_t __pyx_v_offset;
  void *__pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":296
 * cdef void *align_pointer(void *memory, size_t alignment) nogil:
 *     "Align pointer memory on a given boundary"
 *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
 *     cdef size_t offset
 * 
 */
  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);

  /* "View.MemoryView":300
 * 
 *     with cython.cdivision(True):
 *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
 * 
 *     if offset > 0:
 */
  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);

  /* "View.MemoryView":302
 *         offset = aligned_p % alignment
 * 
 *     if offset > 0:             # <<<<<<<<<<<<<<
 *         aligned_p += alignment - offset
 * 
 */
  __pyx_t_1 = (__pyx_v_offset > 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":303
 * 
 *     if offset > 0:
 *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
 * 
 *     return <void *> aligned_p
 */
    __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":305
 *         aligned_p += alignment - offset
 * 
 *     return <void *> aligned_p             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview')
 */
  __pyx_r = ((void *)__pyx_v_aligned_p);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  int __pyx_v_flags;
  int __pyx_v_dtype_is_object;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,&__pyx_n_s__flags,&__pyx_n_s__dtype_is_object,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dtype_is_object);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[2]) {
      __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "View.MemoryView":323
 *     cdef __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
 */
      __pyx_v_dtype_is_object = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "View.MemoryView":324
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj             # <<<<<<<<<<<<<<
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 */
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  __Pyx_GOTREF(__pyx_v_self->obj);
  __Pyx_DECREF(__pyx_v_self->obj);
  __pyx_v_self->obj = __pyx_v_obj;

  /* "View.MemoryView":325
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj
 *         self.flags = flags             # <<<<<<<<<<<<<<
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 */
  __pyx_v_self->flags = __pyx_v_flags;

  /* "View.MemoryView":326
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type)));
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_obj != Py_None);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "View.MemoryView":327
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 */
    __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "View.MemoryView":328
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
 */
    __pyx_t_3 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
    if (__pyx_t_3) {

      /* "View.MemoryView":329
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
 *                 Py_INCREF(Py_None)
 * 
 */
      ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;

      /* "View.MemoryView":330
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         self.lock = PyThread_allocate_lock()
 */
      Py_INCREF(Py_None);
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":332
 *                 Py_INCREF(Py_None)
 * 
 *         self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
 *         if self.lock == NULL:
 *             raise MemoryError
 */
  __pyx_v_self->lock = PyThread_allocate_lock();

  /* "View.MemoryView":333
 * 
 *         self.lock = PyThread_allocate_lock()
 *         if self.lock == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError
 * 
 */
  __pyx_t_3 = (__pyx_v_self->lock == NULL);
  if (__pyx_t_3) {

    /* "View.MemoryView":334
 *         self.lock = PyThread_allocate_lock()
 *         if self.lock == NULL:
 *             raise MemoryError             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
    PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "View.MemoryView":336
 *             raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = self.view.format == b'O'
 *         else:
 */
  __pyx_t_4 = (__pyx_v_flags & PyBUF_FORMAT);
  if (__pyx_t_4) {

    /* "View.MemoryView":337
 * 
 *         if flags & PyBUF_FORMAT:
 *             self.dtype_is_object = self.view.format == b'O'             # <<<<<<<<<<<<<<
 *         else:
 *             self.dtype_is_object = dtype_is_object
 */
    __pyx_t_5 = PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_t_5), ((PyObject *)__pyx_n_b__O), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_self->dtype_is_object = __pyx_t_3;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "View.MemoryView":339
 *             self.dtype_is_object = self.view.format == b'O'
 *         else:
 *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
 * 
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
 */
    __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
  }
  __pyx_L6:;

  /* "View.MemoryView":341
 *             self.dtype_is_object = dtype_is_object
 * 
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
 *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
 *         self.typeinfo = NULL
 */
  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));

  /* "View.MemoryView":343
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
 *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
 *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(memoryview self):
 */
  __pyx_v_self->typeinfo = NULL;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":345
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 */

static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":346
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_ReleaseBuffer(&self.view)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":347
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
 * 
 *         if self.lock != NULL:
 */
    __Pyx_ReleaseBuffer((&__pyx_v_self->view));
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":349
 *             __Pyx_ReleaseBuffer(&self.view)
 * 
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             PyThread_free_lock(self.lock)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->lock != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":350
 * 
 *         if self.lock != NULL:
 *             PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 */
    PyThread_free_lock(__pyx_v_self->lock);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":352
 *             PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
 */

static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  Py_ssize_t __pyx_v_dim;
  char *__pyx_v_itemp;
  PyObject *__pyx_v_idx = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item_pointer", 0);

  /* "View.MemoryView":354
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
 * 
 *         for dim, idx in enumerate(index):
 */
  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);

  /* "View.MemoryView":356
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 */
  __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_v_index) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF(__pyx_v_idx);
    __pyx_v_idx = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_1;
    __pyx_t_1 = (__pyx_t_1 + 1);

    /* "View.MemoryView":357
 * 
 *         for dim, idx in enumerate(index):
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
 * 
 *         return itemp
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_itemp = __pyx_t_7;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":359
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 *         return itemp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_itemp;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":362
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
 */

static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_indices = NULL;
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "View.MemoryView":363
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
  if (__pyx_t_1) {

    /* "View.MemoryView":364
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_r = ((PyObject *)__pyx_v_self);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":366
 *             return self
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         cdef char *itemp
 */
  __pyx_t_2 = ((PyObject *)_unellipsify(__pyx_v_index, __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyTuple_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else if (1) {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  } else
  {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_have_slices = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_indices = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "View.MemoryView":369
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "View.MemoryView":370
 *         cdef char *itemp
 *         if have_slices:
 *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
 *         else:
 *             itemp = self.get_item_pointer(indices)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "View.MemoryView":372
 *             return memview_slice(self, indices)
 *         else:
 *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
 *             return self.convert_item_to_object(itemp)
 * 
 */
    __pyx_t_7 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_itemp = __pyx_t_7;

    /* "View.MemoryView":373
 *         else:
 *             itemp = self.get_item_pointer(indices)
 *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(memoryview self, object index, object value):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":375
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 */

static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_obj = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "View.MemoryView":376
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         if have_slices:
 */
  __pyx_t_1 = ((PyObject *)_unellipsify(__pyx_v_index, __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyTuple_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else if (1) {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  } else
  {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_have_slices = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_index);
  __pyx_v_index = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "View.MemoryView":378
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj:
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "View.MemoryView":379
 * 
 *         if have_slices:
 *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
 *             if obj:
 *                 self.setitem_slice_assignment(self[index], obj)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_obj = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "View.MemoryView":380
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {

      /* "View.MemoryView":381
 *             obj = self.is_slice(value)
 *             if obj:
 *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)
 */
      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (!__pyx_t_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "View.MemoryView":383
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
 *         else:
 *             self.setitem_indexed(index, value)
 */
      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "View.MemoryView":385
 *                 self.setitem_slice_assign_scalar(self[index], value)
 *         else:
 *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef is_slice(self, obj):
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L5:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":387
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
 */

static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_slice", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "View.MemoryView":388
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject *)__pyx_memoryview_type)); 
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "View.MemoryView":389
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 */
    {
      __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:*/ {

        /* "View.MemoryView":390
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
 */
        __pyx_t_6 = PyInt_FromLong((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);

        /* "View.MemoryView":391
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
 *             except TypeError:
 *                 return None
 */
        __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_6 = 0;
        __pyx_t_7 = 0;
        __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_v_obj);
        __pyx_v_obj = __pyx_t_7;
        __pyx_t_7 = 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_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "View.MemoryView":392
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
      __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_6);

        /* "View.MemoryView":393
 *                                  self.dtype_is_object)
 *             except TypeError:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         return obj
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_None);
        __pyx_r = Py_None;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_except_return;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L5_exception_handled;
      }
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L7_except_return:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L0;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L11_try_end:;
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":395
 *                 return None
 * 
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assignment(self, dst, src):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":397
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 */

static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
  __Pyx_memviewslice __pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_src_slice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);

  /* "View.MemoryView":401
 *         cdef __Pyx_memviewslice src_slice
 * 
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
 *                                  get_slice_from_memview(dst, &dst_slice)[0],
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 */
  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":402
 * 
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
 *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 * 
 */
  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":403
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
 *                                  get_slice_from_memview(dst, &dst_slice)[0],
 *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_src, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_dst, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":405
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
 */

static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
  int __pyx_v_array[128];
  void *__pyx_v_tmp;
  void *__pyx_v_item;
  __Pyx_memviewslice __pyx_v_tmp_slice;
  __Pyx_memviewslice *__pyx_v_dst_slice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);

  /* "View.MemoryView":407
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 *         cdef int array[128]
 *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
 *         cdef void *item
 * 
 */
  __pyx_v_tmp = NULL;

  /* "View.MemoryView":411
 * 
 *         cdef __Pyx_memviewslice tmp_slice, *dst_slice
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 */
  __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));

  /* "View.MemoryView":413
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = malloc(self.view.itemsize)
 *             if tmp == NULL:
 */
  __pyx_t_1 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
  if (__pyx_t_1) {

    /* "View.MemoryView":414
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
 *             if tmp == NULL:
 *                 raise MemoryError
 */
    __pyx_v_tmp = malloc(__pyx_v_self->view.itemsize);

    /* "View.MemoryView":415
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
 */
    __pyx_t_1 = (__pyx_v_tmp == NULL);
    if (__pyx_t_1) {

      /* "View.MemoryView":416
 *             tmp = malloc(self.view.itemsize)
 *             if tmp == NULL:
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *             item = tmp
 *         else:
 */
      PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "View.MemoryView":417
 *             if tmp == NULL:
 *                 raise MemoryError
 *             item = tmp             # <<<<<<<<<<<<<<
 *         else:
 *             item = <void *> array
 */
    __pyx_v_item = __pyx_v_tmp;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":419
 *             item = tmp
 *         else:
 *             item = <void *> array             # <<<<<<<<<<<<<<
 * 
 *         if self.dtype_is_object:
 */
    __pyx_v_item = ((void *)__pyx_v_array);
  }
  __pyx_L3:;

  /* "View.MemoryView":421
 *             item = <void *> array
 * 
 *         if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *             (<PyObject **> item)[0] = <PyObject *> value
 *         else:
 */
  if (__pyx_v_self->dtype_is_object) {

    /* "View.MemoryView":422
 * 
 *         if self.dtype_is_object:
 *             (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
 *         else:
 *             try:
 */
    (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
    goto __pyx_L5;
  }
  /*else*/ {

    /* "View.MemoryView":424
 *             (<PyObject **> item)[0] = <PyObject *> value
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self.assign_item_from_object(<char *> item, value)
 *             except:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "View.MemoryView":425
 *         else:
 *             try:
 *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
 *             except:
 *                 free(tmp)
 */
        __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L13_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "View.MemoryView":426
 *             try:
 *                 self.assign_item_from_object(<char *> item, value)
 *             except:             # <<<<<<<<<<<<<<
 *                 free(tmp)
 *                 raise
 */
      /*except:*/ {
        __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_7);

        /* "View.MemoryView":427
 *                 self.assign_item_from_object(<char *> item, value)
 *             except:
 *                 free(tmp)             # <<<<<<<<<<<<<<
 *                 raise
 * 
 */
        free(__pyx_v_tmp);

        /* "View.MemoryView":428
 *             except:
 *                 free(tmp)
 *                 raise             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __Pyx_GIVEREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; 
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L7_exception_handled;
      }
      __pyx_L8_except_error:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L1_error;
      __pyx_L7_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      __pyx_L13_try_end:;
    }
  }
  __pyx_L5:;

  /* "View.MemoryView":432
 * 
 * 
 *         if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *         slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 */
  __pyx_t_1 = (__pyx_v_self->view.suboffsets != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":433
 * 
 *         if self.view.suboffsets != NULL:
 *             assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
 *         slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 *                             item, self.dtype_is_object)
 */
    __pyx_t_7 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L16;
  }
  __pyx_L16:;

  /* "View.MemoryView":435
 *             assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *         slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 *                             item, self.dtype_is_object)             # <<<<<<<<<<<<<<
 *         free(tmp)
 * 
 */
  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);

  /* "View.MemoryView":436
 *         slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 *                             item, self.dtype_is_object)
 *         free(tmp)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_indexed(self, index, value):
 */
  free(__pyx_v_tmp);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":438
 *         free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
 */

static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_indexed", 0);

  /* "View.MemoryView":439
 * 
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
 *         self.assign_item_from_object(itemp, value)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_itemp = __pyx_t_1;

  /* "View.MemoryView":440
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":442
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_v_struct = NULL;
  PyObject *__pyx_v_bytesitem = 0;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":445
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef bytes bytesitem
 * 
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__struct), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":448
 *         cdef bytes bytesitem
 * 
 *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 */
  __pyx_t_1 = PyBytes_FromStringAndSize(((const char*)__pyx_v_itemp) + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":449
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "View.MemoryView":450
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_struct, __pyx_n_s__unpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
      __Pyx_INCREF(((PyObject *)__pyx_v_bytesitem));
      PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_bytesitem));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_bytesitem));
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_v_result = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    /*else:*/ {

      /* "View.MemoryView":454
 *             raise ValueError("Unable to convert item to object")
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
 */
      __pyx_t_7 = strlen(__pyx_v_self->view.format); 
      __pyx_t_8 = (__pyx_t_7 == 1);
      if (__pyx_t_8) {

        /* "View.MemoryView":455
 *         else:
 *             if len(self.view.format) == 1:
 *                 return result[0]             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_result, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L6_except_return;
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "View.MemoryView":456
 *             if len(self.view.format) == 1:
 *                 return result[0]
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L6_except_return;
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "View.MemoryView":451
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:             # <<<<<<<<<<<<<<
 *             raise ValueError("Unable to convert item to object")
 *         else:
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_struct, __pyx_n_s__error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_9) {
      __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_1);

      /* "View.MemoryView":452
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
 *         else:
 *             if len(self.view.format) == 1:
 */
      __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_186), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    __pyx_L10_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesitem);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":458
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_struct = NULL;
  char __pyx_v_c;
  PyObject *__pyx_v_bytesvalue = 0;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  char *__pyx_t_8;
  char *__pyx_t_9;
  char *__pyx_t_10;
  char *__pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":461
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef char c
 *         cdef bytes bytesvalue
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__struct), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":466
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_value); 
  if (__pyx_t_2) {

    /* "View.MemoryView":467
 * 
 *         if isinstance(value, tuple):
 *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_struct, __pyx_n_s__pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":469
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
 * 
 *         for i, c in enumerate(bytesvalue):
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_struct, __pyx_n_s__pack); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __Pyx_INCREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":471
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
 */
  __pyx_t_6 = 0;
  if (unlikely(((PyObject *)__pyx_v_bytesvalue) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_bytesvalue));
  __pyx_t_7 = __pyx_v_bytesvalue;
  __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_7);
  __pyx_t_10 = (__pyx_t_9 + PyBytes_GET_SIZE(__pyx_t_7));
  for (__pyx_t_11 = __pyx_t_9; __pyx_t_11 < __pyx_t_10; __pyx_t_11++) {
    __pyx_t_8 = __pyx_t_11;
    __pyx_v_c = (__pyx_t_8[0]);

    /* "View.MemoryView":472
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
    __pyx_v_i = __pyx_t_6;

    /* "View.MemoryView":471
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
 */
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "View.MemoryView":472
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
    (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
  }
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":475
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         if flags & PyBUF_STRIDES:
 *             info.shape = self.view.shape
 */

static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  char *__pyx_t_3;
  void *__pyx_t_4;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "View.MemoryView":476
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
 */
  __pyx_t_1 = (__pyx_v_flags & PyBUF_STRIDES);
  if (__pyx_t_1) {

    /* "View.MemoryView":477
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_STRIDES:
 *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
 *         else:
 *             info.shape = NULL
 */
    __pyx_t_2 = __pyx_v_self->view.shape;
    __pyx_v_info->shape = __pyx_t_2;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":479
 *             info.shape = self.view.shape
 *         else:
 *             info.shape = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_STRIDES:
 */
    __pyx_v_info->shape = NULL;
  }
  __pyx_L3:;

  /* "View.MemoryView":481
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
 */
  __pyx_t_1 = (__pyx_v_flags & PyBUF_STRIDES);
  if (__pyx_t_1) {

    /* "View.MemoryView":482
 * 
 *         if flags & PyBUF_STRIDES:
 *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
 *         else:
 *             info.strides = NULL
 */
    __pyx_t_2 = __pyx_v_self->view.strides;
    __pyx_v_info->strides = __pyx_t_2;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "View.MemoryView":484
 *             info.strides = self.view.strides
 *         else:
 *             info.strides = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_INDIRECT:
 */
    __pyx_v_info->strides = NULL;
  }
  __pyx_L4:;

  /* "View.MemoryView":486
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
 */
  __pyx_t_1 = (__pyx_v_flags & PyBUF_INDIRECT);
  if (__pyx_t_1) {

    /* "View.MemoryView":487
 * 
 *         if flags & PyBUF_INDIRECT:
 *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
 *         else:
 *             info.suboffsets = NULL
 */
    __pyx_t_2 = __pyx_v_self->view.suboffsets;
    __pyx_v_info->suboffsets = __pyx_t_2;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "View.MemoryView":489
 *             info.suboffsets = self.view.suboffsets
 *         else:
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
    __pyx_v_info->suboffsets = NULL;
  }
  __pyx_L5:;

  /* "View.MemoryView":491
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
 */
  __pyx_t_1 = (__pyx_v_flags & PyBUF_FORMAT);
  if (__pyx_t_1) {

    /* "View.MemoryView":492
 * 
 *         if flags & PyBUF_FORMAT:
 *             info.format = self.view.format             # <<<<<<<<<<<<<<
 *         else:
 *             info.format = NULL
 */
    __pyx_t_3 = __pyx_v_self->view.format;
    __pyx_v_info->format = __pyx_t_3;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "View.MemoryView":494
 *             info.format = self.view.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.buf = self.view.buf
 */
    __pyx_v_info->format = NULL;
  }
  __pyx_L6:;

  /* "View.MemoryView":496
 *             info.format = NULL
 * 
 *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 */
  __pyx_t_4 = __pyx_v_self->view.buf;
  __pyx_v_info->buf = __pyx_t_4;

  /* "View.MemoryView":497
 * 
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 */
  __pyx_t_1 = __pyx_v_self->view.ndim;
  __pyx_v_info->ndim = __pyx_t_1;

  /* "View.MemoryView":498
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
 *         info.len = self.view.len
 *         info.readonly = 0
 */
  __pyx_t_5 = __pyx_v_self->view.itemsize;
  __pyx_v_info->itemsize = __pyx_t_5;

  /* "View.MemoryView":499
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len             # <<<<<<<<<<<<<<
 *         info.readonly = 0
 *         info.obj = self
 */
  __pyx_t_5 = __pyx_v_self->view.len;
  __pyx_v_info->len = __pyx_t_5;

  /* "View.MemoryView":500
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 *         info.readonly = 0             # <<<<<<<<<<<<<<
 *         info.obj = self
 * 
 */
  __pyx_v_info->readonly = 0;

  /* "View.MemoryView":501
 *         info.len = self.view.len
 *         info.readonly = 0
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  __pyx_r = 0;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":508
 *     property T:
 *         @cname('__pyx_memoryview_transpose')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef _memoryviewslice result = memoryview_copy(self)
 *             transpose_memslice(&result.from_slice)
 */

static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":509
 *         @cname('__pyx_memoryview_transpose')
 *         def __get__(self):
 *             cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
 *             transpose_memslice(&result.from_slice)
 *             return result
 */
  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":510
 *         def __get__(self):
 *             cdef _memoryviewslice result = memoryview_copy(self)
 *             transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":511
 *             cdef _memoryviewslice result = memoryview_copy(self)
 *             transpose_memslice(&result.from_slice)
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     property base:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":515
 *     property base:
 *         @cname('__pyx_memoryview__get__base')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.obj
 * 
 */

static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":516
 *         @cname('__pyx_memoryview__get__base')
 *         def __get__(self):
 *             return self.obj             # <<<<<<<<<<<<<<
 * 
 *     property shape:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->obj);
  __pyx_r = __pyx_v_self->obj;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":520
 *     property shape:
 *         @cname('__pyx_memoryview_get_shape')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])
 * 
 */

static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":521
 *         @cname('__pyx_memoryview_get_shape')
 *         def __get__(self):
 *             return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])             # <<<<<<<<<<<<<<
 * 
 *     property strides:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_self->view.ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
    __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_self->view.shape[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = ((PyObject *)PyList_AsTuple(__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":525
 *     property strides:
 *         @cname('__pyx_memoryview_get_strides')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.view.strides == NULL:
 * 
 */

static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":526
 *         @cname('__pyx_memoryview_get_strides')
 *         def __get__(self):
 *             if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *                 raise ValueError("Buffer view does not expose strides")
 */
  __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":528
 *             if self.view.strides == NULL:
 * 
 *                 raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
 * 
 *             return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_188), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":530
 *                 raise ValueError("Buffer view does not expose strides")
 * 
 *             return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])             # <<<<<<<<<<<<<<
 * 
 *     property suboffsets:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_v_self->view.ndim;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;
    __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.strides[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = ((PyObject *)PyList_AsTuple(__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":534
 *     property suboffsets:
 *         @cname('__pyx_memoryview_get_suboffsets')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self.view.suboffsets == NULL:
 *                 return [-1] * self.view.ndim
 */

static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":535
 *         @cname('__pyx_memoryview_get_suboffsets')
 *         def __get__(self):
 *             if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *                 return [-1] * self.view.ndim
 * 
 */
  __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":536
 *         def __get__(self):
 *             if self.view.suboffsets == NULL:
 *                 return [-1] * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *             return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->view.ndim<0) ? 0:__pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_self->view.ndim; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_neg_1);
        PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_neg_1);
        __Pyx_GIVEREF(__pyx_int_neg_1);
      }
    }
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":538
 *                 return [-1] * self.view.ndim
 * 
 *             return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])             # <<<<<<<<<<<<<<
 * 
 *     property ndim:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_v_self->view.ndim;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;
    __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.suboffsets[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = ((PyObject *)PyList_AsTuple(__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":542
 *     property ndim:
 *         @cname('__pyx_memoryview_get_ndim')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.view.ndim
 * 
 */

static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":543
 *         @cname('__pyx_memoryview_get_ndim')
 *         def __get__(self):
 *             return self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     property itemsize:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":547
 *     property itemsize:
 *         @cname('__pyx_memoryview_get_itemsize')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.view.itemsize
 * 
 */

static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":548
 *         @cname('__pyx_memoryview_get_itemsize')
 *         def __get__(self):
 *             return self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     property nbytes:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":552
 *     property nbytes:
 *         @cname('__pyx_memoryview_get_nbytes')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.size * self.view.itemsize
 * 
 */

static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":553
 *         @cname('__pyx_memoryview_get_nbytes')
 *         def __get__(self):
 *             return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     property size:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":557
 *     property size:
 *         @cname('__pyx_memoryview_get_size')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._size is None:
 *                 result = 1
 */

static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":558
 *         @cname('__pyx_memoryview_get_size')
 *         def __get__(self):
 *             if self._size is None:             # <<<<<<<<<<<<<<
 *                 result = 1
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":559
 *         def __get__(self):
 *             if self._size is None:
 *                 result = 1             # <<<<<<<<<<<<<<
 * 
 *                 for length in self.shape:
 */
    __Pyx_INCREF(__pyx_int_1);
    __pyx_v_result = __pyx_int_1;

    /* "View.MemoryView":561
 *                 result = 1
 * 
 *                 for length in self.shape:             # <<<<<<<<<<<<<<
 *                     result *= length
 * 
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __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[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __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[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_2 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF(__pyx_v_length);
      __pyx_v_length = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "View.MemoryView":562
 * 
 *                 for length in self.shape:
 *                     result *= length             # <<<<<<<<<<<<<<
 * 
 *                 self._size = result
 */
      __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_v_result);
      __pyx_v_result = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "View.MemoryView":564
 *                     result *= length
 * 
 *                 self._size = result             # <<<<<<<<<<<<<<
 * 
 *             return self._size
 */
    __Pyx_INCREF(__pyx_v_result);
    __Pyx_GIVEREF(__pyx_v_result);
    __Pyx_GOTREF(__pyx_v_self->_size);
    __Pyx_DECREF(__pyx_v_self->_size);
    __pyx_v_self->_size = __pyx_v_result;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":566
 *                 self._size = result
 * 
 *             return self._size             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_size);
  __pyx_r = __pyx_v_self->_size;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":568
 *             return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
 */

static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "View.MemoryView":569
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
 */
  __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":570
 *     def __len__(self):
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
    __pyx_r = (__pyx_v_self->view.shape[0]);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":572
 *             return self.view.shape[0]
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":574
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
 */

static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":575
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":576
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_3 = PyObject_Call(__pyx_builtin_id, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_189), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":578
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
 */

static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "View.MemoryView":579
 * 
 *     def __str__(self):
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_190), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":582
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice, tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 */

static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_c_contig", 0);

  /* "View.MemoryView":584
 *     def is_c_contig(self):
 *         cdef __Pyx_memviewslice *mslice, tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice, 'C', self.view.ndim)
 * 
 */
  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));

  /* "View.MemoryView":585
 *         cdef __Pyx_memviewslice *mslice, tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice, 'C', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def is_f_contig(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":587
 *         return slice_is_contig(mslice, 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice, tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 */

static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_f_contig", 0);

  /* "View.MemoryView":589
 *     def is_f_contig(self):
 *         cdef __Pyx_memviewslice *mslice, tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice, 'F', self.view.ndim)
 * 
 */
  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));

  /* "View.MemoryView":590
 *         cdef __Pyx_memviewslice *mslice, tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice, 'F', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":592
 *         return slice_is_contig(mslice, 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 */

static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_mslice;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "View.MemoryView":594
 *     def copy(self):
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &mslice)
 */
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));

  /* "View.MemoryView":596
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 * 
 *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
 *                                    self.view.itemsize,
 */
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));

  /* "View.MemoryView":600
 *                                    self.view.itemsize,
 *                                    flags|PyBUF_C_CONTIGUOUS,
 *                                    self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *         return memoryview_copy_from_slice(self, &mslice)
 */
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k__c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":602
 *                                    self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
 * 
 *     def copy_fortran(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
  __pyx_r = __pyx_memoryview_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":604
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 */

static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy_fortran", 0);

  /* "View.MemoryView":606
 *     def copy_fortran(self):
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &src)
 */
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));

  /* "View.MemoryView":608
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 * 
 *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
 *                                 self.view.itemsize,
 */
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));

  /* "View.MemoryView":612
 *                                 self.view.itemsize,
 *                                 flags|PyBUF_F_CONTIGUOUS,
 *                                 self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *         return memoryview_copy_from_slice(self, &dst)
 */
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k__fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dst = __pyx_t_1;

  /* "View.MemoryView":614
 *                                 self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":618
 * 
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 */

static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
  struct __pyx_memoryview_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);

  /* "View.MemoryView":619
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
 *     result.typeinfo = typeinfo
 *     return result
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_o);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
  __Pyx_GIVEREF(__pyx_v_o);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":620
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_v_result->typeinfo = __pyx_v_typeinfo;

  /* "View.MemoryView":621
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_check')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":624
 * 
 * @cname('__pyx_memoryview_check')
 * cdef bint memoryview_check(object o):             # <<<<<<<<<<<<<<
 *     return isinstance(o, memoryview)
 * 
 */

static int __pyx_memoryview_check(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("memoryview_check", 0);

  /* "View.MemoryView":625
 * @cname('__pyx_memoryview_check')
 * cdef bint memoryview_check(object o):
 *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
 * 
 * cdef tuple _unellipsify(object index, int ndim):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject *)__pyx_memoryview_type)); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

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

/* "View.MemoryView":627
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
 */

static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
  PyObject *__pyx_v_tup = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_have_slices = NULL;
  int __pyx_v_seen_ellipsis;
  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_nslices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_unellipsify", 0);

  /* "View.MemoryView":632
 *     full slices.
 *     """
 *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
 *         tup = (index,)
 *     else:
 */
  __pyx_t_1 = PyTuple_Check(__pyx_v_index); 
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "View.MemoryView":633
 *     """
 *     if not isinstance(index, tuple):
 *         tup = (index,)             # <<<<<<<<<<<<<<
 *     else:
 *         tup = index
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    __pyx_v_tup = ((PyObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":635
 *         tup = (index,)
 *     else:
 *         tup = index             # <<<<<<<<<<<<<<
 * 
 *     result = []
 */
    __Pyx_INCREF(__pyx_v_index);
    __pyx_v_tup = __pyx_v_index;
  }
  __pyx_L3:;

  /* "View.MemoryView":637
 *         tup = index
 * 
 *     result = []             # <<<<<<<<<<<<<<
 *     have_slices = False
 *     seen_ellipsis = False
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "View.MemoryView":638
 * 
 *     result = []
 *     have_slices = False             # <<<<<<<<<<<<<<
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_have_slices = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "View.MemoryView":639
 *     result = []
 *     have_slices = False
 *     seen_ellipsis = False             # <<<<<<<<<<<<<<
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:
 */
  __pyx_v_seen_ellipsis = 0;

  /* "View.MemoryView":640
 *     have_slices = False
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_3 = __pyx_int_0;
  if (PyList_CheckExact(__pyx_v_tup) || PyTuple_CheckExact(__pyx_v_tup)) {
    __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_7 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_7)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF(__pyx_v_item);
    __pyx_v_item = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_v_idx);
    __pyx_v_idx = __pyx_t_3;
    __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "View.MemoryView":641
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 */
    __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
    if (__pyx_t_2) {

      /* "View.MemoryView":642
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 *                 seen_ellipsis = True
 */
      __pyx_t_2 = (!__pyx_v_seen_ellipsis);
      if (__pyx_t_2) {

        /* "View.MemoryView":643
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
 *                 seen_ellipsis = True
 *             else:
 */
        __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_k_tuple_191), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_10 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_9) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_9) + 1))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        { Py_ssize_t __pyx_temp;
          for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_9) + 1); __pyx_temp++) {
            __Pyx_INCREF(__pyx_t_8);
            PyList_SET_ITEM(__pyx_t_10, __pyx_temp, __pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_8);
          }
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_10));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
        __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "View.MemoryView":644
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
 *             else:
 *                 result.append(slice(None))
 */
        __pyx_v_seen_ellipsis = 1;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "View.MemoryView":646
 *                 seen_ellipsis = True
 *             else:
 *                 result.append(slice(None))             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
 */
        __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_k_tuple_192), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = PyList_Append(__pyx_v_result, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __pyx_L7:;

      /* "View.MemoryView":647
 *             else:
 *                 result.append(slice(None))
 *             have_slices = True             # <<<<<<<<<<<<<<
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):
 */
      __pyx_t_10 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_v_have_slices);
      __pyx_v_have_slices = __pyx_t_10;
      __pyx_t_10 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "View.MemoryView":649
 *             have_slices = True
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Cannot index with type '%s'" % type(item))
 * 
 */
      __pyx_t_2 = PySlice_Check(__pyx_v_item); 
      __pyx_t_1 = (!__pyx_t_2);
      if (__pyx_t_1) {
        __pyx_t_2 = (!__Pyx_PyIndex_Check(__pyx_v_item));
        __pyx_t_12 = __pyx_t_2;
      } else {
        __pyx_t_12 = __pyx_t_1;
      }
      if (__pyx_t_12) {

        /* "View.MemoryView":650
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):
 *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
 * 
 *             have_slices = have_slices or isinstance(item, slice)
 */
        __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_193), ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_10));
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_10));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
        __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        __Pyx_Raise(__pyx_t_10, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "View.MemoryView":652
 *                 raise TypeError("Cannot index with type '%s'" % type(item))
 * 
 *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
 *             result.append(item)
 * 
 */
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_12) {
        __pyx_t_12 = PySlice_Check(__pyx_v_item); 
        __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = __pyx_t_10;
        __pyx_t_10 = 0;
      } else {
        __Pyx_INCREF(__pyx_v_have_slices);
        __pyx_t_8 = __pyx_v_have_slices;
      }
      __Pyx_DECREF(__pyx_v_have_slices);
      __pyx_v_have_slices = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "View.MemoryView":653
 * 
 *             have_slices = have_slices or isinstance(item, slice)
 *             result.append(item)             # <<<<<<<<<<<<<<
 * 
 *     nslices = ndim - len(result)
 */
      __pyx_t_11 = PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":655
 *             result.append(item)
 * 
 *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
 *     if nslices:
 *         result.extend([slice(None)] * nslices)
 */
  __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_result)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_ndim - __pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_nslices = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "View.MemoryView":656
 * 
 *     nslices = ndim - len(result)
 *     if nslices:             # <<<<<<<<<<<<<<
 *         result.extend([slice(None)] * nslices)
 * 
 */
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_nslices); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_12) {

    /* "View.MemoryView":657
 *     nslices = ndim - len(result)
 *     if nslices:
 *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
 * 
 *     return have_slices or nslices, tuple(result)
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_k_tuple_194), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_8, __pyx_v_nslices); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_temp);
      __Pyx_DECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_temp;
    }
    __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
    __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "View.MemoryView":659
 *         result.extend([slice(None)] * nslices)
 * 
 *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_12) {
    __Pyx_INCREF(__pyx_v_nslices);
    __pyx_t_8 = __pyx_v_nslices;
  } else {
    __Pyx_INCREF(__pyx_v_have_slices);
    __pyx_t_8 = __pyx_v_have_slices;
  }
  __pyx_t_4 = ((PyObject *)PyList_AsTuple(__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_8 = 0;
  __pyx_t_4 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_nslices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":661
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
 *     cdef int i
 *     for i in range(ndim):
 */

static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);

  /* "View.MemoryView":663
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 *     cdef int i
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if suboffsets[i] >= 0:
 *             raise ValueError("Indirect dimensions not supported")
 */
  __pyx_t_1 = __pyx_v_ndim;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "View.MemoryView":664
 *     cdef int i
 *     for i in range(ndim):
 *         if suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Indirect dimensions not supported")
 * 
 */
    __pyx_t_3 = ((__pyx_v_suboffsets[__pyx_v_i]) >= 0);
    if (__pyx_t_3) {

      /* "View.MemoryView":665
 *     for i in range(ndim):
 *         if suboffsets[i] >= 0:
 *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_196), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":672
 * 
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
 *     cdef bint negative_step
 */

static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
  int __pyx_v_new_ndim;
  int __pyx_v_suboffset_dim;
  int __pyx_v_dim;
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  __Pyx_memviewslice *__pyx_v_p_src;
  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
  __Pyx_memviewslice *__pyx_v_p_dst;
  int *__pyx_v_p_suboffset_dim;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  Py_ssize_t __pyx_v_step;
  int __pyx_v_have_start;
  int __pyx_v_have_stop;
  int __pyx_v_have_step;
  PyObject *__pyx_v_index = NULL;
  struct __pyx_memoryview_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  struct __pyx_memoryview_obj *__pyx_t_2;
  char *__pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memview_slice", 0);

  /* "View.MemoryView":673
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
 *     cdef bint negative_step
 *     cdef __Pyx_memviewslice src, dst
 */
  __pyx_v_new_ndim = 0;
  __pyx_v_suboffset_dim = -1;

  /* "View.MemoryView":680
 * 
 * 
 *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
 * 
 *     cdef _memoryviewslice memviewsliceobj
 */
  memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));

  /* "View.MemoryView":684
 *     cdef _memoryviewslice memviewsliceobj
 * 
 *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_memview->view.ndim > 0))) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "View.MemoryView":686
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); 
  if (__pyx_t_1) {

    /* "View.MemoryView":687
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 */
    if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(((PyObject *)__pyx_v_memview));
    __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview);

    /* "View.MemoryView":688
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, &src)
 */
    __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":690
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
 *         p_src = &src
 * 
 */
    __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));

    /* "View.MemoryView":691
 *     else:
 *         slice_copy(memview, &src)
 *         p_src = &src             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_p_src = (&__pyx_v_src);
  }
  __pyx_L3:;

  /* "View.MemoryView":697
 * 
 * 
 *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
 *     dst.data = p_src.data
 * 
 */
  __pyx_t_2 = __pyx_v_p_src->memview;
  __pyx_v_dst.memview = __pyx_t_2;

  /* "View.MemoryView":698
 * 
 *     dst.memview = p_src.memview
 *     dst.data = p_src.data             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __pyx_v_p_src->data;
  __pyx_v_dst.data = __pyx_t_3;

  /* "View.MemoryView":703
 * 
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
 *     cdef int *p_suboffset_dim = &suboffset_dim
 *     cdef Py_ssize_t start, stop, step
 */
  __pyx_v_p_dst = (&__pyx_v_dst);

  /* "View.MemoryView":704
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst
 *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t start, stop, step
 *     cdef bint have_start, have_stop, have_step
 */
  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);

  /* "View.MemoryView":708
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             slice_memviewslice(
 */
  __pyx_t_4 = 0;
  if (PyList_CheckExact(__pyx_v_indices) || PyTuple_CheckExact(__pyx_v_indices)) {
    __pyx_t_5 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_8 = __pyx_t_7(__pyx_t_5);
      if (unlikely(!__pyx_t_8)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_XDECREF(__pyx_v_index);
    __pyx_v_index = __pyx_t_8;
    __pyx_t_8 = 0;
    __pyx_v_dim = __pyx_t_4;
    __pyx_t_4 = (__pyx_t_4 + 1);

    /* "View.MemoryView":709
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             slice_memviewslice(
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 */
    __pyx_t_9 = __Pyx_PyIndex_Check(__pyx_v_index);
    if (__pyx_t_9) {

      /* "View.MemoryView":713
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 */
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "View.MemoryView":715
 *                 index, 0, 0, # start, stop, step
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)             # <<<<<<<<<<<<<<
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1
 */
      __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }

    /* "View.MemoryView":716
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 */
    __pyx_t_1 = (__pyx_v_index == Py_None);
    if (__pyx_t_1) {

      /* "View.MemoryView":717
 *                 False)
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 */
      (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;

      /* "View.MemoryView":718
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1
 */
      (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;

      /* "View.MemoryView":719
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
 *             new_ndim += 1
 *         else:
 */
      (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1;

      /* "View.MemoryView":720
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 *         else:
 *             start = index.start or 0
 */
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
      goto __pyx_L6;
    }
    /*else*/ {

      /* "View.MemoryView":722
 *             new_ndim += 1
 *         else:
 *             start = index.start or 0             # <<<<<<<<<<<<<<
 *             stop = index.stop or 0
 *             step = index.step or 0
 */
      __pyx_t_8 = PyObject_GetAttr(__pyx_v_index, __pyx_n_s__start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_11 = __pyx_int_0;
      } else {
        __pyx_t_11 = __pyx_t_8;
        __pyx_t_8 = 0;
      }
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_v_start = __pyx_t_10;

      /* "View.MemoryView":723
 *         else:
 *             start = index.start or 0
 *             stop = index.stop or 0             # <<<<<<<<<<<<<<
 *             step = index.step or 0
 * 
 */
      __pyx_t_11 = PyObject_GetAttr(__pyx_v_index, __pyx_n_s__stop); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_8 = __pyx_int_0;
      } else {
        __pyx_t_8 = __pyx_t_11;
        __pyx_t_11 = 0;
      }
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_stop = __pyx_t_10;

      /* "View.MemoryView":724
 *             start = index.start or 0
 *             stop = index.stop or 0
 *             step = index.step or 0             # <<<<<<<<<<<<<<
 * 
 *             have_start = index.start is not None
 */
      __pyx_t_8 = PyObject_GetAttr(__pyx_v_index, __pyx_n_s__step); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_11 = __pyx_int_0;
      } else {
        __pyx_t_11 = __pyx_t_8;
        __pyx_t_8 = 0;
      }
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_v_step = __pyx_t_10;

      /* "View.MemoryView":726
 *             step = index.step or 0
 * 
 *             have_start = index.start is not None             # <<<<<<<<<<<<<<
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None
 */
      __pyx_t_11 = PyObject_GetAttr(__pyx_v_index, __pyx_n_s__start); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_1 = (__pyx_t_11 != Py_None);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_v_have_start = __pyx_t_1;

      /* "View.MemoryView":727
 * 
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
 *             have_step = index.step is not None
 * 
 */
      __pyx_t_11 = PyObject_GetAttr(__pyx_v_index, __pyx_n_s__stop); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_1 = (__pyx_t_11 != Py_None);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_v_have_stop = __pyx_t_1;

      /* "View.MemoryView":728
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None             # <<<<<<<<<<<<<<
 * 
 *             slice_memviewslice(
 */
      __pyx_t_11 = PyObject_GetAttr(__pyx_v_index, __pyx_n_s__step); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_1 = (__pyx_t_11 != Py_None);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_v_have_step = __pyx_t_1;

      /* "View.MemoryView":735
 *                 start, stop, step,
 *                 have_start, have_stop, have_step,
 *                 True)             # <<<<<<<<<<<<<<
 *             new_ndim += 1
 * 
 */
      __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "View.MemoryView":736
 *                 have_start, have_stop, have_step,
 *                 True)
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
 */
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
    }
    __pyx_L6:;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "View.MemoryView":738
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); 
  if (__pyx_t_1) {

    /* "View.MemoryView":739
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));

    /* "View.MemoryView":740
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_dtype_func,
 *                                     memview.dtype_is_object)
 */
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }

    /* "View.MemoryView":742
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
 *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
 */
    __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "View.MemoryView":744
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));

    /* "View.MemoryView":745
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
 *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }
  __pyx_L7:;

  __pyx_r = ((struct __pyx_memoryview_obj *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":769
 * 
 * @cname('__pyx_memoryview_slice_memviewslice')
 * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
 *         __Pyx_memviewslice *dst,
 *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
 */

static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
  Py_ssize_t __pyx_v_new_shape;
  int __pyx_v_negative_step;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":789
 *     cdef bint negative_step
 * 
 *     if not is_slice:             # <<<<<<<<<<<<<<
 * 
 *         if start < 0:
 */
  __pyx_t_1 = (!__pyx_v_is_slice);
  if (__pyx_t_1) {

    /* "View.MemoryView":791
 *     if not is_slice:
 * 
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start += shape
 *         if not 0 <= start < shape:
 */
    __pyx_t_1 = (__pyx_v_start < 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":792
 * 
 *         if start < 0:
 *             start += shape             # <<<<<<<<<<<<<<
 *         if not 0 <= start < shape:
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
 */
      __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "View.MemoryView":793
 *         if start < 0:
 *             start += shape
 *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
 *     else:
 */
    __pyx_t_1 = (0 <= __pyx_v_start);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
    }
    __pyx_t_2 = (!__pyx_t_1);
    if (__pyx_t_2) {

      /* "View.MemoryView":794
 *             start += shape
 *         if not 0 <= start < shape:
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
 *     else:
 * 
 */
      __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_197, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":797
 *     else:
 * 
 *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
 * 
 *         if have_step and step == 0:
 */
    __pyx_t_2 = (__pyx_v_have_step != 0);
    if (__pyx_t_2) {
      __pyx_t_1 = (__pyx_v_step < 0);
      __pyx_t_4 = __pyx_t_1;
    } else {
      __pyx_t_4 = __pyx_t_2;
    }
    __pyx_v_negative_step = __pyx_t_4;

    /* "View.MemoryView":799
 *         negative_step = have_step != 0 and step < 0
 * 
 *         if have_step and step == 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
 * 
 */
    if (__pyx_v_have_step) {
      __pyx_t_4 = (__pyx_v_step == 0);
      __pyx_t_2 = __pyx_t_4;
    } else {
      __pyx_t_2 = __pyx_v_have_step;
    }
    if (__pyx_t_2) {

      /* "View.MemoryView":800
 * 
 *         if have_step and step == 0:
 *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_198, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "View.MemoryView":803
 * 
 * 
 *         if have_start:             # <<<<<<<<<<<<<<
 *             if start < 0:
 *                 start += shape
 */
    if (__pyx_v_have_start) {

      /* "View.MemoryView":804
 * 
 *         if have_start:
 *             if start < 0:             # <<<<<<<<<<<<<<
 *                 start += shape
 *                 if start < 0:
 */
      __pyx_t_2 = (__pyx_v_start < 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":805
 *         if have_start:
 *             if start < 0:
 *                 start += shape             # <<<<<<<<<<<<<<
 *                 if start < 0:
 *                     start = 0
 */
        __pyx_v_start = (__pyx_v_start + __pyx_v_shape);

        /* "View.MemoryView":806
 *             if start < 0:
 *                 start += shape
 *                 if start < 0:             # <<<<<<<<<<<<<<
 *                     start = 0
 *             elif start >= shape:
 */
        __pyx_t_2 = (__pyx_v_start < 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":807
 *                 start += shape
 *                 if start < 0:
 *                     start = 0             # <<<<<<<<<<<<<<
 *             elif start >= shape:
 *                 if negative_step:
 */
          __pyx_v_start = 0;
          goto __pyx_L9;
        }
        __pyx_L9:;
        goto __pyx_L8;
      }

      /* "View.MemoryView":808
 *                 if start < 0:
 *                     start = 0
 *             elif start >= shape:             # <<<<<<<<<<<<<<
 *                 if negative_step:
 *                     start = shape - 1
 */
      __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
      if (__pyx_t_2) {

        /* "View.MemoryView":809
 *                     start = 0
 *             elif start >= shape:
 *                 if negative_step:             # <<<<<<<<<<<<<<
 *                     start = shape - 1
 *                 else:
 */
        if (__pyx_v_negative_step) {

          /* "View.MemoryView":810
 *             elif start >= shape:
 *                 if negative_step:
 *                     start = shape - 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     start = shape
 */
          __pyx_v_start = (__pyx_v_shape - 1);
          goto __pyx_L10;
        }
        /*else*/ {

          /* "View.MemoryView":812
 *                     start = shape - 1
 *                 else:
 *                     start = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
          __pyx_v_start = __pyx_v_shape;
        }
        __pyx_L10:;
        goto __pyx_L8;
      }
      __pyx_L8:;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "View.MemoryView":814
 *                     start = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 start = shape - 1
 *             else:
 */
      if (__pyx_v_negative_step) {

        /* "View.MemoryView":815
 *         else:
 *             if negative_step:
 *                 start = shape - 1             # <<<<<<<<<<<<<<
 *             else:
 *                 start = 0
 */
        __pyx_v_start = (__pyx_v_shape - 1);
        goto __pyx_L11;
      }
      /*else*/ {

        /* "View.MemoryView":817
 *                 start = shape - 1
 *             else:
 *                 start = 0             # <<<<<<<<<<<<<<
 * 
 *         if have_stop:
 */
        __pyx_v_start = 0;
      }
      __pyx_L11:;
    }
    __pyx_L7:;

    /* "View.MemoryView":819
 *                 start = 0
 * 
 *         if have_stop:             # <<<<<<<<<<<<<<
 *             if stop < 0:
 *                 stop += shape
 */
    if (__pyx_v_have_stop) {

      /* "View.MemoryView":820
 * 
 *         if have_stop:
 *             if stop < 0:             # <<<<<<<<<<<<<<
 *                 stop += shape
 *                 if stop < 0:
 */
      __pyx_t_2 = (__pyx_v_stop < 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":821
 *         if have_stop:
 *             if stop < 0:
 *                 stop += shape             # <<<<<<<<<<<<<<
 *                 if stop < 0:
 *                     stop = 0
 */
        __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);

        /* "View.MemoryView":822
 *             if stop < 0:
 *                 stop += shape
 *                 if stop < 0:             # <<<<<<<<<<<<<<
 *                     stop = 0
 *             elif stop > shape:
 */
        __pyx_t_2 = (__pyx_v_stop < 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":823
 *                 stop += shape
 *                 if stop < 0:
 *                     stop = 0             # <<<<<<<<<<<<<<
 *             elif stop > shape:
 *                 stop = shape
 */
          __pyx_v_stop = 0;
          goto __pyx_L14;
        }
        __pyx_L14:;
        goto __pyx_L13;
      }

      /* "View.MemoryView":824
 *                 if stop < 0:
 *                     stop = 0
 *             elif stop > shape:             # <<<<<<<<<<<<<<
 *                 stop = shape
 *         else:
 */
      __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
      if (__pyx_t_2) {

        /* "View.MemoryView":825
 *                     stop = 0
 *             elif stop > shape:
 *                 stop = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
        __pyx_v_stop = __pyx_v_shape;
        goto __pyx_L13;
      }
      __pyx_L13:;
      goto __pyx_L12;
    }
    /*else*/ {

      /* "View.MemoryView":827
 *                 stop = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 stop = -1
 *             else:
 */
      if (__pyx_v_negative_step) {

        /* "View.MemoryView":828
 *         else:
 *             if negative_step:
 *                 stop = -1             # <<<<<<<<<<<<<<
 *             else:
 *                 stop = shape
 */
        __pyx_v_stop = -1;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "View.MemoryView":830
 *                 stop = -1
 *             else:
 *                 stop = shape             # <<<<<<<<<<<<<<
 * 
 *         if not have_step:
 */
        __pyx_v_stop = __pyx_v_shape;
      }
      __pyx_L15:;
    }
    __pyx_L12:;

    /* "View.MemoryView":832
 *                 stop = shape
 * 
 *         if not have_step:             # <<<<<<<<<<<<<<
 *             step = 1
 * 
 */
    __pyx_t_2 = (!__pyx_v_have_step);
    if (__pyx_t_2) {

      /* "View.MemoryView":833
 * 
 *         if not have_step:
 *             step = 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_step = 1;
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "View.MemoryView":837
 * 
 *         with cython.cdivision(True):
 *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
 * 
 *             if (stop - start) - step * new_shape:
 */
    __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);

    /* "View.MemoryView":839
 *             new_shape = (stop - start) // step
 * 
 *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
 *                 new_shape += 1
 * 
 */
    __pyx_t_5 = ((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape));
    if (__pyx_t_5) {

      /* "View.MemoryView":840
 * 
 *             if (stop - start) - step * new_shape:
 *                 new_shape += 1             # <<<<<<<<<<<<<<
 * 
 *         if new_shape < 0:
 */
      __pyx_v_new_shape = (__pyx_v_new_shape + 1);
      goto __pyx_L17;
    }
    __pyx_L17:;

    /* "View.MemoryView":842
 *                 new_shape += 1
 * 
 *         if new_shape < 0:             # <<<<<<<<<<<<<<
 *             new_shape = 0
 * 
 */
    __pyx_t_2 = (__pyx_v_new_shape < 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":843
 * 
 *         if new_shape < 0:
 *             new_shape = 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_new_shape = 0;
      goto __pyx_L18;
    }
    __pyx_L18:;

    /* "View.MemoryView":846
 * 
 * 
 *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset
 */
    (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);

    /* "View.MemoryView":847
 * 
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
 *         dst.suboffsets[new_ndim] = suboffset
 * 
 */
    (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;

    /* "View.MemoryView":848
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
  }
  __pyx_L3:;

  /* "View.MemoryView":851
 * 
 * 
 *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
 *         dst.data += start * stride
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":852
 * 
 *     if suboffset_dim[0] < 0:
 *         dst.data += start * stride             # <<<<<<<<<<<<<<
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 */
    __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
    goto __pyx_L19;
  }
  /*else*/ {

    /* "View.MemoryView":854
 *         dst.data += start * stride
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
 * 
 *     if suboffset >= 0:
 */
    __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
    (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
  }
  __pyx_L19:;

  /* "View.MemoryView":856
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 * 
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         if not is_slice:
 *             if new_ndim == 0:
 */
  __pyx_t_2 = (__pyx_v_suboffset >= 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":857
 * 
 *     if suboffset >= 0:
 *         if not is_slice:             # <<<<<<<<<<<<<<
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 */
    __pyx_t_2 = (!__pyx_v_is_slice);
    if (__pyx_t_2) {

      /* "View.MemoryView":858
 *     if suboffset >= 0:
 *         if not is_slice:
 *             if new_ndim == 0:             # <<<<<<<<<<<<<<
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 */
      __pyx_t_2 = (__pyx_v_new_ndim == 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":859
 *         if not is_slice:
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
 */
        __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
        goto __pyx_L22;
      }
      /*else*/ {

        /* "View.MemoryView":862
 *             else:
 *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
 *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
 *         else:
 *             suboffset_dim[0] = new_ndim
 */
        __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_199, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L22:;
      goto __pyx_L21;
    }
    /*else*/ {

      /* "View.MemoryView":864
 *                                      "must be indexed and not sliced", dim)
 *         else:
 *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
 * 
 *     return 0
 */
      (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
    }
    __pyx_L21:;
    goto __pyx_L20;
  }
  __pyx_L20:;

  /* "View.MemoryView":866
 *             suboffset_dim[0] = new_ndim
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":872
 * 
 * @cname('__pyx_pybuffer_index')
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                           int dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 */

static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, int __pyx_v_dim) {
  Py_ssize_t __pyx_v_shape;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_suboffset;
  Py_ssize_t __pyx_v_itemsize;
  char *__pyx_v_resultp;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pybuffer_index", 0);

  /* "View.MemoryView":874
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           int dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t itemsize = view.itemsize
 *     cdef char *resultp
 */
  __pyx_v_suboffset = -1;

  /* "View.MemoryView":875
 *                           int dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
 *     cdef char *resultp
 * 
 */
  __pyx_t_1 = __pyx_v_view->itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":878
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len / itemsize
 *         stride = itemsize
 */
  __pyx_t_2 = (__pyx_v_view->ndim == 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":879
 * 
 *     if view.ndim == 0:
 *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
 *         stride = itemsize
 *     else:
 */
    if (unlikely(__pyx_v_itemsize == 0)) {
      PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
      PyErr_Format(PyExc_OverflowError, "value too large to perform division");
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);

    /* "View.MemoryView":880
 *     if view.ndim == 0:
 *         shape = view.len / itemsize
 *         stride = itemsize             # <<<<<<<<<<<<<<
 *     else:
 *         shape = view.shape[dim]
 */
    __pyx_v_stride = __pyx_v_itemsize;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":882
 *         stride = itemsize
 *     else:
 *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 */
    __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);

    /* "View.MemoryView":883
 *     else:
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]
 */
    __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);

    /* "View.MemoryView":884
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
 */
    __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
    if (__pyx_t_2) {

      /* "View.MemoryView":885
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
 * 
 *     if index < 0:
 */
      __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
      goto __pyx_L4;
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "View.MemoryView":887
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
 */
  __pyx_t_2 = (__pyx_v_index < 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":888
 * 
 *     if index < 0:
 *         index += view.shape[dim]             # <<<<<<<<<<<<<<
 *         if index < 0:
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 */
    __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));

    /* "View.MemoryView":889
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
    __pyx_t_2 = (__pyx_v_index < 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":890
 *         index += view.shape[dim]
 *         if index < 0:
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
 * 
 *     if index >= shape:
 */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_200), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "View.MemoryView":892
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
  __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
  if (__pyx_t_2) {

    /* "View.MemoryView":893
 * 
 *     if index >= shape:
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
 * 
 *     resultp = bufp + index * stride
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_200), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "View.MemoryView":895
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset
 */
  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));

  /* "View.MemoryView":896
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 */
  __pyx_t_2 = (__pyx_v_suboffset >= 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":897
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
 * 
 *     return resultp
 */
    __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "View.MemoryView":899
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 *     return resultp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_resultp;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":905
 * 
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 */

static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
  int __pyx_v_ndim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  long __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":906
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
 *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 */
  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
  __pyx_v_ndim = __pyx_t_1;

  /* "View.MemoryView":908
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t *strides = memslice.strides
 * 
 */
  __pyx_t_2 = __pyx_v_memslice->shape;
  __pyx_v_shape = __pyx_t_2;

  /* "View.MemoryView":909
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_v_memslice->strides;
  __pyx_v_strides = __pyx_t_2;

  /* "View.MemoryView":913
 * 
 *     cdef int i, j
 *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 */
  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":914
 *     cdef int i, j
 *     for i in range(ndim / 2):
 *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]
 */
    __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);

    /* "View.MemoryView":915
 *     for i in range(ndim / 2):
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 */
    __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]);
    __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]);
    (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
    (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;

    /* "View.MemoryView":916
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 */
    __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]);
    __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]);
    (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
    (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;

    /* "View.MemoryView":918
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 */
    __pyx_t_6 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
    if (!__pyx_t_6) {
      __pyx_t_7 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
      __pyx_t_8 = __pyx_t_7;
    } else {
      __pyx_t_8 = __pyx_t_6;
    }
    if (__pyx_t_8) {

      /* "View.MemoryView":919
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
 * 
 *     return 1
 */
      __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_201); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }

  /* "View.MemoryView":921
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 *     return 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 1;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":938
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 */

static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":939
 * 
 *     def __dealloc__(self):
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 */
  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);

  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":941
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
 */

static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":942
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":943
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":945
 *             return self.to_object_func(itemp)
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_vtabptr_memoryview->convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":947
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
 */

static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":948
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":949
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)
 */
    __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":951
 *             self.to_dtype_func(itemp, value)
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     property base:
 */
    __pyx_t_3 = __pyx_vtabptr_memoryview->assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":955
 *     property base:
 *         @cname('__pyx_memoryviewslice__get__base')
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.from_object
 * 
 */

static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":956
 *         @cname('__pyx_memoryviewslice__get__base')
 *         def __get__(self):
 *             return self.from_object             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->from_object);
  __pyx_r = __pyx_v_self->from_object;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":962
 * 
 * @cname('__pyx_memoryview_fromslice')
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
 *                           int ndim,
 *                           object (*to_object_func)(char *),
 */

static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_TypeInfo *__pyx_t_4;
  Py_buffer __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);

  /* "View.MemoryView":971
 *     cdef int i
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":972
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":977
 * 
 * 
 *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     result.from_slice = memviewslice
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":979
 *     result = _memoryviewslice(None, 0, dtype_is_object)
 * 
 *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 */
  __pyx_v_result->from_slice = __pyx_v_memviewslice;

  /* "View.MemoryView":980
 * 
 *     result.from_slice = memviewslice
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base
 */
  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);

  /* "View.MemoryView":982
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s__base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->from_object);
  __Pyx_DECREF(__pyx_v_result->from_object);
  __pyx_v_result->from_object = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":983
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base
 *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
 * 
 *     result.view = memviewslice.memview.view
 */
  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;

  /* "View.MemoryView":985
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 */
  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
  __pyx_v_result->__pyx_base.view = __pyx_t_5;

  /* "View.MemoryView":986
 * 
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 */
  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);

  /* "View.MemoryView":987
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)
 */
  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;

  /* "View.MemoryView":988
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
 *     Py_INCREF(Py_None)
 * 
 */
  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;

  /* "View.MemoryView":989
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     result.flags = PyBUF_RECORDS
 */
  Py_INCREF(Py_None);

  /* "View.MemoryView":991
 *     Py_INCREF(Py_None)
 * 
 *     result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 */
  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;

  /* "View.MemoryView":993
 *     result.flags = PyBUF_RECORDS
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
 *     result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 */
  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);

  /* "View.MemoryView":994
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
 *     result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 * 
 */
  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);

  /* "View.MemoryView":995
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
 *     result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
 * 
 *     result.view.len = result.view.itemsize
 */
  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);

  /* "View.MemoryView":997
 *     result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 * 
 *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
 *     for i in range(ndim):
 *         result.view.len *= result.view.shape[i]
 */
  __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
  __pyx_v_result->__pyx_base.view.len = __pyx_t_6;

  /* "View.MemoryView":998
 * 
 *     result.view.len = result.view.itemsize
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         result.view.len *= result.view.shape[i]
 * 
 */
  __pyx_t_7 = __pyx_v_ndim;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "View.MemoryView":999
 *     result.view.len = result.view.itemsize
 *     for i in range(ndim):
 *         result.view.len *= result.view.shape[i]             # <<<<<<<<<<<<<<
 * 
 *     result.to_object_func = to_object_func
 */
    __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * (__pyx_v_result->__pyx_base.view.shape[__pyx_v_i]));
  }

  /* "View.MemoryView":1001
 *         result.view.len *= result.view.shape[i]
 * 
 *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
 *     result.to_dtype_func = to_dtype_func
 * 
 */
  __pyx_v_result->to_object_func = __pyx_v_to_object_func;

  /* "View.MemoryView":1002
 * 
 *     result.to_object_func = to_object_func
 *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;

  /* "View.MemoryView":1004
 *     result.to_dtype_func = to_dtype_func
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1007
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
 *                                                    __Pyx_memviewslice *mslice):
 *     cdef _memoryviewslice obj
 */

static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
  __Pyx_memviewslice *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);

  /* "View.MemoryView":1010
 *                                                    __Pyx_memviewslice *mslice):
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); 
  if (__pyx_t_1) {

    /* "View.MemoryView":1011
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview             # <<<<<<<<<<<<<<
 *         return &obj.from_slice
 *     else:
 */
    if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(((PyObject *)__pyx_v_memview));
    __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview);

    /* "View.MemoryView":1012
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview
 *         return &obj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, mslice)
 */
    __pyx_r = (&__pyx_v_obj->from_slice);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":1014
 *         return &obj.from_slice
 *     else:
 *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
 *         return mslice
 * 
 */
    __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);

    /* "View.MemoryView":1015
 *     else:
 *         slice_copy(memview, mslice)
 *         return mslice             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_slice_copy')
 */
    __pyx_r = __pyx_v_mslice;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1018
 * 
 * @cname('__pyx_memoryview_slice_copy')
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
 *     cdef int dim
 *     cdef Py_ssize_t *shape, *strides, *suboffsets
 */

static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
  int __pyx_v_dim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  Py_ssize_t *__pyx_v_suboffsets;
  __Pyx_RefNannyDeclarations
  Py_ssize_t *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("slice_copy", 0);

  /* "View.MemoryView":1022
 *     cdef Py_ssize_t *shape, *strides, *suboffsets
 * 
 *     shape = memview.view.shape             # <<<<<<<<<<<<<<
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets
 */
  __pyx_t_1 = __pyx_v_memview->view.shape;
  __pyx_v_shape = __pyx_t_1;

  /* "View.MemoryView":1023
 * 
 *     shape = memview.view.shape
 *     strides = memview.view.strides             # <<<<<<<<<<<<<<
 *     suboffsets = memview.view.suboffsets
 * 
 */
  __pyx_t_1 = __pyx_v_memview->view.strides;
  __pyx_v_strides = __pyx_t_1;

  /* "View.MemoryView":1024
 *     shape = memview.view.shape
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 */
  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
  __pyx_v_suboffsets = __pyx_t_1;

  /* "View.MemoryView":1026
 *     suboffsets = memview.view.suboffsets
 * 
 *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
 *     dst.data = <char *> memview.view.buf
 * 
 */
  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);

  /* "View.MemoryView":1027
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
 * 
 *     for dim in range(memview.view.ndim):
 */
  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);

  /* "View.MemoryView":1029
 *     dst.data = <char *> memview.view.buf
 * 
 *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 */
  __pyx_t_2 = __pyx_v_memview->view.ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_dim = __pyx_t_3;

    /* "View.MemoryView":1030
 * 
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
 *         dst.strides[dim] = strides[dim]
 *         if suboffsets == NULL:
 */
    (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);

    /* "View.MemoryView":1031
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
 *         if suboffsets == NULL:
 *             dst.suboffsets[dim] = -1
 */
    (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);

    /* "View.MemoryView":1032
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 *         if suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             dst.suboffsets[dim] = -1
 *         else:
 */
    __pyx_t_4 = (__pyx_v_suboffsets == NULL);
    if (__pyx_t_4) {

      /* "View.MemoryView":1033
 *         dst.strides[dim] = strides[dim]
 *         if suboffsets == NULL:
 *             dst.suboffsets[dim] = -1             # <<<<<<<<<<<<<<
 *         else:
 *             dst.suboffsets[dim] = suboffsets[dim]
 */
      (__pyx_v_dst->suboffsets[__pyx_v_dim]) = -1;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "View.MemoryView":1035
 *             dst.suboffsets[dim] = -1
 *         else:
 *             dst.suboffsets[dim] = suboffsets[dim]             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object')
 */
      (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
    }
    __pyx_L5:;
  }

  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":1038
 * 
 * @cname('__pyx_memoryview_copy_object')
 * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 */

static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
  __Pyx_memviewslice __pyx_v_memviewslice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_copy", 0);

  /* "View.MemoryView":1041
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
 */
  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));

  /* "View.MemoryView":1042
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)
 *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1045
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
 *     """
 *     Create a new memoryview object from a given memoryview object and slice.
 */

static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
  PyObject *(*__pyx_v_to_object_func)(char *);
  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *(*__pyx_t_2)(char *);
  int (*__pyx_t_3)(char *, PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);

  /* "View.MemoryView":1052
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type)); 
  if (__pyx_t_1) {

    /* "View.MemoryView":1053
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 */
    __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
    __pyx_v_to_object_func = __pyx_t_2;

    /* "View.MemoryView":1054
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
 *     else:
 *         to_object_func = NULL
 */
    __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
    __pyx_v_to_dtype_func = __pyx_t_3;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":1056
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 *         to_object_func = NULL             # <<<<<<<<<<<<<<
 *         to_dtype_func = NULL
 * 
 */
    __pyx_v_to_object_func = NULL;

    /* "View.MemoryView":1057
 *     else:
 *         to_object_func = NULL
 *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 */
    __pyx_v_to_dtype_func = NULL;
  }
  __pyx_L3:;

  /* "View.MemoryView":1059
 *         to_dtype_func = NULL
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "View.MemoryView":1061
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1067
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
 *     if arg < 0:
 *         return -arg
 */

static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
  Py_ssize_t __pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":1068
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
 *     if arg < 0:             # <<<<<<<<<<<<<<
 *         return -arg
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arg < 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1069
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
 *     if arg < 0:
 *         return -arg             # <<<<<<<<<<<<<<
 *     else:
 *         return arg
 */
    __pyx_r = (-__pyx_v_arg);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":1071
 *         return -arg
 *     else:
 *         return arg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_get_best_slice_order')
 */
    __pyx_r = __pyx_v_arg;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1074
 * 
 * @cname('__pyx_get_best_slice_order')
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Figure out the best memory access order for a given slice.
 */

static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_c_stride;
  Py_ssize_t __pyx_v_f_stride;
  char __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1079
 *     """
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t f_stride = 0
 * 
 */
  __pyx_v_c_stride = 0;

  /* "View.MemoryView":1080
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0
 *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
 */
  __pyx_v_f_stride = 0;

  /* "View.MemoryView":1082
 *     cdef Py_ssize_t f_stride = 0
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 */
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1083
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
 */
    __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1084
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1085
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
      goto __pyx_L4_break;
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __pyx_L4_break:;

  /* "View.MemoryView":1087
 *             break
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 */
  __pyx_t_1 = __pyx_v_ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1088
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
 */
    __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1089
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1090
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 */
      goto __pyx_L7_break;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L7_break:;

  /* "View.MemoryView":1092
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
 */
  __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
  if (__pyx_t_2) {

    /* "View.MemoryView":1093
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 *         return 'C'             # <<<<<<<<<<<<<<
 *     else:
 *         return 'F'
 */
    __pyx_r = 'C';
    goto __pyx_L0;
    goto __pyx_L9;
  }
  /*else*/ {

    /* "View.MemoryView":1095
 *         return 'C'
 *     else:
 *         return 'F'             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
    __pyx_r = 'F';
    goto __pyx_L0;
  }
  __pyx_L9:;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1098
 * 
 * @cython.cdivision(True)
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
 *                                    char *dst_data, Py_ssize_t *dst_strides,
 *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
 */

static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
  Py_ssize_t __pyx_v_dst_extent;
  Py_ssize_t __pyx_v_src_stride;
  Py_ssize_t __pyx_v_dst_stride;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;

  /* "View.MemoryView":1105
 * 
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 */
  __pyx_v_src_extent = (__pyx_v_src_shape[0]);

  /* "View.MemoryView":1106
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 */
  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);

  /* "View.MemoryView":1107
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 */
  __pyx_v_src_stride = (__pyx_v_src_strides[0]);

  /* "View.MemoryView":1108
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
 */
  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);

  /* "View.MemoryView":1110
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 */
  __pyx_t_1 = (__pyx_v_ndim == 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":1111
 * 
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 */
    __pyx_t_1 = (__pyx_v_src_stride > 0);
    if (__pyx_t_1) {
      __pyx_t_2 = (__pyx_v_dst_stride > 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":1112
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 *        else:
 */
        __pyx_t_3 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
        if (__pyx_t_3) {
          __pyx_t_3 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
        }
        __pyx_t_4 = __pyx_t_3;
      } else {
        __pyx_t_4 = __pyx_t_2;
      }
      __pyx_t_2 = __pyx_t_4;
    } else {
      __pyx_t_2 = __pyx_t_1;
    }
    if (__pyx_t_2) {

      /* "View.MemoryView":1113
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
 *        else:
 *            for i in range(dst_extent):
 */
      memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
      goto __pyx_L4;
    }
    /*else*/ {

      /* "View.MemoryView":1115
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 *        else:
 *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride
 */
      __pyx_t_5 = __pyx_v_dst_extent;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "View.MemoryView":1116
 *        else:
 *            for i in range(dst_extent):
 *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
 *                src_data += src_stride
 *                dst_data += dst_stride
 */
        memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);

        /* "View.MemoryView":1117
 *            for i in range(dst_extent):
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride             # <<<<<<<<<<<<<<
 *                dst_data += dst_stride
 *     else:
 */
        __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

        /* "View.MemoryView":1118
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride
 *                dst_data += dst_stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(dst_extent):
 */
        __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
      }
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":1120
 *                dst_data += dst_stride
 *     else:
 *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *             _copy_strided_to_strided(src_data, src_strides + 1,
 *                                      dst_data, dst_strides + 1,
 */
    __pyx_t_5 = __pyx_v_dst_extent;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "View.MemoryView":1124
 *                                      dst_data, dst_strides + 1,
 *                                      src_shape + 1, dst_shape + 1,
 *                                      ndim - 1, itemsize)             # <<<<<<<<<<<<<<
 *             src_data += src_stride
 *             dst_data += dst_stride
 */
      _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);

      /* "View.MemoryView":1125
 *                                      src_shape + 1, dst_shape + 1,
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride             # <<<<<<<<<<<<<<
 *             dst_data += dst_stride
 * 
 */
      __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

      /* "View.MemoryView":1126
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride
 *             dst_data += dst_stride             # <<<<<<<<<<<<<<
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
 */
      __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
    }
  }
  __pyx_L3:;

}

/* "View.MemoryView":1128
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) nogil:
 */

static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {

  /* "View.MemoryView":1132
 *                                   int ndim, size_t itemsize) nogil:
 *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,
 *                              src.shape, dst.shape, ndim, itemsize)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_slice_get_size')
 */
  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);

}

/* "View.MemoryView":1135
 * 
 * @cname('__pyx_memoryview_slice_get_size')
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef int i
 */

static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_size;
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1138
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef int i
 *     cdef Py_ssize_t size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_size = __pyx_t_1;

  /* "View.MemoryView":1140
 *     cdef Py_ssize_t size = src.memview.view.itemsize
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         size *= src.shape[i]
 * 
 */
  __pyx_t_2 = __pyx_v_ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1141
 * 
 *     for i in range(ndim):
 *         size *= src.shape[i]             # <<<<<<<<<<<<<<
 * 
 *     return size
 */
    __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
  }

  /* "View.MemoryView":1143
 *         size *= src.shape[i]
 * 
 *     return size             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_fill_contig_strides_array')
 */
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1146
 * 
 * @cname('__pyx_fill_contig_strides_array')
 * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
 *                 int ndim, char order) nogil:
 */

static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1155
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
 */
  __pyx_t_1 = (__pyx_v_order == 'F');
  if (__pyx_t_1) {

    /* "View.MemoryView":1156
 * 
 *     if order == 'F':
 *         for idx in range(ndim):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride = stride * shape[idx]
 */
    __pyx_t_2 = __pyx_v_ndim;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_idx = __pyx_t_3;

      /* "View.MemoryView":1157
 *     if order == 'F':
 *         for idx in range(ndim):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride = stride * shape[idx]
 *     else:
 */
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1158
 *         for idx in range(ndim):
 *             strides[idx] = stride
 *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 */
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":1160
 *             stride = stride * shape[idx]
 *     else:
 *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride = stride * shape[idx]
 */
    for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
      __pyx_v_idx = __pyx_t_2;

      /* "View.MemoryView":1161
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride = stride * shape[idx]
 * 
 */
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1162
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride
 *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
 * 
 *     return stride
 */
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1164
 *             stride = stride * shape[idx]
 * 
 *     return stride             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 */
  __pyx_r = __pyx_v_stride;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1167
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                              __Pyx_memviewslice *tmpslice,
 *                              char order,
 */

static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
  int __pyx_v_i;
  void *__pyx_v_result;
  size_t __pyx_v_itemsize;
  size_t __pyx_v_size;
  void *__pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_memoryview_obj *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":1178
 *     cdef void *result
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 */
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1179
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
 * 
 *     result = malloc(size)
 */
  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);

  /* "View.MemoryView":1181
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 *     result = malloc(size)             # <<<<<<<<<<<<<<
 *     if not result:
 *         _err(MemoryError, NULL)
 */
  __pyx_v_result = malloc(__pyx_v_size);

  /* "View.MemoryView":1182
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err(MemoryError, NULL)
 * 
 */
  __pyx_t_2 = (!(__pyx_v_result != 0));
  if (__pyx_t_2) {

    /* "View.MemoryView":1183
 *     result = malloc(size)
 *     if not result:
 *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":1186
 * 
 * 
 *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 */
  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);

  /* "View.MemoryView":1187
 * 
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 */
  __pyx_t_4 = __pyx_v_src->memview;
  __pyx_v_tmpslice->memview = __pyx_t_4;

  /* "View.MemoryView":1188
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1
 */
  __pyx_t_3 = __pyx_v_ndim;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "View.MemoryView":1189
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
 *         tmpslice.suboffsets[i] = -1
 * 
 */
    (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);

    /* "View.MemoryView":1190
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
 */
    (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1;
  }

  /* "View.MemoryView":1193
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
 *                               ndim, order)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order);

  /* "View.MemoryView":1196
 * 
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0
 */
  __pyx_t_3 = __pyx_v_ndim;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "View.MemoryView":1197
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
 */
    __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1198
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
 * 
 *     if slice_is_contig(src, order, ndim):
 */
      (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "View.MemoryView":1200
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
 */
  __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1201
 * 
 *     if slice_is_contig(src, order, ndim):
 *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 */
    memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size);
    goto __pyx_L9;
  }
  /*else*/ {

    /* "View.MemoryView":1203
 *         memcpy(result, src.data, size)
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
  }
  __pyx_L9:;

  /* "View.MemoryView":1205
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1210
 * 
 * @cname('__pyx_memoryview_err_extents')
 * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
 */

static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err_extents", 0);

  /* "View.MemoryView":1213
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
 *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err_dim')
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_202), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1216
 * 
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise error(msg.decode('ascii') % dim)
 * 
 */

static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err_dim", 0);
  __Pyx_INCREF(__pyx_v_error);

  /* "View.MemoryView":1217
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
 *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err')
 */
  __pyx_t_1 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_t_1), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_v_error, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1220
 * 
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))
 */

static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err", 0);
  __Pyx_INCREF(__pyx_v_error);

  /* "View.MemoryView":1221
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:
 *     if msg != NULL:             # <<<<<<<<<<<<<<
 *         raise error(msg.decode('ascii'))
 *     else:
 */
  __pyx_t_1 = (__pyx_v_msg != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":1222
 * cdef int _err(object error, char *msg) except -1 with gil:
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
 *     else:
 *         raise error
 */
    __pyx_t_2 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_v_error, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":1224
 *         raise error(msg.decode('ascii'))
 *     else:
 *         raise error             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_contents')
 */
    __Pyx_Raise(__pyx_v_error, 0, 0, 0);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1227
 * 
 * @cname('__pyx_memoryview_copy_contents')
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice dst,
 *                                   int src_ndim, int dst_ndim,
 */

static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
  void *__pyx_v_tmpdata;
  size_t __pyx_v_itemsize;
  int __pyx_v_i;
  char __pyx_v_order;
  int __pyx_v_broadcasting;
  int __pyx_v_direct_copy;
  __Pyx_memviewslice __pyx_v_tmp;
  int __pyx_v_ndim;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  void *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":1235
 *     Check for overlapping memory and verify the shapes.
 *     """
 *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 */
  __pyx_v_tmpdata = NULL;

  /* "View.MemoryView":1236
 *     """
 *     cdef void *tmpdata = NULL
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 */
  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1238
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False
 */
  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);

  /* "View.MemoryView":1239
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
 *     cdef bint direct_copy = False
 *     cdef __Pyx_memviewslice tmp
 */
  __pyx_v_broadcasting = 0;

  /* "View.MemoryView":1240
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
 *     cdef __Pyx_memviewslice tmp
 * 
 */
  __pyx_v_direct_copy = 0;

  /* "View.MemoryView":1243
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 */
  __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1244
 * 
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 */
    __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
    goto __pyx_L3;
  }

  /* "View.MemoryView":1245
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 */
  __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1246
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)
 */
    __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "View.MemoryView":1248
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
  __pyx_t_3 = __pyx_v_dst_ndim;
  __pyx_t_4 = __pyx_v_src_ndim;
  if ((__pyx_t_3 > __pyx_t_4)) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  __pyx_v_ndim = __pyx_t_5;

  /* "View.MemoryView":1250
 *     cdef int ndim = max(src_ndim, dst_ndim)
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 */
  __pyx_t_5 = __pyx_v_ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1251
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 */
    __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
    if (__pyx_t_2) {

      /* "View.MemoryView":1252
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
 */
      __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
      if (__pyx_t_2) {

        /* "View.MemoryView":1253
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 *                 broadcasting = True             # <<<<<<<<<<<<<<
 *                 src.strides[i] = 0
 *             else:
 */
        __pyx_v_broadcasting = 1;

        /* "View.MemoryView":1254
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 */
        (__pyx_v_src.strides[__pyx_v_i]) = 0;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "View.MemoryView":1256
 *                 src.strides[i] = 0
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
 * 
 *         if src.suboffsets[i] >= 0:
 */
        __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L7:;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "View.MemoryView":1258
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 */
    __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1259
 * 
 *         if src.suboffsets[i] >= 0:
 *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 */
      __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_203, __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "View.MemoryView":1261
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(&src, order, ndim):
 */
  __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
  if (__pyx_t_2) {

    /* "View.MemoryView":1263
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(&src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
 */
    __pyx_t_2 = (!__pyx_memviewslice_is_contig((&__pyx_v_src), __pyx_v_order, __pyx_v_ndim));
    if (__pyx_t_2) {

      /* "View.MemoryView":1264
 * 
 *         if not slice_is_contig(&src, order, ndim):
 *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 */
      __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "View.MemoryView":1266
 *             order = get_best_order(&dst, ndim)
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
 *         src = tmp
 * 
 */
    __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_tmpdata = __pyx_t_6;

    /* "View.MemoryView":1267
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 *         src = tmp             # <<<<<<<<<<<<<<
 * 
 *     if not broadcasting:
 */
    __pyx_v_src = __pyx_v_tmp;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "View.MemoryView":1269
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (!__pyx_v_broadcasting);
  if (__pyx_t_2) {

    /* "View.MemoryView":1272
 * 
 * 
 *         if slice_is_contig(&src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(&dst, 'C', ndim)
 *         elif slice_is_contig(&src, 'F', ndim):
 */
    __pyx_t_2 = __pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim);
    if (__pyx_t_2) {

      /* "View.MemoryView":1273
 * 
 *         if slice_is_contig(&src, 'C', ndim):
 *             direct_copy = slice_is_contig(&dst, 'C', ndim)             # <<<<<<<<<<<<<<
 *         elif slice_is_contig(&src, 'F', ndim):
 *             direct_copy = slice_is_contig(&dst, 'F', ndim)
 */
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim);
      goto __pyx_L12;
    }

    /* "View.MemoryView":1274
 *         if slice_is_contig(&src, 'C', ndim):
 *             direct_copy = slice_is_contig(&dst, 'C', ndim)
 *         elif slice_is_contig(&src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(&dst, 'F', ndim)
 * 
 */
    __pyx_t_2 = __pyx_memviewslice_is_contig((&__pyx_v_src), 'F', __pyx_v_ndim);
    if (__pyx_t_2) {

      /* "View.MemoryView":1275
 *             direct_copy = slice_is_contig(&dst, 'C', ndim)
 *         elif slice_is_contig(&src, 'F', ndim):
 *             direct_copy = slice_is_contig(&dst, 'F', ndim)             # <<<<<<<<<<<<<<
 * 
 *         if direct_copy:
 */
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'F', __pyx_v_ndim);
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "View.MemoryView":1277
 *             direct_copy = slice_is_contig(&dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 */
    if (__pyx_v_direct_copy) {

      /* "View.MemoryView":1279
 *         if direct_copy:
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 */
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

      /* "View.MemoryView":1280
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 *             return 0
 */
      memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));

      /* "View.MemoryView":1281
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

      /* "View.MemoryView":1282
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):
 */
      __pyx_r = 0;
      goto __pyx_L0;
      goto __pyx_L13;
    }
    __pyx_L13:;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "View.MemoryView":1284
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (__pyx_v_order == 'F');
  if (__pyx_t_2) {
    __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
  }
  if (__pyx_t_2) {

    /* "View.MemoryView":1287
 * 
 * 
 *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&dst)
 * 
 */
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "View.MemoryView":1288
 * 
 *         transpose_memslice(&src)
 *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 */
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "View.MemoryView":1290
 *         transpose_memslice(&dst)
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 */
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1291
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 * 
 */
  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1292
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 * 
 *     free(tmpdata)
 */
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1294
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 * 
 *     free(tmpdata)             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  free(__pyx_v_tmpdata);

  /* "View.MemoryView":1295
 * 
 *     free(tmpdata)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1298
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 * cdef void broadcast_leading(__Pyx_memviewslice *slice,             # <<<<<<<<<<<<<<
 *                             int ndim,
 *                             int ndim_other) nogil:
 */

static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
  int __pyx_v_i;
  int __pyx_v_offset;
  int __pyx_t_1;
  int __pyx_t_2;

  /* "View.MemoryView":1302
 *                             int ndim_other) nogil:
 *     cdef int i
 *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
 */
  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);

  /* "View.MemoryView":1304
 *     cdef int offset = ndim_other - ndim
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         slice.shape[i + offset] = slice.shape[i]
 *         slice.strides[i + offset] = slice.strides[i]
 */
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1305
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         slice.shape[i + offset] = slice.shape[i]             # <<<<<<<<<<<<<<
 *         slice.strides[i + offset] = slice.strides[i]
 *         slice.suboffsets[i + offset] = slice.suboffsets[i]
 */
    (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);

    /* "View.MemoryView":1306
 *     for i in range(ndim - 1, -1, -1):
 *         slice.shape[i + offset] = slice.shape[i]
 *         slice.strides[i + offset] = slice.strides[i]             # <<<<<<<<<<<<<<
 *         slice.suboffsets[i + offset] = slice.suboffsets[i]
 * 
 */
    (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);

    /* "View.MemoryView":1307
 *         slice.shape[i + offset] = slice.shape[i]
 *         slice.strides[i + offset] = slice.strides[i]
 *         slice.suboffsets[i + offset] = slice.suboffsets[i]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(offset):
 */
    (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
  }

  /* "View.MemoryView":1309
 *         slice.suboffsets[i + offset] = slice.suboffsets[i]
 * 
 *     for i in range(offset):             # <<<<<<<<<<<<<<
 *         slice.shape[i] = 1
 *         slice.strides[i] = slice.strides[0]
 */
  __pyx_t_1 = __pyx_v_offset;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "View.MemoryView":1310
 * 
 *     for i in range(offset):
 *         slice.shape[i] = 1             # <<<<<<<<<<<<<<
 *         slice.strides[i] = slice.strides[0]
 *         slice.suboffsets[i] = -1
 */
    (__pyx_v_slice->shape[__pyx_v_i]) = 1;

    /* "View.MemoryView":1311
 *     for i in range(offset):
 *         slice.shape[i] = 1
 *         slice.strides[i] = slice.strides[0]             # <<<<<<<<<<<<<<
 *         slice.suboffsets[i] = -1
 * 
 */
    (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);

    /* "View.MemoryView":1312
 *         slice.shape[i] = 1
 *         slice.strides[i] = slice.strides[0]
 *         slice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
  }

}

/* "View.MemoryView":1320
 * 
 * @cname('__pyx_memoryview_refcount_copying')
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
 *                            int ndim, bint inc) nogil:
 * 
 */

static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {

  /* "View.MemoryView":1324
 * 
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
 *                                            dst.strides, ndim, inc)
 */
  if (__pyx_v_dtype_is_object) {

    /* "View.MemoryView":1326
 *     if dtype_is_object:
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
 *                                            dst.strides, ndim, inc)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
 */
    __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
    goto __pyx_L3;
  }
  __pyx_L3:;

}

/* "View.MemoryView":1329
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) with gil:
 */

static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);

  /* "View.MemoryView":1332
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) with gil:
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 */
  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);

  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "View.MemoryView":1335
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                     Py_ssize_t *strides, int ndim, bint inc):
 *     cdef Py_ssize_t i
 */

static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);

  /* "View.MemoryView":1339
 *     cdef Py_ssize_t i
 * 
 *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
 *         if ndim == 1:
 *             if inc:
 */
  __pyx_t_1 = (__pyx_v_shape[0]);
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "View.MemoryView":1340
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
 */
    __pyx_t_3 = (__pyx_v_ndim == 1);
    if (__pyx_t_3) {

      /* "View.MemoryView":1341
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 */
      if (__pyx_v_inc) {

        /* "View.MemoryView":1342
 *         if ndim == 1:
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])
 */
        Py_INCREF((((PyObject **)__pyx_v_data)[0]));
        goto __pyx_L6;
      }
      /*else*/ {

        /* "View.MemoryView":1344
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1,
 */
        Py_DECREF((((PyObject **)__pyx_v_data)[0]));
      }
      __pyx_L6:;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "View.MemoryView":1347
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1,
 *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
 * 
 *         data += strides[0]
 */
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
    }
    __pyx_L5:;

    /* "View.MemoryView":1349
 *                                       ndim - 1, inc)
 * 
 *         data += strides[0]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
  }

  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":1355
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) nogil:
 */

static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {

  /* "View.MemoryView":1358
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
 *                          itemsize, item)
 */
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1360
 *     refcount_copying(dst, dtype_is_object, ndim, False)
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
 *                          itemsize, item)             # <<<<<<<<<<<<<<
 *     refcount_copying(dst, dtype_is_object, ndim, True)
 * 
 */
  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);

  /* "View.MemoryView":1361
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
 *                          itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

}

/* "View.MemoryView":1365
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                               Py_ssize_t *strides, int ndim,
 *                               size_t itemsize, void *item) nogil:
 */

static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_extent;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;

  /* "View.MemoryView":1369
 *                               size_t itemsize, void *item) nogil:
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t extent = shape[0]
 * 
 */
  __pyx_v_stride = (__pyx_v_strides[0]);

  /* "View.MemoryView":1370
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]
 *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
 */
  __pyx_v_extent = (__pyx_v_shape[0]);

  /* "View.MemoryView":1372
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 */
  __pyx_t_1 = (__pyx_v_ndim == 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":1373
 * 
 *     if ndim == 1:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             memcpy(data, item, itemsize)
 *             data += stride
 */
    __pyx_t_2 = __pyx_v_extent;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "View.MemoryView":1374
 *     if ndim == 1:
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
 *             data += stride
 *     else:
 */
      memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);

      /* "View.MemoryView":1375
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 *             data += stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(extent):
 */
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "View.MemoryView":1377
 *             data += stride
 *     else:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             _slice_assign_scalar(data, shape + 1, strides + 1,
 *                                 ndim - 1, itemsize, item)
 */
    __pyx_t_2 = __pyx_v_extent;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "View.MemoryView":1379
 *         for i in range(extent):
 *             _slice_assign_scalar(data, shape + 1, strides + 1,
 *                                 ndim - 1, itemsize, item)             # <<<<<<<<<<<<<<
 *             data += stride
 * 
 */
      __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);

      /* "View.MemoryView":1380
 *             _slice_assign_scalar(data, shape + 1, strides + 1,
 *                                 ndim - 1, itemsize, item)
 *             data += stride             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }
  }
  __pyx_L3:;

}
static struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_scoreTrackII __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII;

static PyObject *__pyx_tp_new_5MACS2_2IO_11cScoreTrack_scoreTrackII(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)o);
  p->__pyx_vtab = __pyx_vtabptr_5MACS2_2IO_11cScoreTrack_scoreTrackII;
  p->data = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->data_stderr = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->datalength = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->trackline = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
  p->stderr_on = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
  p->pvalue_stat = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5MACS2_2IO_11cScoreTrack_scoreTrackII(PyObject *o) {
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *p = (struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->data);
  Py_CLEAR(p->data_stderr);
  Py_CLEAR(p->datalength);
  Py_CLEAR(p->trackline);
  Py_CLEAR(p->stderr_on);
  Py_CLEAR(p->pvalue_stat);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5MACS2_2IO_11cScoreTrack_scoreTrackII(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *p = (struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)o;
  if (p->data) {
    e = (*v)(p->data, a); if (e) return e;
  }
  if (p->data_stderr) {
    e = (*v)(p->data_stderr, a); if (e) return e;
  }
  if (p->datalength) {
    e = (*v)(p->datalength, a); if (e) return e;
  }
  if (p->trackline) {
    e = (*v)(((PyObject*)p->trackline), a); if (e) return e;
  }
  if (p->stderr_on) {
    e = (*v)(((PyObject*)p->stderr_on), a); if (e) return e;
  }
  if (p->pvalue_stat) {
    e = (*v)(p->pvalue_stat, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5MACS2_2IO_11cScoreTrack_scoreTrackII(PyObject *o) {
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *p = (struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->data);
  p->data = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->data_stderr);
  p->data_stderr = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->datalength);
  p->datalength = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->trackline);
  p->trackline = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->stderr_on);
  p->stderr_on = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pvalue_stat);
  p->pvalue_stat = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5MACS2_2IO_11cScoreTrack_scoreTrackII[] = {
  {__Pyx_NAMESTR("set_pseudocount"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_3set_pseudocount, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("enable_trackline"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_5enable_trackline, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_4enable_trackline)},
  {__Pyx_NAMESTR("add_chromosome"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_7add_chromosome, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_6add_chromosome)},
  {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_9add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_8add)},
  {__Pyx_NAMESTR("finalize"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_11finalize, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_10finalize)},
  {__Pyx_NAMESTR("get_data_by_chr"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_13get_data_by_chr, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_12get_data_by_chr)},
  {__Pyx_NAMESTR("get_chr_names"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_15get_chr_names, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_14get_chr_names)},
  {__Pyx_NAMESTR("change_normalization_method"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_17change_normalization_method, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_16change_normalization_method)},
  {__Pyx_NAMESTR("change_score_method"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_19change_score_method, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_18change_score_method)},
  {__Pyx_NAMESTR("make_pq_table"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_21make_pq_table, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_20make_pq_table)},
  {__Pyx_NAMESTR("write_bedGraph"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_23write_bedGraph, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_22write_bedGraph)},
  {__Pyx_NAMESTR("reassign_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_25reassign_peaks, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_24reassign_peaks)},
  {__Pyx_NAMESTR("call_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_27call_peaks, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_26call_peaks)},
  {__Pyx_NAMESTR("call_broadpeaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_29call_broadpeaks, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_28call_broadpeaks)},
  {__Pyx_NAMESTR("__add_broadpeak"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_31__add_broadpeak, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII_30__add_broadpeak)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_scoreTrackII = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_scoreTrackII = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_scoreTrackII = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_scoreTrackII = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5MACS2_2IO_11cScoreTrack_scoreTrackII = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("MACS2.IO.cScoreTrack.scoreTrackII"), /*tp_name*/
  sizeof(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5MACS2_2IO_11cScoreTrack_scoreTrackII, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_scoreTrackII, /*tp_as_number*/
  &__pyx_tp_as_sequence_scoreTrackII, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_scoreTrackII, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_scoreTrackII, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Class for scoreGraph type data. Modified from scoreTrackI. The\n    difference is that we store a single score data, not\n    p/q/loglikelihood altogether. Score (the 4th) column is calculated\n    through calling change_method() function. Individual scores for\n    filling PeakIO object are calculated by prepare_peakIO_scores()\n    function.\n\n    I want to save mem and simplify calculation in this new class.\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_5MACS2_2IO_11cScoreTrack_scoreTrackII, /*tp_traverse*/
  __pyx_tp_clear_5MACS2_2IO_11cScoreTrack_scoreTrackII, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5MACS2_2IO_11cScoreTrack_scoreTrackII, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5MACS2_2IO_11cScoreTrack_12scoreTrackII_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5MACS2_2IO_11cScoreTrack_scoreTrackII, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_TwoConditionScores __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores;

static PyObject *__pyx_tp_new_5MACS2_2IO_11cScoreTrack_TwoConditionScores(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)o);
  p->__pyx_vtab = __pyx_vtabptr_5MACS2_2IO_11cScoreTrack_TwoConditionScores;
  p->data = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->datalength = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->t1bdg = Py_None; Py_INCREF(Py_None);
  p->c1bdg = Py_None; Py_INCREF(Py_None);
  p->t2bdg = Py_None; Py_INCREF(Py_None);
  p->c2bdg = Py_None; Py_INCREF(Py_None);
  p->pvalue_stat1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->pvalue_stat2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->pvalue_stat3 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5MACS2_2IO_11cScoreTrack_TwoConditionScores(PyObject *o) {
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *p = (struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->data);
  Py_CLEAR(p->datalength);
  Py_CLEAR(p->t1bdg);
  Py_CLEAR(p->c1bdg);
  Py_CLEAR(p->t2bdg);
  Py_CLEAR(p->c2bdg);
  Py_CLEAR(p->pvalue_stat1);
  Py_CLEAR(p->pvalue_stat2);
  Py_CLEAR(p->pvalue_stat3);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5MACS2_2IO_11cScoreTrack_TwoConditionScores(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *p = (struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)o;
  if (p->data) {
    e = (*v)(p->data, a); if (e) return e;
  }
  if (p->datalength) {
    e = (*v)(p->datalength, a); if (e) return e;
  }
  if (p->t1bdg) {
    e = (*v)(p->t1bdg, a); if (e) return e;
  }
  if (p->c1bdg) {
    e = (*v)(p->c1bdg, a); if (e) return e;
  }
  if (p->t2bdg) {
    e = (*v)(p->t2bdg, a); if (e) return e;
  }
  if (p->c2bdg) {
    e = (*v)(p->c2bdg, a); if (e) return e;
  }
  if (p->pvalue_stat1) {
    e = (*v)(p->pvalue_stat1, a); if (e) return e;
  }
  if (p->pvalue_stat2) {
    e = (*v)(p->pvalue_stat2, a); if (e) return e;
  }
  if (p->pvalue_stat3) {
    e = (*v)(p->pvalue_stat3, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5MACS2_2IO_11cScoreTrack_TwoConditionScores(PyObject *o) {
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *p = (struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->data);
  p->data = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->datalength);
  p->datalength = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->t1bdg);
  p->t1bdg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->c1bdg);
  p->c1bdg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->t2bdg);
  p->t2bdg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->c2bdg);
  p->c2bdg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pvalue_stat1);
  p->pvalue_stat1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pvalue_stat2);
  p->pvalue_stat2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pvalue_stat3);
  p->pvalue_stat3 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5MACS2_2IO_11cScoreTrack_TwoConditionScores[] = {
  {__Pyx_NAMESTR("set_pseudocount"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_3set_pseudocount, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("build"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_5build, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_common_chrs"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_7get_common_chrs, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("finalize"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_9finalize, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_8finalize)},
  {__Pyx_NAMESTR("compute_all_pvalues"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_11compute_all_pvalues, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_10compute_all_pvalues)},
  {__Pyx_NAMESTR("compute_track_qvalues"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_13compute_track_qvalues, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_12compute_track_qvalues)},
  {__Pyx_NAMESTR("compute_category_qvalues"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_15compute_category_qvalues, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_14compute_category_qvalues)},
  {__Pyx_NAMESTR("get_data_by_chr"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_17get_data_by_chr, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_16get_data_by_chr)},
  {__Pyx_NAMESTR("get_chr_names"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_19get_chr_names, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_18get_chr_names)},
  {__Pyx_NAMESTR("write_bedGraph"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_21write_bedGraph, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_20write_bedGraph)},
  {__Pyx_NAMESTR("write_matrix"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_23write_matrix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_22write_matrix)},
  {__Pyx_NAMESTR("call_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_25call_peaks, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_24call_peaks)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_TwoConditionScores = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_TwoConditionScores = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_TwoConditionScores = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_TwoConditionScores = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5MACS2_2IO_11cScoreTrack_TwoConditionScores = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("MACS2.IO.cScoreTrack.TwoConditionScores"), /*tp_name*/
  sizeof(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5MACS2_2IO_11cScoreTrack_TwoConditionScores, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_TwoConditionScores, /*tp_as_number*/
  &__pyx_tp_as_sequence_TwoConditionScores, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_TwoConditionScores, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_TwoConditionScores, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5MACS2_2IO_11cScoreTrack_TwoConditionScores, /*tp_traverse*/
  __pyx_tp_clear_5MACS2_2IO_11cScoreTrack_TwoConditionScores, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5MACS2_2IO_11cScoreTrack_TwoConditionScores, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5MACS2_2IO_11cScoreTrack_TwoConditionScores, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI;

static PyObject *__pyx_tp_new_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)o);
  p->__pyx_vtab = __pyx_vtabptr_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI;
  p->pos = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->t1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->c1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->t2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->c2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->tvsc1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->tvsc2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->t1vs2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->tlogLR = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->where_peaks = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->diff_peaks = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->diff_qvalues = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->which_peaks1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->which_peaks2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->p1io = Py_None; Py_INCREF(Py_None);
  p->p2io = Py_None; Py_INCREF(Py_None);
  p->datalength = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->pvalue_stat1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->pvalue_stat2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->track_scoring_method = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->diff_scoring_method = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI(PyObject *o) {
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *p = (struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->pos);
  Py_CLEAR(p->t1);
  Py_CLEAR(p->c1);
  Py_CLEAR(p->t2);
  Py_CLEAR(p->c2);
  Py_CLEAR(p->tvsc1);
  Py_CLEAR(p->tvsc2);
  Py_CLEAR(p->t1vs2);
  Py_CLEAR(p->tlogLR);
  Py_CLEAR(p->where_peaks);
  Py_CLEAR(p->diff_peaks);
  Py_CLEAR(p->diff_qvalues);
  Py_CLEAR(p->which_peaks1);
  Py_CLEAR(p->which_peaks2);
  Py_CLEAR(p->p1io);
  Py_CLEAR(p->p2io);
  Py_CLEAR(p->datalength);
  Py_CLEAR(p->pvalue_stat1);
  Py_CLEAR(p->pvalue_stat2);
  Py_CLEAR(p->track_scoring_method);
  Py_CLEAR(p->diff_scoring_method);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *p = (struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)o;
  if (p->pos) {
    e = (*v)(p->pos, a); if (e) return e;
  }
  if (p->t1) {
    e = (*v)(p->t1, a); if (e) return e;
  }
  if (p->c1) {
    e = (*v)(p->c1, a); if (e) return e;
  }
  if (p->t2) {
    e = (*v)(p->t2, a); if (e) return e;
  }
  if (p->c2) {
    e = (*v)(p->c2, a); if (e) return e;
  }
  if (p->tvsc1) {
    e = (*v)(p->tvsc1, a); if (e) return e;
  }
  if (p->tvsc2) {
    e = (*v)(p->tvsc2, a); if (e) return e;
  }
  if (p->t1vs2) {
    e = (*v)(p->t1vs2, a); if (e) return e;
  }
  if (p->tlogLR) {
    e = (*v)(p->tlogLR, a); if (e) return e;
  }
  if (p->where_peaks) {
    e = (*v)(p->where_peaks, a); if (e) return e;
  }
  if (p->diff_peaks) {
    e = (*v)(p->diff_peaks, a); if (e) return e;
  }
  if (p->diff_qvalues) {
    e = (*v)(p->diff_qvalues, a); if (e) return e;
  }
  if (p->which_peaks1) {
    e = (*v)(p->which_peaks1, a); if (e) return e;
  }
  if (p->which_peaks2) {
    e = (*v)(p->which_peaks2, a); if (e) return e;
  }
  if (p->p1io) {
    e = (*v)(p->p1io, a); if (e) return e;
  }
  if (p->p2io) {
    e = (*v)(p->p2io, a); if (e) return e;
  }
  if (p->datalength) {
    e = (*v)(p->datalength, a); if (e) return e;
  }
  if (p->pvalue_stat1) {
    e = (*v)(p->pvalue_stat1, a); if (e) return e;
  }
  if (p->pvalue_stat2) {
    e = (*v)(p->pvalue_stat2, a); if (e) return e;
  }
  if (p->track_scoring_method) {
    e = (*v)(p->track_scoring_method, a); if (e) return e;
  }
  if (p->diff_scoring_method) {
    e = (*v)(p->diff_scoring_method, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI(PyObject *o) {
  struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *p = (struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->pos);
  p->pos = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->t1);
  p->t1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->c1);
  p->c1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->t2);
  p->t2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->c2);
  p->c2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->tvsc1);
  p->tvsc1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->tvsc2);
  p->tvsc2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->t1vs2);
  p->t1vs2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->tlogLR);
  p->tlogLR = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->where_peaks);
  p->where_peaks = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->diff_peaks);
  p->diff_peaks = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->diff_qvalues);
  p->diff_qvalues = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->which_peaks1);
  p->which_peaks1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->which_peaks2);
  p->which_peaks2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->p1io);
  p->p1io = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->p2io);
  p->p2io = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->datalength);
  p->datalength = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pvalue_stat1);
  p->pvalue_stat1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pvalue_stat2);
  p->pvalue_stat2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->track_scoring_method);
  p->track_scoring_method = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->diff_scoring_method);
  p->diff_scoring_method = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI[] = {
  {__Pyx_NAMESTR("set_pseudocount"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_3set_pseudocount, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("rebuild_chromosomes"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_5rebuild_chromosomes, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("finalize"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_7finalize, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_6finalize)},
  {__Pyx_NAMESTR("set_track_score_method"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_9set_track_score_method, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_8set_track_score_method)},
  {__Pyx_NAMESTR("break_on_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_11break_on_peaks, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_10break_on_peaks)},
  {__Pyx_NAMESTR("call_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_13call_peaks, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_12call_peaks)},
  {__Pyx_NAMESTR("store_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_15store_peaks, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("annotate_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_17annotate_peaks, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("make_treatcontrol_pq_tables"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_19make_treatcontrol_pq_tables, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_18make_treatcontrol_pq_tables)},
  {__Pyx_NAMESTR("compute_diff_pvalues"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_21compute_diff_pvalues, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_20compute_diff_pvalues)},
  {__Pyx_NAMESTR("compute_diff_qvalues"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_23compute_diff_qvalues, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_22compute_diff_qvalues)},
  {__Pyx_NAMESTR("get_data_by_chr"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_25get_data_by_chr, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_24get_data_by_chr)},
  {__Pyx_NAMESTR("get_chr_names"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_27get_chr_names, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_26get_chr_names)},
  {__Pyx_NAMESTR("write_bedGraph"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_29write_bedGraph, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_28write_bedGraph)},
  {__Pyx_NAMESTR("call_diff_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_31call_diff_peaks, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_30call_diff_peaks)},
  {__Pyx_NAMESTR("print_some_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_33print_some_peaks, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_32print_some_peaks)},
  {__Pyx_NAMESTR("print_diff_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_35print_diff_peaks, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_34print_diff_peaks)},
  {__Pyx_NAMESTR("write_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_37write_peaks, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_36write_peaks)},
  {__Pyx_NAMESTR("write_peaks2"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_39write_peaks2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_38write_peaks2)},
  {__Pyx_NAMESTR("has_peakio"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_41has_peakio, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_40has_peakio)},
  {__Pyx_NAMESTR("write_peaks_by_summit"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_43write_peaks_by_summit, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_42write_peaks_by_summit)},
  {__Pyx_NAMESTR("write_bedgraphs"), (PyCFunction)__pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_45write_bedgraphs, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_44write_bedgraphs)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_DiffScoreTrackI = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_DiffScoreTrackI = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_DiffScoreTrackI = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_DiffScoreTrackI = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("MACS2.IO.cScoreTrack.DiffScoreTrackI"), /*tp_name*/
  sizeof(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_DiffScoreTrackI, /*tp_as_number*/
  &__pyx_tp_as_sequence_DiffScoreTrackI, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_DiffScoreTrackI, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_DiffScoreTrackI, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI, /*tp_traverse*/
  __pyx_tp_clear_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

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

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct____add_broadpeak = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct____add_broadpeak = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct____add_broadpeak = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct____add_broadpeak = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("MACS2.IO.cScoreTrack.__pyx_scope_struct____add_broadpeak"), /*tp_name*/
  sizeof(struct __pyx_obj_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct____add_broadpeak, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct____add_broadpeak, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct____add_broadpeak, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct____add_broadpeak, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_array_obj *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_array_obj *)o);
  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (__pyx_array___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_array(PyObject *o) {
  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_array___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mode);
  Py_CLEAR(p->_format);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_array(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
  if (p->mode) {
    e = (*v)(p->mode, a); if (e) return e;
  }
  if (p->_format) {
    e = (*v)(p->_format, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_array(PyObject *o) {
  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->mode);
  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_format);
  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_array___setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
  PyObject *v = PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_array___getattr__(o, n);
  }
  return v;
}

static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
  return get_memview(o);
}

static PyMethodDef __pyx_methods_array[] = {
  {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_array[] = {
  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_array = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_array = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_array, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_array = {
  0, /*mp_length*/
  __pyx_array___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_array = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  __pyx_array_getbuffer, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type___pyx_array = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("MACS2.IO.cScoreTrack.array"), /*tp_name*/
  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_array, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_array, /*tp_as_number*/
  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  __pyx_tp_getattro_array, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_array, /*tp_traverse*/
  __pyx_tp_clear_array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_array, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_array, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_MemviewEnum_obj *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_MemviewEnum_obj *)o);
  p->name = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_Enum(PyObject *o) {
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->name);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  if (p->name) {
    e = (*v)(p->name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_Enum(PyObject *o) {
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->name);
  p->name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyNumberMethods __pyx_tp_as_number_Enum = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Enum = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Enum = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Enum = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type___pyx_MemviewEnum = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("MACS2.IO.cScoreTrack.Enum"), /*tp_name*/
  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_MemviewEnum___repr__, /*tp_repr*/
  &__pyx_tp_as_number_Enum, /*tp_as_number*/
  &__pyx_tp_as_sequence_Enum, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Enum, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Enum, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_Enum, /*tp_traverse*/
  __pyx_tp_clear_Enum, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_Enum, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_MemviewEnum___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_Enum, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;

static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryview_obj *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_memoryview_obj *)o);
  p->__pyx_vtab = __pyx_vtabptr_memoryview;
  p->obj = Py_None; Py_INCREF(Py_None);
  p->_size = Py_None; Py_INCREF(Py_None);
  p->_array_interface = Py_None; Py_INCREF(Py_None);
  p->view.obj = NULL;
  if (__pyx_memoryview___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_memoryview(PyObject *o) {
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_memoryview___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->obj);
  Py_CLEAR(p->_size);
  Py_CLEAR(p->_array_interface);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  if (p->obj) {
    e = (*v)(p->obj, a); if (e) return e;
  }
  if (p->_size) {
    e = (*v)(p->_size, a); if (e) return e;
  }
  if (p->_array_interface) {
    e = (*v)(p->_array_interface, a); if (e) return e;
  }
  if (p->view.obj) {
    e = (*v)(p->view.obj, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_memoryview(PyObject *o) {
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->obj);
  p->obj = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_size);
  p->_size = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_array_interface);
  p->_array_interface = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  Py_CLEAR(p->view.obj);
  return 0;
}
static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_memoryview___setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_transpose(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview__get__base(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_shape(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_strides(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_suboffsets(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_ndim(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_itemsize(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_nbytes(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryview_get_size(o);
}

static PyMethodDef __pyx_methods_memoryview[] = {
  {__Pyx_NAMESTR("is_c_contig"), (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("is_f_contig"), (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("copy_fortran"), (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_memoryview[] = {
  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_memoryview = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
  __pyx_memoryview___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_memoryview, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
  __pyx_memoryview___len__, /*mp_length*/
  __pyx_memoryview___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type___pyx_memoryview = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("MACS2.IO.cScoreTrack.memoryview"), /*tp_name*/
  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_memoryview___repr__, /*tp_repr*/
  &__pyx_tp_as_number_memoryview, /*tp_as_number*/
  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_memoryview___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_memoryview, /*tp_traverse*/
  __pyx_tp_clear_memoryview, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_memoryview, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_memoryview, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_memoryview, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;

static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryviewslice_obj *p;
  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_memoryviewslice_obj *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
  p->from_object = Py_None; Py_INCREF(Py_None);
  p->from_slice.memview = NULL;
  return o;
}

static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_memoryviewslice___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->from_object);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_memoryview(o);
}

static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
  if (p->from_object) {
    e = (*v)(p->from_object, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  PyObject* tmp;
  __pyx_tp_clear_memoryview(o);
  tmp = ((PyObject*)p->from_object);
  p->from_object = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
  return 0;
}

static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_memoryviewslice__get__base(o);
}

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

static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__memoryviewslice = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__memoryviewslice = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview___len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__memoryviewslice = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview___len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview___getitem__, /*mp_subscript*/
  #else
  0, /*mp_subscript*/
  #endif
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__memoryviewslice = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  #else
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type___pyx_memoryviewslice = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("MACS2.IO.cScoreTrack._memoryviewslice"), /*tp_name*/
  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview___repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  &__pyx_tp_as_number__memoryviewslice, /*tp_as_number*/
  &__pyx_tp_as_sequence__memoryviewslice, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__memoryviewslice, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview___str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__memoryviewslice, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods__memoryviewslice, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets__memoryviewslice, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new__memoryviewslice, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

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

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

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 1},
  {&__pyx_kp_s_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 0, 1, 0},
  {&__pyx_kp_s_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 0, 1, 0},
  {&__pyx_kp_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 0},
  {&__pyx_kp_s_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 1, 0},
  {&__pyx_kp_s_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 0, 1, 0},
  {&__pyx_kp_s_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 1, 0},
  {&__pyx_kp_s_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 1, 0},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_kp_s_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 0, 1, 0},
  {&__pyx_kp_s_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 0, 1, 0},
  {&__pyx_kp_s_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 1, 0},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_kp_s_132, __pyx_k_132, sizeof(__pyx_k_132), 0, 0, 1, 0},
  {&__pyx_kp_s_138, __pyx_k_138, sizeof(__pyx_k_138), 0, 0, 1, 0},
  {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
  {&__pyx_kp_s_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 0, 1, 0},
  {&__pyx_kp_s_156, __pyx_k_156, sizeof(__pyx_k_156), 0, 0, 1, 0},
  {&__pyx_kp_s_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 0, 1, 0},
  {&__pyx_kp_s_158, __pyx_k_158, sizeof(__pyx_k_158), 0, 0, 1, 0},
  {&__pyx_kp_u_159, __pyx_k_159, sizeof(__pyx_k_159), 0, 1, 0, 0},
  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
  {&__pyx_kp_u_161, __pyx_k_161, sizeof(__pyx_k_161), 0, 1, 0, 0},
  {&__pyx_kp_u_163, __pyx_k_163, sizeof(__pyx_k_163), 0, 1, 0, 0},
  {&__pyx_kp_u_165, __pyx_k_165, sizeof(__pyx_k_165), 0, 1, 0, 0},
  {&__pyx_kp_u_166, __pyx_k_166, sizeof(__pyx_k_166), 0, 1, 0, 0},
  {&__pyx_kp_u_169, __pyx_k_169, sizeof(__pyx_k_169), 0, 1, 0, 0},
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_kp_s_171, __pyx_k_171, sizeof(__pyx_k_171), 0, 0, 1, 0},
  {&__pyx_kp_s_173, __pyx_k_173, sizeof(__pyx_k_173), 0, 0, 1, 0},
  {&__pyx_kp_s_176, __pyx_k_176, sizeof(__pyx_k_176), 0, 0, 1, 0},
  {&__pyx_kp_s_178, __pyx_k_178, sizeof(__pyx_k_178), 0, 0, 1, 0},
  {&__pyx_kp_s_179, __pyx_k_179, sizeof(__pyx_k_179), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_kp_s_181, __pyx_k_181, sizeof(__pyx_k_181), 0, 0, 1, 0},
  {&__pyx_kp_s_183, __pyx_k_183, sizeof(__pyx_k_183), 0, 0, 1, 0},
  {&__pyx_kp_s_185, __pyx_k_185, sizeof(__pyx_k_185), 0, 0, 1, 0},
  {&__pyx_kp_s_187, __pyx_k_187, sizeof(__pyx_k_187), 0, 0, 1, 0},
  {&__pyx_kp_s_189, __pyx_k_189, sizeof(__pyx_k_189), 0, 0, 1, 0},
  {&__pyx_n_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 1},
  {&__pyx_kp_s_190, __pyx_k_190, sizeof(__pyx_k_190), 0, 0, 1, 0},
  {&__pyx_kp_s_193, __pyx_k_193, sizeof(__pyx_k_193), 0, 0, 1, 0},
  {&__pyx_kp_s_195, __pyx_k_195, sizeof(__pyx_k_195), 0, 0, 1, 0},
  {&__pyx_n_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 1},
  {&__pyx_kp_s_200, __pyx_k_200, sizeof(__pyx_k_200), 0, 0, 1, 0},
  {&__pyx_kp_s_202, __pyx_k_202, sizeof(__pyx_k_202), 0, 0, 1, 0},
  {&__pyx_n_s_205, __pyx_k_205, sizeof(__pyx_k_205), 0, 0, 1, 1},
  {&__pyx_n_s_206, __pyx_k_206, sizeof(__pyx_k_206), 0, 0, 1, 1},
  {&__pyx_n_s_207, __pyx_k_207, sizeof(__pyx_k_207), 0, 0, 1, 1},
  {&__pyx_n_s_208, __pyx_k_208, sizeof(__pyx_k_208), 0, 0, 1, 1},
  {&__pyx_n_s_209, __pyx_k_209, sizeof(__pyx_k_209), 0, 0, 1, 1},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_s_210, __pyx_k_210, sizeof(__pyx_k_210), 0, 0, 1, 0},
  {&__pyx_kp_s_211, __pyx_k_211, sizeof(__pyx_k_211), 0, 0, 1, 0},
  {&__pyx_kp_s_212, __pyx_k_212, sizeof(__pyx_k_212), 0, 0, 1, 0},
  {&__pyx_kp_s_215, __pyx_k_215, sizeof(__pyx_k_215), 0, 0, 1, 0},
  {&__pyx_n_s_218, __pyx_k_218, sizeof(__pyx_k_218), 0, 0, 1, 1},
  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
  {&__pyx_n_s_221, __pyx_k_221, sizeof(__pyx_k_221), 0, 0, 1, 1},
  {&__pyx_n_s_224, __pyx_k_224, sizeof(__pyx_k_224), 0, 0, 1, 1},
  {&__pyx_n_s_227, __pyx_k_227, sizeof(__pyx_k_227), 0, 0, 1, 1},
  {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
  {&__pyx_n_s_230, __pyx_k_230, sizeof(__pyx_k_230), 0, 0, 1, 1},
  {&__pyx_n_s_233, __pyx_k_233, sizeof(__pyx_k_233), 0, 0, 1, 1},
  {&__pyx_n_s_236, __pyx_k_236, sizeof(__pyx_k_236), 0, 0, 1, 1},
  {&__pyx_n_s_239, __pyx_k_239, sizeof(__pyx_k_239), 0, 0, 1, 1},
  {&__pyx_n_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 1},
  {&__pyx_n_s_242, __pyx_k_242, sizeof(__pyx_k_242), 0, 0, 1, 1},
  {&__pyx_n_s_245, __pyx_k_245, sizeof(__pyx_k_245), 0, 0, 1, 1},
  {&__pyx_n_s_248, __pyx_k_248, sizeof(__pyx_k_248), 0, 0, 1, 1},
  {&__pyx_kp_s_249, __pyx_k_249, sizeof(__pyx_k_249), 0, 0, 1, 0},
  {&__pyx_kp_s_251, __pyx_k_251, sizeof(__pyx_k_251), 0, 0, 1, 0},
  {&__pyx_kp_s_253, __pyx_k_253, sizeof(__pyx_k_253), 0, 0, 1, 0},
  {&__pyx_kp_s_255, __pyx_k_255, sizeof(__pyx_k_255), 0, 0, 1, 0},
  {&__pyx_kp_s_257, __pyx_k_257, sizeof(__pyx_k_257), 0, 0, 1, 0},
  {&__pyx_kp_s_259, __pyx_k_259, sizeof(__pyx_k_259), 0, 0, 1, 0},
  {&__pyx_n_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 1},
  {&__pyx_n_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 1},
  {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_n_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 1},
  {&__pyx_n_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 1},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_n_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 1},
  {&__pyx_n_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 1},
  {&__pyx_n_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 1},
  {&__pyx_kp_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 0},
  {&__pyx_kp_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 0},
  {&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0},
  {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0},
  {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0},
  {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0},
  {&__pyx_kp_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 0},
  {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0},
  {&__pyx_kp_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 0},
  {&__pyx_kp_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 0},
  {&__pyx_kp_s_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 1, 0},
  {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0},
  {&__pyx_kp_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 0},
  {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
  {&__pyx_kp_s_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 1, 0},
  {&__pyx_kp_s_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 1, 0},
  {&__pyx_kp_s_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 1, 0},
  {&__pyx_kp_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 0},
  {&__pyx_kp_s_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 0, 1, 0},
  {&__pyx_kp_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 0},
  {&__pyx_kp_s_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 0, 1, 0},
  {&__pyx_kp_s_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 1, 0},
  {&__pyx_kp_s_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 1, 0},
  {&__pyx_kp_s_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 0, 1, 0},
  {&__pyx_kp_s_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 1, 0},
  {&__pyx_kp_s_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 1, 0},
  {&__pyx_kp_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 0},
  {&__pyx_kp_s_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 1, 0},
  {&__pyx_n_s__ASCII, __pyx_k__ASCII, sizeof(__pyx_k__ASCII), 0, 0, 1, 1},
  {&__pyx_n_s__BYTE4, __pyx_k__BYTE4, sizeof(__pyx_k__BYTE4), 0, 0, 1, 1},
  {&__pyx_n_s__BroadPeakIO, __pyx_k__BroadPeakIO, sizeof(__pyx_k__BroadPeakIO), 0, 0, 1, 1},
  {&__pyx_n_s__CombinedTwoTrack, __pyx_k__CombinedTwoTrack, sizeof(__pyx_k__CombinedTwoTrack), 0, 0, 1, 1},
  {&__pyx_n_s__Ellipsis, __pyx_k__Ellipsis, sizeof(__pyx_k__Ellipsis), 0, 0, 1, 1},
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
  {&__pyx_n_s__FBYTE4, __pyx_k__FBYTE4, sizeof(__pyx_k__FBYTE4), 0, 0, 1, 1},
  {&__pyx_n_s__Float64HashTable, __pyx_k__Float64HashTable, sizeof(__pyx_k__Float64HashTable), 0, 0, 1, 1},
  {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
  {&__pyx_n_s__Int64HashTable, __pyx_k__Int64HashTable, sizeof(__pyx_k__Int64HashTable), 0, 0, 1, 1},
  {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
  {&__pyx_n_s__LOG10_E, __pyx_k__LOG10_E, sizeof(__pyx_k__LOG10_E), 0, 0, 1, 1},
  {&__pyx_n_s__MACS, __pyx_k__MACS, sizeof(__pyx_k__MACS), 0, 0, 1, 1},
  {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1},
  {&__pyx_n_s__NotImplemented, __pyx_k__NotImplemented, sizeof(__pyx_k__NotImplemented), 0, 0, 1, 1},
  {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_b__O, __pyx_k__O, sizeof(__pyx_k__O), 0, 0, 0, 1},
  {&__pyx_n_s__PeakIO, __pyx_k__PeakIO, sizeof(__pyx_k__PeakIO), 0, 0, 1, 1},
  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
  {&__pyx_n_s__V1, __pyx_k__V1, sizeof(__pyx_k__V1), 0, 0, 1, 1},
  {&__pyx_n_s__V2, __pyx_k__V2, sizeof(__pyx_k__V2), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s____add_broadpeak, __pyx_k____add_broadpeak, sizeof(__pyx_k____add_broadpeak), 0, 0, 1, 1},
  {&__pyx_n_s____author__, __pyx_k____author__, sizeof(__pyx_k____author__), 0, 0, 1, 1},
  {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1},
  {&__pyx_n_s____doc__, __pyx_k____doc__, sizeof(__pyx_k____doc__), 0, 0, 1, 1},
  {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1},
  {&__pyx_n_s____pyx_getbuffer, __pyx_k____pyx_getbuffer, sizeof(__pyx_k____pyx_getbuffer), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s____version__, __pyx_k____version__, sizeof(__pyx_k____version__), 0, 0, 1, 1},
  {&__pyx_n_s__abs, __pyx_k__abs, sizeof(__pyx_k__abs), 0, 0, 1, 1},
  {&__pyx_n_s__add, __pyx_k__add, sizeof(__pyx_k__add), 0, 0, 1, 1},
  {&__pyx_n_s__add_chromosome, __pyx_k__add_chromosome, sizeof(__pyx_k__add_chromosome), 0, 0, 1, 1},
  {&__pyx_n_s__all, __pyx_k__all, sizeof(__pyx_k__all), 0, 0, 1, 1},
  {&__pyx_n_s__allocate_buffer, __pyx_k__allocate_buffer, sizeof(__pyx_k__allocate_buffer), 0, 0, 1, 1},
  {&__pyx_n_s__annotate_peaks, __pyx_k__annotate_peaks, sizeof(__pyx_k__annotate_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1},
  {&__pyx_n_s__argmin, __pyx_k__argmin, sizeof(__pyx_k__argmin), 0, 0, 1, 1},
  {&__pyx_n_s__args, __pyx_k__args, sizeof(__pyx_k__args), 0, 0, 1, 1},
  {&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1},
  {&__pyx_n_s__astype, __pyx_k__astype, sizeof(__pyx_k__astype), 0, 0, 1, 1},
  {&__pyx_n_s__base, __pyx_k__base, sizeof(__pyx_k__base), 0, 0, 1, 1},
  {&__pyx_n_s__bdgTrack2, __pyx_k__bdgTrack2, sizeof(__pyx_k__bdgTrack2), 0, 0, 1, 1},
  {&__pyx_n_s__bed, __pyx_k__bed, sizeof(__pyx_k__bed), 0, 0, 1, 1},
  {&__pyx_n_s__blockNum, __pyx_k__blockNum, sizeof(__pyx_k__blockNum), 0, 0, 1, 1},
  {&__pyx_n_s__blockSizes, __pyx_k__blockSizes, sizeof(__pyx_k__blockSizes), 0, 0, 1, 1},
  {&__pyx_n_s__blockStarts, __pyx_k__blockStarts, sizeof(__pyx_k__blockStarts), 0, 0, 1, 1},
  {&__pyx_n_s__bool, __pyx_k__bool, sizeof(__pyx_k__bool), 0, 0, 1, 1},
  {&__pyx_n_s__bpeaks, __pyx_k__bpeaks, sizeof(__pyx_k__bpeaks), 0, 0, 1, 1},
  {&__pyx_n_s__break_on_peaks, __pyx_k__break_on_peaks, sizeof(__pyx_k__break_on_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__build, __pyx_k__build, sizeof(__pyx_k__build), 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_u__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 1, 0, 1},
  {&__pyx_n_s__c1bdg, __pyx_k__c1bdg, sizeof(__pyx_k__c1bdg), 0, 0, 1, 1},
  {&__pyx_n_s__c2bdg, __pyx_k__c2bdg, sizeof(__pyx_k__c2bdg), 0, 0, 1, 1},
  {&__pyx_n_s__call_broadpeaks, __pyx_k__call_broadpeaks, sizeof(__pyx_k__call_broadpeaks), 0, 0, 1, 1},
  {&__pyx_n_s__call_diff_peaks, __pyx_k__call_diff_peaks, sizeof(__pyx_k__call_diff_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__call_peaks, __pyx_k__call_peaks, sizeof(__pyx_k__call_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__call_summits, __pyx_k__call_summits, sizeof(__pyx_k__call_summits), 0, 0, 1, 1},
  {&__pyx_n_s__captureWarnings, __pyx_k__captureWarnings, sizeof(__pyx_k__captureWarnings), 0, 0, 1, 1},
  {&__pyx_n_s__change_score_method, __pyx_k__change_score_method, sizeof(__pyx_k__change_score_method), 0, 0, 1, 1},
  {&__pyx_n_s__chi2, __pyx_k__chi2, sizeof(__pyx_k__chi2), 0, 0, 1, 1},
  {&__pyx_n_s__chip, __pyx_k__chip, sizeof(__pyx_k__chip), 0, 0, 1, 1},
  {&__pyx_n_s__chr, __pyx_k__chr, sizeof(__pyx_k__chr), 0, 0, 1, 1},
  {&__pyx_n_s__chr1, __pyx_k__chr1, sizeof(__pyx_k__chr1), 0, 0, 1, 1},
  {&__pyx_n_s__chr2, __pyx_k__chr2, sizeof(__pyx_k__chr2), 0, 0, 1, 1},
  {&__pyx_n_s__chrom, __pyx_k__chrom, sizeof(__pyx_k__chrom), 0, 0, 1, 1},
  {&__pyx_n_s__chrom_data, __pyx_k__chrom_data, sizeof(__pyx_k__chrom_data), 0, 0, 1, 1},
  {&__pyx_n_s__chrom_max_len, __pyx_k__chrom_max_len, sizeof(__pyx_k__chrom_max_len), 0, 0, 1, 1},
  {&__pyx_n_s__chromosome, __pyx_k__chromosome, sizeof(__pyx_k__chromosome), 0, 0, 1, 1},
  {&__pyx_n_s__chrs, __pyx_k__chrs, sizeof(__pyx_k__chrs), 0, 0, 1, 1},
  {&__pyx_n_s__colname, __pyx_k__colname, sizeof(__pyx_k__colname), 0, 0, 1, 1},
  {&__pyx_n_s__column, __pyx_k__column, sizeof(__pyx_k__column), 0, 0, 1, 1},
  {&__pyx_n_s__common_chr, __pyx_k__common_chr, sizeof(__pyx_k__common_chr), 0, 0, 1, 1},
  {&__pyx_n_s__compute_all_pvalues, __pyx_k__compute_all_pvalues, sizeof(__pyx_k__compute_all_pvalues), 0, 0, 1, 1},
  {&__pyx_n_s__cond1_depth, __pyx_k__cond1_depth, sizeof(__pyx_k__cond1_depth), 0, 0, 1, 1},
  {&__pyx_n_s__cond2_depth, __pyx_k__cond2_depth, sizeof(__pyx_k__cond2_depth), 0, 0, 1, 1},
  {&__pyx_n_s__control, __pyx_k__control, sizeof(__pyx_k__control), 0, 0, 1, 1},
  {&__pyx_n_s__control1, __pyx_k__control1, sizeof(__pyx_k__control1), 0, 0, 1, 1},
  {&__pyx_n_s__control2, __pyx_k__control2, sizeof(__pyx_k__control2), 0, 0, 1, 1},
  {&__pyx_n_s__copy, __pyx_k__copy, sizeof(__pyx_k__copy), 0, 0, 1, 1},
  {&__pyx_n_s__ctrl_depth, __pyx_k__ctrl_depth, sizeof(__pyx_k__ctrl_depth), 0, 0, 1, 1},
  {&__pyx_n_s__cur_region, __pyx_k__cur_region, sizeof(__pyx_k__cur_region), 0, 0, 1, 1},
  {&__pyx_n_s__cutoff, __pyx_k__cutoff, sizeof(__pyx_k__cutoff), 0, 0, 1, 1},
  {&__pyx_n_s__d, __pyx_k__d, sizeof(__pyx_k__d), 0, 0, 1, 1},
  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
  {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1},
  {&__pyx_n_s__description, __pyx_k__description, sizeof(__pyx_k__description), 0, 0, 1, 1},
  {&__pyx_n_s__do_nothing, __pyx_k__do_nothing, sizeof(__pyx_k__do_nothing), 0, 0, 1, 1},
  {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
  {&__pyx_n_s__dtype_is_object, __pyx_k__dtype_is_object, sizeof(__pyx_k__dtype_is_object), 0, 0, 1, 1},
  {&__pyx_n_s__enable_trackline, __pyx_k__enable_trackline, sizeof(__pyx_k__enable_trackline), 0, 0, 1, 1},
  {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1},
  {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
  {&__pyx_n_s__endpos, __pyx_k__endpos, sizeof(__pyx_k__endpos), 0, 0, 1, 1},
  {&__pyx_n_s__enforce_peakyness, __pyx_k__enforce_peakyness, sizeof(__pyx_k__enforce_peakyness), 0, 0, 1, 1},
  {&__pyx_n_s__enforce_valleys, __pyx_k__enforce_valleys, sizeof(__pyx_k__enforce_valleys), 0, 0, 1, 1},
  {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1},
  {&__pyx_n_s__error, __pyx_k__error, sizeof(__pyx_k__error), 0, 0, 1, 1},
  {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1},
  {&__pyx_n_s__extract_average, __pyx_k__extract_average, sizeof(__pyx_k__extract_average), 0, 0, 1, 1},
  {&__pyx_n_s__extract_sum, __pyx_k__extract_sum, sizeof(__pyx_k__extract_sum), 0, 0, 1, 1},
  {&__pyx_n_s__extract_value, __pyx_k__extract_value, sizeof(__pyx_k__extract_value), 0, 0, 1, 1},
  {&__pyx_n_s__fc, __pyx_k__fc, sizeof(__pyx_k__fc), 0, 0, 1, 1},
  {&__pyx_n_s__fhd, __pyx_k__fhd, sizeof(__pyx_k__fhd), 0, 0, 1, 1},
  {&__pyx_n_s__finalize, __pyx_k__finalize, sizeof(__pyx_k__finalize), 0, 0, 1, 1},
  {&__pyx_n_s__flags, __pyx_k__flags, sizeof(__pyx_k__flags), 0, 0, 1, 1},
  {&__pyx_n_s__flat, __pyx_k__flat, sizeof(__pyx_k__flat), 0, 0, 1, 1},
  {&__pyx_n_s__float32, __pyx_k__float32, sizeof(__pyx_k__float32), 0, 0, 1, 1},
  {&__pyx_n_s__fold_change, __pyx_k__fold_change, sizeof(__pyx_k__fold_change), 0, 0, 1, 1},
  {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
  {&__pyx_n_b__fortran, __pyx_k__fortran, sizeof(__pyx_k__fortran), 0, 0, 0, 1},
  {&__pyx_n_s__fortran, __pyx_k__fortran, sizeof(__pyx_k__fortran), 0, 0, 1, 1},
  {&__pyx_n_s__get_chr_names, __pyx_k__get_chr_names, sizeof(__pyx_k__get_chr_names), 0, 0, 1, 1},
  {&__pyx_n_s__get_common_chrs, __pyx_k__get_common_chrs, sizeof(__pyx_k__get_common_chrs), 0, 0, 1, 1},
  {&__pyx_n_s__get_data_by_chr, __pyx_k__get_data_by_chr, sizeof(__pyx_k__get_data_by_chr), 0, 0, 1, 1},
  {&__pyx_n_s__get_data_from_chrom, __pyx_k__get_data_from_chrom, sizeof(__pyx_k__get_data_from_chrom), 0, 0, 1, 1},
  {&__pyx_n_s__get_item, __pyx_k__get_item, sizeof(__pyx_k__get_item), 0, 0, 1, 1},
  {&__pyx_n_s__has_key, __pyx_k__has_key, sizeof(__pyx_k__has_key), 0, 0, 1, 1},
  {&__pyx_n_s__has_peakio, __pyx_k__has_peakio, sizeof(__pyx_k__has_peakio), 0, 0, 1, 1},
  {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
  {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
  {&__pyx_n_s__int32, __pyx_k__int32, sizeof(__pyx_k__int32), 0, 0, 1, 1},
  {&__pyx_n_s__intersection, __pyx_k__intersection, sizeof(__pyx_k__intersection), 0, 0, 1, 1},
  {&__pyx_n_s__isfinite, __pyx_k__isfinite, sizeof(__pyx_k__isfinite), 0, 0, 1, 1},
  {&__pyx_n_s__itemgetter, __pyx_k__itemgetter, sizeof(__pyx_k__itemgetter), 0, 0, 1, 1},
  {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1},
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
  {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1},
  {&__pyx_n_s__kwargs, __pyx_k__kwargs, sizeof(__pyx_k__kwargs), 0, 0, 1, 1},
  {&__pyx_n_s__l, __pyx_k__l, sizeof(__pyx_k__l), 0, 0, 1, 1},
  {&__pyx_n_s__ladd, __pyx_k__ladd, sizeof(__pyx_k__ladd), 0, 0, 1, 1},
  {&__pyx_n_s__larray, __pyx_k__larray, sizeof(__pyx_k__larray), 0, 0, 1, 1},
  {&__pyx_n_s__length, __pyx_k__length, sizeof(__pyx_k__length), 0, 0, 1, 1},
  {&__pyx_n_s__log10, __pyx_k__log10, sizeof(__pyx_k__log10), 0, 0, 1, 1},
  {&__pyx_n_s__log2, __pyx_k__log2, sizeof(__pyx_k__log2), 0, 0, 1, 1},
  {&__pyx_n_s__logFC, __pyx_k__logFC, sizeof(__pyx_k__logFC), 0, 0, 1, 1},
  {&__pyx_n_s__logLR, __pyx_k__logLR, sizeof(__pyx_k__logLR), 0, 0, 1, 1},
  {&__pyx_n_s__logLR_khashtable, __pyx_k__logLR_khashtable, sizeof(__pyx_k__logLR_khashtable), 0, 0, 1, 1},
  {&__pyx_n_s__logging, __pyx_k__logging, sizeof(__pyx_k__logging), 0, 0, 1, 1},
  {&__pyx_n_s__logical_and, __pyx_k__logical_and, sizeof(__pyx_k__logical_and), 0, 0, 1, 1},
  {&__pyx_n_s__logical_not, __pyx_k__logical_not, sizeof(__pyx_k__logical_not), 0, 0, 1, 1},
  {&__pyx_n_s__logical_or, __pyx_k__logical_or, sizeof(__pyx_k__logical_or), 0, 0, 1, 1},
  {&__pyx_n_s__lvl1_cutoff, __pyx_k__lvl1_cutoff, sizeof(__pyx_k__lvl1_cutoff), 0, 0, 1, 1},
  {&__pyx_n_s__lvl1_max_gap, __pyx_k__lvl1_max_gap, sizeof(__pyx_k__lvl1_max_gap), 0, 0, 1, 1},
  {&__pyx_n_s__lvl1peakset, __pyx_k__lvl1peakset, sizeof(__pyx_k__lvl1peakset), 0, 0, 1, 1},
  {&__pyx_n_s__lvl2_cutoff, __pyx_k__lvl2_cutoff, sizeof(__pyx_k__lvl2_cutoff), 0, 0, 1, 1},
  {&__pyx_n_s__lvl2_max_gap, __pyx_k__lvl2_max_gap, sizeof(__pyx_k__lvl2_max_gap), 0, 0, 1, 1},
  {&__pyx_n_s__lvl2peak, __pyx_k__lvl2peak, sizeof(__pyx_k__lvl2peak), 0, 0, 1, 1},
  {&__pyx_n_s__make_pq_table, __pyx_k__make_pq_table, sizeof(__pyx_k__make_pq_table), 0, 0, 1, 1},
  {&__pyx_n_s__map, __pyx_k__map, sizeof(__pyx_k__map), 0, 0, 1, 1},
  {&__pyx_n_s__max, __pyx_k__max, sizeof(__pyx_k__max), 0, 0, 1, 1},
  {&__pyx_n_s__max_gap, __pyx_k__max_gap, sizeof(__pyx_k__max_gap), 0, 0, 1, 1},
  {&__pyx_n_s__maxima, __pyx_k__maxima, sizeof(__pyx_k__maxima), 0, 0, 1, 1},
  {&__pyx_n_s__median, __pyx_k__median, sizeof(__pyx_k__median), 0, 0, 1, 1},
  {&__pyx_n_s__memview, __pyx_k__memview, sizeof(__pyx_k__memview), 0, 0, 1, 1},
  {&__pyx_n_s__min, __pyx_k__min, sizeof(__pyx_k__min), 0, 0, 1, 1},
  {&__pyx_n_s__min_length, __pyx_k__min_length, sizeof(__pyx_k__min_length), 0, 0, 1, 1},
  {&__pyx_n_s__mode, __pyx_k__mode, sizeof(__pyx_k__mode), 0, 0, 1, 1},
  {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
  {&__pyx_n_s__name_prefix, __pyx_k__name_prefix, sizeof(__pyx_k__name_prefix), 0, 0, 1, 1},
  {&__pyx_n_s__ndim, __pyx_k__ndim, sizeof(__pyx_k__ndim), 0, 0, 1, 1},
  {&__pyx_n_s__next, __pyx_k__next, sizeof(__pyx_k__next), 0, 0, 1, 1},
  {&__pyx_n_s__nonzero, __pyx_k__nonzero, sizeof(__pyx_k__nonzero), 0, 0, 1, 1},
  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
  {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1},
  {&__pyx_n_s__ones, __pyx_k__ones, sizeof(__pyx_k__ones), 0, 0, 1, 1},
  {&__pyx_n_s__operator, __pyx_k__operator, sizeof(__pyx_k__operator), 0, 0, 1, 1},
  {&__pyx_n_s__ord, __pyx_k__ord, sizeof(__pyx_k__ord), 0, 0, 1, 1},
  {&__pyx_n_s__p, __pyx_k__p, sizeof(__pyx_k__p), 0, 0, 1, 1},
  {&__pyx_n_s__p1, __pyx_k__p1, sizeof(__pyx_k__p1), 0, 0, 1, 1},
  {&__pyx_n_s__p1io, __pyx_k__p1io, sizeof(__pyx_k__p1io), 0, 0, 1, 1},
  {&__pyx_n_s__p1n, __pyx_k__p1n, sizeof(__pyx_k__p1n), 0, 0, 1, 1},
  {&__pyx_n_s__p2, __pyx_k__p2, sizeof(__pyx_k__p2), 0, 0, 1, 1},
  {&__pyx_n_s__p2io, __pyx_k__p2io, sizeof(__pyx_k__p2io), 0, 0, 1, 1},
  {&__pyx_n_s__p2n, __pyx_k__p2n, sizeof(__pyx_k__p2n), 0, 0, 1, 1},
  {&__pyx_n_s__p2s, __pyx_k__p2s, sizeof(__pyx_k__p2s), 0, 0, 1, 1},
  {&__pyx_n_s__pack, __pyx_k__pack, sizeof(__pyx_k__pack), 0, 0, 1, 1},
  {&__pyx_n_s__parse_peakname, __pyx_k__parse_peakname, sizeof(__pyx_k__parse_peakname), 0, 0, 1, 1},
  {&__pyx_n_s__peak_score, __pyx_k__peak_score, sizeof(__pyx_k__peak_score), 0, 0, 1, 1},
  {&__pyx_n_s__peakname1, __pyx_k__peakname1, sizeof(__pyx_k__peakname1), 0, 0, 1, 1},
  {&__pyx_n_s__peakname2, __pyx_k__peakname2, sizeof(__pyx_k__peakname2), 0, 0, 1, 1},
  {&__pyx_n_s__peaks, __pyx_k__peaks, sizeof(__pyx_k__peaks), 0, 0, 1, 1},
  {&__pyx_n_s__pileup, __pyx_k__pileup, sizeof(__pyx_k__pileup), 0, 0, 1, 1},
  {&__pyx_n_s__pointer, __pyx_k__pointer, sizeof(__pyx_k__pointer), 0, 0, 1, 1},
  {&__pyx_n_s__pos, __pyx_k__pos, sizeof(__pyx_k__pos), 0, 0, 1, 1},
  {&__pyx_n_s__pre, __pyx_k__pre, sizeof(__pyx_k__pre), 0, 0, 1, 1},
  {&__pyx_n_s__pre_p, __pyx_k__pre_p, sizeof(__pyx_k__pre_p), 0, 0, 1, 1},
  {&__pyx_n_s__print_diff_peaks, __pyx_k__print_diff_peaks, sizeof(__pyx_k__print_diff_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__print_some_peaks, __pyx_k__print_some_peaks, sizeof(__pyx_k__print_some_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__pscore, __pyx_k__pscore, sizeof(__pyx_k__pscore), 0, 0, 1, 1},
  {&__pyx_n_s__pscore_khashtable, __pyx_k__pscore_khashtable, sizeof(__pyx_k__pscore_khashtable), 0, 0, 1, 1},
  {&__pyx_n_s__pseudocount, __pyx_k__pseudocount, sizeof(__pyx_k__pseudocount), 0, 0, 1, 1},
  {&__pyx_n_s__pvalue, __pyx_k__pvalue, sizeof(__pyx_k__pvalue), 0, 0, 1, 1},
  {&__pyx_n_s__pyarray, __pyx_k__pyarray, sizeof(__pyx_k__pyarray), 0, 0, 1, 1},
  {&__pyx_n_s__q, __pyx_k__q, sizeof(__pyx_k__q), 0, 0, 1, 1},
  {&__pyx_n_s__qscore, __pyx_k__qscore, sizeof(__pyx_k__qscore), 0, 0, 1, 1},
  {&__pyx_n_s__radd, __pyx_k__radd, sizeof(__pyx_k__radd), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__rarray, __pyx_k__rarray, sizeof(__pyx_k__rarray), 0, 0, 1, 1},
  {&__pyx_n_s__reassign_peaks, __pyx_k__reassign_peaks, sizeof(__pyx_k__reassign_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__rebuild_chromosomes, __pyx_k__rebuild_chromosomes, sizeof(__pyx_k__rebuild_chromosomes), 0, 0, 1, 1},
  {&__pyx_n_s__reduce, __pyx_k__reduce, sizeof(__pyx_k__reduce), 0, 0, 1, 1},
  {&__pyx_n_s__refcheck, __pyx_k__refcheck, sizeof(__pyx_k__refcheck), 0, 0, 1, 1},
  {&__pyx_n_s__replace, __pyx_k__replace, sizeof(__pyx_k__replace), 0, 0, 1, 1},
  {&__pyx_n_s__resize, __pyx_k__resize, sizeof(__pyx_k__resize), 0, 0, 1, 1},
  {&__pyx_n_s__ret, __pyx_k__ret, sizeof(__pyx_k__ret), 0, 0, 1, 1},
  {&__pyx_n_s__reverse, __pyx_k__reverse, sizeof(__pyx_k__reverse), 0, 0, 1, 1},
  {&__pyx_n_s__right, __pyx_k__right, sizeof(__pyx_k__right), 0, 0, 1, 1},
  {&__pyx_n_s__score, __pyx_k__score, sizeof(__pyx_k__score), 0, 0, 1, 1},
  {&__pyx_n_s__score_method, __pyx_k__score_method, sizeof(__pyx_k__score_method), 0, 0, 1, 1},
  {&__pyx_n_s__searchsorted, __pyx_k__searchsorted, sizeof(__pyx_k__searchsorted), 0, 0, 1, 1},
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
  {&__pyx_n_s__set_item, __pyx_k__set_item, sizeof(__pyx_k__set_item), 0, 0, 1, 1},
  {&__pyx_n_s__set_pseudocount, __pyx_k__set_pseudocount, sizeof(__pyx_k__set_pseudocount), 0, 0, 1, 1},
  {&__pyx_n_s__sf, __pyx_k__sf, sizeof(__pyx_k__sf), 0, 0, 1, 1},
  {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1},
  {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
  {&__pyx_n_s__sort, __pyx_k__sort, sizeof(__pyx_k__sort), 0, 0, 1, 1},
  {&__pyx_n_s__sorted, __pyx_k__sorted, sizeof(__pyx_k__sorted), 0, 0, 1, 1},
  {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1},
  {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
  {&__pyx_n_s__stderr_on, __pyx_k__stderr_on, sizeof(__pyx_k__stderr_on), 0, 0, 1, 1},
  {&__pyx_n_s__step, __pyx_k__step, sizeof(__pyx_k__step), 0, 0, 1, 1},
  {&__pyx_n_s__stop, __pyx_k__stop, sizeof(__pyx_k__stop), 0, 0, 1, 1},
  {&__pyx_n_s__store_peaks, __pyx_k__store_peaks, sizeof(__pyx_k__store_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__struct, __pyx_k__struct, sizeof(__pyx_k__struct), 0, 0, 1, 1},
  {&__pyx_n_s__sum, __pyx_k__sum, sizeof(__pyx_k__sum), 0, 0, 1, 1},
  {&__pyx_n_s__summit, __pyx_k__summit, sizeof(__pyx_k__summit), 0, 0, 1, 1},
  {&__pyx_n_s__summit1, __pyx_k__summit1, sizeof(__pyx_k__summit1), 0, 0, 1, 1},
  {&__pyx_n_s__summit2, __pyx_k__summit2, sizeof(__pyx_k__summit2), 0, 0, 1, 1},
  {&__pyx_n_s__t, __pyx_k__t, sizeof(__pyx_k__t), 0, 0, 1, 1},
  {&__pyx_n_s__t1bdg, __pyx_k__t1bdg, sizeof(__pyx_k__t1bdg), 0, 0, 1, 1},
  {&__pyx_n_s__t2bdg, __pyx_k__t2bdg, sizeof(__pyx_k__t2bdg), 0, 0, 1, 1},
  {&__pyx_n_s__thickEnd, __pyx_k__thickEnd, sizeof(__pyx_k__thickEnd), 0, 0, 1, 1},
  {&__pyx_n_s__thickStart, __pyx_k__thickStart, sizeof(__pyx_k__thickStart), 0, 0, 1, 1},
  {&__pyx_n_s__total, __pyx_k__total, sizeof(__pyx_k__total), 0, 0, 1, 1},
  {&__pyx_n_s__trackline, __pyx_k__trackline, sizeof(__pyx_k__trackline), 0, 0, 1, 1},
  {&__pyx_n_s__treat1, __pyx_k__treat1, sizeof(__pyx_k__treat1), 0, 0, 1, 1},
  {&__pyx_n_s__treat2, __pyx_k__treat2, sizeof(__pyx_k__treat2), 0, 0, 1, 1},
  {&__pyx_n_s__treat_depth, __pyx_k__treat_depth, sizeof(__pyx_k__treat_depth), 0, 0, 1, 1},
  {&__pyx_n_s__unique, __pyx_k__unique, sizeof(__pyx_k__unique), 0, 0, 1, 1},
  {&__pyx_n_s__unpack, __pyx_k__unpack, sizeof(__pyx_k__unpack), 0, 0, 1, 1},
  {&__pyx_n_s__v11, __pyx_k__v11, sizeof(__pyx_k__v11), 0, 0, 1, 1},
  {&__pyx_n_s__v11n, __pyx_k__v11n, sizeof(__pyx_k__v11n), 0, 0, 1, 1},
  {&__pyx_n_s__v1add, __pyx_k__v1add, sizeof(__pyx_k__v1add), 0, 0, 1, 1},
  {&__pyx_n_s__v1array, __pyx_k__v1array, sizeof(__pyx_k__v1array), 0, 0, 1, 1},
  {&__pyx_n_s__v2, __pyx_k__v2, sizeof(__pyx_k__v2), 0, 0, 1, 1},
  {&__pyx_n_s__v21, __pyx_k__v21, sizeof(__pyx_k__v21), 0, 0, 1, 1},
  {&__pyx_n_s__v21n, __pyx_k__v21n, sizeof(__pyx_k__v21n), 0, 0, 1, 1},
  {&__pyx_n_s__v2add, __pyx_k__v2add, sizeof(__pyx_k__v2add), 0, 0, 1, 1},
  {&__pyx_n_s__v2array, __pyx_k__v2array, sizeof(__pyx_k__v2array), 0, 0, 1, 1},
  {&__pyx_n_s__v2n, __pyx_k__v2n, sizeof(__pyx_k__v2n), 0, 0, 1, 1},
  {&__pyx_n_s__v2s, __pyx_k__v2s, sizeof(__pyx_k__v2s), 0, 0, 1, 1},
  {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
  {&__pyx_n_s__where, __pyx_k__where, sizeof(__pyx_k__where), 0, 0, 1, 1},
  {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1},
  {&__pyx_n_s__write_bedGraph, __pyx_k__write_bedGraph, sizeof(__pyx_k__write_bedGraph), 0, 0, 1, 1},
  {&__pyx_n_s__write_matrix, __pyx_k__write_matrix, sizeof(__pyx_k__write_matrix), 0, 0, 1, 1},
  {&__pyx_n_s__write_peaks2, __pyx_k__write_peaks2, sizeof(__pyx_k__write_peaks2), 0, 0, 1, 1},
  {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1},
  {&__pyx_n_s__xls, __pyx_k__xls, sizeof(__pyx_k__xls), 0, 0, 1, 1},
  {&__pyx_n_s__xls1, __pyx_k__xls1, sizeof(__pyx_k__xls1), 0, 0, 1, 1},
  {&__pyx_n_s__xls2, __pyx_k__xls2, sizeof(__pyx_k__xls2), 0, 0, 1, 1},
  {&__pyx_n_s__xrange, __pyx_k__xrange, sizeof(__pyx_k__xrange), 0, 0, 1, 1},
  {&__pyx_n_s__y, __pyx_k__y, sizeof(__pyx_k__y), 0, 0, 1, 1},
  {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
  {&__pyx_n_s__zip, __pyx_k__zip, sizeof(__pyx_k__zip), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ord = __Pyx_GetName(__pyx_b, __pyx_n_s__ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplemented = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplemented); if (!__pyx_builtin_NotImplemented) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_sum = __Pyx_GetName(__pyx_b, __pyx_n_s__sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_zip = __Pyx_GetName(__pyx_b, __pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_reduce = __Pyx_GetName(__pyx_b, __pyx_n_s__reduce); if (!__pyx_builtin_reduce) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_min = __Pyx_GetName(__pyx_b, __pyx_n_s__min); if (!__pyx_builtin_min) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_Ellipsis = __Pyx_GetName(__pyx_b, __pyx_n_s__Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin_id = __Pyx_GetName(__pyx_b, __pyx_n_s__id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __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);

  /* "MACS2/IO/cScoreTrack.pyx":201
 *     def add_chromosome ( self, str chrom, int chrom_max_len ):
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
 *                                                              ('V1','float32'), # value for the first track
 *                                                              ('V2','float32'), # value for the second track
 */
  __pyx_k_tuple_1 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__pos), ((PyObject *)__pyx_n_s__int32)); if (unlikely(!__pyx_k_tuple_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_1));

  /* "MACS2/IO/cScoreTrack.pyx":202
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 *                                                              ('V1','float32'), # value for the first track             # <<<<<<<<<<<<<<
 *                                                              ('V2','float32'), # value for the second track
 *                                                              ])
 */
  __pyx_k_tuple_2 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__V1), ((PyObject *)__pyx_n_s__float32)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_2);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));

  /* "MACS2/IO/cScoreTrack.pyx":203
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 *                                                              ('V1','float32'), # value for the first track
 *                                                              ('V2','float32'), # value for the second track             # <<<<<<<<<<<<<<
 *                                                              ])
 *             self.pointer[chrom] = 0
 */
  __pyx_k_tuple_3 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__V2), ((PyObject *)__pyx_n_s__float32)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_3);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));

  /* "MACS2/IO/cScoreTrack.pyx":398
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
 *         for i in range(len(rarray)):
 *             (chrom,start,end) = rarray[i].split('.')             # <<<<<<<<<<<<<<
 *             if chrom == cur_region[0] and start == cur_region[2]:
 *                 cur_region[2] =  end
 */
  __pyx_k_tuple_7 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_7);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));

  /* "MACS2/IO/cScoreTrack.pyx":431
 *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
 *         for i in range(len(rarray)):
 *             (chrom,start,end) = rarray[i].split('.')             # <<<<<<<<<<<<<<
 *             if chrom == cur_region[0] and start == cur_region[2]:
 *                 cur_region[2] =  end
 */
  __pyx_k_tuple_8 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_8);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));

  /* "MACS2/IO/cScoreTrack.pyx":956
 *             np.ndarray pos, value
 * 
 *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."             # <<<<<<<<<<<<<<
 * 
 *         write = fhd.write
 */
  __pyx_k_tuple_11 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_4); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_11);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));

  /* "MACS2/IO/cScoreTrack.pyx":1518
 *             long l, i, prev_pos
 *             str chrom
 *         rv = chi2(1) # a chi-squared distribution with one degree of freedom             # <<<<<<<<<<<<<<
 *         sf = rv.sf
 *         log10 = np.log10
 */
  __pyx_k_tuple_25 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_25);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));

  /* "MACS2/IO/cScoreTrack.pyx":1525
 *             pos = self.data[chrom][0]
 *             l = self.datalength[chrom]
 *             self.data[chrom][1] = -log10(sf(2 * self.data[chrom][1] / LOG10_E)).astype('float32')             # <<<<<<<<<<<<<<
 *             self.data[chrom][2] = -log10(sf(2 * self.data[chrom][2] / LOG10_E)).astype('float32')
 *             self.data[chrom][3] = -log10(sf(2 * np.abs(self.data[chrom][3]) / LOG10_E)).astype('float32')
 */
  __pyx_k_tuple_26 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__float32)); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_26);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));

  /* "MACS2/IO/cScoreTrack.pyx":1526
 *             l = self.datalength[chrom]
 *             self.data[chrom][1] = -log10(sf(2 * self.data[chrom][1] / LOG10_E)).astype('float32')
 *             self.data[chrom][2] = -log10(sf(2 * self.data[chrom][2] / LOG10_E)).astype('float32')             # <<<<<<<<<<<<<<
 *             self.data[chrom][3] = -log10(sf(2 * np.abs(self.data[chrom][3]) / LOG10_E)).astype('float32')
 *             v1 = self.data[chrom][1]
 */
  __pyx_k_tuple_27 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__float32)); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_27);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));

  /* "MACS2/IO/cScoreTrack.pyx":1527
 *             self.data[chrom][1] = -log10(sf(2 * self.data[chrom][1] / LOG10_E)).astype('float32')
 *             self.data[chrom][2] = -log10(sf(2 * self.data[chrom][2] / LOG10_E)).astype('float32')
 *             self.data[chrom][3] = -log10(sf(2 * np.abs(self.data[chrom][3]) / LOG10_E)).astype('float32')             # <<<<<<<<<<<<<<
 *             v1 = self.data[chrom][1]
 *             v2 = self.data[chrom][2]
 */
  __pyx_k_tuple_28 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__float32)); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_28);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28));

  /* "MACS2/IO/cScoreTrack.pyx":1562
 *         # convert pvalue2qvalue to a simple dict based on khash
 *         # khash has big advantage while checking keys for millions of times.
 *         for table_index in range(2):             # <<<<<<<<<<<<<<
 *             pqtable = pqtables[table_index]
 *             s_p2q = Float64HashTable()
 */
  __pyx_k_tuple_30 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_30);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));

  /* "MACS2/IO/cScoreTrack.pyx":1755
 *             np.ndarray pos, value
 * 
 *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."             # <<<<<<<<<<<<<<
 * 
 *         write = fhd.write
 */
  __pyx_k_tuple_32 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_4); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_32);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));

  /* "MACS2/IO/cScoreTrack.pyx":1923
 *                         # close
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                             best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                             cat1_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
  __pyx_k_tuple_35 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_35);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));

  /* "MACS2/IO/cScoreTrack.pyx":1934
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                         best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                         cat1_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
  __pyx_k_tuple_36 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_36);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));

  /* "MACS2/IO/cScoreTrack.pyx":1955
 *                         # close
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                             best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                             cat2_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
  __pyx_k_tuple_37 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_37);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));

  /* "MACS2/IO/cScoreTrack.pyx":1966
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                         best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                         cat2_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
  __pyx_k_tuple_38 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_38);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));

  /* "MACS2/IO/cScoreTrack.pyx":1988
 *                         # close
 *                         if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                             best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                             cat3_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                             summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
  __pyx_k_tuple_39 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_39);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39));

  /* "MACS2/IO/cScoreTrack.pyx":1999
 *                 else:
 *                     if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
 *                         best_qscore = min(map(itemgetter(2), peak_content))             # <<<<<<<<<<<<<<
 *                         cat3_peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
 *                                         summit = -1, peak_score  = 0, pileup = 0, pscore = 0,
 */
  __pyx_k_tuple_40 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_40);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));

  /* "MACS2/IO/cScoreTrack.pyx":2151
 *                 peaks2 = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []
 *             peaks = np.unique(np.array(map(itemgetter('start'), peaks1) +             # <<<<<<<<<<<<<<
 *                              map(itemgetter('end'), peaks1) +
 *                              map(itemgetter('start'), peaks2) +
 */
  __pyx_k_tuple_42 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__start)); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_42);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42));

  /* "MACS2/IO/cScoreTrack.pyx":2152
 *             except KeyError: peaks2 = []
 *             peaks = np.unique(np.array(map(itemgetter('start'), peaks1) +
 *                              map(itemgetter('end'), peaks1) +             # <<<<<<<<<<<<<<
 *                              map(itemgetter('start'), peaks2) +
 *                              map(itemgetter('end'), peaks2),
 */
  __pyx_k_tuple_43 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__end)); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_43);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));

  /* "MACS2/IO/cScoreTrack.pyx":2153
 *             peaks = np.unique(np.array(map(itemgetter('start'), peaks1) +
 *                              map(itemgetter('end'), peaks1) +
 *                              map(itemgetter('start'), peaks2) +             # <<<<<<<<<<<<<<
 *                              map(itemgetter('end'), peaks2),
 *                              dtype='int32'))
 */
  __pyx_k_tuple_44 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__start)); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_44);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));

  /* "MACS2/IO/cScoreTrack.pyx":2154
 *                              map(itemgetter('end'), peaks1) +
 *                              map(itemgetter('start'), peaks2) +
 *                              map(itemgetter('end'), peaks2),             # <<<<<<<<<<<<<<
 *                              dtype='int32'))
 *             n = peaks.size
 */
  __pyx_k_tuple_45 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__end)); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_45);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45));

  /* "MACS2/IO/cScoreTrack.pyx":2487
 *                         in_peaks[above_cutoff[first_i]:above_cutoff[i]] = True
 * 
 *             self.where_peaks[chrom] = np.where(in_peaks)[0].astype('int32')             # <<<<<<<<<<<<<<
 * #            print "Total peakage in bp", in_peaks.sum()
 * 
 */
  __pyx_k_tuple_47 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__int32)); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_47);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));

  /* "MACS2/IO/cScoreTrack.pyx":2511
 *                 data = self.p1io.get_data_from_chrom(chrom)
 *             except KeyError: data = []
 *             p1starts = np.array(map(itemgetter("start"), data), 'int32')             # <<<<<<<<<<<<<<
 *             p1ends = np.array(map(itemgetter("end"), data), 'int32')
 *             j = 0
 */
  __pyx_k_tuple_48 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__start)); if (unlikely(!__pyx_k_tuple_48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_48);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_48));

  /* "MACS2/IO/cScoreTrack.pyx":2512
 *             except KeyError: data = []
 *             p1starts = np.array(map(itemgetter("start"), data), 'int32')
 *             p1ends = np.array(map(itemgetter("end"), data), 'int32')             # <<<<<<<<<<<<<<
 *             j = 0
 *             j_max = p1starts.size
 */
  __pyx_k_tuple_49 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__end)); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_49);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));

  /* "MACS2/IO/cScoreTrack.pyx":2537
 *                 data = self.p2io.get_data_from_chrom(chrom)
 *             except KeyError: data = []
 *             p2starts = np.array(map(itemgetter("start"), data), 'int32')             # <<<<<<<<<<<<<<
 *             p2ends = np.array(map(itemgetter("end"), data), 'int32')
 *             j = 0
 */
  __pyx_k_tuple_50 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__start)); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_50);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));

  /* "MACS2/IO/cScoreTrack.pyx":2538
 *             except KeyError: data = []
 *             p2starts = np.array(map(itemgetter("start"), data), 'int32')
 *             p2ends = np.array(map(itemgetter("end"), data), 'int32')             # <<<<<<<<<<<<<<
 *             j = 0
 *             j_max = p2starts.size
 */
  __pyx_k_tuple_51 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__end)); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_51);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));

  /* "MACS2/IO/cScoreTrack.pyx":2561
 * 
 *             where_peaks = np.where(np.logical_or(which_peaks1 >= 0,
 *                                                  which_peaks2 >= 0))[0].astype('int32')             # <<<<<<<<<<<<<<
 *             self.where_peaks[chrom] = where_peaks
 *             self.which_peaks1[chrom] = which_peaks1[where_peaks]
 */
  __pyx_k_tuple_52 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__int32)); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_52);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52));

  /* "MACS2/IO/cScoreTrack.pyx":2638
 *             int pseudocount
 *             np.ndarray[np.float32_t] t1, t2, v
 *         rv = chi2(1) # a chi-squared distribution with one degree of freedom             # <<<<<<<<<<<<<<
 *         sf = rv.sf
 *         log10 = np.log10
 */
  __pyx_k_tuple_55 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_55);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55));

  /* "MACS2/IO/cScoreTrack.pyx":2652
 *                     v[i] = logLR_adjusted(<int>t1[i] + pseudocount,
 *                                           <int>t2[i] + pseudocount)
 *                 self.t1vs2[chrom] = -log10(sf(2 * v / LOG10_E)).astype('float32')             # <<<<<<<<<<<<<<
 * 
 *     cpdef compute_diff_qvalues ( self ):
 */
  __pyx_k_tuple_56 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__float32)); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_56);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));

  /* "MACS2/IO/cScoreTrack.pyx":2762
 *             np.ndarray pos, value
 * 
 *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."             # <<<<<<<<<<<<<<
 * 
 *         write = fhd.write
 */
  __pyx_k_tuple_58 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_4); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_58);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));

  /* "MACS2/IO/cScoreTrack.pyx":2979
 *         else:
 *             bedwrite = do_nothing
 *         xlswrite("# values are maxmimum in region\n")             # <<<<<<<<<<<<<<
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xlswrite("# log10_fold_change is positive if t1 > t2\n")
 */
  __pyx_k_tuple_65 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_65);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));

  /* "MACS2/IO/cScoreTrack.pyx":2980
 *             bedwrite = do_nothing
 *         xlswrite("# values are maxmimum in region\n")
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth             # <<<<<<<<<<<<<<
 *         xlswrite("# log10_fold_change is positive if t1 > t2\n")
 *         tc_method = self.track_scoring_method
 */
  __pyx_k_tuple_67 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_66)); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_67);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));

  /* "MACS2/IO/cScoreTrack.pyx":2981
 *         xlswrite("# values are maxmimum in region\n")
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xlswrite("# log10_fold_change is positive if t1 > t2\n")             # <<<<<<<<<<<<<<
 *         tc_method = self.track_scoring_method
 *         xlswrite("\t".join(("chr", "start", "end", "length",
 */
  __pyx_k_tuple_69 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_69);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_69));

  /* "MACS2/IO/cScoreTrack.pyx":2996
 *         try: desc = description % name
 *         except: desc = description
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))             # <<<<<<<<<<<<<<
 *         if trackline:
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)
 */
  __pyx_k_tuple_83 = PyTuple_Pack(2, ((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_kp_s_82)); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_83);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_83));
  __pyx_k_tuple_84 = PyTuple_Pack(2, ((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_kp_s_82)); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_84);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_84));

  /* "MACS2/IO/cScoreTrack.pyx":2999
 *         if trackline:
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)
 *             except: bedwrite('track name=MACS description=Unknown\n')             # <<<<<<<<<<<<<<
 * 
 *         log10 = np.log10
 */
  __pyx_k_tuple_87 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_86)); if (unlikely(!__pyx_k_tuple_87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_87);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_87));

  /* "MACS2/IO/cScoreTrack.pyx":3019
 *             if self.diff_scoring_method == 'q':
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')
 */
  __pyx_k_tuple_88 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__int32)); if (unlikely(!__pyx_k_tuple_88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_88);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_88));

  /* "MACS2/IO/cScoreTrack.pyx":3021
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             for first_i, last_i, n_peak in self.diff_peaks[chrom]:
 *                 start_i = above_cutoff[first_i]
 */
  __pyx_k_tuple_89 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__int32)); if (unlikely(!__pyx_k_tuple_89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_89);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_89));

  /* "MACS2/IO/cScoreTrack.pyx":3074
 *                 xlswrite("\t%.5f" % log2_fe2)
 *                 xlswrite("\t%.5f" % tc_value2)
 *                 xlswrite("\n")             # <<<<<<<<<<<<<<
 *                 bedwrite("%s\t%d\t%d\t%s\t%.5f\n" %
 *                          (chrom, start, end, peakname,
 */
  __pyx_k_tuple_94 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_80)); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_94);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_94));

  /* "MACS2/IO/cScoreTrack.pyx":3118
 *         else:
 *             bedwrite = do_nothing
 *         xlswrite("# summit is defined as greatest summit from greatest sample in region \n")             # <<<<<<<<<<<<<<
 *         xlswrite("# values are reported for the summit, except for \n")
 *         xlswrite("# fold_enrichment, sample/control qvalues, peaknames, which are copied from the peak info \n")
 */
  __pyx_k_tuple_99 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_98)); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_99);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_99));

  /* "MACS2/IO/cScoreTrack.pyx":3119
 *             bedwrite = do_nothing
 *         xlswrite("# summit is defined as greatest summit from greatest sample in region \n")
 *         xlswrite("# values are reported for the summit, except for \n")             # <<<<<<<<<<<<<<
 *         xlswrite("# fold_enrichment, sample/control qvalues, peaknames, which are copied from the peak info \n")
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 */
  __pyx_k_tuple_101 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_100)); if (unlikely(!__pyx_k_tuple_101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_101);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_101));

  /* "MACS2/IO/cScoreTrack.pyx":3120
 *         xlswrite("# summit is defined as greatest summit from greatest sample in region \n")
 *         xlswrite("# values are reported for the summit, except for \n")
 *         xlswrite("# fold_enrichment, sample/control qvalues, peaknames, which are copied from the peak info \n")             # <<<<<<<<<<<<<<
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xlswrite("# differential values are reported at the taller sample peak\n")
 */
  __pyx_k_tuple_103 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_102)); if (unlikely(!__pyx_k_tuple_103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_103);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_103));

  /* "MACS2/IO/cScoreTrack.pyx":3121
 *         xlswrite("# values are reported for the summit, except for \n")
 *         xlswrite("# fold_enrichment, sample/control qvalues, peaknames, which are copied from the peak info \n")
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth             # <<<<<<<<<<<<<<
 *         xlswrite("# differential values are reported at the taller sample peak\n")
 *         xlswrite("# log2_fold_change is positive if t1 > t2\n")
 */
  __pyx_k_tuple_104 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_66)); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_104);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_104));

  /* "MACS2/IO/cScoreTrack.pyx":3122
 *         xlswrite("# fold_enrichment, sample/control qvalues, peaknames, which are copied from the peak info \n")
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xlswrite("# differential values are reported at the taller sample peak\n")             # <<<<<<<<<<<<<<
 *         xlswrite("# log2_fold_change is positive if t1 > t2\n")
 *         xlswrite("\t".join(("chr", "start", "end", "length", "summit",
 */
  __pyx_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_105)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_106);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_106));

  /* "MACS2/IO/cScoreTrack.pyx":3123
 *         xlswrite("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xlswrite("# differential values are reported at the taller sample peak\n")
 *         xlswrite("# log2_fold_change is positive if t1 > t2\n")             # <<<<<<<<<<<<<<
 *         xlswrite("\t".join(("chr", "start", "end", "length", "summit",
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 */
  __pyx_k_tuple_108 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_107)); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_108);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_108));

  /* "MACS2/IO/cScoreTrack.pyx":3124
 *         xlswrite("# differential values are reported at the taller sample peak\n")
 *         xlswrite("# log2_fold_change is positive if t1 > t2\n")
 *         xlswrite("\t".join(("chr", "start", "end", "length", "summit",             # <<<<<<<<<<<<<<
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 *                          "-log10.diff.pvalue",
 */
  __pyx_k_tuple_112 = PyTuple_Pack(23, ((PyObject *)__pyx_n_s__chr), ((PyObject *)__pyx_n_s__start), ((PyObject *)__pyx_n_s__end), ((PyObject *)__pyx_n_s__length), ((PyObject *)__pyx_n_s__summit), ((PyObject *)__pyx_kp_s_71), ((PyObject *)__pyx_kp_s_109), ((PyObject *)__pyx_kp_s_72), ((PyObject *)__pyx_kp_s_73), ((PyObject *)__pyx_kp_s_74), ((PyObject *)__pyx_kp_s_75), ((PyObject *)__pyx_n_s__treat1), ((PyObject *)__pyx_n_s__control1), ((PyObject *)__pyx_kp_s_76), ((PyObject *)__pyx_kp_s_110), ((PyObject *)__pyx_n_s__peakname1), ((PyObject *)__pyx_n_s__summit1), ((PyObject *)__pyx_n_s__treat2), ((PyObject *)__pyx_n_s__control2), ((PyObject *)__pyx_kp_s_78), ((PyObject *)__pyx_kp_s_111), ((PyObject *)__pyx_n_s__peakname2), ((PyObject *)__pyx_n_s__summit2)); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_112);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_112));
  __pyx_k_tuple_113 = PyTuple_Pack(1, ((PyObject *)__pyx_k_tuple_112)); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_113);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_113));

  /* "MACS2/IO/cScoreTrack.pyx":3139
 *         try: desc = description % name
 *         except: desc = description
 *         trackcontents = (name.replace("\"", "\\\""), desc.replace("\"", "\\\""))             # <<<<<<<<<<<<<<
 *         if trackline:
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)
 */
  __pyx_k_tuple_114 = PyTuple_Pack(2, ((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_kp_s_82)); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_114);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_114));
  __pyx_k_tuple_115 = PyTuple_Pack(2, ((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_kp_s_82)); if (unlikely(!__pyx_k_tuple_115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_115);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_115));

  /* "MACS2/IO/cScoreTrack.pyx":3142
 *         if trackline:
 *             try: bedwrite('track name="%s (peaks)" description="%s" visibility=1\n' % trackcontents)
 *             except: bedwrite('track name=MACS description=Unknown\n')             # <<<<<<<<<<<<<<
 * 
 *         log10 = np.log10
 */
  __pyx_k_tuple_116 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_86)); if (unlikely(!__pyx_k_tuple_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_116);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_116));

  /* "MACS2/IO/cScoreTrack.pyx":3170
 *             if self.diff_scoring_method == 'q':
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')
 */
  __pyx_k_tuple_117 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__int32)); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_117);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_117));

  /* "MACS2/IO/cScoreTrack.pyx":3172
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][self.where_peaks[chrom]] >= self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             # use some extra memory so we don't have to reallocate every time
 *             peaks1_selection = np.ndarray(npeaks1, 'int32')
 */
  __pyx_k_tuple_118 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__int32)); if (unlikely(!__pyx_k_tuple_118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_118);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_118));

  /* "MACS2/IO/cScoreTrack.pyx":3182
 *                 pos_start = qpos[start_i] - 1
 *                 pos_end = qpos[end_i]
 *                 i_peaks1 = np.unique(which_peaks1[start_i:(end_i + 1)]).astype('int32')             # <<<<<<<<<<<<<<
 *                 try:
 *                     if i_peaks1[0] == -1: i_peaks1 = i_peaks1[1:]
 */
  __pyx_k_tuple_119 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__int32)); if (unlikely(!__pyx_k_tuple_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_119);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_119));

  /* "MACS2/IO/cScoreTrack.pyx":3186
 *                     if i_peaks1[0] == -1: i_peaks1 = i_peaks1[1:]
 *                 except IndexError: pass
 *                 i_peaks2 = np.unique(which_peaks2[start_i:(end_i + 1)]).astype('int32')             # <<<<<<<<<<<<<<
 *                 try:
 *                     if i_peaks2[0] == -1: i_peaks2 = i_peaks2[1:]
 */
  __pyx_k_tuple_120 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__int32)); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_120);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_120));

  /* "MACS2/IO/cScoreTrack.pyx":3297
 *                     xlswrite("\t%s" % peak1["name"])
 *                     xlswrite("\t%d" % peak1["summit"])
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")             # <<<<<<<<<<<<<<
 *                 xlswrite("\t%.5f" % t2[peak_pos_i])
 *                 xlswrite("\t%.5f" % c2[peak_pos_i])
 */
  __pyx_k_tuple_123 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_122)); if (unlikely(!__pyx_k_tuple_123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_123);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_123));

  /* "MACS2/IO/cScoreTrack.pyx":3305
 *                     xlswrite("\t%s" % peak2["name"])
 *                     xlswrite("\t%d" % peak2["summit"])
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")             # <<<<<<<<<<<<<<
 *                 xlswrite("\n")
 *                 bedwrite("%s\t%d\t%d\t%s\t%.5f\n" %
 */
  __pyx_k_tuple_124 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_122)); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_124);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_124));

  /* "MACS2/IO/cScoreTrack.pyx":3306
 *                     xlswrite("\t%d" % peak2["summit"])
 *                 else: xlswrite("\tNA\tNA\tNA\tNA")
 *                 xlswrite("\n")             # <<<<<<<<<<<<<<
 *                 bedwrite("%s\t%d\t%d\t%s\t%.5f\n" %
 *                          (chrom, start, end, peakname,
 */
  __pyx_k_tuple_125 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_80)); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_125);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_125));

  /* "MACS2/IO/cScoreTrack.pyx":3326
 *         try: peakprefix = name_prefix % name
 *         except: peakprefix = name_prefix
 *         xls1.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth             # <<<<<<<<<<<<<<
 *         xls1.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls1.write("# log2_fold_change is positive if t1 > t2\n")
 */
  __pyx_k_tuple_126 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_66)); if (unlikely(!__pyx_k_tuple_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_126);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_126));

  /* "MACS2/IO/cScoreTrack.pyx":3327
 *         except: peakprefix = name_prefix
 *         xls1.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xls1.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")             # <<<<<<<<<<<<<<
 *         xls1.write("# log2_fold_change is positive if t1 > t2\n")
 *         xls2.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond2_depth
 */
  __pyx_k_tuple_128 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_127)); if (unlikely(!__pyx_k_tuple_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_128);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_128));

  /* "MACS2/IO/cScoreTrack.pyx":3328
 *         xls1.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond1_depth
 *         xls1.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls1.write("# log2_fold_change is positive if t1 > t2\n")             # <<<<<<<<<<<<<<
 *         xls2.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond2_depth
 *         xls2.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 */
  __pyx_k_tuple_129 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_107)); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_129);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_129));

  /* "MACS2/IO/cScoreTrack.pyx":3329
 *         xls1.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls1.write("# log2_fold_change is positive if t1 > t2\n")
 *         xls2.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond2_depth             # <<<<<<<<<<<<<<
 *         xls2.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls2.write("# log2_fold_change is positive if t2 > t1\n")
 */
  __pyx_k_tuple_130 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_66)); if (unlikely(!__pyx_k_tuple_130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_130);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_130));

  /* "MACS2/IO/cScoreTrack.pyx":3330
 *         xls1.write("# log2_fold_change is positive if t1 > t2\n")
 *         xls2.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond2_depth
 *         xls2.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")             # <<<<<<<<<<<<<<
 *         xls2.write("# log2_fold_change is positive if t2 > t1\n")
 *         xls1.write("\t".join(("chr", "start", "end", "length", "summit",
 */
  __pyx_k_tuple_131 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_127)); if (unlikely(!__pyx_k_tuple_131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_131);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_131));

  /* "MACS2/IO/cScoreTrack.pyx":3331
 *         xls2.write("# Depth multiplier used: %f (treat/control values are after multiplication)\n") % self.cond2_depth
 *         xls2.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls2.write("# log2_fold_change is positive if t2 > t1\n")             # <<<<<<<<<<<<<<
 *         xls1.write("\t".join(("chr", "start", "end", "length", "summit",
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 */
  __pyx_k_tuple_133 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_132)); if (unlikely(!__pyx_k_tuple_133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_133);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_133));

  /* "MACS2/IO/cScoreTrack.pyx":3332
 *         xls2.write("# the peak with the closest summit from the other sample is reported if a peak overlaps the summit\n")
 *         xls2.write("# log2_fold_change is positive if t2 > t1\n")
 *         xls1.write("\t".join(("chr", "start", "end", "length", "summit",             # <<<<<<<<<<<<<<
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 *                          "-log10.diff.pvalue",
 */
  __pyx_k_tuple_134 = PyTuple_Pack(23, ((PyObject *)__pyx_n_s__chr), ((PyObject *)__pyx_n_s__start), ((PyObject *)__pyx_n_s__end), ((PyObject *)__pyx_n_s__length), ((PyObject *)__pyx_n_s__summit), ((PyObject *)__pyx_kp_s_71), ((PyObject *)__pyx_kp_s_109), ((PyObject *)__pyx_kp_s_72), ((PyObject *)__pyx_kp_s_73), ((PyObject *)__pyx_kp_s_74), ((PyObject *)__pyx_kp_s_75), ((PyObject *)__pyx_n_s__treat1), ((PyObject *)__pyx_n_s__control1), ((PyObject *)__pyx_kp_s_76), ((PyObject *)__pyx_kp_s_110), ((PyObject *)__pyx_n_s__peakname1), ((PyObject *)__pyx_n_s__summit1), ((PyObject *)__pyx_n_s__treat2), ((PyObject *)__pyx_n_s__control2), ((PyObject *)__pyx_kp_s_78), ((PyObject *)__pyx_kp_s_111), ((PyObject *)__pyx_n_s__peakname2), ((PyObject *)__pyx_n_s__summit2)); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_134);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_134));
  __pyx_k_tuple_135 = PyTuple_Pack(1, ((PyObject *)__pyx_k_tuple_134)); if (unlikely(!__pyx_k_tuple_135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_135);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_135));

  /* "MACS2/IO/cScoreTrack.pyx":3342
 *                          "-log10.qvalue2", "peakname2", "summit2",
 *                          ))+"\n")
 *         xls2.write("\t".join(("chr", "start", "end", "length", "summit",             # <<<<<<<<<<<<<<
 *                          "log2.fold.change","log2.fold.change.w.psuedocounts",
 *                          "-log10.diff.pvalue",
 */
  __pyx_k_tuple_136 = PyTuple_Pack(23, ((PyObject *)__pyx_n_s__chr), ((PyObject *)__pyx_n_s__start), ((PyObject *)__pyx_n_s__end), ((PyObject *)__pyx_n_s__length), ((PyObject *)__pyx_n_s__summit), ((PyObject *)__pyx_kp_s_71), ((PyObject *)__pyx_kp_s_109), ((PyObject *)__pyx_kp_s_72), ((PyObject *)__pyx_kp_s_73), ((PyObject *)__pyx_kp_s_74), ((PyObject *)__pyx_kp_s_75), ((PyObject *)__pyx_n_s__treat2), ((PyObject *)__pyx_n_s__control2), ((PyObject *)__pyx_kp_s_78), ((PyObject *)__pyx_kp_s_111), ((PyObject *)__pyx_n_s__peakname2), ((PyObject *)__pyx_n_s__summit2), ((PyObject *)__pyx_n_s__treat1), ((PyObject *)__pyx_n_s__control1), ((PyObject *)__pyx_kp_s_76), ((PyObject *)__pyx_kp_s_110), ((PyObject *)__pyx_n_s__peakname1), ((PyObject *)__pyx_n_s__summit1)); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_136);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_136));
  __pyx_k_tuple_137 = PyTuple_Pack(1, ((PyObject *)__pyx_k_tuple_136)); if (unlikely(!__pyx_k_tuple_137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_137);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_137));

  /* "MACS2/IO/cScoreTrack.pyx":3399
 *                     write("%s\t%d\t%d\t%d" % (chrom,start,end,length))
 *                     write("\t%d" % peak["summit"] + 1) # summit position
 *                     write("\tNA\tNA\tNA\tNA\tNA\tNA")             # <<<<<<<<<<<<<<
 *                     # this part spits out stuff for sample 1
 *                     write("\t%.5f" % peak["pileup"])
 */
  __pyx_k_tuple_139 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_138)); if (unlikely(!__pyx_k_tuple_139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_139);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_139));

  /* "MACS2/IO/cScoreTrack.pyx":3402
 *                     # this part spits out stuff for sample 1
 *                     write("\t%.5f" % peak["pileup"])
 *                     write("\tNA")             # <<<<<<<<<<<<<<
 *                     write("\t%.5f" % log2(peak["fc"]))
 *                     write("\t%.5f" % peak["qscore"])
 */
  __pyx_k_tuple_141 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_140)); if (unlikely(!__pyx_k_tuple_141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_141);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_141));

  /* "MACS2/IO/cScoreTrack.pyx":3408
 *                     write("\t%d" % peak["summit"] + 1)
 *                     # this stuff for peak 2
 *                     write("\tNA\tNA\tNA\tNA\tNA\tNA")             # <<<<<<<<<<<<<<
 *                     write("\n")
 *                 continue
 */
  __pyx_k_tuple_142 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_138)); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_142);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142));

  /* "MACS2/IO/cScoreTrack.pyx":3409
 *                     # this stuff for peak 2
 *                     write("\tNA\tNA\tNA\tNA\tNA\tNA")
 *                     write("\n")             # <<<<<<<<<<<<<<
 *                 continue
 *             peaks1 = p1io.get_data_from_chrom(chrom)
 */
  __pyx_k_tuple_143 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_80)); if (unlikely(!__pyx_k_tuple_143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_143);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_143));

  /* "MACS2/IO/cScoreTrack.pyx":3414
 *             try: peaks2 = p2io.get_data_from_chrom(chrom)
 *             except KeyError: peaks2 = []
 *             summits1 = np.array(map(itemgetter('summit'), peaks1),             # <<<<<<<<<<<<<<
 *                                 dtype='int32')
 *             # note, summits should be unique and should be in order
 */
  __pyx_k_tuple_144 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__summit)); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_144);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144));

  /* "MACS2/IO/cScoreTrack.pyx":3434
 *             if self.diff_scoring_method == 'q':
 *                 above_cutoff = np.where(self.diff_qvalues[chrom] >=
 *                                         self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][where_peaks] >= self.cutoff)[0].astype('int32')
 */
  __pyx_k_tuple_145 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__int32)); if (unlikely(!__pyx_k_tuple_145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_145);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_145));

  /* "MACS2/IO/cScoreTrack.pyx":3436
 *                                         self.cutoff)[0].astype('int32')
 *             elif self.diff_scoring_method == 'p':
 *                 above_cutoff = np.where(self.t1vs2[chrom][where_peaks] >= self.cutoff)[0].astype('int32')             # <<<<<<<<<<<<<<
 *             # change to coordinates for diff peak now
 *             for d in range(d_max):
 */
  __pyx_k_tuple_146 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__int32)); if (unlikely(!__pyx_k_tuple_146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_146);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_146));

  /* "MACS2/IO/cScoreTrack.pyx":3502
 *                         if score_value >= self.cutoff:
 *                             if d_max == 0:
 *                                 write("\tNA")             # <<<<<<<<<<<<<<
 *                             elif summit >= diff_peaks[d, 0]:
 *                                 diffpeakname = "%s%d" % (peakprefix,
 */
  __pyx_k_tuple_147 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_140)); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_147);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_147));

  /* "MACS2/IO/cScoreTrack.pyx":3508
 *                                 write("\t%s" % diffpeakname)
 *                             else:
 *                                 write("\tNA")             # <<<<<<<<<<<<<<
 *                         else:
 *                             write("\tNA")
 */
  __pyx_k_tuple_148 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_140)); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_148);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_148));

  /* "MACS2/IO/cScoreTrack.pyx":3510
 *                                 write("\tNA")
 *                         else:
 *                             write("\tNA")             # <<<<<<<<<<<<<<
 *                         # this part spits out stuff for sample 1
 *                         write("\t%.5f" % t1[i])
 */
  __pyx_k_tuple_149 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_140)); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_149);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_149));

  /* "MACS2/IO/cScoreTrack.pyx":3526
 *                             peak_i = which_peaks[w]
 *                         if peak_i == -1:
 *                             write("\tNA\tNA\tNA\tNA")             # <<<<<<<<<<<<<<
 *                         else:
 *                             # find the closest summit2 to this region
 */
  __pyx_k_tuple_150 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_122)); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_150);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150));

  /* "MACS2/IO/cScoreTrack.pyx":3533
 *                             for peak_j in range(peak_i + 1, n_peaks):
 *                                 if peaks2[peak_j]["end"] != end: break
 *                             peak2_summits = np.array(map(itemgetter("summit"),             # <<<<<<<<<<<<<<
 *                                                          peaks2[peak_i:peak_j]),
 *                                                      dtype='int32')
 */
  __pyx_k_tuple_151 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__summit)); if (unlikely(!__pyx_k_tuple_151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_151);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_151));

  /* "MACS2/IO/cScoreTrack.pyx":3543
 *                             write("\t%d" % (peak2["summit"] + 1))
 * 
 *                         write("\n")             # <<<<<<<<<<<<<<
 *                         break
 * 
 */
  __pyx_k_tuple_152 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_80)); if (unlikely(!__pyx_k_tuple_152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_152);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_152));

  /* "MACS2/IO/cScoreTrack.pyx":3565
 *         isfinite = np.isfinite
 *         if trackline:
 *             trackcontents = (name.replace("\"", "\\\""), description.replace("\"", "\\\""))             # <<<<<<<<<<<<<<
 *             if logLR is not None:
 *                 logLR.write("track type=bedGraph name=\"%s\" description=\"log10-likelihood ratio %s\" visibility=2 alwaysZero=on\n" % trackcontents)
 */
  __pyx_k_tuple_154 = PyTuple_Pack(2, ((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_kp_s_82)); if (unlikely(!__pyx_k_tuple_154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_154);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_154));
  __pyx_k_tuple_155 = PyTuple_Pack(2, ((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_kp_s_82)); if (unlikely(!__pyx_k_tuple_155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_155);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_155));

  /* "numpy.pxd":215
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_k_tuple_160 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_159)); if (unlikely(!__pyx_k_tuple_160)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_160);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_160));

  /* "numpy.pxd":219
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_k_tuple_162 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_161)); if (unlikely(!__pyx_k_tuple_162)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_162);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_162));

  /* "numpy.pxd":257
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_k_tuple_164 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_163)); if (unlikely(!__pyx_k_tuple_164)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_164);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_164));

  /* "numpy.pxd":801
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
  __pyx_k_tuple_167 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_166)); if (unlikely(!__pyx_k_tuple_167)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_167);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_167));

  /* "numpy.pxd":805
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
  __pyx_k_tuple_168 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_163)); if (unlikely(!__pyx_k_tuple_168)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_168);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_168));

  /* "numpy.pxd":825
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_k_tuple_170 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_169)); if (unlikely(!__pyx_k_tuple_170)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_170);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_170));

  /* "View.MemoryView":124
 * 
 *         if not self.ndim:
 *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if self.itemsize <= 0:
 */
  __pyx_k_tuple_172 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_171)); if (unlikely(!__pyx_k_tuple_172)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_172);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_172));

  /* "View.MemoryView":127
 * 
 *         if self.itemsize <= 0:
 *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         encode = getattr(format, 'encode', None)
 */
  __pyx_k_tuple_174 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_173)); if (unlikely(!__pyx_k_tuple_174)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_174);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_174));

  /* "View.MemoryView":131
 *         encode = getattr(format, 'encode', None)
 *         if encode:
 *             format = encode('ASCII')             # <<<<<<<<<<<<<<
 *         self._format = format
 *         self.format = self._format
 */
  __pyx_k_tuple_175 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__ASCII)); if (unlikely(!__pyx_k_tuple_175)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_175);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_175));

  /* "View.MemoryView":141
 *             free(self._shape)
 *             free(self._strides)
 *             raise MemoryError("unable to allocate shape or strides.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_177 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_176)); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_177);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_177));

  /* "View.MemoryView":166
 *         decode = getattr(mode, 'decode', None)
 *         if decode:
 *             mode = decode('ASCII')             # <<<<<<<<<<<<<<
 *         self.mode = mode
 * 
 */
  __pyx_k_tuple_180 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__ASCII)); if (unlikely(!__pyx_k_tuple_180)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_180);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_180));

  /* "View.MemoryView":174
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_is_object:
 */
  __pyx_k_tuple_182 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_181)); if (unlikely(!__pyx_k_tuple_182)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_182);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_182));

  /* "View.MemoryView":190
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
 *         info.buf = self.data
 *         info.len = self.len
 */
  __pyx_k_tuple_184 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_183)); if (unlikely(!__pyx_k_tuple_184)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_184);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_184));

  /* "View.MemoryView":452
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
 *         else:
 *             if len(self.view.format) == 1:
 */
  __pyx_k_tuple_186 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_185)); if (unlikely(!__pyx_k_tuple_186)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_186);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_186));

  /* "View.MemoryView":528
 *             if self.view.strides == NULL:
 * 
 *                 raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
 * 
 *             return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
 */
  __pyx_k_tuple_188 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_187)); if (unlikely(!__pyx_k_tuple_188)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_188);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_188));

  /* "View.MemoryView":643
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
 *                 seen_ellipsis = True
 *             else:
 */
  __pyx_k_tuple_191 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_k_tuple_191)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_191);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_191));

  /* "View.MemoryView":646
 *                 seen_ellipsis = True
 *             else:
 *                 result.append(slice(None))             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
 */
  __pyx_k_tuple_192 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_k_tuple_192)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_192);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_192));

  /* "View.MemoryView":657
 *     nslices = ndim - len(result)
 *     if nslices:
 *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
 * 
 *     return have_slices or nslices, tuple(result)
 */
  __pyx_k_tuple_194 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_k_tuple_194)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_194);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_194));

  /* "View.MemoryView":665
 *     for i in range(ndim):
 *         if suboffsets[i] >= 0:
 *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_196 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_195)); if (unlikely(!__pyx_k_tuple_196)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_196);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_196));

  /* "MACS2/IO/cScoreTrack.pyx":61
 * cdef inline int int_max(int a, int b): return a if a >= b else b
 * cdef inline int int_min(int a, int b): return a if a <= b else b
 * def do_nothing(*args, **kwargs):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_k_tuple_213 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__args), ((PyObject *)__pyx_n_s__kwargs), ((PyObject *)__pyx_n_s__args), ((PyObject *)__pyx_n_s__kwargs)); if (unlikely(!__pyx_k_tuple_213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_213);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_213));
  __pyx_k_codeobj_214 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s__do_nothing, 61, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":191
 * 
 *     """
 *     def __init__ (self):             # <<<<<<<<<<<<<<
 *         """Different with bedGraphTrackI, missing values are simply
 *         replaced with 0.
 */
  __pyx_k_tuple_216 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__self)); if (unlikely(!__pyx_k_tuple_216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_216);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_216));
  __pyx_k_codeobj_217 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s____init__, 191, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_217)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":199
 *         self.pointer = {}
 * 
 *     def add_chromosome ( self, str chrom, int chrom_max_len ):             # <<<<<<<<<<<<<<
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 */
  __pyx_k_tuple_219 = PyTuple_Pack(3, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__chrom), ((PyObject *)__pyx_n_s__chrom_max_len)); if (unlikely(!__pyx_k_tuple_219)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_219);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_219));
  __pyx_k_codeobj_220 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s__add_chromosome, 199, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_220)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":207
 *             self.pointer[chrom] = 0
 * 
 *     def add ( self, str chromosome, int endpos, double V1, double V2 ):             # <<<<<<<<<<<<<<
 *         """Add a chr-endpos-sample-control block into data
 *         dictionary. At the mean time, calculate pvalues.
 */
  __pyx_k_tuple_222 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__chromosome), ((PyObject *)__pyx_n_s__endpos), ((PyObject *)__pyx_n_s__V1), ((PyObject *)__pyx_n_s__V2), ((PyObject *)__pyx_n_s__c), ((PyObject *)__pyx_n_s__i)); if (unlikely(!__pyx_k_tuple_222)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_222);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_222));
  __pyx_k_codeobj_223 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s__add, 207, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_223)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":222
 *         self.pointer[chromosome] += 1
 * 
 *     def finalize ( self ):             # <<<<<<<<<<<<<<
 *         cdef str chrom
 * 
 */
  __pyx_k_tuple_225 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__chrom), ((PyObject *)__pyx_n_s__d), ((PyObject *)__pyx_n_s__l)); if (unlikely(!__pyx_k_tuple_225)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_225);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_225));
  __pyx_k_codeobj_226 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s__finalize, 222, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_226)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":230
 *             d.resize(l,refcheck=False)
 * 
 *     def get_data_by_chr (self, str chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */
  __pyx_k_tuple_228 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__chromosome)); if (unlikely(!__pyx_k_tuple_228)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_228);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_228));
  __pyx_k_codeobj_229 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s__get_data_by_chr, 230, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_229)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":241
 *             return None
 * 
 *     def get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */
  __pyx_k_tuple_231 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__l)); if (unlikely(!__pyx_k_tuple_231)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_231);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_231));
  __pyx_k_codeobj_232 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s__get_chr_names, 241, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_232)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":250
 *         return l
 * 
 *     def write_bedGraph (self, fhd, str name, str description, str colname):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in Wiggle Format.
 * 
 */
  __pyx_k_tuple_234 = PyTuple_Pack(14, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__fhd), ((PyObject *)__pyx_n_s__name), ((PyObject *)__pyx_n_s__description), ((PyObject *)__pyx_n_s__colname), ((PyObject *)__pyx_n_s__chrom), ((PyObject *)__pyx_n_s__chrs), ((PyObject *)__pyx_n_s__pre), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__l), ((PyObject *)__pyx_n_s__pos), ((PyObject *)__pyx_n_s__value), ((PyObject *)__pyx_n_s__write), ((PyObject *)__pyx_n_s__d)); if (unlikely(!__pyx_k_tuple_234)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_234);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_234));
  __pyx_k_codeobj_235 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s__write_bedGraph, 250, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_235)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":282
 *         return True
 * 
 *     def total ( self ):             # <<<<<<<<<<<<<<
 *         """Return the number of regions in this object.
 * 
 */
  __pyx_k_tuple_237 = PyTuple_Pack(3, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__t), ((PyObject *)__pyx_n_s__chrom)); if (unlikely(!__pyx_k_tuple_237)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_237);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_237));
  __pyx_k_codeobj_238 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s__total, 282, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_238)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":295
 *         return t
 * 
 *     def extract_value ( self, bdgTrack2 ):             # <<<<<<<<<<<<<<
 *         """It's like overlie function. THe overlapped regions between
 *         bdgTrack2 and self, will be recorded. The values from self in
 */
  __pyx_k_tuple_240 = PyTuple_Pack(25, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__bdgTrack2), ((PyObject *)__pyx_n_s__chr1), ((PyObject *)__pyx_n_s__chr2), ((PyObject *)__pyx_n_s__common_chr), ((PyObject *)__pyx_n_s__chrom), ((PyObject *)__pyx_n_s__pre_p), ((PyObject *)__pyx_n_s__p1), ((PyObject *)__pyx_n_s__p2), ((PyObject *)__pyx_n_s__v11), ((PyObject *)__pyx_n_s__v21), ((PyObject *)__pyx_n_s__v2), ((PyObject *)__pyx_n_s__ret), ((PyObject *)__pyx_n_s__radd), ((PyObject *)__pyx_n_s__v1add), ((PyObject *)__pyx_n_s__v2add), ((PyObject *)__pyx_n_s__ladd), ((PyObject *)__pyx_n_s__chrom_data), ((PyObject *)__pyx_n_s__p1n), ((PyObject *)__pyx_n_s__v11n), ((PyObject *)__pyx_n_s__v21n), ((PyObject *)__pyx_n_s__p2s), ((PyObject *)__pyx_n_s__v2s), ((PyObject *)__pyx_n_s__p2n), ((PyObject *)__pyx_n_s__v2n)); if (unlikely(!__pyx_k_tuple_240)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_240);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_240));
  __pyx_k_codeobj_241 = (PyObject*)__Pyx_PyCode_New(2, 0, 25, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_240, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s__extract_value, 295, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_241)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":386
 *         return ret
 * 
 *     def extract_average (self, bdgTrack2):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int i, l
 */
  __pyx_k_tuple_243 = PyTuple_Pack(16, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__bdgTrack2), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__l), ((PyObject *)__pyx_n_s__chrom), ((PyObject *)__pyx_n_s__start), ((PyObject *)__pyx_n_s__end), ((PyObject *)__pyx_n_s__rarray), ((PyObject *)__pyx_n_s__v1array), ((PyObject *)__pyx_n_s__v2array), ((PyObject *)__pyx_n_s__larray), ((PyObject *)__pyx_n_s__ret), ((PyObject *)__pyx_n_s__radd), ((PyObject *)__pyx_n_s__v1add), ((PyObject *)__pyx_n_s__v2add), ((PyObject *)__pyx_n_s__cur_region)); if (unlikely(!__pyx_k_tuple_243)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_243);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_243));
  __pyx_k_codeobj_244 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s__extract_average, 386, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":416
 *         return ret
 * 
 *     def extract_sum (self, bdgTrack2):             # <<<<<<<<<<<<<<
 *         """Get sum values in each region defined in bdgTrack2.
 * 
 */
  __pyx_k_tuple_246 = PyTuple_Pack(15, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__bdgTrack2), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__chrom), ((PyObject *)__pyx_n_s__start), ((PyObject *)__pyx_n_s__end), ((PyObject *)__pyx_n_s__rarray), ((PyObject *)__pyx_n_s__v1array), ((PyObject *)__pyx_n_s__v2array), ((PyObject *)__pyx_n_s__larray), ((PyObject *)__pyx_n_s__ret), ((PyObject *)__pyx_n_s__radd), ((PyObject *)__pyx_n_s__v1add), ((PyObject *)__pyx_n_s__v2add), ((PyObject *)__pyx_n_s__cur_region)); if (unlikely(!__pyx_k_tuple_246)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_246);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_246));
  __pyx_k_codeobj_247 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_215, __pyx_n_s__extract_sum, 416, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_247)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "View.MemoryView":282
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
 */
  __pyx_k_tuple_252 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_251)); if (unlikely(!__pyx_k_tuple_252)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_252);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_252));

  /* "View.MemoryView":283
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
 */
  __pyx_k_tuple_254 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_253)); if (unlikely(!__pyx_k_tuple_254)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_254);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_254));

  /* "View.MemoryView":284
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_256 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_255)); if (unlikely(!__pyx_k_tuple_256)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_256);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_256));

  /* "View.MemoryView":287
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_k_tuple_258 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_257)); if (unlikely(!__pyx_k_tuple_258)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_258);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_258));

  /* "View.MemoryView":288
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_260 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_259)); if (unlikely(!__pyx_k_tuple_260)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_260);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_260));
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  /* InitThreads.init */
  #ifdef WITH_THREAD
PyEval_InitThreads();
#endif

if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_78 = PyInt_FromLong(78); if (unlikely(!__pyx_int_78)) {__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 initcScoreTrack(void); /*proto*/
PyMODINIT_FUNC initcScoreTrack(void)
#else
PyMODINIT_FUNC PyInit_cScoreTrack(void); /*proto*/
PyMODINIT_FUNC PyInit_cScoreTrack(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_cScoreTrack(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("cScoreTrack"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_204), 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;}
  #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, "MACS2.IO.cScoreTrack")) {
      if (unlikely(PyDict_SetItemString(modules, "MACS2.IO.cScoreTrack", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_MACS2__IO__cScoreTrack) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  generic = Py_None; Py_INCREF(Py_None);
  strided = Py_None; Py_INCREF(Py_None);
  indirect = Py_None; Py_INCREF(Py_None);
  contiguous = Py_None; Py_INCREF(Py_None);
  indirect_contiguous = Py_None; Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_5MACS2_2IO_11cScoreTrack_scoreTrackII = &__pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.set_pseudocount = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, float, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_set_pseudocount;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.enable_trackline = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_enable_trackline;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.add_chromosome = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, int, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_add_chromosome;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.add = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, int, float, float, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_add;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.finalize = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_finalize;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.get_data_by_chr = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_get_data_by_chr;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.get_chr_names = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_get_chr_names;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.change_normalization_method = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, char, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_change_normalization_method;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.normalize = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, double, double))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_normalize;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.change_score_method = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, char, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_change_score_method;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.compute_pvalue = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_pvalue;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.compute_qvalue = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_qvalue;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.make_pq_table = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_make_pq_table;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.compute_likelihood = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_likelihood;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.compute_logFE = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_logFE;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.compute_foldenrichment = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_foldenrichment;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.compute_subtraction = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_subtraction;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.compute_SPMR = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_compute_SPMR;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.write_bedGraph = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_write_bedGraph *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_write_bedGraph;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.reassign_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_reassign_peaks;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.call_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_peaks *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_peaks;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.__pyx___close_peak = (PyBoolObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, PyObject *, int, PyObject *, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.__pyx___close_peak2 = (PyBoolObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, PyObject *, PyObject *, int, PyObject *, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak2 *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII___close_peak2;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.total = (long (*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_total;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_scoreTrackII.call_broadpeaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_scoreTrackII *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_broadpeaks *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_12scoreTrackII_call_broadpeaks;
  if (PyType_Ready(&__pyx_type_5MACS2_2IO_11cScoreTrack_scoreTrackII) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5MACS2_2IO_11cScoreTrack_scoreTrackII, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5MACS2_2IO_11cScoreTrack_12scoreTrackII___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5MACS2_2IO_11cScoreTrack_12scoreTrackII___init__.doc = __pyx_doc_5MACS2_2IO_11cScoreTrack_12scoreTrackII___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5MACS2_2IO_11cScoreTrack_12scoreTrackII___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5MACS2_2IO_11cScoreTrack_scoreTrackII.tp_dict, __pyx_vtabptr_5MACS2_2IO_11cScoreTrack_scoreTrackII) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "scoreTrackII", (PyObject *)&__pyx_type_5MACS2_2IO_11cScoreTrack_scoreTrackII) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5MACS2_2IO_11cScoreTrack_scoreTrackII = &__pyx_type_5MACS2_2IO_11cScoreTrack_scoreTrackII;
  __pyx_vtabptr_5MACS2_2IO_11cScoreTrack_TwoConditionScores = &__pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.set_pseudocount = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, float, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_set_pseudocount;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.build = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_build;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.build_chromosome = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_build_chromosome;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.add_chromosome = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, int))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_add_chromosome;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.add = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, int, float, float, float, float))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_add;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.finalize = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_finalize;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.compute_all_pvalues = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_compute_all_pvalues;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.compute_track_qvalues = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_compute_track_qvalues;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.compute_category_qvalues = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_compute_category_qvalues;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.make_pq_tables = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_make_pq_tables;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.get_data_by_chr = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_get_data_by_chr;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.get_chr_names = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_get_chr_names;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.write_bedGraph = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_bedGraph *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_bedGraph;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.write_matrix = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_matrix *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_write_matrix;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.call_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_call_peaks *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_call_peaks;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_TwoConditionScores.total = (long (*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_TwoConditionScores *))__pyx_f_5MACS2_2IO_11cScoreTrack_18TwoConditionScores_total;
  if (PyType_Ready(&__pyx_type_5MACS2_2IO_11cScoreTrack_TwoConditionScores) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5MACS2_2IO_11cScoreTrack_TwoConditionScores.tp_dict, __pyx_vtabptr_5MACS2_2IO_11cScoreTrack_TwoConditionScores) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "TwoConditionScores", (PyObject *)&__pyx_type_5MACS2_2IO_11cScoreTrack_TwoConditionScores) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5MACS2_2IO_11cScoreTrack_TwoConditionScores = &__pyx_type_5MACS2_2IO_11cScoreTrack_TwoConditionScores;
  __pyx_vtabptr_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI = &__pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.set_pseudocount = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_set_pseudocount;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.build_chromosome = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_build_chromosome;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.rebuild_chromosomes = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_rebuild_chromosomes;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.add_chromosome = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, int))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_add_chromosome;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.add = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, int, float, float, float, float))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_add;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.finalize = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_finalize;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.set_track_score_method = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_set_track_score_method;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.compute_treatcontrol_pvalues = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_compute_treatcontrol_pvalues;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.compute_treatcontrol_qvalues = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_compute_treatcontrol_qvalues;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.break_on_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_break_on_peaks;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.call_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_peaks *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_peaks;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.store_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_store_peaks;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.annotate_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_annotate_peaks;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.make_treatcontrol_pq_tables = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_make_treatcontrol_pq_tables;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.compute_diff_pvalues = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_compute_diff_pvalues;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.compute_diff_qvalues = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_compute_diff_qvalues;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.get_data_by_chr = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_get_data_by_chr;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.get_chr_names = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_get_chr_names;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.write_bedGraph = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_write_bedGraph *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_write_bedGraph;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.call_diff_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_diff_peaks *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_call_diff_peaks;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.print_some_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_print_some_peaks *__pyx_optional_args))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_print_some_peaks;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.print_diff_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_print_diff_peaks;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI._write_peaks_by_summit = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *, PyObject *, PyObject *, PyObject *, PyObject *, PyBoolObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI__write_peaks_by_summit;
  __pyx_vtable_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.total = (long (*)(struct __pyx_obj_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI *))__pyx_f_5MACS2_2IO_11cScoreTrack_15DiffScoreTrackI_total;
  if (PyType_Ready(&__pyx_type_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI.tp_dict, __pyx_vtabptr_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "DiffScoreTrackI", (PyObject *)&__pyx_type_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI = &__pyx_type_5MACS2_2IO_11cScoreTrack_DiffScoreTrackI;
  if (PyType_Ready(&__pyx_type_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak = &__pyx_type_5MACS2_2IO_11cScoreTrack___pyx_scope_struct____add_broadpeak;
  if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "array", (PyObject *)&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_array_type = &__pyx_type___pyx_array;
  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Enum", (PyObject *)&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "memoryview", (PyObject *)&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_memoryviewslice", (PyObject *)&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
  /*--- 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[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5MACS2_2IO_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5MACS2_2IO_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5MACS2_2IO_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5MACS2_2IO_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5MACS2_2IO_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5MACS2_2IO_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5MACS2_2IO_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5MACS2_2IO_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5MACS2_2IO_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5MACS2_2IO_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  __pyx_t_1 = __Pyx_ImportModule("MACS2.cProb"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "poisson_cdf", (void (**)(void))&__pyx_f_5MACS2_5cProb_poisson_cdf, "double (unsigned int, double, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_5cProb_poisson_cdf *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*--- Execution code ---*/

  /* "MACS2/IO/cScoreTrack.pyx":20
 * # python modules
 * # ------------------------------------
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * 
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":23
 * cimport numpy as np
 * 
 * from array import array as pyarray             # <<<<<<<<<<<<<<
 * from copy import copy
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__array));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__array));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__array));
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__array), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__array);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__array);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pyarray, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":24
 * 
 * from array import array as pyarray
 * from copy import copy             # <<<<<<<<<<<<<<
 * 
 * from operator import itemgetter
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__copy));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__copy));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__copy));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__copy), ((PyObject *)__pyx_t_3), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__copy);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__copy);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__copy, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":26
 * from copy import copy
 * 
 * from operator import itemgetter             # <<<<<<<<<<<<<<
 * 
 * from cpython cimport bool
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__itemgetter));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__itemgetter));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__itemgetter));
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__operator), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__itemgetter);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__itemgetter);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__itemgetter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":30
 * from cpython cimport bool
 * #from scipy.signal import fftconvolve
 * from MACS2.cSignal import maxima, enforce_valleys, enforce_peakyness             # <<<<<<<<<<<<<<
 * #np_convolve = np.convolve
 * 
 */
  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__maxima));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__maxima));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__maxima));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__enforce_valleys));
  PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__enforce_valleys));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__enforce_valleys));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__enforce_peakyness));
  PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_n_s__enforce_peakyness));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__enforce_peakyness));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_205), ((PyObject *)__pyx_t_3), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__maxima);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__maxima);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__maxima, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__enforce_valleys);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__enforce_valleys);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__enforce_valleys, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__enforce_peakyness);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__enforce_peakyness);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__enforce_peakyness, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":34
 * 
 * # Experimental
 * from scipy.stats import chi2             # <<<<<<<<<<<<<<
 * 
 * from cython.parallel import parallel, prange
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chi2));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__chi2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chi2));
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s_206), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__chi2);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__chi2);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__chi2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":41
 * from libc.math cimport log10,log, floor, ceil
 * 
 * from MACS2.Constants import BYTE4, FBYTE4, array             # <<<<<<<<<<<<<<
 * from MACS2.cProb cimport poisson_cdf
 * from MACS2.IO.cPeakIO import PeakIO, BroadPeakIO, parse_peakname
 */
  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__BYTE4));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__BYTE4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__BYTE4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__FBYTE4));
  PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__FBYTE4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FBYTE4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__array));
  PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_n_s__array));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__array));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_207), ((PyObject *)__pyx_t_3), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__BYTE4);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__BYTE4);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__BYTE4, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__FBYTE4);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__FBYTE4);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FBYTE4, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__array);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__array);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__array, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":43
 * from MACS2.Constants import BYTE4, FBYTE4, array
 * from MACS2.cProb cimport poisson_cdf
 * from MACS2.IO.cPeakIO import PeakIO, BroadPeakIO, parse_peakname             # <<<<<<<<<<<<<<
 * 
 * from MACS2.hashtable import Int64HashTable, Float64HashTable
 */
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__PeakIO));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__PeakIO));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PeakIO));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__BroadPeakIO));
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__BroadPeakIO));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__BroadPeakIO));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__parse_peakname));
  PyList_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_n_s__parse_peakname));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__parse_peakname));
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s_208), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__PeakIO);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__PeakIO);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PeakIO, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__BroadPeakIO);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__BroadPeakIO);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__BroadPeakIO, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__parse_peakname);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__parse_peakname);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__parse_peakname, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":45
 * from MACS2.IO.cPeakIO import PeakIO, BroadPeakIO, parse_peakname
 * 
 * from MACS2.hashtable import Int64HashTable, Float64HashTable             # <<<<<<<<<<<<<<
 * 
 * import logging
 */
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Int64HashTable));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__Int64HashTable));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Int64HashTable));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Float64HashTable));
  PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__Float64HashTable));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Float64HashTable));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_209), ((PyObject *)__pyx_t_3), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Int64HashTable);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__Int64HashTable);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Int64HashTable, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Float64HashTable);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__Float64HashTable);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Float64HashTable, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":47
 * from MACS2.hashtable import Int64HashTable, Float64HashTable
 * 
 * import logging             # <<<<<<<<<<<<<<
 * 
 * # ------------------------------------
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__logging), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logging, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":52
 * # constants
 * # ------------------------------------
 * __version__ = "scoreTrackI $Revision$"             # <<<<<<<<<<<<<<
 * __author__ = "Tao Liu <taoliu@jimmy.harvard.edu>"
 * __doc__ = "scoreTrackI classes"
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_210)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":53
 * # ------------------------------------
 * __version__ = "scoreTrackI $Revision$"
 * __author__ = "Tao Liu <taoliu@jimmy.harvard.edu>"             # <<<<<<<<<<<<<<
 * __doc__ = "scoreTrackI classes"
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____author__, ((PyObject *)__pyx_kp_s_211)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":54
 * __version__ = "scoreTrackI $Revision$"
 * __author__ = "Tao Liu <taoliu@jimmy.harvard.edu>"
 * __doc__ = "scoreTrackI classes"             # <<<<<<<<<<<<<<
 * 
 * # ------------------------------------
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____doc__, ((PyObject *)__pyx_kp_s_212)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cScoreTrack.pyx":61
 * cdef inline int int_max(int a, int b): return a if a >= b else b
 * cdef inline int int_min(int a, int b): return a if a <= b else b
 * def do_nothing(*args, **kwargs):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_1do_nothing, NULL, __pyx_n_s_20); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__do_nothing, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":64
 *     pass
 * 
 * LOG10_E = 0.43429448190325176             # <<<<<<<<<<<<<<
 * pscore_khashtable = Int64HashTable()
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(0.43429448190325176); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__LOG10_E, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":65
 * 
 * LOG10_E = 0.43429448190325176
 * pscore_khashtable = Int64HashTable()             # <<<<<<<<<<<<<<
 * 
 * cdef inline double get_pscore ( int observed, double expectation ):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__Int64HashTable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pscore_khashtable, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":92
 *     #return score
 * 
 * logLR_khashtable = Int64HashTable()             # <<<<<<<<<<<<<<
 * 
 * cdef double get_interpolated_pscore ( double observed, double expectation ):
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__Int64HashTable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logLR_khashtable, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":187
 * # ------------------------------------
 * 
 * class CombinedTwoTrack:             # <<<<<<<<<<<<<<
 *     """ For differential peak calling.
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "MACS2/IO/cScoreTrack.pyx":191
 * 
 *     """
 *     def __init__ (self):             # <<<<<<<<<<<<<<
 *         """Different with bedGraphTrackI, missing values are simply
 *         replaced with 0.
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_1__init__, 0, __pyx_n_s_218, NULL, __pyx_n_s_20, ((PyObject *)__pyx_k_codeobj_217)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____init__, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":199
 *         self.pointer = {}
 * 
 *     def add_chromosome ( self, str chrom, int chrom_max_len ):             # <<<<<<<<<<<<<<
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_3add_chromosome, 0, __pyx_n_s_221, NULL, __pyx_n_s_20, ((PyObject *)__pyx_k_codeobj_220)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__add_chromosome, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":207
 *             self.pointer[chrom] = 0
 * 
 *     def add ( self, str chromosome, int endpos, double V1, double V2 ):             # <<<<<<<<<<<<<<
 *         """Add a chr-endpos-sample-control block into data
 *         dictionary. At the mean time, calculate pvalues.
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_5add, 0, __pyx_n_s_224, NULL, __pyx_n_s_20, ((PyObject *)__pyx_k_codeobj_223)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__add, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":222
 *         self.pointer[chromosome] += 1
 * 
 *     def finalize ( self ):             # <<<<<<<<<<<<<<
 *         cdef str chrom
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_7finalize, 0, __pyx_n_s_227, NULL, __pyx_n_s_20, ((PyObject *)__pyx_k_codeobj_226)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__finalize, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":230
 *             d.resize(l,refcheck=False)
 * 
 *     def get_data_by_chr (self, str chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_9get_data_by_chr, 0, __pyx_n_s_230, NULL, __pyx_n_s_20, ((PyObject *)__pyx_k_codeobj_229)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__get_data_by_chr, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":241
 *             return None
 * 
 *     def get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_11get_chr_names, 0, __pyx_n_s_233, NULL, __pyx_n_s_20, ((PyObject *)__pyx_k_codeobj_232)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__get_chr_names, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":250
 *         return l
 * 
 *     def write_bedGraph (self, fhd, str name, str description, str colname):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in Wiggle Format.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_13write_bedGraph, 0, __pyx_n_s_236, NULL, __pyx_n_s_20, ((PyObject *)__pyx_k_codeobj_235)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__write_bedGraph, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":282
 *         return True
 * 
 *     def total ( self ):             # <<<<<<<<<<<<<<
 *         """Return the number of regions in this object.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_15total, 0, __pyx_n_s_239, NULL, __pyx_n_s_20, ((PyObject *)__pyx_k_codeobj_238)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__total, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":295
 *         return t
 * 
 *     def extract_value ( self, bdgTrack2 ):             # <<<<<<<<<<<<<<
 *         """It's like overlie function. THe overlapped regions between
 *         bdgTrack2 and self, will be recorded. The values from self in
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_17extract_value, 0, __pyx_n_s_242, NULL, __pyx_n_s_20, ((PyObject *)__pyx_k_codeobj_241)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__extract_value, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":386
 *         return ret
 * 
 *     def extract_average (self, bdgTrack2):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int i, l
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_19extract_average, 0, __pyx_n_s_245, NULL, __pyx_n_s_20, ((PyObject *)__pyx_k_codeobj_244)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__extract_average, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":416
 *         return ret
 * 
 *     def extract_sum (self, bdgTrack2):             # <<<<<<<<<<<<<<
 *         """Get sum values in each region defined in bdgTrack2.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_11cScoreTrack_16CombinedTwoTrack_21extract_sum, 0, __pyx_n_s_248, NULL, __pyx_n_s_20, ((PyObject *)__pyx_k_codeobj_247)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__extract_sum, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":187
 * # ------------------------------------
 * 
 * class CombinedTwoTrack:             # <<<<<<<<<<<<<<
 *     """ For differential peak calling.
 * 
 */
  if (PyDict_SetItemString(((PyObject *)__pyx_t_2), "__doc__", ((PyObject *)__pyx_kp_s_249)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2), __pyx_n_s__CombinedTwoTrack, __pyx_n_s__CombinedTwoTrack, __pyx_n_s_20); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__CombinedTwoTrack, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":474
 * 
 * 
 *     def __init__ (self, float treat_depth, float ctrl_depth, bool stderr_on = False, float pseudocount = 1.0 ):             # <<<<<<<<<<<<<<
 *         """Initialize.
 * 
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_9 = ((PyBoolObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1045
 *         return ret_peaks
 * 
 *     cpdef call_peaks (self, float cutoff=5.0, int min_length=200, int max_gap=50, bool call_summits=False):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_15 = ((PyBoolObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1823
 * 
 *     cpdef call_peaks (self, float cutoff=0.05, int min_length=200,
 *                       bool call_summits=False):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_34 = ((PyBoolObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":2962
 * 
 *     def write_peaks(self, xls=None, bed=None, name_prefix="%s_peak_", name="MACS",
 *                     description='%s', trackline=True):             # <<<<<<<<<<<<<<
 *         """Save the peak results in a tab-delimited plain text file
 *         with suffix .xls.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_63 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3082
 * 
 *     def write_peaks2(self, xls=None, bed=None, name_prefix="%s_peak_", name="MACS",
 *                     description='%s', trackline=True):             # <<<<<<<<<<<<<<
 *         """Save the peak results in a tab-delimited plain text file
 *         with suffix .xls.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_96 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":3549
 *     def write_bedgraphs(self, logLR=None, pvalue=None, logFC=None,
 *                           str name="MACS",
 *                           str description='%s', bool trackline=True):             # <<<<<<<<<<<<<<
 *         """Write logLR and diff pvalue data to in Wiggle Format.
 * 
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_153 = ((PyBoolObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "MACS2/IO/cScoreTrack.pyx":1
 * # Time-stamp: <2013-05-02 00:53:49 Tao Liu>             # <<<<<<<<<<<<<<
 * 
 * """Module for Feature IO classes.
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "View.MemoryView":207
 *         info.obj = self
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(array self):
 */
  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_250); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s____pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_array_type);

  /* "View.MemoryView":282
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_252), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XGOTREF(generic);
  __Pyx_DECREF(generic);
  __Pyx_GIVEREF(__pyx_t_2);
  generic = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":283
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_254), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XGOTREF(strided);
  __Pyx_DECREF(strided);
  __Pyx_GIVEREF(__pyx_t_2);
  strided = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":284
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_256), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XGOTREF(indirect);
  __Pyx_DECREF(indirect);
  __Pyx_GIVEREF(__pyx_t_2);
  indirect = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":287
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_258), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XGOTREF(contiguous);
  __Pyx_DECREF(contiguous);
  __Pyx_GIVEREF(__pyx_t_2);
  contiguous = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":288
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_260), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XGOTREF(indirect_contiguous);
  __Pyx_DECREF(indirect_contiguous);
  __Pyx_GIVEREF(__pyx_t_2);
  indirect_contiguous = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":503
 *         info.obj = self
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_250); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s____pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_memoryview_type);

  /* "View.MemoryView":958
 *             return self.from_object
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_250); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s____pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_memoryviewslice_type);

  /* "View.MemoryView":1365
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                               Py_ssize_t *strides, int ndim,
 *                               size_t itemsize, void *item) nogil:
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (__pyx_m) {
    __Pyx_AddTraceback("init MACS2.IO.cScoreTrack", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init MACS2.IO.cScoreTrack");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CPYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

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 (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    *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;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (DECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static CYTHON_INLINE 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)) {
        if (PyBytes_GET_SIZE(s1) != PyBytes_GET_SIZE(s2)) {
            return (equals == Py_NE);
        } else if (PyBytes_GET_SIZE(s1) == 1) {
            if (equals == Py_EQ)
                return (PyBytes_AS_STRING(s1)[0] == PyBytes_AS_STRING(s2)[0]);
            else
                return (PyBytes_AS_STRING(s1)[0] != PyBytes_AS_STRING(s2)[0]);
        } else {
            int result = memcmp(PyBytes_AS_STRING(s1), PyBytes_AS_STRING(s2), (size_t)PyBytes_GET_SIZE(s1));
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyUnicode_CheckExact(s1) & PyUnicode_CheckExact(s2)) {
        #if CYTHON_PEP393_ENABLED
        if ((PyUnicode_READY(s1) < 0) || (PyUnicode_READY(s2) < 0))
            return -1;
        if (PyUnicode_GET_LENGTH(s1) != PyUnicode_GET_LENGTH(s2)) {
            return (equals == Py_NE);
        } else if (PyUnicode_GET_LENGTH(s1) == 1) {
            Py_UCS4 ch1 = PyUnicode_READ_CHAR(s1, 0);
            Py_UCS4 ch2 = PyUnicode_READ_CHAR(s2, 0);
            return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2);
        #else
        if (PyUnicode_GET_SIZE(s1) != PyUnicode_GET_SIZE(s2)) {
            return (equals == Py_NE);
        } else if (PyUnicode_GET_SIZE(s1) == 1) {
            Py_UNICODE ch1 = PyUnicode_AS_UNICODE(s1)[0];
            Py_UNICODE ch2 = PyUnicode_AS_UNICODE(s2)[0];
            return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2);
        #endif
        } else {
            int result = PyUnicode_Compare(s1, s2);
            if ((result == -1) && unlikely(PyErr_Occurred()))
                return -1;
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyUnicode_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyUnicode_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 void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    #if PY_VERSION_HEX < 0x02050000
    if (PyClass_Check(type)) {
    #else
    if (PyType_Check(type)) {
    #endif
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *args;
        if (!value)
            args = PyTuple_New(0);
        else if (PyTuple_Check(value)) {
            Py_INCREF(value);
            args = value;
        }
        else
            args = PyTuple_Pack(1, value);
        if (!args)
            goto bad;
        owned_instance = PyEval_CallObject(type, args);
        Py_DECREF(args);
        if (!owned_instance)
            goto bad;
        value = owned_instance;
        if (!PyExceptionInstance_Check(value)) {
            PyErr_Format(PyExc_TypeError,
                         "calling %R should have returned an instance of "
                         "BaseException, not %R",
                         type, Py_TYPE(value));
            goto bad;
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause && cause != Py_None) {
        PyObject *fixed_cause;
        if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        }
        else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        }
        else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  unsigned int n = 1;
  return *(unsigned char*)(&n) != 0;
}
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t < '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1) /* First char was not a digit */
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparseable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count; /* Consume from buffer string */
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break; /* breaks both loops as ctx->enc_count == 0 */
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue; /* empty struct */
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static CYTHON_INLINE PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number;
    int ndim = ctx->head->field->type->ndim;
;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return NULL;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
    while (*ts && *ts != ')') {
        if (isspace(*ts))
            continue;
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return NULL;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
            return PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
        if (*ts != ',' && *ts != ')')
            return PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim)
        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return NULL;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return Py_None;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
                return ts;
      case ' ':
      case 10:
      case 13:
        ++ts;
        break;
      case '<':
        if (!__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T': /* substruct */
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0; /* Erase processed last struct element */
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}': /* end of substruct; either repeat or move on */
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0; /* Erase processed last struct element */
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }        /* fall through */
      case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 's': case 'p':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          ctx->enc_count += ctx->new_count;
        } else {
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_count = ctx->new_count;
          ctx->enc_packmode = ctx->new_packmode;
          ctx->enc_type = *ts;
          ctx->is_complex = got_Z;
        }
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}
static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  if (obj == Py_None || obj == NULL) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if ((unsigned)buf->itemsize != dtype->size) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (info->buf == NULL) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}

static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_Format(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if CYTHON_COMPILING_IN_PYPY
    float_value = PyNumber_Float(obj);
#else
    if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) {
        return PyFloat_AsDouble(obj);
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

static CYTHON_INLINE 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 void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
    int i;
    if (!a || !b)
        return 0;
    if (a == b)
        return 1;
    if (a->size != b->size || a->typegroup != b->typegroup ||
            a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
        if (a->typegroup == 'H' || b->typegroup == 'H') {
            return a->size == b->size;
        } else {
            return 0;
        }
    }
    if (a->ndim) {
        for (i = 0; i < a->ndim; i++)
            if (a->arraysize[i] != b->arraysize[i])
                return 0;
    }
    if (a->typegroup == 'S') {
        if (a->flags != b->flags)
            return 0;
        if (a->fields || b->fields) {
            if (!(a->fields && b->fields))
                return 0;
            for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
                __Pyx_StructField *field_a = a->fields + i;
                __Pyx_StructField *field_b = b->fields + i;
                if (field_a->offset != field_b->offset ||
                    !__pyx_typeinfo_cmp(field_a->type, field_b->type))
                    return 0;
            }
            return !a->fields[i].type && !b->fields[i].type;
        }
    }
    return 1;
}

static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                __Pyx_TypeInfo *dtype,
                __Pyx_BufFmt_StackElem stack[],
                __Pyx_memviewslice *memviewslice,
                PyObject *original_obj)
{
    struct __pyx_memoryview_obj *memview, *new_memview;
    __Pyx_RefNannyDeclarations
    Py_buffer *buf;
    int i, spec = 0, retval = -1;
    __Pyx_BufFmt_Context ctx;
    int from_memoryview = __pyx_memoryview_check(original_obj);
    __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
    if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
                                                            original_obj)->typeinfo)) {
        memview = (struct __pyx_memoryview_obj *) original_obj;
        new_memview = NULL;
    } else {
        memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                            original_obj, buf_flags, 0, dtype);
        new_memview = memview;
        if (unlikely(!memview))
            goto fail;
    }
    buf = &memview->view;
    if (buf->ndim != ndim) {
        PyErr_Format(PyExc_ValueError,
                "Buffer has wrong number of dimensions (expected %d, got %d)",
                ndim, buf->ndim);
        goto fail;
    }
    if (new_memview) {
        __Pyx_BufFmt_Init(&ctx, stack, dtype);
        if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
    }
    if ((unsigned)buf->itemsize != dtype->size) {
        PyErr_Format(PyExc_ValueError,
                     "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
                     "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
                     buf->itemsize,
                     (buf->itemsize > 1) ? "s" : "",
                     dtype->name,
                     dtype->size,
                     (dtype->size > 1) ? "s" : "");
        goto fail;
    }
    for (i = 0; i < ndim; i++) {
        spec = axes_specs[i];
        if (buf->strides) {
            if (spec & __Pyx_MEMVIEW_CONTIG) {
                if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
                    if (buf->strides[i] != sizeof(void *)) {
                        PyErr_Format(PyExc_ValueError,
                            "Buffer is not indirectly contiguous in dimension %d.", i);
                        goto fail;
                    }
                } else if (buf->strides[i] != buf->itemsize) {
                    PyErr_SetString(PyExc_ValueError,
                        "Buffer and memoryview are not contiguous in the same dimension.");
                    goto fail;
                }
            }
            if (spec & __Pyx_MEMVIEW_FOLLOW) {
                Py_ssize_t stride = buf->strides[i];
                if (stride < 0)
                    stride = -stride;
                if (stride < buf->itemsize) {
                    PyErr_SetString(PyExc_ValueError,
                        "Buffer and memoryview are not contiguous in the same dimension.");
                    goto fail;
                }
            }
        } else {
            if (spec & __Pyx_MEMVIEW_CONTIG && i != ndim - 1) {
                PyErr_Format(PyExc_ValueError,
                             "C-contiguous buffer is not contiguous in "
                             "dimension %d", i);
                goto fail;
            } else if (spec & (__Pyx_MEMVIEW_PTR)) {
                PyErr_Format(PyExc_ValueError,
                             "C-contiguous buffer is not indirect in "
                             "dimension %d", i);
                goto fail;
            } else if (buf->suboffsets) {
                PyErr_SetString(PyExc_ValueError,
                                "Buffer exposes suboffsets but no strides");
                goto fail;
            }
        }
        /* Todo: without PyBUF_INDIRECT we may not have suboffset information, i.e., the
           ptr may not be set to NULL but may be uninitialized? */
        if (spec & __Pyx_MEMVIEW_DIRECT) {
            if (buf->suboffsets && buf->suboffsets[i] >= 0) {
                PyErr_Format(PyExc_ValueError,
                    "Buffer not compatible with direct access in dimension %d.", i);
                goto fail;
            }
        }
        if (spec & __Pyx_MEMVIEW_PTR) {
            if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[i] < 0)) {
                PyErr_Format(PyExc_ValueError,
                    "Buffer is not indirectly accessisble in dimension %d.", i);
                goto fail;
            }
        }
    }
    if (buf->strides) {
        if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
            Py_ssize_t stride = 1;
            for (i=0; i<ndim; i++) {
                if (stride * buf->itemsize != buf->strides[i]) {
                    PyErr_SetString(PyExc_ValueError,
                        "Buffer not fortran contiguous.");
                    goto fail;
                }
                stride = stride * buf->shape[i];
            }
        } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
            Py_ssize_t stride = 1;
            for (i = ndim-1; i>-1; i--) {
                if(stride * buf->itemsize != buf->strides[i]) {
                    PyErr_SetString(PyExc_ValueError,
                        "Buffer not C contiguous.");
                    goto fail;
                }
                stride = stride * buf->shape[i];
            }
        }
    }
    if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
                                         new_memview != NULL) == -1)) {
        goto fail;
    }
    retval = 0;
    goto no_fail;
fail:
    Py_XDECREF(new_memview);
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}
static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
                        int ndim,
                        __Pyx_memviewslice *memviewslice,
                        int memview_is_new_reference)
{
    __Pyx_RefNannyDeclarations
    int i, retval=-1;
    Py_buffer *buf = &memview->view;
    __Pyx_RefNannySetupContext("init_memviewslice", 0);
    if (!buf) {
        PyErr_SetString(PyExc_ValueError,
            "buf is NULL.");
        goto fail;
    } else if (memviewslice->memview || memviewslice->data) {
        PyErr_SetString(PyExc_ValueError,
            "memviewslice is already initialized!");
        goto fail;
    }
    if (buf->strides) {
        for (i = 0; i < ndim; i++) {
            memviewslice->strides[i] = buf->strides[i];
        }
    } else {
        Py_ssize_t stride = buf->itemsize;
        for (i = ndim - 1; i >= 0; i--) {
            memviewslice->strides[i] = stride;
            stride *= buf->shape[i];
        }
    }
    for (i = 0; i < ndim; i++) {
        memviewslice->shape[i]   = buf->shape[i];
        if (buf->suboffsets) {
            memviewslice->suboffsets[i] = buf->suboffsets[i];
        } else {
            memviewslice->suboffsets[i] = -1;
        }
    }
    memviewslice->memview = memview;
    memviewslice->data = (char *)buf->buf;
    if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
        Py_INCREF(memview);
    }
    retval = 0;
    goto no_fail;
fail:
    memviewslice->memview = 0;
    memviewslice->data = 0;
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}
static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) {
    va_list vargs;
    char msg[200];
    va_start(vargs, fmt);
#ifdef HAVE_STDARG_PROTOTYPES
    va_start(vargs, fmt);
#else
    va_start(vargs);
#endif
    vsnprintf(msg, 200, fmt, vargs);
    Py_FatalError(msg);
    va_end(vargs);
}
static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)++;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)--;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
{
    int first_time;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (!memview || (PyObject *) memview == Py_None)
        return; /* allow uninitialized memoryview assignment */
    if (__pyx_get_slice_count(memview) < 0)
        __pyx_fatalerror("Acquisition count is %d (line %d)",
                         __pyx_get_slice_count(memview), lineno);
    first_time = __pyx_add_acquisition_count(memview) == 0;
    if (first_time) {
        if (have_gil) {
            Py_INCREF((PyObject *) memview);
        } else {
            PyGILState_STATE _gilstate = PyGILState_Ensure();
            Py_INCREF((PyObject *) memview);
            PyGILState_Release(_gilstate);
        }
    }
}
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
                                             int have_gil, int lineno) {
    int last_time;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (!memview ) {
        return;
    } else if ((PyObject *) memview == Py_None) {
        memslice->memview = NULL;
        return;
    }
    if (__pyx_get_slice_count(memview) <= 0)
        __pyx_fatalerror("Acquisition count is %d (line %d)",
                         __pyx_get_slice_count(memview), lineno);
    last_time = __pyx_sub_acquisition_count(memview) == 1;
    memslice->data = NULL;
    if (last_time) {
        if (have_gil) {
            Py_CLEAR(memslice->memview);
        } else {
            PyGILState_STATE _gilstate = PyGILState_Ensure();
            Py_CLEAR(memslice->memview);
            PyGILState_Release(_gilstate);
        }
    } else {
        memslice->memview = NULL;
    }
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = PyObject_GetAttr(o, n);
    if (!r) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        length = strlen(cstring);
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

static CYTHON_INLINE void __Pyx_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
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    CYTHON_UNUSED PyObject *getbuffer_cobj;
  #if PY_VERSION_HEX >= 0x02060000
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
  #endif
        if (PyObject_TypeCheck(obj, __pyx_ptype_5MACS2_2IO_5numpy_ndarray)) return __pyx_pw_5MACS2_2IO_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
        if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
        if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
  #if PY_VERSION_HEX < 0x02060000
    if (obj->ob_type->tp_dict &&
        (getbuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
                                             "__pyx_getbuffer"))) {
        getbufferproc func;
      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
        func = (getbufferproc) PyCapsule_GetPointer(getbuffer_cobj, "getbuffer(obj, view, flags)");
      #else
        func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
      #endif
        Py_DECREF(getbuffer_cobj);
        if (!func)
            goto fail;
        return func(obj, view, flags);
    } else {
        PyErr_Clear();
    }
  #endif
    PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
#if PY_VERSION_HEX < 0x02060000
fail:
#endif
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    CYTHON_UNUSED PyObject *releasebuffer_cobj;
    if (!obj) return;
  #if PY_VERSION_HEX >= 0x02060000
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
  #endif
        if (PyObject_TypeCheck(obj, __pyx_ptype_5MACS2_2IO_5numpy_ndarray)) { __pyx_pw_5MACS2_2IO_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
  #if PY_VERSION_HEX < 0x02060000
    if (obj->ob_type->tp_dict &&
        (releasebuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
                                                      "__pyx_releasebuffer"))) {
        releasebufferproc func;
      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
        func = (releasebufferproc) PyCapsule_GetPointer(releasebuffer_cobj, "releasebuffer(obj, view)");
      #else
        func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
      #endif
        Py_DECREF(releasebuffer_cobj);
        if (!func)
            goto fail;
        func(obj, view);
        return;
    } else {
        PyErr_Clear();
    }
  #endif
    goto nofail;
#if PY_VERSION_HEX < 0x02060000
fail:
#endif
    PyErr_WriteUnraisable(obj);
nofail:
    Py_DECREF(obj);
    view->obj = NULL;
}
#endif /*  PY_MAJOR_VERSION < 3 */


      static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import = 0;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    #if PY_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
                 PyString_AsString(name));
#else
    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
    PyObject *metaclass;
#if PY_MAJOR_VERSION < 3
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = PyObject_GetAttrString(base, (char *)"__class__");
        if (!metaclass) {
            PyErr_Clear();
            metaclass = (PyObject*) Py_TYPE(base);
        }
    } else {
        metaclass = (PyObject *) &PyClass_Type;
    }
#else
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = (PyObject*) Py_TYPE(base);
    } else {
        metaclass = (PyObject *) &PyType_Type;
    }
#endif
    Py_INCREF(metaclass);
    return metaclass;
}

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *qualname, PyObject *modname) {
    PyObject *result;
    PyObject *metaclass;
    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;
    if (PyDict_SetItemString(dict, "__qualname__", qualname) < 0)
        return NULL;
    metaclass = PyDict_GetItemString(dict, "__metaclass__");
    if (metaclass) {
        Py_INCREF(metaclass);
    } else {
        metaclass = __Pyx_FindPy2Metaclass(bases);
    }
    result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
    Py_DECREF(metaclass);
    return result;
}

static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL)
        value = Py_None; /* Mark as deleted */
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    PyObject* dict = PyModule_GetDict(__pyx_m);
    Py_XINCREF(dict);
    return dict;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op)
{
    if (op->defaults_tuple) {
        Py_INCREF(op->defaults_tuple);
        return op->defaults_tuple;
    }
    if (op->defaults_getter) {
        PyObject *res = op->defaults_getter((PyObject *) op);
        if (likely(res)) {
            Py_INCREF(res);
            op->defaults_tuple = res;
        }
        return res;
    }
    Py_INCREF(Py_None);
    return Py_None;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, 0, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, 0, 0, 0},
    {0, 0, 0, 0, 0}
};
#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
#define PY_WRITE_RESTRICTED WRITE_RESTRICTED
#endif
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    op->func_weakreflist = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_getter = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyMem_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (m->func_weakreflist != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return PyMethod_New(func,
                            type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    Py_ssize_t size;
    switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
    case METH_VARARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0)
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 0)
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%zd given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 1)
                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%zd given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
    sizeof(__pyx_CyFunctionObject),   /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#endif
    (reprfunc) __Pyx_CyFunction_repr,   /*tp_repr*/
    0,                                  /*tp_as_number*/
    0,                                  /*tp_as_sequence*/
    0,                                  /*tp_as_mapping*/
    0,                                  /*tp_hash*/
    __Pyx_CyFunction_Call,              /*tp_call*/
    0,                                  /*tp_str*/
    0,                                  /*tp_getattro*/
    0,                                  /*tp_setattro*/
    0,                                  /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_CyFunction_traverse,   /*tp_traverse*/
    (inquiry) __Pyx_CyFunction_clear,   /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
    0,                                  /*tp_iter*/
    0,                                  /*tp_iternext*/
    __pyx_CyFunction_methods,           /*tp_methods*/
    __pyx_CyFunction_members,           /*tp_members*/
    __pyx_CyFunction_getsets,           /*tp_getset*/
    0,                                  /*tp_base*/
    0,                                  /*tp_dict*/
    __Pyx_CyFunction_descr_get,         /*tp_descr_get*/
    0,                                  /*tp_descr_set*/
    offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/
    0,                                  /*tp_init*/
    0,                                  /*tp_alloc*/
    0,                                  /*tp_new*/
    0,                                  /*tp_free*/
    0,                                  /*tp_is_gc*/
    0,                                  /*tp_bases*/
    0,                                  /*tp_mro*/
    0,                                  /*tp_cache*/
    0,                                  /*tp_subclasses*/
    0,                                  /*tp_weaklist*/
    0,                                  /*tp_del*/
#if PY_VERSION_HEX >= 0x02060000
    0,                                  /*tp_version_tag*/
#endif
};
static int __Pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    if (PyType_Ready(&__pyx_CyFunctionType_type) < 0)
        return -1;
    __pyx_CyFunctionType = &__pyx_CyFunctionType_type;
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyMem_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, sizeof(size));
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}

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

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0 &&
                isspace(Py_CHARMASK(s[len-1])) &&
                s[len-1] != ' ')
                    PyFile_SoftSpace(f, 0);
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else /* Python 3 has a print function */
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItemString(kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else /* Python 3 has a print function */
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

static CYTHON_INLINE npy_int32 __Pyx_PyInt_from_py_npy_int32(PyObject* x) {
    const npy_int32 neg_one = (npy_int32)-1, const_zero = (npy_int32)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(npy_int32) == sizeof(char)) {
        if (is_unsigned)
            return (npy_int32)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (npy_int32)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(npy_int32) == sizeof(short)) {
        if (is_unsigned)
            return (npy_int32)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (npy_int32)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(npy_int32) == sizeof(int)) {
        if (is_unsigned)
            return (npy_int32)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (npy_int32)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(npy_int32) == sizeof(long)) {
        if (is_unsigned)
            return (npy_int32)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (npy_int32)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(npy_int32) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (npy_int32)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (npy_int32)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
        #else
        npy_int32 val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        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 (npy_int32)-1;
    }
}

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        float denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(a, a);
                    case 3:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, a);
                    case 4:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_absf(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        double denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(a, a);
                    case 3:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, a);
                    case 4:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_abs(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
                             char order, int ndim)
{
    int i, index, step, start;
    Py_ssize_t itemsize = mvs->memview->view.itemsize;
    if (order == 'F') {
        step = 1;
        start = 0;
    } else {
        step = -1;
        start = ndim - 1;
    }
    for (i = 0; i < ndim; i++) {
        index = start + step * i;
        if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize)
            return 0;
        itemsize *= mvs->shape[index];
    }
    return 1;
}

static void
__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
                               void **out_start, void **out_end,
                               int ndim, size_t itemsize)
{
    char *start, *end;
    int i;
    start = end = slice->data;
    for (i = 0; i < ndim; i++) {
        Py_ssize_t stride = slice->strides[i];
        Py_ssize_t extent = slice->shape[i];
        if (extent == 0) {
            *out_start = *out_end = start;
            return;
        } else {
            if (stride > 0)
                end += stride * (extent - 1);
            else
                start += stride * (extent - 1);
        }
    }
    *out_start = start;
    *out_end = end + itemsize;
}
static int
__pyx_slices_overlap(__Pyx_memviewslice *slice1,
                     __Pyx_memviewslice *slice2,
                     int ndim, size_t itemsize)
{
    void *start1, *end1, *start2, *end2;
    __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
    __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
    return (start1 < end2) && (start2 < end1);
}

static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                 const char *mode, int ndim,
                                 size_t sizeof_dtype, int contig_flag,
                                 int dtype_is_object)
{
    __Pyx_RefNannyDeclarations
    int i;
    __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
    struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
    Py_buffer *buf = &from_memview->view;
    PyObject *shape_tuple = NULL;
    PyObject *temp_int = NULL;
    struct __pyx_array_obj *array_obj = NULL;
    struct __pyx_memoryview_obj *memview_obj = NULL;
    __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
    for (i = 0; i < ndim; i++) {
        if (from_mvs->suboffsets[i] >= 0) {
            PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
                                           "indirect dimensions (axis %d)", i);
            goto fail;
        }
    }
    shape_tuple = PyTuple_New(ndim);
    if (unlikely(!shape_tuple)) {
        goto fail;
    }
    __Pyx_GOTREF(shape_tuple);
    for(i = 0; i < ndim; i++) {
        temp_int = PyInt_FromLong(from_mvs->shape[i]);
        if(unlikely(!temp_int)) {
            goto fail;
        } else {
            PyTuple_SET_ITEM(shape_tuple, i, temp_int);
            temp_int = NULL;
        }
    }
    array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
    if (unlikely(!array_obj)) {
        goto fail;
    }
    __Pyx_GOTREF(array_obj);
    memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                    (PyObject *) array_obj, contig_flag,
                                    dtype_is_object,
                                    from_mvs->memview->typeinfo);
    if (unlikely(!memview_obj))
        goto fail;
    if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
        goto fail;
    if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
                                                dtype_is_object) < 0))
        goto fail;
    goto no_fail;
fail:
    __Pyx_XDECREF(new_mvs.memview);
    new_mvs.memview = NULL;
    new_mvs.data = NULL;
no_fail:
    __Pyx_XDECREF(shape_tuple);
    __Pyx_XDECREF(temp_int);
    __Pyx_XDECREF(array_obj);
    __Pyx_RefNannyFinishContext();
    return new_mvs;
}

static CYTHON_INLINE PyObject *
__pyx_capsule_create(void *p, const char *sig)
{
    PyObject *cobj;
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
    cobj = PyCapsule_New(p, sig, NULL);
#else
    cobj = PyCObject_FromVoidPtr(p, NULL);
#endif
    return cobj;
}

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_int, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS, 1,
                                                 &__Pyx_TypeInfo_float, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%s does not export expected C function %s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3 && PY_MINOR_VERSION==0)
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C function %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), funcname, sig, desc);
        goto bad;
    }
    tmp.p = PyCObject_AsVoidPtr(cobj);}
#endif
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = (start + end) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,      /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
