/* Generated by Cython 0.16 on Wed Aug  1 19:51:21 2012 */

#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 CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCFunction_Call PyObject_Call
#else
  #define __Pyx_PyCFunction_Call PyCFunction_Call
#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 PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
  #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"
#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_GET_LENGTH)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#else
  #define CYTHON_PEP393_ENABLED 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]))
#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__cCompositeScoreTrack
#define __PYX_HAVE_API__MACS2__IO__cCompositeScoreTrack
#include "math.h"
#include "stdio.h"
#include "pythread.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


/* inline attribute */
#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

/* unused attribute */
#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*/


/* Type Conversion Predeclarations */

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

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#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;


static const char *__pyx_f[] = {
  "cCompositeScoreTrack.pyx",
  "bool.pxd",
  "complex.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak;
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;
};

/* "MACS2/IO/cCompositeScoreTrack.pyx":383
 *         return lvl1_peaks, broadpeaks
 * 
 *     def __add_broadpeak (self, bpeaks, chrom, lvl2peak, lvl1peakset):             # <<<<<<<<<<<<<<
 *         """Internal function to create broad peak.
 * 
 */
struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak {
  PyObject_HEAD
  PyObject *__pyx_v_start;
};

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

#ifndef CYTHON_PROFILE
  #define CYTHON_PROFILE 1
#endif
#ifndef CYTHON_PROFILE_REUSE_FRAME
  #define CYTHON_PROFILE_REUSE_FRAME 0
#endif
#if CYTHON_PROFILE
  #include "compile.h"
  #include "frameobject.h"
  #include "traceback.h"
  #if CYTHON_PROFILE_REUSE_FRAME
    #define CYTHON_FRAME_MODIFIER static
    #define CYTHON_FRAME_DEL
  #else
    #define CYTHON_FRAME_MODIFIER
    #define CYTHON_FRAME_DEL Py_DECREF(__pyx_frame)
  #endif
  #define __Pyx_TraceDeclarations                                  \
  static PyCodeObject *__pyx_frame_code = NULL;                      \
  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;           \
  int __Pyx_use_tracing = 0;
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno)                            \
  if (unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc)) {      \
      __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno);  \
  }
  #define __Pyx_TraceException()                                                           \
  if (unlikely(__Pyx_use_tracing( && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) {  \
      PyObject *exc_info = __Pyx_GetExceptionTuple();                                      \
      if (exc_info) {                                                                      \
          PyThreadState_GET()->c_profilefunc(                                              \
              PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);  \
          Py_DECREF(exc_info);                                                             \
      }                                                                                    \
  }
  #define __Pyx_TraceReturn(result)                                                  \
  if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) {  \
      PyThreadState_GET()->c_profilefunc(                                            \
          PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result);     \
      CYTHON_FRAME_DEL;                                                               \
  }
  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/
  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/
#else
  #define __Pyx_TraceDeclarations
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno)
  #define __Pyx_TraceException()
  #define __Pyx_TraceReturn(result)
#endif /* CYTHON_PROFILE */

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

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

static 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 void __Pyx_RaiseNoneIndexingError(void);

#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(d == Py_None)) {
        __Pyx_RaiseNoneIndexingError();
        return NULL;
    }
    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 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 (likely(o != Py_None)) {
        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));
}
#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 (likely(o != Py_None)) {
        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));
}
#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 (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 if (likely(i >= 0)) {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            return m->sq_item(o, i);
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

#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 (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 if (likely(i >= 0)) {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            return m->sq_ass_item(o, i, v);
        }
    }
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*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_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (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 void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long 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 *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_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, self, module, code) \
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, self, module, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *,
                                      PyMethodDef *ml, int flags,
                                      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);

#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 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 CYTHON_INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/

static int __Pyx_check_binary_version(void);

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.bool' */
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;

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

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

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.complex' */
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from 'cpython' */

/* Module declarations from '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.cCompositeScoreTrack' */
static PyTypeObject *__pyx_ptype_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak = 0;
#define __Pyx_MODULE_NAME "MACS2.IO.cCompositeScoreTrack"
int __pyx_module_is_main_MACS2__IO__cCompositeScoreTrack = 0;

/* Implementation of 'MACS2.IO.cCompositeScoreTrack' */
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_sorted;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_2add_chromosome(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_chrom_max_len); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_4add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome, PyObject *__pyx_v_endpos, PyObject *__pyx_v_sample, PyObject *__pyx_v_control); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_6get_data_by_chr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_8get_chr_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_10write_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_20cCompositeScoreTrack_21compositeScoreTrackII_12__calculate_fold_change(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_14make_pq_table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_16assign_qvalue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_pvalue2qvalue); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_18call_peaks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_max_gap, PyObject *__pyx_v_colname); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_20__close_peak(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_peak_content, PyObject *__pyx_v_peaks, PyObject *__pyx_v_min_length, PyObject *__pyx_v_chrom, PyObject *__pyx_v_colname); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_22call_broadpeaks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lvl1_cutoff, PyObject *__pyx_v_lvl2_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_lvl1_max_gap, PyObject *__pyx_v_lvl2_max_gap, PyObject *__pyx_v_colname); /* 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_20cCompositeScoreTrack_21compositeScoreTrackII_24__add_broadpeak(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_bpeaks, PyObject *__pyx_v_chrom, PyObject *__pyx_v_lvl2peak, PyObject *__pyx_v_lvl1peakset); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_26total(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_2add_chromosome(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_chrom_max_len); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_4add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome, PyObject *__pyx_v_endpos, PyObject *__pyx_v_sc1i1, PyObject *__pyx_v_sc2i2, PyObject *__pyx_v_sc1c2, PyObject *__pyx_v_sc2c1); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_6get_data_by_chr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_8get_chr_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_10call_consistent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_max_gap); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_12call_condition1_unique(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_max_gap); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_14call_condition2_unique(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_max_gap); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_16call_diff_regions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_max_gap); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_18total(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_make_compositeScoreTrack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bdgTrack1, PyObject *__pyx_v_bdgTrack2, PyObject *__pyx_v_bdgTrack3, PyObject *__pyx_v_bdgTrack4); /* proto */
static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_2make_compositeScoreTrack2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bdgTrack1, PyObject *__pyx_v_bdgTrack2, PyObject *__pyx_v_bdgTrack3, PyObject *__pyx_v_bdgTrack4); /* proto */
static char __pyx_k_6[] = "-100logq1";
static char __pyx_k_8[] = "-100logq2";
static char __pyx_k_10[] = "-100logp";
static char __pyx_k_11[] = "-100logq";
static char __pyx_k_12[] = "%s not supported!";
static char __pyx_k_13[] = "%s\t%d\t%d\t%.5f\n";
static char __pyx_k_14[] = "_compositeScoreTrackII__close_peak";
static char __pyx_k_15[] = "level 1 cutoff should be larger than level 2.";
static char __pyx_k_16[] = "level 2 maximum gap should be larger than level 1.";
static char __pyx_k_17[] = "_compositeScoreTrackII__add_broadpeak";
static char __pyx_k_18[] = ",";
static char __pyx_k_19[] = "MACS2.IO.cCompositeScoreTrack";
static char __pyx_k_20[] = "1,";
static char __pyx_k_21[] = "0,";
static char __pyx_k_22[] = ",1";
static char __pyx_k_28[] = "bdgTrack1 is not a bedGraphTrackI object";
static char __pyx_k_29[] = "bdgTrack2 is not a bedGraphTrackI object";
static char __pyx_k_30[] = "bdgTrack3 is not a bedGraphTrackI object";
static char __pyx_k_31[] = "bdgTrack4 is not a bedGraphTrackI object";
static char __pyx_k_32[] = "compositeScoreTrackI";
static char __pyx_k_33[] = "compositeScoreTrackII";
static char __pyx_k_34[] = "make_scoreTrack_for_macs";
static char __pyx_k_35[] = "Module for Composite Score Track 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_36[] = "MACS2.Constants";
static char __pyx_k_37[] = "*";
static char __pyx_k_38[] = "MACS2.IO.cPeakIO";
static char __pyx_k_39[] = "MACS2.IO.cBedGraph";
static char __pyx_k_40[] = "scoreTrackI $Revision$";
static char __pyx_k_41[] = "Tao Liu <taoliu@jimmy.harvard.edu>";
static char __pyx_k_42[] = "scoreTrackI classes";
static char __pyx_k_45[] = "/Users/taoliu/Codes/Git/MACS_original/MACS/MACS2/IO/cCompositeScoreTrack.pyx";
static char __pyx_k_58[] = "__calculate_fold_change";
static char __pyx_k_59[] = "_compositeScoreTrackII__calculate_fold_change";
static char __pyx_k_64[] = "above_cutoff_startpos";
static char __pyx_k_77[] = "Class for scoreGraph type data. Modified from\n    bedGraphTrackI. The only difference is that we store pvalue score,\n    qvalue score and foldchange together.\n\n    In bedGraph, data are represented as continuous non-overlapping\n    regions in the whole genome. I keep this assumption in all the\n    functions. If data has overlaps, some functions will definitely\n    give incorrect results.\n\n    1. Continuous: the next region should be after the previous one\n    unless they are on different chromosomes;\n    \n    2. Non-overlapping: the next region should never have overlaps\n    with preceding region.\n\n    The way to memorize bedGraph data is to remember the transition\n    points together with values of their preceding regions. The last\n    data point may exceed chromosome end, unless a chromosome\n    dictionary is given. Remember the coordinations in bedGraph and\n    this class is 0-indexed and right-open.\n    \n    ";
static char __pyx_k_93[] = "call_condition1_unique";
static char __pyx_k_97[] = "call_condition2_unique";
static char __pyx_k_99[] = "consistent_peak_content";
static char __pyx_k__N[] = "N";
static char __pyx_k__c[] = "c";
static char __pyx_k__d[] = "d";
static char __pyx_k__f[] = "f";
static char __pyx_k__i[] = "i";
static char __pyx_k__j[] = "j";
static char __pyx_k__k[] = "k";
static char __pyx_k__l[] = "l";
static char __pyx_k__n[] = "n";
static char __pyx_k__p[] = "p";
static char __pyx_k__q[] = "q";
static char __pyx_k__t[] = "t";
static char __pyx_k__v[] = "v";
static char __pyx_k__x[] = "x";
static char __pyx_k_100[] = "condition1_peak_content";
static char __pyx_k_101[] = "condition2_peak_content";
static char __pyx_k_107[] = "Class for composite scoreGraph type data for two\n    conditions. Modified from bedGraphTrackI. The only difference is\n    that we store pvalue score, qvalue score and foldchange together.\n\n    In bedGraph, data are represented as continuous non-overlapping\n    regions in the whole genome. I keep this assumption in all the\n    functions. If data has overlaps, some functions will definitely\n    give incorrect results.\n\n    1. Continuous: the next region should be after the previous one\n    unless they are on different chromosomes;\n    \n    2. Non-overlapping: the next region should never have overlaps\n    with preceding region.\n\n    The way to memorize bedGraph data is to remember the transition\n    points together with values of their preceding regions. The last\n    data point may exceed chromosome end, unless a chromosome\n    dictionary is given. Remember the coordinations in bedGraph and\n    this class is 0-indexed and right-open.\n    \n    ";
static char __pyx_k_110[] = "make_compositeScoreTrack";
static char __pyx_k_113[] = "make_compositeScoreTrack2";
static char __pyx_k__np[] = "np";
static char __pyx_k__p1[] = "p1";
static char __pyx_k__p2[] = "p2";
static char __pyx_k__p3[] = "p3";
static char __pyx_k__p4[] = "p4";
static char __pyx_k__v1[] = "v1";
static char __pyx_k__v2[] = "v2";
static char __pyx_k__v3[] = "v3";
static char __pyx_k__v4[] = "v4";
static char __pyx_k__add[] = "add";
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__p1n[] = "p1n";
static char __pyx_k__p1s[] = "p1s";
static char __pyx_k__p2n[] = "p2n";
static char __pyx_k__p2s[] = "p2s";
static char __pyx_k__p3n[] = "p3n";
static char __pyx_k__p3s[] = "p3s";
static char __pyx_k__p4n[] = "p4n";
static char __pyx_k__p4s[] = "p4s";
static char __pyx_k__pop[] = "pop";
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__v1n[] = "v1n";
static char __pyx_k__v1s[] = "v1s";
static char __pyx_k__v2n[] = "v2n";
static char __pyx_k__v2s[] = "v2s";
static char __pyx_k__v3n[] = "v3n";
static char __pyx_k__v3s[] = "v3s";
static char __pyx_k__v4n[] = "v4n";
static char __pyx_k__v4s[] = "v4s";
static char __pyx_k__chr1[] = "chr1";
static char __pyx_k__chr2[] = "chr2";
static char __pyx_k__chr3[] = "chr3";
static char __pyx_k__chr4[] = "chr4";
static char __pyx_k__chrs[] = "chrs";
static char __pyx_k__data[] = "data";
static char __pyx_k__join[] = "join";
static char __pyx_k__keys[] = "keys";
static char __pyx_k__lvl1[] = "lvl1";
static char __pyx_k__lvl2[] = "lvl2";
static char __pyx_k__name[] = "name";
static char __pyx_k__next[] = "next";
static char __pyx_k__self[] = "self";
static char __pyx_k__size[] = "size";
static char __pyx_k__chrom[] = "chrom";
static char __pyx_k__dtype[] = "dtype";
static char __pyx_k__index[] = "index";
static char __pyx_k__int32[] = "int32";
static char __pyx_k__int64[] = "int64";
static char __pyx_k__min_p[] = "min_p";
static char __pyx_k__numpy[] = "numpy";
static char __pyx_k__peaks[] = "peaks";
static char __pyx_k__pre_l[] = "pre_l";
static char __pyx_k__pre_p[] = "pre_p";
static char __pyx_k__pre_q[] = "pre_q";
static char __pyx_k__pre_v[] = "pre_v";
static char __pyx_k__range[] = "range";
static char __pyx_k__sc1c2[] = "sc1c2";
static char __pyx_k__sc1i1[] = "sc1i1";
static char __pyx_k__sc2c1[] = "sc2c1";
static char __pyx_k__sc2i2[] = "sc2i2";
static char __pyx_k__score[] = "score";
static char __pyx_k__start[] = "start";
static char __pyx_k__total[] = "total";
static char __pyx_k__value[] = "value";
static char __pyx_k__vc1c2[] = "vc1c2";
static char __pyx_k__vc1i1[] = "vc1i1";
static char __pyx_k__vc2c1[] = "vc2c1";
static char __pyx_k__vc2i2[] = "vc2i2";
static char __pyx_k__write[] = "write";
static char __pyx_k__zeros[] = "zeros";
static char __pyx_k__PeakIO[] = "PeakIO";
static char __pyx_k__bpeaks[] = "bpeaks";
static char __pyx_k__cutoff[] = "cutoff";
static char __pyx_k__endpos[] = "endpos";
static char __pyx_k__length[] = "length";
static char __pyx_k__m_c1c2[] = "m_c1c2";
static char __pyx_k__m_c2c1[] = "m_c2c1";
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__qvalue[] = "qvalue";
static char __pyx_k__retadd[] = "retadd";
static char __pyx_k__sample[] = "sample";
static char __pyx_k__sorted[] = "sorted";
static char __pyx_k__summit[] = "summit";
static char __pyx_k__this_p[] = "this_p";
static char __pyx_k__this_v[] = "this_v";
static char __pyx_k__tmpend[] = "tmpend";
static char __pyx_k__xrange[] = "xrange";
static char __pyx_k____doc__[] = "__doc__";
static char __pyx_k__chrom_d[] = "chrom_d";
static char __pyx_k__colname[] = "colname";
static char __pyx_k__control[] = "control";
static char __pyx_k__flag100[] = "flag100";
static char __pyx_k__float32[] = "float32";
static char __pyx_k__has_key[] = "has_key";
static char __pyx_k__max_gap[] = "max_gap";
static char __pyx_k__nonzero[] = "nonzero";
static char __pyx_k__pointer[] = "pointer";
static char __pyx_k__reverse[] = "reverse";
static char __pyx_k__sample1[] = "sample1";
static char __pyx_k__sample2[] = "sample2";
static char __pyx_k____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
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__lvl2peak[] = "lvl2peak";
static char __pyx_k__pqtable1[] = "pqtable1";
static char __pyx_k__pqtable2[] = "pqtable2";
static char __pyx_k__thickEnd[] = "thickEnd";
static char __pyx_k__tmpindex[] = "tmpindex";
static char __pyx_k__tmpstart[] = "tmpstart";
static char __pyx_k__tmpvalue[] = "tmpvalue";
static char __pyx_k__Exception[] = "Exception";
static char __pyx_k__bdgTrack1[] = "bdgTrack1";
static char __pyx_k__bdgTrack2[] = "bdgTrack2";
static char __pyx_k__bdgTrack3[] = "bdgTrack3";
static char __pyx_k__bdgTrack4[] = "bdgTrack4";
static char __pyx_k__chrom_pos[] = "chrom_pos";
static char __pyx_k__tmpsummit[] = "tmpsummit";
static char __pyx_k____author__[] = "__author__";
static char __pyx_k__blockSizes[] = "blockSizes";
static char __pyx_k__broadpeaks[] = "broadpeaks";
static char __pyx_k__call_peaks[] = "call_peaks";
static char __pyx_k__chromosome[] = "chromosome";
static char __pyx_k__common_chr[] = "common_chr";
static char __pyx_k__diff_score[] = "diff_score";
static char __pyx_k__get_pscore[] = "get_pscore";
static char __pyx_k__lvl1_peaks[] = "lvl1_peaks";
static char __pyx_k__lvl2_peaks[] = "lvl2_peaks";
static char __pyx_k__min_length[] = "min_length";
static char __pyx_k__peak_score[] = "peak_score";
static char __pyx_k__summit_pos[] = "summit_pos";
static char __pyx_k__thickStart[] = "thickStart";
static char __pyx_k__tmppeakset[] = "tmppeakset";
static char __pyx_k__value_dict[] = "value_dict";
static char __pyx_k__BroadPeakIO[] = "BroadPeakIO";
static char __pyx_k____version__[] = "__version__";
static char __pyx_k__blockStarts[] = "blockStarts";
static char __pyx_k__chrom_sc1c2[] = "chrom_sc1c2";
static char __pyx_k__chrom_sc1i1[] = "chrom_sc1i1";
static char __pyx_k__chrom_sc2c1[] = "chrom_sc2c1";
static char __pyx_k__chrom_sc2i2[] = "chrom_sc2i2";
static char __pyx_k__description[] = "description";
static char __pyx_k__fold_change[] = "fold_change";
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__peak_length[] = "peak_length";
static char __pyx_k____close_peak[] = "__close_peak";
static char __pyx_k__above_cutoff[] = "above_cutoff";
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__peak_content[] = "peak_content";
static char __pyx_k__summit_index[] = "summit_index";
static char __pyx_k__summit_value[] = "summit_value";
static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k__assign_qvalue[] = "assign_qvalue";
static char __pyx_k__chrom_max_len[] = "chrom_max_len";
static char __pyx_k__chrom_pointer[] = "chrom_pointer";
static char __pyx_k__get_chr_names[] = "get_chr_names";
static char __pyx_k__make_pq_table[] = "make_pq_table";
static char __pyx_k__middle_summit[] = "middle_summit";
static char __pyx_k__pvalue2qvalue[] = "pvalue2qvalue";
static char __pyx_k__score_btrack1[] = "score_btrack1";
static char __pyx_k__score_btrack2[] = "score_btrack2";
static char __pyx_k__above_cutoff_v[] = "above_cutoff_v";
static char __pyx_k__add_chromosome[] = "add_chromosome";
static char __pyx_k__bedGraphTrackI[] = "bedGraphTrackI";
static char __pyx_k__lvl1peakschrom[] = "lvl1peakschrom";
static char __pyx_k__lvl2peakschrom[] = "lvl2peakschrom";
static char __pyx_k__tmpsummitvalue[] = "tmpsummitvalue";
static char __pyx_k__write_bedGraph[] = "write_bedGraph";
static char __pyx_k____add_broadpeak[] = "__add_broadpeak";
static char __pyx_k__above_cutoff_sv[] = "above_cutoff_sv";
static char __pyx_k__call_broadpeaks[] = "call_broadpeaks";
static char __pyx_k__call_consistent[] = "call_consistent";
static char __pyx_k__get_data_by_chr[] = "get_data_by_chr";
static char __pyx_k__tmpsummit_index[] = "tmpsummit_index";
static char __pyx_k__condition1_peaks[] = "condition1_peaks";
static char __pyx_k__condition2_peaks[] = "condition2_peaks";
static char __pyx_k__consistent_peaks[] = "consistent_peaks";
static char __pyx_k__call_diff_regions[] = "call_diff_regions";
static char __pyx_k__above_cutoff_endpos[] = "above_cutoff_endpos";
static char __pyx_k__lvl1peakschrom_next[] = "lvl1peakschrom_next";
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_n_s_100;
static PyObject *__pyx_n_s_101;
static PyObject *__pyx_kp_s_107;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_n_s_110;
static PyObject *__pyx_n_s_113;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_n_s_14;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_n_s_17;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_n_s_19;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_n_s_32;
static PyObject *__pyx_n_s_33;
static PyObject *__pyx_n_s_34;
static PyObject *__pyx_n_s_36;
static PyObject *__pyx_n_s_37;
static PyObject *__pyx_n_s_38;
static PyObject *__pyx_n_s_39;
static PyObject *__pyx_kp_s_40;
static PyObject *__pyx_kp_s_41;
static PyObject *__pyx_kp_s_42;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_n_s_58;
static PyObject *__pyx_n_s_59;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_n_s_64;
static PyObject *__pyx_kp_s_77;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_n_s_93;
static PyObject *__pyx_n_s_97;
static PyObject *__pyx_n_s_99;
static PyObject *__pyx_n_s__BroadPeakIO;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__N;
static PyObject *__pyx_n_s__PeakIO;
static PyObject *__pyx_n_s__StopIteration;
static PyObject *__pyx_n_s____add_broadpeak;
static PyObject *__pyx_n_s____author__;
static PyObject *__pyx_n_s____close_peak;
static PyObject *__pyx_n_s____doc__;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s____version__;
static PyObject *__pyx_n_s__above_cutoff;
static PyObject *__pyx_n_s__above_cutoff_endpos;
static PyObject *__pyx_n_s__above_cutoff_sv;
static PyObject *__pyx_n_s__above_cutoff_v;
static PyObject *__pyx_n_s__add;
static PyObject *__pyx_n_s__add_chromosome;
static PyObject *__pyx_n_s__assign_qvalue;
static PyObject *__pyx_n_s__bdgTrack1;
static PyObject *__pyx_n_s__bdgTrack2;
static PyObject *__pyx_n_s__bdgTrack3;
static PyObject *__pyx_n_s__bdgTrack4;
static PyObject *__pyx_n_s__bedGraphTrackI;
static PyObject *__pyx_n_s__blockNum;
static PyObject *__pyx_n_s__blockSizes;
static PyObject *__pyx_n_s__blockStarts;
static PyObject *__pyx_n_s__bpeaks;
static PyObject *__pyx_n_s__broadpeaks;
static PyObject *__pyx_n_s__c;
static PyObject *__pyx_n_s__call_broadpeaks;
static PyObject *__pyx_n_s__call_consistent;
static PyObject *__pyx_n_s__call_diff_regions;
static PyObject *__pyx_n_s__call_peaks;
static PyObject *__pyx_n_s__chr1;
static PyObject *__pyx_n_s__chr2;
static PyObject *__pyx_n_s__chr3;
static PyObject *__pyx_n_s__chr4;
static PyObject *__pyx_n_s__chrom;
static PyObject *__pyx_n_s__chrom_d;
static PyObject *__pyx_n_s__chrom_max_len;
static PyObject *__pyx_n_s__chrom_pointer;
static PyObject *__pyx_n_s__chrom_pos;
static PyObject *__pyx_n_s__chrom_sc1c2;
static PyObject *__pyx_n_s__chrom_sc1i1;
static PyObject *__pyx_n_s__chrom_sc2c1;
static PyObject *__pyx_n_s__chrom_sc2i2;
static PyObject *__pyx_n_s__chromosome;
static PyObject *__pyx_n_s__chrs;
static PyObject *__pyx_n_s__colname;
static PyObject *__pyx_n_s__common_chr;
static PyObject *__pyx_n_s__condition1_peaks;
static PyObject *__pyx_n_s__condition2_peaks;
static PyObject *__pyx_n_s__consistent_peaks;
static PyObject *__pyx_n_s__control;
static PyObject *__pyx_n_s__control1;
static PyObject *__pyx_n_s__control2;
static PyObject *__pyx_n_s__cutoff;
static PyObject *__pyx_n_s__d;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__description;
static PyObject *__pyx_n_s__diff_score;
static PyObject *__pyx_n_s__dtype;
static PyObject *__pyx_n_s__end;
static PyObject *__pyx_n_s__endpos;
static PyObject *__pyx_n_s__f;
static PyObject *__pyx_n_s__fhd;
static PyObject *__pyx_n_s__flag100;
static PyObject *__pyx_n_s__float32;
static PyObject *__pyx_n_s__fold_change;
static PyObject *__pyx_n_s__get_chr_names;
static PyObject *__pyx_n_s__get_data_by_chr;
static PyObject *__pyx_n_s__get_pscore;
static PyObject *__pyx_n_s__has_key;
static PyObject *__pyx_n_s__i;
static PyObject *__pyx_n_s__index;
static PyObject *__pyx_n_s__int32;
static PyObject *__pyx_n_s__int64;
static PyObject *__pyx_n_s__intersection;
static PyObject *__pyx_n_s__j;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__k;
static PyObject *__pyx_n_s__keys;
static PyObject *__pyx_n_s__l;
static PyObject *__pyx_n_s__length;
static PyObject *__pyx_n_s__lvl1;
static PyObject *__pyx_n_s__lvl1_cutoff;
static PyObject *__pyx_n_s__lvl1_max_gap;
static PyObject *__pyx_n_s__lvl1_peaks;
static PyObject *__pyx_n_s__lvl1peakschrom;
static PyObject *__pyx_n_s__lvl1peakschrom_next;
static PyObject *__pyx_n_s__lvl1peakset;
static PyObject *__pyx_n_s__lvl2;
static PyObject *__pyx_n_s__lvl2_cutoff;
static PyObject *__pyx_n_s__lvl2_max_gap;
static PyObject *__pyx_n_s__lvl2_peaks;
static PyObject *__pyx_n_s__lvl2peak;
static PyObject *__pyx_n_s__lvl2peakschrom;
static PyObject *__pyx_n_s__m_c1c2;
static PyObject *__pyx_n_s__m_c2c1;
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__middle_summit;
static PyObject *__pyx_n_s__min_length;
static PyObject *__pyx_n_s__min_p;
static PyObject *__pyx_n_s__n;
static PyObject *__pyx_n_s__name;
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__p;
static PyObject *__pyx_n_s__p1;
static PyObject *__pyx_n_s__p1n;
static PyObject *__pyx_n_s__p1s;
static PyObject *__pyx_n_s__p2;
static PyObject *__pyx_n_s__p2n;
static PyObject *__pyx_n_s__p2s;
static PyObject *__pyx_n_s__p3;
static PyObject *__pyx_n_s__p3n;
static PyObject *__pyx_n_s__p3s;
static PyObject *__pyx_n_s__p4;
static PyObject *__pyx_n_s__p4n;
static PyObject *__pyx_n_s__p4s;
static PyObject *__pyx_n_s__peak_content;
static PyObject *__pyx_n_s__peak_length;
static PyObject *__pyx_n_s__peak_score;
static PyObject *__pyx_n_s__peaks;
static PyObject *__pyx_n_s__pileup;
static PyObject *__pyx_n_s__pointer;
static PyObject *__pyx_n_s__pop;
static PyObject *__pyx_n_s__pos;
static PyObject *__pyx_n_s__pqtable1;
static PyObject *__pyx_n_s__pqtable2;
static PyObject *__pyx_n_s__pre;
static PyObject *__pyx_n_s__pre_l;
static PyObject *__pyx_n_s__pre_p;
static PyObject *__pyx_n_s__pre_q;
static PyObject *__pyx_n_s__pre_v;
static PyObject *__pyx_n_s__pscore;
static PyObject *__pyx_n_s__pvalue;
static PyObject *__pyx_n_s__pvalue2qvalue;
static PyObject *__pyx_n_s__q;
static PyObject *__pyx_n_s__qscore;
static PyObject *__pyx_n_s__qvalue;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__ret;
static PyObject *__pyx_n_s__retadd;
static PyObject *__pyx_n_s__reverse;
static PyObject *__pyx_n_s__sample;
static PyObject *__pyx_n_s__sample1;
static PyObject *__pyx_n_s__sample2;
static PyObject *__pyx_n_s__sc1c2;
static PyObject *__pyx_n_s__sc1i1;
static PyObject *__pyx_n_s__sc2c1;
static PyObject *__pyx_n_s__sc2i2;
static PyObject *__pyx_n_s__score;
static PyObject *__pyx_n_s__score_btrack1;
static PyObject *__pyx_n_s__score_btrack2;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__size;
static PyObject *__pyx_n_s__sorted;
static PyObject *__pyx_n_s__start;
static PyObject *__pyx_n_s__sum;
static PyObject *__pyx_n_s__summit;
static PyObject *__pyx_n_s__summit_index;
static PyObject *__pyx_n_s__summit_pos;
static PyObject *__pyx_n_s__summit_value;
static PyObject *__pyx_n_s__t;
static PyObject *__pyx_n_s__thickEnd;
static PyObject *__pyx_n_s__thickStart;
static PyObject *__pyx_n_s__this_p;
static PyObject *__pyx_n_s__this_v;
static PyObject *__pyx_n_s__tmpend;
static PyObject *__pyx_n_s__tmpindex;
static PyObject *__pyx_n_s__tmppeakset;
static PyObject *__pyx_n_s__tmpstart;
static PyObject *__pyx_n_s__tmpsummit;
static PyObject *__pyx_n_s__tmpsummit_index;
static PyObject *__pyx_n_s__tmpsummitvalue;
static PyObject *__pyx_n_s__tmpvalue;
static PyObject *__pyx_n_s__total;
static PyObject *__pyx_n_s__v;
static PyObject *__pyx_n_s__v1;
static PyObject *__pyx_n_s__v1n;
static PyObject *__pyx_n_s__v1s;
static PyObject *__pyx_n_s__v2;
static PyObject *__pyx_n_s__v2n;
static PyObject *__pyx_n_s__v2s;
static PyObject *__pyx_n_s__v3;
static PyObject *__pyx_n_s__v3n;
static PyObject *__pyx_n_s__v3s;
static PyObject *__pyx_n_s__v4;
static PyObject *__pyx_n_s__v4n;
static PyObject *__pyx_n_s__v4s;
static PyObject *__pyx_n_s__value;
static PyObject *__pyx_n_s__value_dict;
static PyObject *__pyx_n_s__vc1c2;
static PyObject *__pyx_n_s__vc1i1;
static PyObject *__pyx_n_s__vc2c1;
static PyObject *__pyx_n_s__vc2i2;
static PyObject *__pyx_n_s__write;
static PyObject *__pyx_n_s__write_bedGraph;
static PyObject *__pyx_n_s__x;
static PyObject *__pyx_n_s__xrange;
static PyObject *__pyx_n_s__zeros;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_50;
static PyObject *__pyx_int_100;
static PyObject *__pyx_int_200;
static PyObject *__pyx_int_400;
static PyObject *__pyx_int_500;
static PyObject *__pyx_k_tuple_1;
static PyObject *__pyx_k_tuple_2;
static PyObject *__pyx_k_tuple_3;
static PyObject *__pyx_k_tuple_4;
static PyObject *__pyx_k_tuple_5;
static PyObject *__pyx_k_tuple_7;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_23;
static PyObject *__pyx_k_tuple_24;
static PyObject *__pyx_k_tuple_25;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_27;
static PyObject *__pyx_k_tuple_43;
static PyObject *__pyx_k_tuple_46;
static PyObject *__pyx_k_tuple_48;
static PyObject *__pyx_k_tuple_50;
static PyObject *__pyx_k_tuple_52;
static PyObject *__pyx_k_tuple_54;
static PyObject *__pyx_k_tuple_56;
static PyObject *__pyx_k_tuple_60;
static PyObject *__pyx_k_tuple_62;
static PyObject *__pyx_k_tuple_65;
static PyObject *__pyx_k_tuple_67;
static PyObject *__pyx_k_tuple_68;
static PyObject *__pyx_k_tuple_70;
static PyObject *__pyx_k_tuple_72;
static PyObject *__pyx_k_tuple_73;
static PyObject *__pyx_k_tuple_75;
static PyObject *__pyx_k_tuple_78;
static PyObject *__pyx_k_tuple_80;
static PyObject *__pyx_k_tuple_82;
static PyObject *__pyx_k_tuple_84;
static PyObject *__pyx_k_tuple_86;
static PyObject *__pyx_k_tuple_88;
static PyObject *__pyx_k_tuple_90;
static PyObject *__pyx_k_tuple_91;
static PyObject *__pyx_k_tuple_94;
static PyObject *__pyx_k_tuple_95;
static PyObject *__pyx_k_tuple_98;
static PyObject *__pyx_k_tuple_102;
static PyObject *__pyx_k_tuple_104;
static PyObject *__pyx_k_tuple_105;
static PyObject *__pyx_k_tuple_108;
static PyObject *__pyx_k_tuple_111;
static PyObject *__pyx_k_codeobj_44;
static PyObject *__pyx_k_codeobj_47;
static PyObject *__pyx_k_codeobj_49;
static PyObject *__pyx_k_codeobj_51;
static PyObject *__pyx_k_codeobj_53;
static PyObject *__pyx_k_codeobj_55;
static PyObject *__pyx_k_codeobj_57;
static PyObject *__pyx_k_codeobj_61;
static PyObject *__pyx_k_codeobj_63;
static PyObject *__pyx_k_codeobj_66;
static PyObject *__pyx_k_codeobj_69;
static PyObject *__pyx_k_codeobj_71;
static PyObject *__pyx_k_codeobj_74;
static PyObject *__pyx_k_codeobj_76;
static PyObject *__pyx_k_codeobj_79;
static PyObject *__pyx_k_codeobj_81;
static PyObject *__pyx_k_codeobj_83;
static PyObject *__pyx_k_codeobj_85;
static PyObject *__pyx_k_codeobj_87;
static PyObject *__pyx_k_codeobj_89;
static PyObject *__pyx_k_codeobj_92;
static PyObject *__pyx_k_codeobj_96;
static PyObject *__pyx_k_codeobj_103;
static PyObject *__pyx_k_codeobj_106;
static PyObject *__pyx_k_codeobj_109;
static PyObject *__pyx_k_codeobj_112;

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

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

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII___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_TraceDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_TraceCall("__init__", __pyx_f[0], 69);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":74
 * 
 *         """
 *         self.data = {}             # <<<<<<<<<<<<<<
 *         self.pointer = {}
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":75
 *         """
 *         self.data = {}
 *         self.pointer = {}             # <<<<<<<<<<<<<<
 * 
 *     def add_chromosome ( self, chrom, chrom_max_len ):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __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 = 75; __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.cCompositeScoreTrack.compositeScoreTrackII.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_3add_chromosome(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_3add_chromosome = {__Pyx_NAMESTR("add_chromosome"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_3add_chromosome, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_3add_chromosome(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_chrom_max_len = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chrom,&__pyx_n_s__chrom_max_len,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_chromosome (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom_max_len);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __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 = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_chrom = values[1];
    __pyx_v_chrom_max_len = values[2];
  }
  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 = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_2add_chromosome(__pyx_self, __pyx_v_self, __pyx_v_chrom, __pyx_v_chrom_max_len);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":77
 *         self.pointer = {}
 * 
 *     def add_chromosome ( self, chrom, 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_20cCompositeScoreTrack_21compositeScoreTrackII_2add_chromosome(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__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_TraceDeclarations
  __Pyx_RefNannySetupContext("add_chromosome", 0);
  __Pyx_TraceCall("add_chromosome", __pyx_f[0], 77);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":78
 * 
 *     def add_chromosome ( self, chrom, chrom_max_len ):
 *         if not self.data.has_key(chrom):             # <<<<<<<<<<<<<<
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 *                                                              ('sample1','float32'),
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); 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 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); 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_INCREF(__pyx_v_chrom);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
  __Pyx_GIVEREF(__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 = 78; __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 = 78; __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/cCompositeScoreTrack.pyx":79
 *     def add_chromosome ( self, chrom, chrom_max_len ):
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
 *                                                              ('sample1','float32'),
 *                                                              ('sample2','float32'),
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_chrom_max_len);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrom_max_len);
    __Pyx_GIVEREF(__pyx_v_chrom_max_len);
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));

    /* "MACS2/IO/cCompositeScoreTrack.pyx":85
 *                                                              ('control2','float32'),
 *                                                              ('-100logq1','int32'),
 *                                                              ('-100logq2','int32')])             # <<<<<<<<<<<<<<
 *             self.pointer[chrom] = 0
 * 
 */
    __pyx_t_6 = PyList_New(7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_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));
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_4));
    PyList_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_k_tuple_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_5));
    PyList_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_k_tuple_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_7));
    PyList_SET_ITEM(__pyx_t_6, 5, ((PyObject *)__pyx_k_tuple_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_9));
    PyList_SET_ITEM(__pyx_t_6, 6, ((PyObject *)__pyx_k_tuple_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_t_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __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_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":79
 *     def add_chromosome ( self, chrom, chrom_max_len ):
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
 *                                                              ('sample1','float32'),
 *                                                              ('sample2','float32'),
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyObject_SetItem(__pyx_t_2, __pyx_v_chrom, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":86
 *                                                              ('-100logq1','int32'),
 *                                                              ('-100logq2','int32')])
 *             self.pointer[chrom] = 0             # <<<<<<<<<<<<<<
 * 
 *     def add (self,chromosome,endpos,sample,control):
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (PyObject_SetItem(__pyx_t_6, __pyx_v_chrom, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __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.cCompositeScoreTrack.compositeScoreTrackII.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_5add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_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_20cCompositeScoreTrack_21compositeScoreTrackII_5add = {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_5add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_4add)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_5add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_chromosome = 0;
  PyObject *__pyx_v_endpos = 0;
  PyObject *__pyx_v_sample = 0;
  PyObject *__pyx_v_control = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chromosome,&__pyx_n_s__endpos,&__pyx_n_s__sample,&__pyx_n_s__control,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chromosome);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__endpos);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sample);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__control);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __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 = 88; __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 = values[1];
    __pyx_v_endpos = values[2];
    __pyx_v_sample = values[3];
    __pyx_v_control = values[4];
  }
  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 = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_4add(__pyx_self, __pyx_v_self, __pyx_v_chromosome, __pyx_v_endpos, __pyx_v_sample, __pyx_v_control);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_4add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome, PyObject *__pyx_v_endpos, PyObject *__pyx_v_sample, PyObject *__pyx_v_control) {
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_TraceCall("add", __pyx_f[0], 88);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":93
 * 
 *         """
 *         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 = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_chromosome); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":94
 *         """
 *         c = self.data[chromosome]
 *         i = self.pointer[chromosome]             # <<<<<<<<<<<<<<
 *         # get the preceding region
 *         #c[i] = (endpos,sample,control,int(-100*poisson_cdf(sample,control,False,True)),0)
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_chromosome); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_i = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":97
 *         # get the preceding region
 *         #c[i] = (endpos,sample,control,int(-100*poisson_cdf(sample,control,False,True)),0)
 *         c[i] = (endpos,sample,control,get_pscore(sample,control),0)             # <<<<<<<<<<<<<<
 *         self.pointer[chromosome] += 1
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_pscore); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_sample);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sample);
  __Pyx_GIVEREF(__pyx_v_sample);
  __Pyx_INCREF(__pyx_v_control);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_control);
  __Pyx_GIVEREF(__pyx_v_control);
  __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 = 97; __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_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_endpos);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_endpos);
  __Pyx_GIVEREF(__pyx_v_endpos);
  __Pyx_INCREF(__pyx_v_sample);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_sample);
  __Pyx_GIVEREF(__pyx_v_sample);
  __Pyx_INCREF(__pyx_v_control);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_control);
  __Pyx_GIVEREF(__pyx_v_control);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_t_3 = 0;
  if (PyObject_SetItem(__pyx_v_c, __pyx_v_i, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":98
 *         #c[i] = (endpos,sample,control,int(-100*poisson_cdf(sample,control,False,True)),0)
 *         c[i] = (endpos,sample,control,get_pscore(sample,control),0)
 *         self.pointer[chromosome] += 1             # <<<<<<<<<<<<<<
 * 
 *     def get_data_by_chr (self, chromosome):
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_chromosome);
  __pyx_t_3 = __pyx_v_chromosome;
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __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 = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_7get_data_by_chr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_6get_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_20cCompositeScoreTrack_21compositeScoreTrackII_7get_data_by_chr = {__Pyx_NAMESTR("get_data_by_chr"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_7get_data_by_chr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_6get_data_by_chr)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_7get_data_by_chr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_chromosome = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chromosome,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data_by_chr (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chromosome);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_data_by_chr", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_data_by_chr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_chromosome = 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 = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_6get_data_by_chr(__pyx_self, __pyx_v_self, __pyx_v_chromosome);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":100
 *         self.pointer[chromosome] += 1
 * 
 *     def get_data_by_chr (self, chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_6get_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_TraceDeclarations
  __Pyx_RefNannySetupContext("get_data_by_chr", 0);
  __Pyx_TraceCall("get_data_by_chr", __pyx_f[0], 100);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":106
 *         ([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 = 106; __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 = 106; __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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_chromosome);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chromosome);
  __Pyx_GIVEREF(__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 = 106; __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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "MACS2/IO/cCompositeScoreTrack.pyx":107
 *         """
 *         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 = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_v_chromosome); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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/cCompositeScoreTrack.pyx":109
 *             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.cCompositeScoreTrack.compositeScoreTrackII.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_8get_chr_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  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_TraceDeclarations
  __Pyx_RefNannySetupContext("get_chr_names", 0);
  __Pyx_TraceCall("get_chr_names", __pyx_f[0], 111);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":115
 * 
 *         """
 *         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 = 115; __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 = 115; __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 = 115; __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 = 115; __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 = 115; __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/cCompositeScoreTrack.pyx":116
 *         """
 *         l = set(self.data.keys())
 *         return l             # <<<<<<<<<<<<<<
 * 
 *     def write_bedGraph (self, fhd, name, description, 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.cCompositeScoreTrack.compositeScoreTrackII.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_11write_bedGraph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_10write_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_20cCompositeScoreTrack_21compositeScoreTrackII_11write_bedGraph = {__Pyx_NAMESTR("write_bedGraph"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_11write_bedGraph, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_10write_bedGraph)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_11write_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;
  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 *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_bedGraph (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fhd);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__description);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__colname);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __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 = 118; __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 = values[2];
    __pyx_v_description = values[3];
    __pyx_v_colname = 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 = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_10write_bedGraph(__pyx_self, __pyx_v_self, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_v_colname);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_10write_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) {
  int __pyx_v_flag100;
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_pre = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_i = NULL;
  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;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("write_bedGraph", 0);
  __Pyx_TraceCall("write_bedGraph", __pyx_f[0], 118);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":127
 * 
 *         """
 *         if colname not in ['sample','control','-100logp','-100logq']:             # <<<<<<<<<<<<<<
 *             raise Exception("%s not supported!" % colname)
 *         if colname in ['-100logp', '-100logq']:
 */
  __Pyx_INCREF(__pyx_v_colname);
  __pyx_t_1 = __pyx_v_colname;
  __pyx_t_2 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_n_s__sample), Py_NE); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (((int)__pyx_t_2)) {
    __pyx_t_3 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_n_s__control), Py_NE); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = ((int)__pyx_t_3);
  } else {
    __pyx_t_4 = ((int)__pyx_t_2);
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_kp_s_10), Py_NE); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = ((int)__pyx_t_2);
  } else {
    __pyx_t_3 = __pyx_t_4;
  }
  if (__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_kp_s_11), Py_NE); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((int)__pyx_t_4);
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_2;
  if (__pyx_t_3) {

    /* "MACS2/IO/cCompositeScoreTrack.pyx":128
 *         """
 *         if colname not in ['sample','control','-100logp','-100logq']:
 *             raise Exception("%s not supported!" % colname)             # <<<<<<<<<<<<<<
 *         if colname in ['-100logp', '-100logq']:
 *             flag100 = True              # for pvalue or qvalue, divide them by 100 while writing to bedGraph file
 */
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_12), __pyx_v_colname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":129
 *         if colname not in ['sample','control','-100logp','-100logq']:
 *             raise Exception("%s not supported!" % colname)
 *         if colname in ['-100logp', '-100logq']:             # <<<<<<<<<<<<<<
 *             flag100 = True              # for pvalue or qvalue, divide them by 100 while writing to bedGraph file
 *         else:
 */
  __Pyx_INCREF(__pyx_v_colname);
  __pyx_t_1 = __pyx_v_colname;
  __pyx_t_3 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_kp_s_10), Py_EQ); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!((int)__pyx_t_3)) {
    __pyx_t_2 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_kp_s_11), Py_EQ); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = ((int)__pyx_t_2);
  } else {
    __pyx_t_4 = ((int)__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_4;
  if (__pyx_t_3) {

    /* "MACS2/IO/cCompositeScoreTrack.pyx":130
 *             raise Exception("%s not supported!" % colname)
 *         if colname in ['-100logp', '-100logq']:
 *             flag100 = True              # for pvalue or qvalue, divide them by 100 while writing to bedGraph file             # <<<<<<<<<<<<<<
 *         else:
 *             flag100 = False
 */
    __pyx_v_flag100 = 1;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "MACS2/IO/cCompositeScoreTrack.pyx":132
 *             flag100 = True              # for pvalue or qvalue, divide them by 100 while writing to bedGraph file
 *         else:
 *             flag100 = False             # <<<<<<<<<<<<<<
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:
 */
    __pyx_v_flag100 = 0;
  }
  __pyx_L4:;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":133
 *         else:
 *             flag100 = False
 *         chrs = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         for chrom in chrs:
 *             d = self.data[chrom]
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_chrs = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":134
 *             flag100 = False
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             d = self.data[chrom]
 *             l = self.pointer[chrom]
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_5 = __pyx_v_chrs; __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_chrs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __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;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++;
    } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++;
    } 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 = 134; __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/cCompositeScoreTrack.pyx":135
 *         chrs = self.get_chr_names()
 *         for chrom in chrs:
 *             d = self.data[chrom]             # <<<<<<<<<<<<<<
 *             l = self.pointer[chrom]
 *             pre = 0
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyObject_GetItem(__pyx_t_1, __pyx_v_chrom); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_d);
    __pyx_v_d = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":136
 *         for chrom in chrs:
 *             d = self.data[chrom]
 *             l = self.pointer[chrom]             # <<<<<<<<<<<<<<
 *             pre = 0
 *             pos   = d['pos']
 */
    __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_v_l);
    __pyx_v_l = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":137
 *             d = self.data[chrom]
 *             l = self.pointer[chrom]
 *             pre = 0             # <<<<<<<<<<<<<<
 *             pos   = d['pos']
 *             if flag100:
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_pre);
    __pyx_v_pre = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":138
 *             l = self.pointer[chrom]
 *             pre = 0
 *             pos   = d['pos']             # <<<<<<<<<<<<<<
 *             if flag100:
 *                 value = d[colname]/100.0
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_d, ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __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/cCompositeScoreTrack.pyx":139
 *             pre = 0
 *             pos   = d['pos']
 *             if flag100:             # <<<<<<<<<<<<<<
 *                 value = d[colname]/100.0
 *             else:
 */
    if (__pyx_v_flag100) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":140
 *             pos   = d['pos']
 *             if flag100:
 *                 value = d[colname]/100.0             # <<<<<<<<<<<<<<
 *             else:
 *                 value = d[colname]
 */
      __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_v_colname); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyFloat_FromDouble(100.0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __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_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_9;
      __pyx_t_9 = 0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":142
 *                 value = d[colname]/100.0
 *             else:
 *                 value = d[colname]             # <<<<<<<<<<<<<<
 *             for i in xrange( l ):
 *                 fhd.write("%s\t%d\t%d\t%.5f\n" % (chrom,pre,pos[i],value[i]))
 */
      __pyx_t_9 = PyObject_GetItem(__pyx_v_d, __pyx_v_colname); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_9;
      __pyx_t_9 = 0;
    }
    __pyx_L7:;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":143
 *             else:
 *                 value = d[colname]
 *             for i in xrange( l ):             # <<<<<<<<<<<<<<
 *                 fhd.write("%s\t%d\t%d\t%.5f\n" % (chrom,pre,pos[i],value[i]))
 *                 pre = pos[i]
 */
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v_l);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_l);
    __Pyx_GIVEREF(__pyx_v_l);
    __pyx_t_8 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
    if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_9 = __pyx_t_8; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_9)) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break;
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++;
      } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_9)) {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++;
      } else {
        __pyx_t_8 = __pyx_t_11(__pyx_t_9);
        if (unlikely(!__pyx_t_8)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":144
 *                 value = d[colname]
 *             for i in xrange( l ):
 *                 fhd.write("%s\t%d\t%d\t%.5f\n" % (chrom,pre,pos[i],value[i]))             # <<<<<<<<<<<<<<
 *                 pre = pos[i]
 * 
 */
      __pyx_t_8 = PyObject_GetAttr(__pyx_v_fhd, __pyx_n_s__write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = PyObject_GetItem(__pyx_v_pos, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = PyObject_GetItem(__pyx_v_value, __pyx_v_i); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __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 = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      __Pyx_INCREF(__pyx_v_pre);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_pre);
      __Pyx_GIVEREF(__pyx_v_pre);
      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_1 = 0;
      __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __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 = 144; __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_t_8, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __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_13)); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":145
 *             for i in xrange( l ):
 *                 fhd.write("%s\t%d\t%d\t%.5f\n" % (chrom,pre,pos[i],value[i]))
 *                 pre = pos[i]             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
      __pyx_t_12 = PyObject_GetItem(__pyx_v_pos, __pyx_v_i); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_v_pre);
      __pyx_v_pre = __pyx_t_12;
      __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":147
 *                 pre = pos[i]
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def __calculate_fold_change ( self, chrom, index ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __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_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_pre);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_13__calculate_fold_change(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_12__calculate_fold_change[] = "From 'sample' and 'control' columns, calculate foldchanges.\n\n        chrom: chromosome name\n        index: index in data[chrom]\n        \n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_13__calculate_fold_change = {__Pyx_NAMESTR("__calculate_fold_change"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_13__calculate_fold_change, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_12__calculate_fold_change)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_13__calculate_fold_change(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_index = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chrom,&__pyx_n_s__index,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__calculate_fold_change (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__calculate_fold_change", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__calculate_fold_change", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__calculate_fold_change") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_chrom = values[1];
    __pyx_v_index = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__calculate_fold_change", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.__calculate_fold_change", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_12__calculate_fold_change(__pyx_self, __pyx_v_self, __pyx_v_chrom, __pyx_v_index);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":149
 *         return True
 * 
 *     def __calculate_fold_change ( self, chrom, index ):             # <<<<<<<<<<<<<<
 *         """From 'sample' and 'control' columns, calculate foldchanges.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_12__calculate_fold_change(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__calculate_fold_change", 0);
  __Pyx_TraceCall("__calculate_fold_change", __pyx_f[0], 149);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":156
 * 
 *         """
 *         return self.data[chrom]['sample'][index]/self.data[chrom]['control'][index]             # <<<<<<<<<<<<<<
 * 
 *     def make_pq_table ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_chrom); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __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_GetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__sample)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __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_GetItem(__pyx_t_1, __pyx_v_index); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __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_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_v_chrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __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_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__control)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __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(__pyx_t_1, __pyx_v_index); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __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_PyNumber_Divide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15make_pq_table(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_14make_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 {-100log10pvalue:(-100log10qvalue,rank)} relationships.\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15make_pq_table = {__Pyx_NAMESTR("make_pq_table"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15make_pq_table, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_14make_pq_table)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15make_pq_table(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_pq_table (wrapper)", 0);
  __pyx_self = __pyx_self;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_14make_pq_table(__pyx_self, ((PyObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":158
 *         return self.data[chrom]['sample'][index]/self.data[chrom]['control'][index]
 * 
 *     def make_pq_table ( self ):             # <<<<<<<<<<<<<<
 *         """Make pvalue-qvalue table.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_14make_pq_table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_value_dict = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_pre_p = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_this_p = NULL;
  PyObject *__pyx_v_this_v = NULL;
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_k = NULL;
  double __pyx_v_f;
  PyObject *__pyx_v_pre_v = NULL;
  CYTHON_UNUSED long __pyx_v_pre_l;
  PyObject *__pyx_v_pre_q = NULL;
  PyObject *__pyx_v_pvalue2qvalue = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_q = 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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  double __pyx_t_9;
  long __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("make_pq_table", 0);
  __Pyx_TraceCall("make_pq_table", __pyx_f[0], 158);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":168
 *         """
 *         #logging.info("####test#### start make_pq")
 *         n = self.total()             # <<<<<<<<<<<<<<
 *         #value_list = np.empty( n, dtype = [('v', '<f4'), ('l', '<i4')])
 *         value_dict = {}
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__total); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __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 = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":170
 *         n = self.total()
 *         #value_list = np.empty( n, dtype = [('v', '<f4'), ('l', '<i4')])
 *         value_dict = {}             # <<<<<<<<<<<<<<
 *         #i = 0                           # index for value_list
 *         for chrom in self.data.keys():
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_value_dict = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":172
 *         value_dict = {}
 *         #i = 0                           # index for value_list
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             # for each chromosome
 *             pre_p  = 0
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __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_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __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;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } 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 = 172; __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/cCompositeScoreTrack.pyx":174
 *         for chrom in self.data.keys():
 *             # for each chromosome
 *             pre_p  = 0             # <<<<<<<<<<<<<<
 *             pos    = iter(self.data[chrom][ 'pos' ]).next
 *             value  = iter(self.data[chrom][ '-100logp' ]).next
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_pre_p);
    __pyx_v_pre_p = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":175
 *             # for each chromosome
 *             pre_p  = 0
 *             pos    = iter(self.data[chrom][ 'pos' ]).next             # <<<<<<<<<<<<<<
 *             value  = iter(self.data[chrom][ '-100logp' ]).next
 *             length = self.pointer[chrom]
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_2, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_pos);
    __pyx_v_pos = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":176
 *             pre_p  = 0
 *             pos    = iter(self.data[chrom][ 'pos' ]).next
 *             value  = iter(self.data[chrom][ '-100logp' ]).next             # <<<<<<<<<<<<<<
 *             length = self.pointer[chrom]
 *             j = 0
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_2, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetItem(__pyx_t_5, ((PyObject *)__pyx_kp_s_10)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_value);
    __pyx_v_value = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":177
 *             pos    = iter(self.data[chrom][ 'pos' ]).next
 *             value  = iter(self.data[chrom][ '-100logp' ]).next
 *             length = self.pointer[chrom]             # <<<<<<<<<<<<<<
 *             j = 0
 *             while j<length:
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_2, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_length);
    __pyx_v_length = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":178
 *             value  = iter(self.data[chrom][ '-100logp' ]).next
 *             length = self.pointer[chrom]
 *             j = 0             # <<<<<<<<<<<<<<
 *             while j<length:
 *                 this_p = pos()
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_j);
    __pyx_v_j = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":179
 *             length = self.pointer[chrom]
 *             j = 0
 *             while j<length:             # <<<<<<<<<<<<<<
 *                 this_p = pos()
 *                 this_v = value()
 */
    while (1) {
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_j, __pyx_v_length, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!__pyx_t_6) break;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":180
 *             j = 0
 *             while j<length:
 *                 this_p = pos()             # <<<<<<<<<<<<<<
 *                 this_v = value()
 *                 #value_list[i] = (this_v,this_p-pre_p)
 */
      __pyx_t_5 = PyObject_Call(__pyx_v_pos, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_v_this_p);
      __pyx_v_this_p = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":181
 *             while j<length:
 *                 this_p = pos()
 *                 this_v = value()             # <<<<<<<<<<<<<<
 *                 #value_list[i] = (this_v,this_p-pre_p)
 *                 #i += 1
 */
      __pyx_t_5 = PyObject_Call(__pyx_v_value, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_v_this_v);
      __pyx_v_this_v = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":184
 *                 #value_list[i] = (this_v,this_p-pre_p)
 *                 #i += 1
 *                 if value_dict.has_key(this_v):             # <<<<<<<<<<<<<<
 *                     value_dict[this_v] += this_p-pre_p
 *                 else:
 */
      __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 = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_this_v);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_this_v);
      __Pyx_GIVEREF(__pyx_v_this_v);
      __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_6) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":185
 *                 #i += 1
 *                 if value_dict.has_key(this_v):
 *                     value_dict[this_v] += this_p-pre_p             # <<<<<<<<<<<<<<
 *                 else:
 *                     value_dict[this_v] = this_p-pre_p
 */
        __Pyx_INCREF(__pyx_v_this_v);
        __pyx_t_7 = __pyx_v_this_v;
        __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_7); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = PyNumber_Subtract(__pyx_v_this_p, __pyx_v_pre_p); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (PyDict_SetItem(((PyObject *)__pyx_v_value_dict), __pyx_t_7, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":187
 *                     value_dict[this_v] += this_p-pre_p
 *                 else:
 *                     value_dict[this_v] = this_p-pre_p             # <<<<<<<<<<<<<<
 *                 j += 1
 *                 pre_p = this_p
 */
        __pyx_t_7 = PyNumber_Subtract(__pyx_v_this_p, __pyx_v_pre_p); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(((PyObject *)__pyx_v_value_dict), __pyx_v_this_v, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_L7:;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":188
 *                 else:
 *                     value_dict[this_v] = this_p-pre_p
 *                 j += 1             # <<<<<<<<<<<<<<
 *                 pre_p = this_p
 * 
 */
      __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_j, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_v_j);
      __pyx_v_j = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":189
 *                     value_dict[this_v] = this_p-pre_p
 *                 j += 1
 *                 pre_p = this_p             # <<<<<<<<<<<<<<
 * 
 *         N = sum(value_dict.values())
 */
      __Pyx_INCREF(__pyx_v_this_p);
      __Pyx_DECREF(__pyx_v_pre_p);
      __pyx_v_pre_p = __pyx_v_this_p;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":191
 *                 pre_p = this_p
 * 
 *         N = sum(value_dict.values())             # <<<<<<<<<<<<<<
 *         k = 1                           # rank
 *         f = -log10(N)
 */
  __pyx_t_1 = PyDict_Values(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __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 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":192
 * 
 *         N = sum(value_dict.values())
 *         k = 1                           # rank             # <<<<<<<<<<<<<<
 *         f = -log10(N)
 *         pre_v = -1e100
 */
  __Pyx_INCREF(__pyx_int_1);
  __pyx_v_k = __pyx_int_1;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":193
 *         N = sum(value_dict.values())
 *         k = 1                           # rank
 *         f = -log10(N)             # <<<<<<<<<<<<<<
 *         pre_v = -1e100
 *         pre_l = 0
 */
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_N); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_f = (-log10(__pyx_t_9));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":194
 *         k = 1                           # rank
 *         f = -log10(N)
 *         pre_v = -1e100             # <<<<<<<<<<<<<<
 *         pre_l = 0
 *         pre_q = 1e100                       # save the previous q-value
 */
  __pyx_t_1 = PyFloat_FromDouble(-1e100); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pre_v = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":195
 *         f = -log10(N)
 *         pre_v = -1e100
 *         pre_l = 0             # <<<<<<<<<<<<<<
 *         pre_q = 1e100                       # save the previous q-value
 *         pvalue2qvalue = {pre_v:[0,k,0]}              # pvalue:[qvalue,rank,bp_with_this_pvalue]
 */
  __pyx_v_pre_l = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":196
 *         pre_v = -1e100
 *         pre_l = 0
 *         pre_q = 1e100                       # save the previous q-value             # <<<<<<<<<<<<<<
 *         pvalue2qvalue = {pre_v:[0,k,0]}              # pvalue:[qvalue,rank,bp_with_this_pvalue]
 *         #logging.info("####test#### start matching pvalue to qvalue")
 */
  __pyx_t_1 = PyFloat_FromDouble(1e100); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pre_q = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":197
 *         pre_l = 0
 *         pre_q = 1e100                       # save the previous q-value
 *         pvalue2qvalue = {pre_v:[0,k,0]}              # pvalue:[qvalue,rank,bp_with_this_pvalue]             # <<<<<<<<<<<<<<
 *         #logging.info("####test#### start matching pvalue to qvalue")
 *         for v in sorted(value_dict.keys(),reverse=True):
 */
  __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));
  __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(__pyx_v_k);
  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_v_k);
  __Pyx_GIVEREF(__pyx_v_k);
  __Pyx_INCREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  if (PyDict_SetItem(__pyx_t_1, __pyx_v_pre_v, ((PyObject *)__pyx_t_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __pyx_v_pvalue2qvalue = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":199
 *         pvalue2qvalue = {pre_v:[0,k,0]}              # pvalue:[qvalue,rank,bp_with_this_pvalue]
 *         #logging.info("####test#### start matching pvalue to qvalue")
 *         for v in sorted(value_dict.keys(),reverse=True):             # <<<<<<<<<<<<<<
 *             l = value_dict[v]
 *             q = v+int((log10(k)+f)*100) # we save integars here.
 */
  __pyx_t_1 = PyDict_Keys(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __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 = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__reverse), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
    __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++;
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++;
    } else {
      __pyx_t_8 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_8)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":200
 *         #logging.info("####test#### start matching pvalue to qvalue")
 *         for v in sorted(value_dict.keys(),reverse=True):
 *             l = value_dict[v]             # <<<<<<<<<<<<<<
 *             q = v+int((log10(k)+f)*100) # we save integars here.
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 */
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_value_dict), __pyx_v_v); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF(__pyx_v_l);
    __pyx_v_l = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":201
 *         for v in sorted(value_dict.keys(),reverse=True):
 *             l = value_dict[v]
 *             q = v+int((log10(k)+f)*100) # we save integars here.             # <<<<<<<<<<<<<<
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue[v] = [q, k, 0]
 */
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_k); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = PyFloat_FromDouble(((log10(__pyx_t_9) + __pyx_v_f) * 100.0)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __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 = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_v_v, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_v_q);
    __pyx_v_q = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":202
 *             l = value_dict[v]
 *             q = v+int((log10(k)+f)*100) # we save integars here.
 *             q = max(0,min(pre_q,q))           # make q-score monotonic             # <<<<<<<<<<<<<<
 *             pvalue2qvalue[v] = [q, k, 0]
 *             pvalue2qvalue[pre_v][2] = k-pvalue2qvalue[pre_v][1]
 */
    __Pyx_INCREF(__pyx_v_q);
    __pyx_t_7 = __pyx_v_q;
    __Pyx_INCREF(__pyx_v_pre_q);
    __pyx_t_8 = __pyx_v_pre_q;
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_t_8, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_5 = __pyx_t_7;
    } else {
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_5 = __pyx_t_8;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_7 = __pyx_t_5;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = 0;
    __pyx_t_8 = PyInt_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_t_8, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_5 = __pyx_t_7;
    } else {
      __pyx_t_2 = PyInt_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_v_q);
    __pyx_v_q = __pyx_t_5;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":203
 *             q = v+int((log10(k)+f)*100) # we save integars here.
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue[v] = [q, k, 0]             # <<<<<<<<<<<<<<
 *             pvalue2qvalue[pre_v][2] = k-pvalue2qvalue[pre_v][1]
 *             pre_v = v
 */
    __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_q);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_q);
    __Pyx_GIVEREF(__pyx_v_q);
    __Pyx_INCREF(__pyx_v_k);
    PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_k);
    __Pyx_GIVEREF(__pyx_v_k);
    __Pyx_INCREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    if (PyDict_SetItem(((PyObject *)__pyx_v_pvalue2qvalue), __pyx_v_v, ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":204
 *             q = max(0,min(pre_q,q))           # make q-score monotonic
 *             pvalue2qvalue[v] = [q, k, 0]
 *             pvalue2qvalue[pre_v][2] = k-pvalue2qvalue[pre_v][1]             # <<<<<<<<<<<<<<
 *             pre_v = v
 *             pre_q = q
 */
    __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pvalue2qvalue), __pyx_v_pre_v); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_k, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pvalue2qvalue), __pyx_v_pre_v); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_SetItemInt(__pyx_t_7, 2, __pyx_t_5, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":205
 *             pvalue2qvalue[v] = [q, k, 0]
 *             pvalue2qvalue[pre_v][2] = k-pvalue2qvalue[pre_v][1]
 *             pre_v = v             # <<<<<<<<<<<<<<
 *             pre_q = q
 *             k+=l
 */
    __Pyx_INCREF(__pyx_v_v);
    __Pyx_DECREF(__pyx_v_pre_v);
    __pyx_v_pre_v = __pyx_v_v;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":206
 *             pvalue2qvalue[pre_v][2] = k-pvalue2qvalue[pre_v][1]
 *             pre_v = v
 *             pre_q = q             # <<<<<<<<<<<<<<
 *             k+=l
 *         pvalue2qvalue[pre_v][2] = k-pvalue2qvalue[pre_v][1]
 */
    __Pyx_INCREF(__pyx_v_q);
    __Pyx_DECREF(__pyx_v_pre_q);
    __pyx_v_pre_q = __pyx_v_q;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":207
 *             pre_v = v
 *             pre_q = q
 *             k+=l             # <<<<<<<<<<<<<<
 *         pvalue2qvalue[pre_v][2] = k-pvalue2qvalue[pre_v][1]
 *         #logging.info("####test#### finish building pqtable")
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_v_l); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_v_k);
    __pyx_v_k = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":208
 *             pre_q = q
 *             k+=l
 *         pvalue2qvalue[pre_v][2] = k-pvalue2qvalue[pre_v][1]             # <<<<<<<<<<<<<<
 *         #logging.info("####test#### finish building pqtable")
 *         # pop the first -1e100 one
 */
  __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pvalue2qvalue), __pyx_v_pre_v); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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 = 208; __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_Subtract(__pyx_v_k, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pvalue2qvalue), __pyx_v_pre_v); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemInt(__pyx_t_5, 2, __pyx_t_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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/cCompositeScoreTrack.pyx":211
 *         #logging.info("####test#### finish building pqtable")
 *         # pop the first -1e100 one
 *         pvalue2qvalue.pop(-1e100)             # <<<<<<<<<<<<<<
 * 
 *         return pvalue2qvalue
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_pvalue2qvalue), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyFloat_FromDouble(-1e100); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __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_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":213
 *         pvalue2qvalue.pop(-1e100)
 * 
 *         return pvalue2qvalue             # <<<<<<<<<<<<<<
 * 
 *     def assign_qvalue ( self , pvalue2qvalue ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_pvalue2qvalue));
  __pyx_r = ((PyObject *)__pyx_v_pvalue2qvalue);
  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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.make_pq_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_value_dict);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_pre_p);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_this_p);
  __Pyx_XDECREF(__pyx_v_this_v);
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_pre_v);
  __Pyx_XDECREF(__pyx_v_pre_q);
  __Pyx_XDECREF(__pyx_v_pvalue2qvalue);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_q);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_17assign_qvalue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_16assign_qvalue[] = "Assign -100log10qvalue to every point.\n\n        pvalue2qvalue: a dictionary of -100log10pvalue:-100log10qvalue\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_17assign_qvalue = {__Pyx_NAMESTR("assign_qvalue"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_17assign_qvalue, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_16assign_qvalue)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_17assign_qvalue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_pvalue2qvalue = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__pvalue2qvalue,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assign_qvalue (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pvalue2qvalue);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("assign_qvalue", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assign_qvalue") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __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_pvalue2qvalue = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assign_qvalue", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.assign_qvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_16assign_qvalue(__pyx_self, __pyx_v_self, __pyx_v_pvalue2qvalue);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":215
 *         return pvalue2qvalue
 * 
 *     def assign_qvalue ( self , pvalue2qvalue ):             # <<<<<<<<<<<<<<
 *         """Assign -100log10qvalue to every point.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_16assign_qvalue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_pvalue2qvalue) {
  CYTHON_UNUSED long __pyx_v_t;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_pvalue = NULL;
  PyObject *__pyx_v_qvalue = NULL;
  PyObject *__pyx_v_i = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("assign_qvalue", 0);
  __Pyx_TraceCall("assign_qvalue", __pyx_f[0], 215);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":220
 *         pvalue2qvalue: a dictionary of -100log10pvalue:-100log10qvalue
 *         """
 *         t = 0             # <<<<<<<<<<<<<<
 *         for chrom in self.data.keys():
 *             pvalue = self.data[chrom]['-100logp']
 */
  __pyx_v_t = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":221
 *         """
 *         t = 0
 *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
 *             pvalue = self.data[chrom]['-100logp']
 *             qvalue = self.data[chrom]['-100logq']
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __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 = 221; __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 = 221; __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;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } 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 = 221; __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/cCompositeScoreTrack.pyx":222
 *         t = 0
 *         for chrom in self.data.keys():
 *             pvalue = self.data[chrom]['-100logp']             # <<<<<<<<<<<<<<
 *             qvalue = self.data[chrom]['-100logq']
 *             for i in xrange( 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 = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __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_GetItem(__pyx_t_5, ((PyObject *)__pyx_kp_s_10)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_pvalue);
    __pyx_v_pvalue = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":223
 *         for chrom in self.data.keys():
 *             pvalue = self.data[chrom]['-100logp']
 *             qvalue = self.data[chrom]['-100logq']             # <<<<<<<<<<<<<<
 *             for i in xrange( self.pointer[chrom] ):
 *                 qvalue[i] = pvalue2qvalue[pvalue[i]][0]
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __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_GetItem(__pyx_t_5, ((PyObject *)__pyx_kp_s_11)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __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_qvalue);
    __pyx_v_qvalue = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":224
 *             pvalue = self.data[chrom]['-100logp']
 *             qvalue = self.data[chrom]['-100logq']
 *             for i in xrange( self.pointer[chrom] ):             # <<<<<<<<<<<<<<
 *                 qvalue[i] = pvalue2qvalue[pvalue[i]][0]
 *         return True
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __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 = 224; __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_builtin_xrange, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __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;
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
      } 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 = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":225
 *             qvalue = self.data[chrom]['-100logq']
 *             for i in xrange( self.pointer[chrom] ):
 *                 qvalue[i] = pvalue2qvalue[pvalue[i]][0]             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
      __pyx_t_5 = PyObject_GetItem(__pyx_v_pvalue, __pyx_v_i); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = PyObject_GetItem(__pyx_v_pvalue2qvalue, __pyx_t_5); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyObject_SetItem(__pyx_v_qvalue, __pyx_v_i, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":226
 *             for i in xrange( self.pointer[chrom] ):
 *                 qvalue[i] = pvalue2qvalue[pvalue[i]][0]
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def call_peaks (self, cutoff=500, min_length=200, max_gap=50, colname='-100logp'):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __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_8);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.assign_qvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_pvalue);
  __Pyx_XDECREF(__pyx_v_qvalue);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_19call_peaks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_18call_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 1.\n        min_length :  minimum peak length, default 200.\n        gap   :  maximum gap to merge nearby peaks, default 50.\n        colname: can be 'sample','control','-100logp','-100logq'. Cutoff will be applied to the specified column.\n        ptrack:  an optional track for pileup heights. If it's not None, use it to find summits. Otherwise, use self/scoreTrack.\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_19call_peaks = {__Pyx_NAMESTR("call_peaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_19call_peaks, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_18call_peaks)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_19call_peaks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_cutoff = 0;
  PyObject *__pyx_v_min_length = 0;
  PyObject *__pyx_v_max_gap = 0;
  PyObject *__pyx_v_colname = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__cutoff,&__pyx_n_s__min_length,&__pyx_n_s__max_gap,&__pyx_n_s__colname,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_peaks (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_500));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_200));
    values[3] = ((PyObject *)((PyObject *)__pyx_int_50));
    values[4] = ((PyObject *)((PyObject*)__pyx_kp_s_10));
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__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__max_gap);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__colname);
          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_peaks") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_cutoff = values[1];
    __pyx_v_min_length = values[2];
    __pyx_v_max_gap = values[3];
    __pyx_v_colname = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_peaks", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_18call_peaks(__pyx_self, __pyx_v_self, __pyx_v_cutoff, __pyx_v_min_length, __pyx_v_max_gap, __pyx_v_colname);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":228
 *         return True
 * 
 *     def call_peaks (self, cutoff=500, min_length=200, max_gap=50, colname='-100logp'):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_18call_peaks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_max_gap, PyObject *__pyx_v_colname) {
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_v_peaks = NULL;
  PyObject *__pyx_v_chrom = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_chrom_pointer = NULL;
  PyObject *__pyx_v_peak_content = NULL;
  PyObject *__pyx_v_above_cutoff = NULL;
  PyObject *__pyx_v_above_cutoff_v = NULL;
  PyObject *__pyx_v_above_cutoff_endpos = NULL;
  PyObject *__pyx_v_above_cutoff_startpos = NULL;
  PyObject *__pyx_v_above_cutoff_sv = NULL;
  PyObject *__pyx_v_i = NULL;
  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;
  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 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("call_peaks", 0);
  __Pyx_TraceCall("call_peaks", __pyx_f[0], 228);
  __Pyx_INCREF(__pyx_v_cutoff);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":244
 *         ptrack:  an optional track for pileup heights. If it's not None, use it to find summits. Otherwise, use self/scoreTrack.
 *         """
 *         assert (colname in [ 'sample', 'control', '-100logp', '-100logq' ]), "%s not supported!" % colname             # <<<<<<<<<<<<<<
 * 
 *         chrs  = self.get_chr_names()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __Pyx_INCREF(__pyx_v_colname);
  __pyx_t_1 = __pyx_v_colname;
  __pyx_t_2 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_n_s__sample), Py_EQ); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!((int)__pyx_t_2)) {
    __pyx_t_3 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_n_s__control), Py_EQ); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = ((int)__pyx_t_3);
  } else {
    __pyx_t_4 = ((int)__pyx_t_2);
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_kp_s_10), Py_EQ); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = ((int)__pyx_t_2);
  } else {
    __pyx_t_3 = __pyx_t_4;
  }
  if (!__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_kp_s_11), Py_EQ); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((int)__pyx_t_4);
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) {
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_12), __pyx_v_colname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cCompositeScoreTrack.pyx":246
 *         assert (colname in [ 'sample', 'control', '-100logp', '-100logq' ]), "%s not supported!" % colname
 * 
 *         chrs  = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         peaks = PeakIO()                      # dictionary to save peaks
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __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 = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_chrs = __pyx_t_5;
  __pyx_t_5 = 0;

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

  /* "MACS2/IO/cCompositeScoreTrack.pyx":251
 *         #tloop = 0
 * 
 *         cutoff = int(cutoff)             # <<<<<<<<<<<<<<
 * 
 *         for chrom in chrs:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_cutoff);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cutoff);
  __Pyx_GIVEREF(__pyx_v_cutoff);
  __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_cutoff);
  __pyx_v_cutoff = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":253
 *         cutoff = int(cutoff)
 * 
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             chrom_pointer = self.pointer[chrom]
 *             peak_content = []           # to store points above cutoff
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_5 = __pyx_v_chrs; __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_chrs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __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;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++;
    } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++;
    } 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 = 253; __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/cCompositeScoreTrack.pyx":254
 * 
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]             # <<<<<<<<<<<<<<
 *             peak_content = []           # to store points above cutoff
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyObject_GetItem(__pyx_t_1, __pyx_v_chrom); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_chrom_pointer);
    __pyx_v_chrom_pointer = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":255
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]
 *             peak_content = []           # to store points above cutoff             # <<<<<<<<<<<<<<
 * 
 *             #t0 = ttime()
 */
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF(((PyObject *)__pyx_v_peak_content));
    __pyx_v_peak_content = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":258
 * 
 *             #t0 = ttime()
 *             above_cutoff = np.nonzero( self.data[chrom][colname] >= cutoff )[0] # indices where score is above cutoff             # <<<<<<<<<<<<<<
 *             above_cutoff_v = self.data[chrom][colname][above_cutoff] # scores 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 = 258; __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 = 258; __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_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyObject_GetItem(__pyx_t_8, __pyx_v_chrom); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __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_9, __pyx_v_colname); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __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 = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_9 = 0;
    __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 = 258; __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_8)); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_v_above_cutoff);
    __pyx_v_above_cutoff = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":259
 *             #t0 = ttime()
 *             above_cutoff = np.nonzero( self.data[chrom][colname] >= cutoff )[0] # indices where score is above cutoff
 *             above_cutoff_v = self.data[chrom][colname][above_cutoff] # scores where score is above cutoff             # <<<<<<<<<<<<<<
 * 
 *             above_cutoff_endpos = self.data[chrom]['pos'][above_cutoff] # end positions of regions where score is above cutoff
 */
    __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyObject_GetItem(__pyx_t_8, __pyx_v_chrom); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __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_9, __pyx_v_colname); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyObject_GetItem(__pyx_t_8, __pyx_v_above_cutoff); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_v_above_cutoff_v);
    __pyx_v_above_cutoff_v = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":261
 *             above_cutoff_v = self.data[chrom][colname][above_cutoff] # scores where score is above cutoff
 * 
 *             above_cutoff_endpos = self.data[chrom]['pos'][above_cutoff] # end positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 *             above_cutoff_startpos = self.data[chrom]['pos'][above_cutoff-1] # start positions of regions where score is above cutoff
 *             above_cutoff_sv= self.data[chrom]['sample'][above_cutoff] # sample pileup height where score is above cutoff
 */
    __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = PyObject_GetItem(__pyx_t_9, __pyx_v_chrom); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyObject_GetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __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_9, __pyx_v_above_cutoff); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_v_above_cutoff_endpos);
    __pyx_v_above_cutoff_endpos = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":262
 * 
 *             above_cutoff_endpos = self.data[chrom]['pos'][above_cutoff] # end positions of regions where score is above cutoff
 *             above_cutoff_startpos = self.data[chrom]['pos'][above_cutoff-1] # start positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
 *             above_cutoff_sv= self.data[chrom]['sample'][above_cutoff] # sample pileup height where score is above cutoff
 * 
 */
    __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyObject_GetItem(__pyx_t_8, __pyx_v_chrom); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __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_9, ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyNumber_Subtract(__pyx_v_above_cutoff, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_t_9); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __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_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_v_above_cutoff_startpos);
    __pyx_v_above_cutoff_startpos = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":263
 *             above_cutoff_endpos = self.data[chrom]['pos'][above_cutoff] # end positions of regions where score is above cutoff
 *             above_cutoff_startpos = self.data[chrom]['pos'][above_cutoff-1] # start positions of regions where score is above cutoff
 *             above_cutoff_sv= self.data[chrom]['sample'][above_cutoff] # sample pileup height where score is above cutoff             # <<<<<<<<<<<<<<
 * 
 *             if above_cutoff_v.size == 0:
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyObject_GetItem(__pyx_t_1, __pyx_v_chrom); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__sample)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyObject_GetItem(__pyx_t_1, __pyx_v_above_cutoff); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_above_cutoff_sv);
    __pyx_v_above_cutoff_sv = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":265
 *             above_cutoff_sv= self.data[chrom]['sample'][above_cutoff] # sample pileup height where score is above cutoff
 * 
 *             if above_cutoff_v.size == 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_9 = PyObject_GetAttr(__pyx_v_above_cutoff_v, __pyx_n_s__size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_9, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":266
 * 
 *             if above_cutoff_v.size == 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if above_cutoff[0] == 0:
 */
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":268
 *                 continue
 * 
 *             if above_cutoff[0] == 0:             # <<<<<<<<<<<<<<
 *                 above_cutoff_startpos[0] = 0
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_above_cutoff, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_2) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":269
 * 
 *             if above_cutoff[0] == 0:
 *                 above_cutoff_startpos[0] = 0             # <<<<<<<<<<<<<<
 * 
 *             # first bit of region above cutoff
 */
      if (__Pyx_SetItemInt(__pyx_v_above_cutoff_startpos, 0, __pyx_int_0, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":272
 * 
 *             # 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 xrange(1,above_cutoff_startpos.size):
 *                 if above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 */
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_above_cutoff_startpos, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_above_cutoff_endpos, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_above_cutoff_v, 0, sizeof(long), PyInt_FromLong); if (!__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_10 = __Pyx_GetItemInt(__pyx_v_above_cutoff_sv, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_above_cutoff, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = PyTuple_New(5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_t_9 = 0;
    __pyx_t_1 = 0;
    __pyx_t_8 = 0;
    __pyx_t_10 = 0;
    __pyx_t_11 = 0;
    __pyx_t_13 = PyList_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_12)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":273
 *             # 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 xrange(1,above_cutoff_startpos.size):             # <<<<<<<<<<<<<<
 *                 if above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
 *                     # append
 */
    __pyx_t_12 = PyObject_GetAttr(__pyx_v_above_cutoff_startpos, __pyx_n_s__size); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) {
      __pyx_t_11 = __pyx_t_12; __Pyx_INCREF(__pyx_t_11); __pyx_t_14 = 0;
      __pyx_t_15 = NULL;
    } else {
      __pyx_t_14 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_15 = Py_TYPE(__pyx_t_11)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    for (;;) {
      if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_11)) {
        if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_11)) break;
        __pyx_t_12 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_14); __Pyx_INCREF(__pyx_t_12); __pyx_t_14++;
      } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_11)) {
        if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
        __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_14); __Pyx_INCREF(__pyx_t_12); __pyx_t_14++;
      } else {
        __pyx_t_12 = __pyx_t_15(__pyx_t_11);
        if (unlikely(!__pyx_t_12)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_12);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":274
 *             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 xrange(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_12 = PyObject_GetItem(__pyx_v_above_cutoff_startpos, __pyx_v_i); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_peak_content), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_10, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyNumber_Subtract(__pyx_t_12, __pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_10, __pyx_v_max_gap, Py_LE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_2) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":276
 *                 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_8 = PyObject_GetItem(__pyx_v_above_cutoff_startpos, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = PyObject_GetItem(__pyx_v_above_cutoff_endpos, __pyx_v_i); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_12 = PyObject_GetItem(__pyx_v_above_cutoff_v, __pyx_v_i); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_1 = PyObject_GetItem(__pyx_v_above_cutoff_sv, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_9 = PyObject_GetItem(__pyx_v_above_cutoff, __pyx_v_i); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_16 = PyTuple_New(5); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_8 = 0;
        __pyx_t_10 = 0;
        __pyx_t_12 = 0;
        __pyx_t_1 = 0;
        __pyx_t_9 = 0;
        __pyx_t_13 = PyList_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_16)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
        goto __pyx_L9;
      }
      /*else*/ {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":279
 *                 else:
 *                     # close
 *                     self.__close_peak(peak_content, peaks, min_length, chrom, colname )             # <<<<<<<<<<<<<<
 *                     peak_content = [(above_cutoff_startpos[i], above_cutoff_endpos[i], above_cutoff_v[i], above_cutoff_sv[i], above_cutoff[i]),]
 * 
 */
        __pyx_t_16 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_14); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_9 = PyTuple_New(5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(((PyObject *)__pyx_v_peak_content));
        PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_peak_content));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_peak_content));
        __Pyx_INCREF(__pyx_v_peaks);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_peaks);
        __Pyx_GIVEREF(__pyx_v_peaks);
        __Pyx_INCREF(__pyx_v_min_length);
        PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_min_length);
        __Pyx_GIVEREF(__pyx_v_min_length);
        __Pyx_INCREF(__pyx_v_chrom);
        PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_v_chrom);
        __Pyx_GIVEREF(__pyx_v_chrom);
        __Pyx_INCREF(__pyx_v_colname);
        PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_colname);
        __Pyx_GIVEREF(__pyx_v_colname);
        __pyx_t_1 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":280
 *                     # close
 *                     self.__close_peak(peak_content, peaks, min_length, chrom, colname )
 *                     peak_content = [(above_cutoff_startpos[i], above_cutoff_endpos[i], above_cutoff_v[i], above_cutoff_sv[i], above_cutoff[i]),]             # <<<<<<<<<<<<<<
 * 
 *             #tloop += ttime() - t0
 */
        __pyx_t_1 = PyObject_GetItem(__pyx_v_above_cutoff_startpos, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_9 = PyObject_GetItem(__pyx_v_above_cutoff_endpos, __pyx_v_i); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_16 = PyObject_GetItem(__pyx_v_above_cutoff_v, __pyx_v_i); if (!__pyx_t_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_12 = PyObject_GetItem(__pyx_v_above_cutoff_sv, __pyx_v_i); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_10 = PyObject_GetItem(__pyx_v_above_cutoff, __pyx_v_i); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __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);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_16);
        __Pyx_GIVEREF(__pyx_t_16);
        PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_1 = 0;
        __pyx_t_9 = 0;
        __pyx_t_16 = 0;
        __pyx_t_12 = 0;
        __pyx_t_10 = 0;
        __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyList_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_8));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
        __pyx_t_8 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_v_peak_content));
        __pyx_v_peak_content = __pyx_t_10;
        __pyx_t_10 = 0;
      }
      __pyx_L9:;
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":284
 *             #tloop += ttime() - t0
 *             # save the last peak
 *             if not peak_content:             # <<<<<<<<<<<<<<
 *                 continue
 *             else:
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_peak_content) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_peak_content)) != 0);
    __pyx_t_3 = (!__pyx_t_2);
    if (__pyx_t_3) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":285
 *             # save the last peak
 *             if not peak_content:
 *                 continue             # <<<<<<<<<<<<<<
 *             else:
 *                 self.__close_peak(peak_content, peaks, min_length, chrom, colname )
 */
      goto __pyx_L3_continue;
      goto __pyx_L10;
    }
    /*else*/ {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":287
 *                 continue
 *             else:
 *                 self.__close_peak(peak_content, peaks, min_length, chrom, colname )             # <<<<<<<<<<<<<<
 * 
 *         #print "loop: %.2f" % tloop
 */
      __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_14); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(((PyObject *)__pyx_v_peak_content));
      PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_peak_content));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_peak_content));
      __Pyx_INCREF(__pyx_v_peaks);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_peaks);
      __Pyx_GIVEREF(__pyx_v_peaks);
      __Pyx_INCREF(__pyx_v_min_length);
      PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_min_length);
      __Pyx_GIVEREF(__pyx_v_min_length);
      __Pyx_INCREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      __Pyx_INCREF(__pyx_v_colname);
      PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_v_colname);
      __Pyx_GIVEREF(__pyx_v_colname);
      __pyx_t_8 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_L10:;
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":290
 * 
 *         #print "loop: %.2f" % tloop
 *         return peaks             # <<<<<<<<<<<<<<
 * 
 *     def __close_peak (self, peak_content, peaks, min_length, chrom, colname):
 */
  __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_5);
  __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_16);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF(__pyx_v_peaks);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_chrom_pointer);
  __Pyx_XDECREF(__pyx_v_peak_content);
  __Pyx_XDECREF(__pyx_v_above_cutoff);
  __Pyx_XDECREF(__pyx_v_above_cutoff_v);
  __Pyx_XDECREF(__pyx_v_above_cutoff_endpos);
  __Pyx_XDECREF(__pyx_v_above_cutoff_startpos);
  __Pyx_XDECREF(__pyx_v_above_cutoff_sv);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_cutoff);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_21__close_peak(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_21__close_peak = {__Pyx_NAMESTR("__close_peak"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_21__close_peak, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_21__close_peak(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_peak_content = 0;
  PyObject *__pyx_v_peaks = 0;
  PyObject *__pyx_v_min_length = 0;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_colname = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__peak_content,&__pyx_n_s__peaks,&__pyx_n_s__min_length,&__pyx_n_s__chrom,&__pyx_n_s__colname,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__close_peak (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[6] = {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  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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__peak_content);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__close_peak", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__peaks);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__close_peak", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_length);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__close_peak", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__close_peak", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__colname);
        if (likely(values[5])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__close_peak", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__close_peak") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_self = values[0];
    __pyx_v_peak_content = values[1];
    __pyx_v_peaks = values[2];
    __pyx_v_min_length = values[3];
    __pyx_v_chrom = values[4];
    __pyx_v_colname = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__close_peak", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.__close_peak", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_20__close_peak(__pyx_self, __pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, __pyx_v_colname);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":292
 *         return peaks
 * 
 *     def __close_peak (self, peak_content, peaks, min_length, chrom, colname):             # <<<<<<<<<<<<<<
 *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *         if peak_length >= min_length: # if the peak is too small, reject it
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_20__close_peak(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_peak_content, PyObject *__pyx_v_peaks, PyObject *__pyx_v_min_length, PyObject *__pyx_v_chrom, PyObject *__pyx_v_colname) {
  PyObject *__pyx_v_peak_length = NULL;
  PyObject *__pyx_v_tmpsummit = NULL;
  PyObject *__pyx_v_summit_pos = NULL;
  PyObject *__pyx_v_summit_value = NULL;
  PyObject *__pyx_v_tmpstart = NULL;
  PyObject *__pyx_v_tmpend = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_tmpvalue = NULL;
  PyObject *__pyx_v_tmpsummitvalue = NULL;
  PyObject *__pyx_v_tmpindex = NULL;
  PyObject *__pyx_v_tmpsummit_index = NULL;
  PyObject *__pyx_v_middle_summit = NULL;
  PyObject *__pyx_v_summit_index = 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 *);
  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)(PyObject *);
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__close_peak", 0);
  __Pyx_TraceCall("__close_peak", __pyx_f[0], 292);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":293
 * 
 *     def __close_peak (self, peak_content, peaks, min_length, chrom, colname):
 *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *         if peak_length >= min_length: # if the peak is too small, reject it
 *             tmpsummit = []
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_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/cCompositeScoreTrack.pyx":294
 *     def __close_peak (self, peak_content, peaks, min_length, chrom, colname):
 *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *         if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *             tmpsummit = []
 *             summit_pos   = None
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "MACS2/IO/cCompositeScoreTrack.pyx":295
 *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *         if peak_length >= min_length: # if the peak is too small, reject it
 *             tmpsummit = []             # <<<<<<<<<<<<<<
 *             summit_pos   = None
 *             summit_value = None
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_tmpsummit = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":296
 *         if peak_length >= min_length: # if the peak is too small, reject it
 *             tmpsummit = []
 *             summit_pos   = None             # <<<<<<<<<<<<<<
 *             summit_value = None
 *             for (tmpstart,tmpend,tmpvalue,tmpsummitvalue, tmpindex) in peak_content:
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_summit_pos = Py_None;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":297
 *             tmpsummit = []
 *             summit_pos   = None
 *             summit_value = None             # <<<<<<<<<<<<<<
 *             for (tmpstart,tmpend,tmpvalue,tmpsummitvalue, tmpindex) in peak_content:
 *                 if not summit_value or summit_value < tmpsummitvalue:
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_summit_value = Py_None;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":298
 *             summit_pos   = None
 *             summit_value = None
 *             for (tmpstart,tmpend,tmpvalue,tmpsummitvalue, tmpindex) in peak_content:             # <<<<<<<<<<<<<<
 *                 if not summit_value or summit_value < tmpsummitvalue:
 *                     tmpsummit = [ int(( tmpend+tmpstart )/2), ]
 */
    if (PyList_CheckExact(__pyx_v_peak_content) || PyTuple_CheckExact(__pyx_v_peak_content)) {
      __pyx_t_1 = __pyx_v_peak_content; __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_peak_content); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __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;
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
      } else {
        __pyx_t_3 = __pyx_t_6(__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 = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        if (likely(PyTuple_CheckExact(sequence))) {
          if (unlikely(PyTuple_GET_SIZE(sequence) != 5)) {
            if (PyTuple_GET_SIZE(sequence) > 5) __Pyx_RaiseTooManyValuesError(5);
            else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 4); 
        } else {
          if (unlikely(PyList_GET_SIZE(sequence) != 5)) {
            if (PyList_GET_SIZE(sequence) > 5) __Pyx_RaiseTooManyValuesError(5);
            else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 2); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 3); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 4); 
        }
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 2; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 3; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        index = 4; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
        if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L7_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_v_tmpstart);
      __pyx_v_tmpstart = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_v_tmpend);
      __pyx_v_tmpend = __pyx_t_7;
      __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_v_tmpvalue);
      __pyx_v_tmpvalue = __pyx_t_8;
      __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_v_tmpsummitvalue);
      __pyx_v_tmpsummitvalue = __pyx_t_9;
      __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_v_tmpindex);
      __pyx_v_tmpindex = __pyx_t_10;
      __pyx_t_10 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":299
 *             summit_value = None
 *             for (tmpstart,tmpend,tmpvalue,tmpsummitvalue, tmpindex) in peak_content:
 *                 if not summit_value or summit_value < tmpsummitvalue:             # <<<<<<<<<<<<<<
 *                     tmpsummit = [ int(( tmpend+tmpstart )/2), ]
 *                     tmpsummit_index = [ tmpindex, ]
 */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_summit_value); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = (!__pyx_t_4);
      if (!__pyx_t_13) {
        __pyx_t_3 = PyObject_RichCompare(__pyx_v_summit_value, __pyx_v_tmpsummitvalue, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_14 = __pyx_t_4;
      } else {
        __pyx_t_14 = __pyx_t_13;
      }
      if (__pyx_t_14) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":300
 *             for (tmpstart,tmpend,tmpvalue,tmpsummitvalue, tmpindex) in peak_content:
 *                 if not summit_value or summit_value < tmpsummitvalue:
 *                     tmpsummit = [ int(( tmpend+tmpstart )/2), ]             # <<<<<<<<<<<<<<
 *                     tmpsummit_index = [ tmpindex, ]
 *                     summit_value = tmpsummitvalue
 */
        __pyx_t_3 = PyNumber_Add(__pyx_v_tmpend, __pyx_v_tmpstart); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_v_tmpsummit));
        __pyx_v_tmpsummit = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":301
 *                 if not summit_value or summit_value < tmpsummitvalue:
 *                     tmpsummit = [ int(( tmpend+tmpstart )/2), ]
 *                     tmpsummit_index = [ tmpindex, ]             # <<<<<<<<<<<<<<
 *                     summit_value = tmpsummitvalue
 *                 elif summit_value == tmpsummitvalue:
 */
        __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_tmpindex);
        PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_tmpindex);
        __Pyx_GIVEREF(__pyx_v_tmpindex);
        __Pyx_XDECREF(((PyObject *)__pyx_v_tmpsummit_index));
        __pyx_v_tmpsummit_index = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":302
 *                     tmpsummit = [ int(( tmpend+tmpstart )/2), ]
 *                     tmpsummit_index = [ tmpindex, ]
 *                     summit_value = tmpsummitvalue             # <<<<<<<<<<<<<<
 *                 elif summit_value == tmpsummitvalue:
 *                     # remember continuous summit values
 */
        __Pyx_INCREF(__pyx_v_tmpsummitvalue);
        __Pyx_DECREF(__pyx_v_summit_value);
        __pyx_v_summit_value = __pyx_v_tmpsummitvalue;
        goto __pyx_L8;
      }

      /* "MACS2/IO/cCompositeScoreTrack.pyx":303
 *                     tmpsummit_index = [ tmpindex, ]
 *                     summit_value = tmpsummitvalue
 *                 elif summit_value == tmpsummitvalue:             # <<<<<<<<<<<<<<
 *                     # remember continuous summit values
 *                     tmpsummit.append( int( (tmpend+tmpstart)/2 ) )
 */
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_summit_value, __pyx_v_tmpsummitvalue, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_14) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":305
 *                 elif summit_value == tmpsummitvalue:
 *                     # remember continuous summit values
 *                     tmpsummit.append( int( (tmpend+tmpstart)/2 ) )             # <<<<<<<<<<<<<<
 *                     tmpsummit_index.append( tmpindex )
 *             middle_summit = int( ( len(tmpsummit)+1 )/2 )-1 # the middle of all highest points in peak region is defined as summit
 */
        __pyx_t_3 = PyNumber_Add(__pyx_v_tmpend, __pyx_v_tmpstart); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __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 = 305; __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);
        __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_15 = PyList_Append(__pyx_v_tmpsummit, __pyx_t_10); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":306
 *                     # remember continuous summit values
 *                     tmpsummit.append( int( (tmpend+tmpstart)/2 ) )
 *                     tmpsummit_index.append( tmpindex )             # <<<<<<<<<<<<<<
 *             middle_summit = int( ( len(tmpsummit)+1 )/2 )-1 # the middle of all highest points in peak region is defined as summit
 *             summit_pos    = tmpsummit[ middle_summit ]
 */
        if (unlikely(!__pyx_v_tmpsummit_index)) { __Pyx_RaiseUnboundLocalError("tmpsummit_index"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        __pyx_t_15 = PyList_Append(__pyx_v_tmpsummit_index, __pyx_v_tmpindex); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":307
 *                     tmpsummit.append( int( (tmpend+tmpstart)/2 ) )
 *                     tmpsummit_index.append( tmpindex )
 *             middle_summit = int( ( len(tmpsummit)+1 )/2 )-1 # the middle of all highest points in peak region is defined as summit             # <<<<<<<<<<<<<<
 *             summit_pos    = tmpsummit[ middle_summit ]
 *             summit_index  = tmpsummit_index[ middle_summit ]
 */
    __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_tmpsummit)); 
    __pyx_t_1 = PyInt_FromSsize_t(__Pyx_div_Py_ssize_t((__pyx_t_5 + 1), 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_middle_summit = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":308
 *                     tmpsummit_index.append( tmpindex )
 *             middle_summit = int( ( len(tmpsummit)+1 )/2 )-1 # the middle of all highest points in peak region is defined as summit
 *             summit_pos    = tmpsummit[ middle_summit ]             # <<<<<<<<<<<<<<
 *             summit_index  = tmpsummit_index[ middle_summit ]
 *             # char * chromosome, long start, long end, long summit = 0,
 */
    __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_tmpsummit), __pyx_v_middle_summit); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_v_summit_pos);
    __pyx_v_summit_pos = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":309
 *             middle_summit = int( ( len(tmpsummit)+1 )/2 )-1 # the middle of all highest points in peak region is defined as summit
 *             summit_pos    = tmpsummit[ middle_summit ]
 *             summit_index  = tmpsummit_index[ middle_summit ]             # <<<<<<<<<<<<<<
 *             # char * chromosome, long start, long end, long summit = 0,
 *             # double peak_height=0, int pileup=0,
 */
    if (unlikely(!__pyx_v_tmpsummit_index)) { __Pyx_RaiseUnboundLocalError("tmpsummit_index"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_tmpsummit_index), __pyx_v_middle_summit); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_v_summit_index = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":313
 *             # double peak_height=0, int pileup=0,
 *             # double pvalue=0, double fold_change=0, double qvalue=0
 *             peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                        peak_content[0][0],
 *                        peak_content[-1][1],
 */
    __pyx_t_10 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);

    /* "MACS2/IO/cCompositeScoreTrack.pyx":314
 *             # double pvalue=0, double fold_change=0, double qvalue=0
 *             peaks.add( chrom,
 *                        peak_content[0][0],             # <<<<<<<<<<<<<<
 *                        peak_content[-1][1],
 *                        summit      = summit_pos,
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __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 = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":315
 *             peaks.add( chrom,
 *                        peak_content[0][0],
 *                        peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                        summit      = summit_pos,
 *                        peak_score  = self.data[chrom][colname][ summit_index ],
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_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_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_3 = 0;
    __pyx_t_9 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":313
 *             # double peak_height=0, int pileup=0,
 *             # double pvalue=0, double fold_change=0, double qvalue=0
 *             peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                        peak_content[0][0],
 *                        peak_content[-1][1],
 */
    __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_9));

    /* "MACS2/IO/cCompositeScoreTrack.pyx":316
 *                        peak_content[0][0],
 *                        peak_content[-1][1],
 *                        summit      = summit_pos,             # <<<<<<<<<<<<<<
 *                        peak_score  = self.data[chrom][colname][ summit_index ],
 *                        pileup      = self.data[chrom]['sample'][ summit_index ], # should be the same as summit_value
 */
    if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__summit), __pyx_v_summit_pos) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "MACS2/IO/cCompositeScoreTrack.pyx":317
 *                        peak_content[-1][1],
 *                        summit      = summit_pos,
 *                        peak_score  = self.data[chrom][colname][ summit_index ],             # <<<<<<<<<<<<<<
 *                        pileup      = self.data[chrom]['sample'][ summit_index ], # should be the same as summit_value
 *                        pscore      = self.data[chrom]['-100logp'][ summit_index ]/100.0,
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_v_chrom); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __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(__pyx_t_8, __pyx_v_colname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __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_GetItem(__pyx_t_3, __pyx_v_summit_index); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__peak_score), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":318
 *                        summit      = summit_pos,
 *                        peak_score  = self.data[chrom][colname][ summit_index ],
 *                        pileup      = self.data[chrom]['sample'][ summit_index ], # should be the same as summit_value             # <<<<<<<<<<<<<<
 *                        pscore      = self.data[chrom]['-100logp'][ summit_index ]/100.0,
 *                        fold_change = self.data[chrom]['sample'][ summit_index ]/self.data[chrom]['control'][ summit_index ],
 */
    __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyObject_GetItem(__pyx_t_8, __pyx_v_chrom); if (!__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_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__sample)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __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(__pyx_t_8, __pyx_v_summit_index); if (!__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_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__pileup), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":319
 *                        peak_score  = self.data[chrom][colname][ summit_index ],
 *                        pileup      = self.data[chrom]['sample'][ summit_index ], # should be the same as summit_value
 *                        pscore      = self.data[chrom]['-100logp'][ summit_index ]/100.0,             # <<<<<<<<<<<<<<
 *                        fold_change = self.data[chrom]['sample'][ summit_index ]/self.data[chrom]['control'][ summit_index ],
 *                        qscore      = self.data[chrom]['-100logq'][ summit_index ]/100.0,
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); 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 = PyObject_GetItem(__pyx_t_3, __pyx_v_chrom); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __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(__pyx_t_8, ((PyObject *)__pyx_kp_s_10)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __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_GetItem(__pyx_t_3, __pyx_v_summit_index); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __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(100.0); 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_7 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__pscore), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":320
 *                        pileup      = self.data[chrom]['sample'][ summit_index ], # should be the same as summit_value
 *                        pscore      = self.data[chrom]['-100logp'][ summit_index ]/100.0,
 *                        fold_change = self.data[chrom]['sample'][ summit_index ]/self.data[chrom]['control'][ summit_index ],             # <<<<<<<<<<<<<<
 *                        qscore      = self.data[chrom]['-100logq'][ summit_index ]/100.0,
 *                        #peak_score  = chrom_score [ summit_index ],
 */
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); 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_t_3 = PyObject_GetItem(__pyx_t_7, __pyx_v_chrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__sample)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_GetItem(__pyx_t_7, __pyx_v_summit_index); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); 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_t_8 = PyObject_GetItem(__pyx_t_7, __pyx_v_chrom); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_GetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__control)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_GetItem(__pyx_t_7, __pyx_v_summit_index); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_8); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__fold_change), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":321
 *                        pscore      = self.data[chrom]['-100logp'][ summit_index ]/100.0,
 *                        fold_change = self.data[chrom]['sample'][ summit_index ]/self.data[chrom]['control'][ summit_index ],
 *                        qscore      = self.data[chrom]['-100logq'][ summit_index ]/100.0,             # <<<<<<<<<<<<<<
 *                        #peak_score  = chrom_score [ summit_index ],
 *                        #pileup      = chrom_sample[ summit_index ], # should be the same as summit_value
 */
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); 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_t_8 = PyObject_GetItem(__pyx_t_7, __pyx_v_chrom); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_GetItem(__pyx_t_8, ((PyObject *)__pyx_kp_s_11)); if (!__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_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_GetItem(__pyx_t_7, __pyx_v_summit_index); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyFloat_FromDouble(100.0); 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_t_3 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__qscore), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __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;
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":329
 *                        )
 *             # start a new peak
 *             return True             # <<<<<<<<<<<<<<
 * 
 *     def call_broadpeaks (self, lvl1_cutoff=500, lvl2_cutoff=100, min_length=200, lvl1_max_gap=50, lvl2_max_gap=400, colname='-100logq'):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.__close_peak", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_peak_length);
  __Pyx_XDECREF(__pyx_v_tmpsummit);
  __Pyx_XDECREF(__pyx_v_summit_pos);
  __Pyx_XDECREF(__pyx_v_summit_value);
  __Pyx_XDECREF(__pyx_v_tmpstart);
  __Pyx_XDECREF(__pyx_v_tmpend);
  __Pyx_XDECREF(__pyx_v_tmpvalue);
  __Pyx_XDECREF(__pyx_v_tmpsummitvalue);
  __Pyx_XDECREF(__pyx_v_tmpindex);
  __Pyx_XDECREF(__pyx_v_tmpsummit_index);
  __Pyx_XDECREF(__pyx_v_middle_summit);
  __Pyx_XDECREF(__pyx_v_summit_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_23call_broadpeaks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_22call_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 500.\n        lvl2_cutoff:  cutoff of value at linkage regions, default 100.        \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        colname: can be 'sample','control','-100logp','-100logq'. Cutoff will be applied to the specified column.\n\n        Return both general PeakIO object for highly enriched regions\n        and gapped broad regions in BroadPeakIO.\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_23call_broadpeaks = {__Pyx_NAMESTR("call_broadpeaks"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_23call_broadpeaks, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_22call_broadpeaks)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_23call_broadpeaks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_lvl1_cutoff = 0;
  PyObject *__pyx_v_lvl2_cutoff = 0;
  PyObject *__pyx_v_min_length = 0;
  PyObject *__pyx_v_lvl1_max_gap = 0;
  PyObject *__pyx_v_lvl2_max_gap = 0;
  PyObject *__pyx_v_colname = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__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,&__pyx_n_s__colname,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_broadpeaks (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_500));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_100));
    values[3] = ((PyObject *)((PyObject *)__pyx_int_200));
    values[4] = ((PyObject *)((PyObject *)__pyx_int_50));
    values[5] = ((PyObject *)((PyObject *)__pyx_int_400));
    values[6] = ((PyObject *)((PyObject*)__pyx_kp_s_11));
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl1_cutoff);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl2_cutoff);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_length);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl1_max_gap);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl2_max_gap);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__colname);
          if (value) { values[6] = 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 = 331; __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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_lvl1_cutoff = values[1];
    __pyx_v_lvl2_cutoff = values[2];
    __pyx_v_min_length = values[3];
    __pyx_v_lvl1_max_gap = values[4];
    __pyx_v_lvl2_max_gap = values[5];
    __pyx_v_colname = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_broadpeaks", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_22call_broadpeaks(__pyx_self, __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_v_colname);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":331
 *             return True
 * 
 *     def call_broadpeaks (self, lvl1_cutoff=500, lvl2_cutoff=100, min_length=200, lvl1_max_gap=50, lvl2_max_gap=400, colname='-100logq'):             # <<<<<<<<<<<<<<
 *         """This function try to find enriched regions within which,
 *         scores are continuously higher than a given cutoff for level
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_22call_broadpeaks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lvl1_cutoff, PyObject *__pyx_v_lvl2_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_lvl1_max_gap, PyObject *__pyx_v_lvl2_max_gap, PyObject *__pyx_v_colname) {
  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_chrom = 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;
  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;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("call_broadpeaks", 0);
  __Pyx_TraceCall("call_broadpeaks", __pyx_f[0], 331);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":347
 *         and gapped broad regions in BroadPeakIO.
 *         """
 *         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, colname=colname)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_lvl1_cutoff, __pyx_v_lvl2_cutoff, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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 = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_15));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cCompositeScoreTrack.pyx":348
 *         """
 *         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, colname=colname)
 *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap, colname=colname)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_lvl1_max_gap, __pyx_v_lvl2_max_gap, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __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 = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_16));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cCompositeScoreTrack.pyx":349
 *         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, colname=colname)             # <<<<<<<<<<<<<<
 *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap, colname=colname)
 *         chrs = lvl1_peaks.peaks.keys()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__call_peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __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 = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__cutoff), __pyx_v_lvl1_cutoff) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__min_length), __pyx_v_min_length) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__max_gap), __pyx_v_lvl1_max_gap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__colname), __pyx_v_colname) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __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 = 349; __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_v_lvl1_peaks = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":350
 *         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, colname=colname)
 *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap, colname=colname)             # <<<<<<<<<<<<<<
 *         chrs = lvl1_peaks.peaks.keys()
 *         broadpeaks = BroadPeakIO()
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__call_peaks); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__cutoff), __pyx_v_lvl2_cutoff) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__min_length), __pyx_v_min_length) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__max_gap), __pyx_v_lvl2_max_gap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__colname), __pyx_v_colname) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_lvl2_peaks = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":351
 *         lvl1_peaks = self.call_peaks(cutoff=lvl1_cutoff, min_length=min_length, max_gap=lvl1_max_gap, colname=colname)
 *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap, colname=colname)
 *         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 = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __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 = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_chrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":352
 *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap, colname=colname)
 *         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 = 352; __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_broadpeaks = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":354
 *         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_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 = 354; __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;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++;
    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++;
    } 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 = 354; __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/cCompositeScoreTrack.pyx":355
 *         # 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 = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_v_chrom); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __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_lvl1peakschrom);
    __pyx_v_lvl1peakschrom = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":356
 *         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_4 = PyObject_GetAttr(__pyx_v_lvl2_peaks, __pyx_n_s__peaks); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_GetItem(__pyx_t_4, __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __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_lvl2peakschrom);
    __pyx_v_lvl2peakschrom = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":357
 *             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 = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __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_lvl1peakschrom_next);
    __pyx_v_lvl1peakschrom_next = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":358
 *             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_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF(((PyObject *)__pyx_v_tmppeakset));
    __pyx_v_tmppeakset = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":360
 *             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_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/cCompositeScoreTrack.pyx":361
 *             # our assumption is lvl1 regions should be included in lvl2 regions
 *             try:
 *                 lvl1 = lvl1peakschrom_next()             # <<<<<<<<<<<<<<
 *             except StopIteration:
 *                 break
 */
        __pyx_t_4 = PyObject_Call(__pyx_v_lvl1peakschrom_next, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF(__pyx_v_lvl1);
        __pyx_v_lvl1 = __pyx_t_4;
        __pyx_t_4 = 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_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":362
 *             try:
 *                 lvl1 = lvl1peakschrom_next()
 *             except StopIteration:             # <<<<<<<<<<<<<<
 *                 break
 *             for lvl2 in lvl2peakschrom:
 */
      __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
      if (__pyx_t_10) {
        __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_11);

        /* "MACS2/IO/cCompositeScoreTrack.pyx":363
 *                 lvl1 = lvl1peakschrom_next()
 *             except StopIteration:
 *                 break             # <<<<<<<<<<<<<<
 *             for lvl2 in lvl2peakschrom:
 *                 # for each lvl2 peak, find all lvl1 peaks inside
 */
        goto __pyx_L13_except_break;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L6_exception_handled;
        __pyx_L13_except_break:;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L10_try_break;
      }
      __pyx_L7_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_L10_try_break:;
      __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_L4_break;
      __pyx_L6_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_L12_try_end:;
    }

    /* "MACS2/IO/cCompositeScoreTrack.pyx":364
 *             except StopIteration:
 *                 break
 *             for lvl2 in lvl2peakschrom:             # <<<<<<<<<<<<<<
 *                 # for each lvl2 peak, find all lvl1 peaks inside
 *                 try:
 */
    if (PyList_CheckExact(__pyx_v_lvl2peakschrom) || PyTuple_CheckExact(__pyx_v_lvl2peakschrom)) {
      __pyx_t_11 = __pyx_v_lvl2peakschrom; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_lvl2peakschrom); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_11)) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_11)) break;
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++;
      } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_11)) {
        if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++;
      } else {
        __pyx_t_1 = __pyx_t_13(__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 = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF(__pyx_v_lvl2);
      __pyx_v_lvl2 = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":366
 *             for lvl2 in lvl2peakschrom:
 *                 # for each lvl2 peak, find all lvl1 peaks inside
 *                 try:             # <<<<<<<<<<<<<<
 *                     while True:
 *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:
 */
      {
        __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/cCompositeScoreTrack.pyx":367
 *                 # for each lvl2 peak, find all lvl1 peaks inside
 *                 try:
 *                     while True:             # <<<<<<<<<<<<<<
 *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:
 *                             tmppeakset.append(lvl1)
 */
          while (1) {
            if (!1) break;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":368
 *                 try:
 *                     while True:
 *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:             # <<<<<<<<<<<<<<
 *                             tmppeakset.append(lvl1)
 *                         else:
 */
            __pyx_t_1 = PyObject_GetItem(__pyx_v_lvl2, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_4 = PyObject_GetItem(__pyx_v_lvl1, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_14 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LE); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __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 = 368; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (__pyx_t_2) {
              __pyx_t_14 = PyObject_GetItem(__pyx_v_lvl1, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_4 = PyObject_GetItem(__pyx_v_lvl2, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_1 = PyObject_RichCompare(__pyx_t_14, __pyx_t_4, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_16 = __pyx_t_15;
            } else {
              __pyx_t_16 = __pyx_t_2;
            }
            if (__pyx_t_16) {

              /* "MACS2/IO/cCompositeScoreTrack.pyx":369
 *                     while True:
 *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:
 *                             tmppeakset.append(lvl1)             # <<<<<<<<<<<<<<
 *                         else:
 *                             if tmppeakset:
 */
              __pyx_t_17 = PyList_Append(__pyx_v_tmppeakset, __pyx_v_lvl1); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              goto __pyx_L27;
            }
            /*else*/ {

              /* "MACS2/IO/cCompositeScoreTrack.pyx":371
 *                             tmppeakset.append(lvl1)
 *                         else:
 *                             if tmppeakset:             # <<<<<<<<<<<<<<
 *                                 self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 *                             tmppeakset = []
 */
              __pyx_t_16 = (((PyObject *)__pyx_v_tmppeakset) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_tmppeakset)) != 0);
              if (__pyx_t_16) {

                /* "MACS2/IO/cCompositeScoreTrack.pyx":372
 *                         else:
 *                             if tmppeakset:
 *                                 self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)             # <<<<<<<<<<<<<<
 *                             tmppeakset = []
 *                             break
 */
                __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_INCREF(__pyx_v_broadpeaks);
                PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_broadpeaks);
                __Pyx_GIVEREF(__pyx_v_broadpeaks);
                __Pyx_INCREF(__pyx_v_chrom);
                PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_chrom);
                __Pyx_GIVEREF(__pyx_v_chrom);
                __Pyx_INCREF(__pyx_v_lvl2);
                PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_lvl2);
                __Pyx_GIVEREF(__pyx_v_lvl2);
                __Pyx_INCREF(((PyObject *)__pyx_v_tmppeakset));
                PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_tmppeakset));
                __Pyx_GIVEREF(((PyObject *)__pyx_v_tmppeakset));
                __pyx_t_14 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                goto __pyx_L28;
              }
              __pyx_L28:;

              /* "MACS2/IO/cCompositeScoreTrack.pyx":373
 *                             if tmppeakset:
 *                                 self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 *                             tmppeakset = []             # <<<<<<<<<<<<<<
 *                             break
 *                         lvl1 = lvl1peakschrom_next()
 */
              __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(((PyObject *)__pyx_v_tmppeakset));
              __pyx_v_tmppeakset = __pyx_t_14;
              __pyx_t_14 = 0;

              /* "MACS2/IO/cCompositeScoreTrack.pyx":374
 *                                 self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 *                             tmppeakset = []
 *                             break             # <<<<<<<<<<<<<<
 *                         lvl1 = lvl1peakschrom_next()
 *                 except StopIteration:
 */
              goto __pyx_L26_break;
            }
            __pyx_L27:;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":375
 *                             tmppeakset = []
 *                             break
 *                         lvl1 = lvl1peakschrom_next()             # <<<<<<<<<<<<<<
 *                 except StopIteration:
 *                     if tmppeakset:
 */
            __pyx_t_14 = PyObject_Call(__pyx_v_lvl1peakschrom_next, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_v_lvl1);
            __pyx_v_lvl1 = __pyx_t_14;
            __pyx_t_14 = 0;
          }
          __pyx_L26_break:;
        }
        __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_L24_try_end;
        __pyx_L17_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":376
 *                             break
 *                         lvl1 = lvl1peakschrom_next()
 *                 except StopIteration:             # <<<<<<<<<<<<<<
 *                     if tmppeakset:
 *                         self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 */
        __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
        if (__pyx_t_10) {
          __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_1);

          /* "MACS2/IO/cCompositeScoreTrack.pyx":377
 *                         lvl1 = lvl1peakschrom_next()
 *                 except StopIteration:
 *                     if tmppeakset:             # <<<<<<<<<<<<<<
 *                         self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 *                     break
 */
          __pyx_t_16 = (((PyObject *)__pyx_v_tmppeakset) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_tmppeakset)) != 0);
          if (__pyx_t_16) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":378
 *                 except StopIteration:
 *                     if tmppeakset:
 *                         self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
            __pyx_t_18 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_17); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
            __Pyx_GOTREF(__pyx_t_18);
            __pyx_t_19 = PyTuple_New(4); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_INCREF(__pyx_v_broadpeaks);
            PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_broadpeaks);
            __Pyx_GIVEREF(__pyx_v_broadpeaks);
            __Pyx_INCREF(__pyx_v_chrom);
            PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_chrom);
            __Pyx_GIVEREF(__pyx_v_chrom);
            __Pyx_INCREF(__pyx_v_lvl2);
            PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_v_lvl2);
            __Pyx_GIVEREF(__pyx_v_lvl2);
            __Pyx_INCREF(((PyObject *)__pyx_v_tmppeakset));
            PyTuple_SET_ITEM(__pyx_t_19, 3, ((PyObject *)__pyx_v_tmppeakset));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_tmppeakset));
            __pyx_t_20 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            goto __pyx_L31;
          }
          __pyx_L31:;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":379
 *                     if tmppeakset:
 *                         self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
 *                     break             # <<<<<<<<<<<<<<
 * 
 *         return lvl1_peaks, broadpeaks
 */
          goto __pyx_L29_except_break;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L18_exception_handled;
          __pyx_L29_except_break:;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L22_try_break;
        }
        __pyx_L19_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_L22_try_break:;
        __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_L16_break;
        __pyx_L18_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_L24_try_end:;
      }
    }
    __pyx_L16_break:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":381
 *                     break
 * 
 *         return lvl1_peaks, broadpeaks             # <<<<<<<<<<<<<<
 * 
 *     def __add_broadpeak (self, bpeaks, chrom, lvl2peak, lvl1peakset):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_lvl1_peaks);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_lvl1_peaks);
  __Pyx_GIVEREF(__pyx_v_lvl1_peaks);
  __Pyx_INCREF(__pyx_v_broadpeaks);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_broadpeaks);
  __Pyx_GIVEREF(__pyx_v_broadpeaks);
  __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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_chrom);
  __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_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_25__add_broadpeak(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_24__add_broadpeak[] = "Internal function to create broad peak.\n        \n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_25__add_broadpeak = {__Pyx_NAMESTR("__add_broadpeak"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_25__add_broadpeak, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_24__add_broadpeak)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_25__add_broadpeak(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_bpeaks = 0;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_lvl2peak = 0;
  PyObject *__pyx_v_lvl1peakset = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__bpeaks,&__pyx_n_s__chrom,&__pyx_n_s__lvl2peak,&__pyx_n_s__lvl1peakset,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_broadpeak (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bpeaks);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl2peak);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvl1peakset);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __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 = 383; __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_bpeaks = values[1];
    __pyx_v_chrom = values[2];
    __pyx_v_lvl2peak = values[3];
    __pyx_v_lvl1peakset = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.__add_broadpeak", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_24__add_broadpeak(__pyx_self, __pyx_v_self, __pyx_v_bpeaks, __pyx_v_chrom, __pyx_v_lvl2peak, __pyx_v_lvl1peakset);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15__add_broadpeak_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15__add_broadpeak_lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15__add_broadpeak_lambda1, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15__add_broadpeak_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  __pyx_self = __pyx_self;
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_x));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":392
 *         thickEnd   = lvl1peakset[-1]["end"]
 *         blockNum   = 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_TraceDeclarations
  __Pyx_RefNannySetupContext("lambda1", 0);
  __Pyx_TraceCall("lambda1", __pyx_f[0], 392);
  __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 = 392; __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 = 392; __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 = 392; __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.cCompositeScoreTrack.compositeScoreTrackII.__add_broadpeak.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15__add_broadpeak_1lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15__add_broadpeak_1lambda2 = {__Pyx_NAMESTR("lambda2"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15__add_broadpeak_1lambda2, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15__add_broadpeak_1lambda2(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
  __pyx_self = __pyx_self;
  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, ((PyObject *)__pyx_v_x));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":393
 *         blockNum   = 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_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *__pyx_cur_scope;
  struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("lambda2", 0);
  __pyx_outer_scope = (struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_TraceCall("lambda2", __pyx_f[0], 393);
  __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 = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_start)) { __Pyx_RaiseClosureNameError("start"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __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 = 393; __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(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__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("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.__add_broadpeak.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":383
 *         return lvl1_peaks, broadpeaks
 * 
 *     def __add_broadpeak (self, bpeaks, chrom, lvl2peak, lvl1peakset):             # <<<<<<<<<<<<<<
 *         """Internal function to create broad peak.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_24__add_broadpeak(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_bpeaks, PyObject *__pyx_v_chrom, PyObject *__pyx_v_lvl2peak, PyObject *__pyx_v_lvl1peakset) {
  struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *__pyx_cur_scope;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_v_thickStart = NULL;
  PyObject *__pyx_v_thickEnd = NULL;
  PyObject *__pyx_v_blockNum = NULL;
  PyObject *__pyx_v_blockSizes = NULL;
  PyObject *__pyx_v_blockStarts = 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 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__add_broadpeak", 0);
  __pyx_cur_scope = (struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *)__pyx_ptype_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak->tp_new(__pyx_ptype_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_TraceCall("__add_broadpeak", __pyx_f[0], 383);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":387
 * 
 *         """
 *         start      = lvl2peak["start"]             # <<<<<<<<<<<<<<
 *         end        = lvl2peak["end"]
 *         thickStart = lvl1peakset[0]["start"]
 */
  __pyx_t_1 = PyObject_GetItem(__pyx_v_lvl2peak, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_start = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":388
 *         """
 *         start      = lvl2peak["start"]
 *         end        = lvl2peak["end"]             # <<<<<<<<<<<<<<
 *         thickStart = lvl1peakset[0]["start"]
 *         thickEnd   = lvl1peakset[-1]["end"]
 */
  __pyx_t_1 = PyObject_GetItem(__pyx_v_lvl2peak, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_end = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":389
 *         start      = lvl2peak["start"]
 *         end        = lvl2peak["end"]
 *         thickStart = lvl1peakset[0]["start"]             # <<<<<<<<<<<<<<
 *         thickEnd   = lvl1peakset[-1]["end"]
 *         blockNum   = len(lvl1peakset)
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_lvl1peakset, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_thickStart = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":390
 *         end        = lvl2peak["end"]
 *         thickStart = lvl1peakset[0]["start"]
 *         thickEnd   = lvl1peakset[-1]["end"]             # <<<<<<<<<<<<<<
 *         blockNum   = len(lvl1peakset)
 *         blockSizes = ",".join( map(lambda x:str(x["length"]),lvl1peakset) )
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_lvl1peakset, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_thickEnd = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":391
 *         thickStart = lvl1peakset[0]["start"]
 *         thickEnd   = lvl1peakset[-1]["end"]
 *         blockNum   = len(lvl1peakset)             # <<<<<<<<<<<<<<
 *         blockSizes = ",".join( map(lambda x:str(x["length"]),lvl1peakset) )
 *         blockStarts = ",".join( map(lambda x:str(x["start"]-start),lvl1peakset) )
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_lvl1peakset); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); 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_v_blockNum = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":392
 *         thickEnd   = lvl1peakset[-1]["end"]
 *         blockNum   = 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 = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15__add_broadpeak_lambda1, 0, NULL, __pyx_n_s_19, NULL); 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_4 = PyTuple_New(2); 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);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_lvl1peakset);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_lvl1peakset);
  __Pyx_GIVEREF(__pyx_v_lvl1peakset);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_4), NULL); 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_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 = 392; __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 = 392; __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_v_blockSizes = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":393
 *         blockNum   = 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_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_18), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15__add_broadpeak_1lambda2, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s_19, NULL); 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_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_lvl1peakset);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_lvl1peakset);
  __Pyx_GIVEREF(__pyx_v_lvl1peakset);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_1), NULL); 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(((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 = 393; __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 = 393; __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_v_blockStarts = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":394
 *         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
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_v_lvl2peak, ((PyObject *)__pyx_n_s__start)); 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_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_thickStart, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "MACS2/IO/cCompositeScoreTrack.pyx":396
 *         if lvl2peak["start"] != thickStart:
 *             # add 1bp mark for the start of lvl2 peak
 *             blockNum += 1             # <<<<<<<<<<<<<<
 *             blockSizes = "1,"+blockSizes
 *             blockStarts = "0,"+blockStarts
 */
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_blockNum, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_blockNum);
    __pyx_v_blockNum = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":397
 *             # add 1bp mark for the start of lvl2 peak
 *             blockNum += 1
 *             blockSizes = "1,"+blockSizes             # <<<<<<<<<<<<<<
 *             blockStarts = "0,"+blockStarts
 *         if lvl2peak["end"] != thickEnd:
 */
    __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_20), __pyx_v_blockSizes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_blockSizes);
    __pyx_v_blockSizes = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":398
 *             blockNum += 1
 *             blockSizes = "1,"+blockSizes
 *             blockStarts = "0,"+blockStarts             # <<<<<<<<<<<<<<
 *         if lvl2peak["end"] != thickEnd:
 *             # add 1bp mark for the end of lvl2 peak
 */
    __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_21), __pyx_v_blockStarts); 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_DECREF(__pyx_v_blockStarts);
    __pyx_v_blockStarts = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":399
 *             blockSizes = "1,"+blockSizes
 *             blockStarts = "0,"+blockStarts
 *         if lvl2peak["end"] != thickEnd:             # <<<<<<<<<<<<<<
 *             # add 1bp mark for the end of lvl2 peak
 *             blockNum += 1
 */
  __pyx_t_1 = PyObject_GetItem(__pyx_v_lvl2peak, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_thickEnd, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 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;
  if (__pyx_t_5) {

    /* "MACS2/IO/cCompositeScoreTrack.pyx":401
 *         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_t_4 = PyNumber_InPlaceAdd(__pyx_v_blockNum, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_v_blockNum);
    __pyx_v_blockNum = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":402
 *             # add 1bp mark for the end of lvl2 peak
 *             blockNum += 1
 *             blockSizes = blockSizes+",1"             # <<<<<<<<<<<<<<
 *             blockStarts = blockStarts+","+str(end-start-1)
 * 
 */
    __pyx_t_4 = PyNumber_Add(__pyx_v_blockSizes, ((PyObject *)__pyx_kp_s_22)); 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_v_blockSizes);
    __pyx_v_blockSizes = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":403
 *             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_4 = PyNumber_Add(__pyx_v_blockStarts, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_cur_scope->__pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __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 = 403; __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(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __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 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __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_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_blockStarts);
    __pyx_v_blockStarts = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":405
 *             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_1 = PyObject_GetAttr(__pyx_v_bpeaks, __pyx_n_s__add); 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_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_chrom);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
  __Pyx_GIVEREF(__pyx_v_chrom);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_start);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_start);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_start);
  __Pyx_INCREF(__pyx_v_end);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end);
  __Pyx_GIVEREF(__pyx_v_end);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_6 = PyObject_GetItem(__pyx_v_lvl2peak, ((PyObject *)__pyx_n_s__score)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__score), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__thickStart), __pyx_v_thickStart) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__thickEnd), __pyx_v_thickEnd) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":406
 * 
 *         bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=thickStart, thickEnd=thickEnd,
 *                    blockNum = blockNum, blockSizes = blockSizes, blockStarts = blockStarts)             # <<<<<<<<<<<<<<
 *         return bpeaks
 * 
 */
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__blockNum), __pyx_v_blockNum) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__blockSizes), __pyx_v_blockSizes) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__blockStarts), __pyx_v_blockStarts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __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_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":407
 *         bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=thickStart, thickEnd=thickEnd,
 *                    blockNum = blockNum, blockSizes = blockSizes, blockStarts = blockStarts)
 *         return bpeaks             # <<<<<<<<<<<<<<
 * 
 *     def total ( self ):
 */
  __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_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.__add_broadpeak", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XDECREF(__pyx_v_thickStart);
  __Pyx_XDECREF(__pyx_v_thickEnd);
  __Pyx_XDECREF(__pyx_v_blockNum);
  __Pyx_XDECREF(__pyx_v_blockSizes);
  __Pyx_XDECREF(__pyx_v_blockStarts);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_26total(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_t = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("total", 0);
  __Pyx_TraceCall("total", __pyx_f[0], 409);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":413
 * 
 *         """
 *         t = 0             # <<<<<<<<<<<<<<
 *         for chrom in self.data.keys():
 *             t += self.pointer[chrom]
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_t = __pyx_int_0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":414
 *         """
 *         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 = 414; __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 = 414; __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 = 414; __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 = 414; __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;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } 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 = 414; __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/cCompositeScoreTrack.pyx":415
 *         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__pointer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __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_InPlaceAdd(__pyx_v_t, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_t);
    __pyx_v_t = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":416
 *         for chrom in self.data.keys():
 *             t += self.pointer[chrom]
 *         return t             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  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_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackII.total", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI___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_TraceDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_TraceCall("__init__", __pyx_f[0], 442);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":447
 * 
 *         """
 *         self.data = {}             # <<<<<<<<<<<<<<
 *         self.pointer = {}
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __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 = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":448
 *         """
 *         self.data = {}
 *         self.pointer = {}             # <<<<<<<<<<<<<<
 * 
 *     def add_chromosome ( self, chrom, chrom_max_len ):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __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 = 448; __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.cCompositeScoreTrack.compositeScoreTrackI.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_3add_chromosome(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_3add_chromosome = {__Pyx_NAMESTR("add_chromosome"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_3add_chromosome, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_3add_chromosome(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_chrom_max_len = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chrom,&__pyx_n_s__chrom_max_len,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_chromosome (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom_max_len);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __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 = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_chrom = values[1];
    __pyx_v_chrom_max_len = values[2];
  }
  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 = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_2add_chromosome(__pyx_self, __pyx_v_self, __pyx_v_chrom, __pyx_v_chrom_max_len);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":450
 *         self.pointer = {}
 * 
 *     def add_chromosome ( self, chrom, 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_20cCompositeScoreTrack_20compositeScoreTrackI_2add_chromosome(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__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_TraceDeclarations
  __Pyx_RefNannySetupContext("add_chromosome", 0);
  __Pyx_TraceCall("add_chromosome", __pyx_f[0], 450);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":451
 * 
 *     def add_chromosome ( self, chrom, chrom_max_len ):
 *         if not self.data.has_key(chrom):             # <<<<<<<<<<<<<<
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 *                                                              ('sc1i1','float32'),
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_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 = 451; __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_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_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 = 451; __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/cCompositeScoreTrack.pyx":452
 *     def add_chromosome ( self, chrom, chrom_max_len ):
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
 *                                                              ('sc1i1','float32'),
 *                                                              ('sc2i2','float32'),
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __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 = 452; __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 = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_chrom_max_len);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrom_max_len);
    __Pyx_GIVEREF(__pyx_v_chrom_max_len);
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));

    /* "MACS2/IO/cCompositeScoreTrack.pyx":456
 *                                                              ('sc2i2','float32'),
 *                                                              ('sc1c2','float32'),
 *                                                              ('sc2c1','float32')])             # <<<<<<<<<<<<<<
 *             self.pointer[chrom] = 0
 * 
 */
    __pyx_t_6 = PyList_New(5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_23));
    PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_k_tuple_23));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_24));
    PyList_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_k_tuple_24));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_25));
    PyList_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_k_tuple_25));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_26));
    PyList_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_k_tuple_26));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_27));
    PyList_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_k_tuple_27));
    __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_t_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __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_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __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_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":452
 *     def add_chromosome ( self, chrom, chrom_max_len ):
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
 *                                                              ('sc1i1','float32'),
 *                                                              ('sc2i2','float32'),
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyObject_SetItem(__pyx_t_2, __pyx_v_chrom, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":457
 *                                                              ('sc1c2','float32'),
 *                                                              ('sc2c1','float32')])
 *             self.pointer[chrom] = 0             # <<<<<<<<<<<<<<
 * 
 *     def add (self,chromosome,endpos,sc1i1,sc2i2,sc1c2,sc2c1):
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (PyObject_SetItem(__pyx_t_6, __pyx_v_chrom, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __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.cCompositeScoreTrack.compositeScoreTrackI.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_5add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_4add[] = "Add a chr-endpos-score-score-score-score block into data\n        dictionary.\n\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_5add = {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_5add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_4add)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_5add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_chromosome = 0;
  PyObject *__pyx_v_endpos = 0;
  PyObject *__pyx_v_sc1i1 = 0;
  PyObject *__pyx_v_sc2i2 = 0;
  PyObject *__pyx_v_sc1c2 = 0;
  PyObject *__pyx_v_sc2c1 = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chromosome,&__pyx_n_s__endpos,&__pyx_n_s__sc1i1,&__pyx_n_s__sc2i2,&__pyx_n_s__sc1c2,&__pyx_n_s__sc2c1,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chromosome);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__endpos);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sc1i1);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sc2i2);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sc1c2);
        if (likely(values[5])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sc2c1);
        if (likely(values[6])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __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 = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_self = values[0];
    __pyx_v_chromosome = values[1];
    __pyx_v_endpos = values[2];
    __pyx_v_sc1i1 = values[3];
    __pyx_v_sc2i2 = values[4];
    __pyx_v_sc1c2 = values[5];
    __pyx_v_sc2c1 = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_4add(__pyx_self, __pyx_v_self, __pyx_v_chromosome, __pyx_v_endpos, __pyx_v_sc1i1, __pyx_v_sc2i2, __pyx_v_sc1c2, __pyx_v_sc2c1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":459
 *             self.pointer[chrom] = 0
 * 
 *     def add (self,chromosome,endpos,sc1i1,sc2i2,sc1c2,sc2c1):             # <<<<<<<<<<<<<<
 *         """Add a chr-endpos-score-score-score-score block into data
 *         dictionary.
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_4add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome, PyObject *__pyx_v_endpos, PyObject *__pyx_v_sc1i1, PyObject *__pyx_v_sc2i2, PyObject *__pyx_v_sc1c2, PyObject *__pyx_v_sc2c1) {
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_TraceCall("add", __pyx_f[0], 459);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":464
 * 
 *         """
 *         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 = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_chromosome); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":465
 *         """
 *         c = self.data[chromosome]
 *         i = self.pointer[chromosome]             # <<<<<<<<<<<<<<
 *         # get the preceding region
 *         c[i] = (endpos,sc1i1,sc2i2,sc1c2,sc2c1)
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_chromosome); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_i = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":467
 *         i = self.pointer[chromosome]
 *         # get the preceding region
 *         c[i] = (endpos,sc1i1,sc2i2,sc1c2,sc2c1)             # <<<<<<<<<<<<<<
 *         self.pointer[chromosome] += 1
 * 
 */
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_endpos);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_endpos);
  __Pyx_GIVEREF(__pyx_v_endpos);
  __Pyx_INCREF(__pyx_v_sc1i1);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_sc1i1);
  __Pyx_GIVEREF(__pyx_v_sc1i1);
  __Pyx_INCREF(__pyx_v_sc2i2);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_sc2i2);
  __Pyx_GIVEREF(__pyx_v_sc2i2);
  __Pyx_INCREF(__pyx_v_sc1c2);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_sc1c2);
  __Pyx_GIVEREF(__pyx_v_sc1c2);
  __Pyx_INCREF(__pyx_v_sc2c1);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_sc2c1);
  __Pyx_GIVEREF(__pyx_v_sc2c1);
  if (PyObject_SetItem(__pyx_v_c, __pyx_v_i, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":468
 *         # get the preceding region
 *         c[i] = (endpos,sc1i1,sc2i2,sc1c2,sc2c1)
 *         self.pointer[chromosome] += 1             # <<<<<<<<<<<<<<
 * 
 *     def get_data_by_chr (self, chromosome):
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_chromosome);
  __pyx_t_2 = __pyx_v_chromosome;
  __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_7get_data_by_chr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_6get_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_20cCompositeScoreTrack_20compositeScoreTrackI_7get_data_by_chr = {__Pyx_NAMESTR("get_data_by_chr"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_7get_data_by_chr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_6get_data_by_chr)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_7get_data_by_chr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_chromosome = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__chromosome,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data_by_chr (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chromosome);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_data_by_chr", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __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 = 470; __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 = 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 = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_6get_data_by_chr(__pyx_self, __pyx_v_self, __pyx_v_chromosome);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":470
 *         self.pointer[chromosome] += 1
 * 
 *     def get_data_by_chr (self, chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_6get_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_TraceDeclarations
  __Pyx_RefNannySetupContext("get_data_by_chr", 0);
  __Pyx_TraceCall("get_data_by_chr", __pyx_f[0], 470);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":476
 *         ([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 = 476; __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 = 476; __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 = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_chromosome);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chromosome);
  __Pyx_GIVEREF(__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 = 476; __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 = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "MACS2/IO/cCompositeScoreTrack.pyx":477
 *         """
 *         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 = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_v_chromosome); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __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/cCompositeScoreTrack.pyx":479
 *             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.cCompositeScoreTrack.compositeScoreTrackI.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_8get_chr_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  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_TraceDeclarations
  __Pyx_RefNannySetupContext("get_chr_names", 0);
  __Pyx_TraceCall("get_chr_names", __pyx_f[0], 481);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":485
 * 
 *         """
 *         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 = 485; __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 = 485; __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 = 485; __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 = 485; __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 = 485; __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/cCompositeScoreTrack.pyx":486
 *         """
 *         l = set(self.data.keys())
 *         return l             # <<<<<<<<<<<<<<
 * 
 *     def call_consistent (self, cutoff=50, min_length=200, max_gap=50):
 */
  __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.cCompositeScoreTrack.compositeScoreTrackI.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_11call_consistent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_10call_consistent[] = "This function try to find regions within which, scores\n        are continuously higher than a given cutoff.\n\n        Consistent peaks are those met all the following criteria\n\n        1. sc1i1 >= cutoff\n        2. sc2i2 >= cutoff\n        3. sc1c2 <= cutoff\n        4. sc2c1 <= cutoff\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_11call_consistent = {__Pyx_NAMESTR("call_consistent"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_11call_consistent, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_10call_consistent)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_11call_consistent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_cutoff = 0;
  PyObject *__pyx_v_min_length = 0;
  PyObject *__pyx_v_max_gap = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__cutoff,&__pyx_n_s__min_length,&__pyx_n_s__max_gap,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_consistent (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_50));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_200));
    values[3] = ((PyObject *)((PyObject *)__pyx_int_50));
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__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__max_gap);
          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_consistent") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_cutoff = values[1];
    __pyx_v_min_length = values[2];
    __pyx_v_max_gap = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_consistent", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.call_consistent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_10call_consistent(__pyx_self, __pyx_v_self, __pyx_v_cutoff, __pyx_v_min_length, __pyx_v_max_gap);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":488
 *         return l
 * 
 *     def call_consistent (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_10call_consistent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_max_gap) {
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_v_peaks = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_chrom_pointer = NULL;
  PyObject *__pyx_v_chrom_d = NULL;
  PyObject *__pyx_v_chrom_pos = NULL;
  PyObject *__pyx_v_chrom_sc1i1 = NULL;
  PyObject *__pyx_v_chrom_sc2i2 = NULL;
  PyObject *__pyx_v_chrom_sc1c2 = NULL;
  PyObject *__pyx_v_chrom_sc2c1 = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_pre_p = NULL;
  PyObject *__pyx_v_peak_content = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_vc1i1 = NULL;
  PyObject *__pyx_v_vc2i2 = NULL;
  PyObject *__pyx_v_vc1c2 = NULL;
  PyObject *__pyx_v_vc2c1 = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_peak_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("call_consistent", 0);
  __Pyx_TraceCall("call_consistent", __pyx_f[0], 488);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":499
 *         4. sc2c1 <= cutoff
 *         """
 *         chrs  = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         peaks = PeakIO()                      # dictionary to save peaks
 *         #condition1_unique_peaks = PeakIO()                      # dictionary to save peaks
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __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 = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_chrs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":500
 *         """
 *         chrs  = self.get_chr_names()
 *         peaks = PeakIO()                      # dictionary to save peaks             # <<<<<<<<<<<<<<
 *         #condition1_unique_peaks = PeakIO()                      # dictionary to save peaks
 *         #condition2_unique_peaks = PeakIO()                      # dictionary to save peaks
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__PeakIO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __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 = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_peaks = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":503
 *         #condition1_unique_peaks = PeakIO()                      # dictionary to save peaks
 *         #condition2_unique_peaks = PeakIO()                      # dictionary to save peaks
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_1 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } 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 = 503; __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/cCompositeScoreTrack.pyx":504
 *         #condition2_unique_peaks = PeakIO()                      # dictionary to save peaks
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]             # <<<<<<<<<<<<<<
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_2, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_chrom_pointer);
    __pyx_v_chrom_pointer = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":505
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values             # <<<<<<<<<<<<<<
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_chrom_d);
    __pyx_v_chrom_d = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":506
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]             # <<<<<<<<<<<<<<
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]
 *             chrom_sc2i2  = chrom_d[ 'sc2i2' ]
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_pos);
    __pyx_v_chrom_pos = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":507
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]             # <<<<<<<<<<<<<<
 *             chrom_sc2i2  = chrom_d[ 'sc2i2' ]
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc1i1)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc1i1);
    __pyx_v_chrom_sc1i1 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":508
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]
 *             chrom_sc2i2  = chrom_d[ 'sc2i2' ]             # <<<<<<<<<<<<<<
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]
 *             chrom_sc2c1  = chrom_d[ 'sc2c1' ]
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc2i2)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc2i2);
    __pyx_v_chrom_sc2i2 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":509
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]
 *             chrom_sc2i2  = chrom_d[ 'sc2i2' ]
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]             # <<<<<<<<<<<<<<
 *             chrom_sc2c1  = chrom_d[ 'sc2c1' ]
 * 
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc1c2)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc1c2);
    __pyx_v_chrom_sc1c2 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":510
 *             chrom_sc2i2  = chrom_d[ 'sc2i2' ]
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]
 *             chrom_sc2c1  = chrom_d[ 'sc2c1' ]             # <<<<<<<<<<<<<<
 * 
 *             x     = 0                   # index in compositeScoreTrackI
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc2c1)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc2c1);
    __pyx_v_chrom_sc2c1 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":512
 *             chrom_sc2c1  = chrom_d[ 'sc2c1' ]
 * 
 *             x     = 0                   # index in compositeScoreTrackI             # <<<<<<<<<<<<<<
 *             pre_p = 0                   # remember previous position
 *             peak_content = None         # to store points above cutoff
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":513
 * 
 *             x     = 0                   # index in compositeScoreTrackI
 *             pre_p = 0                   # remember previous position             # <<<<<<<<<<<<<<
 *             peak_content = None         # to store points above cutoff
 * 
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_pre_p);
    __pyx_v_pre_p = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":514
 *             x     = 0                   # index in compositeScoreTrackI
 *             pre_p = 0                   # remember previous position
 *             peak_content = None         # to store points above cutoff             # <<<<<<<<<<<<<<
 * 
 *             while True and x < chrom_pointer:
 */
    __Pyx_INCREF(Py_None);
    __Pyx_XDECREF(__pyx_v_peak_content);
    __pyx_v_peak_content = Py_None;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":516
 *             peak_content = None         # to store points above cutoff
 * 
 *             while True and x < chrom_pointer:             # <<<<<<<<<<<<<<
 *                 # find the first region above cutoff
 *                 # try to read the first data range for this chrom
 */
    while (1) {
      __pyx_t_7 = 1;
      if (__pyx_t_7) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_x, __pyx_v_chrom_pointer, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_7;
      }
      if (!__pyx_t_9) break;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":519
 *                 # find the first region above cutoff
 *                 # try to read the first data range for this chrom
 *                 p = chrom_pos[ x ]             # <<<<<<<<<<<<<<
 *                 vc1i1 = chrom_sc1i1[ x ]
 *                 vc2i2 = chrom_sc2i2[ x ]
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_pos, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_p);
      __pyx_v_p = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":520
 *                 # try to read the first data range for this chrom
 *                 p = chrom_pos[ x ]
 *                 vc1i1 = chrom_sc1i1[ x ]             # <<<<<<<<<<<<<<
 *                 vc2i2 = chrom_sc2i2[ x ]
 *                 vc1c2 = chrom_sc1c2[ x ]
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc1i1, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc1i1);
      __pyx_v_vc1i1 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":521
 *                 p = chrom_pos[ x ]
 *                 vc1i1 = chrom_sc1i1[ x ]
 *                 vc2i2 = chrom_sc2i2[ x ]             # <<<<<<<<<<<<<<
 *                 vc1c2 = chrom_sc1c2[ x ]
 *                 vc2c1 = chrom_sc2c1[ x ]
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc2i2, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc2i2);
      __pyx_v_vc2i2 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":522
 *                 vc1i1 = chrom_sc1i1[ x ]
 *                 vc2i2 = chrom_sc2i2[ x ]
 *                 vc1c2 = chrom_sc1c2[ x ]             # <<<<<<<<<<<<<<
 *                 vc2c1 = chrom_sc2c1[ x ]
 *                 x += 1                  # index for the next point
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc1c2, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc1c2);
      __pyx_v_vc1c2 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":523
 *                 vc2i2 = chrom_sc2i2[ x ]
 *                 vc1c2 = chrom_sc1c2[ x ]
 *                 vc2c1 = chrom_sc2c1[ x ]             # <<<<<<<<<<<<<<
 *                 x += 1                  # index for the next point
 *                 if vc1i1 >= cutoff and vc2i2 >= cutoff and vc1c2 <= cutoff and vc2c1 <= cutoff:
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc2c1, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc2c1);
      __pyx_v_vc2c1 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":524
 *                 vc1c2 = chrom_sc1c2[ x ]
 *                 vc2c1 = chrom_sc2c1[ x ]
 *                 x += 1                  # index for the next point             # <<<<<<<<<<<<<<
 *                 if vc1i1 >= cutoff and vc2i2 >= cutoff and vc1c2 <= cutoff and vc2c1 <= cutoff:
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 */
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_x, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_v_x);
      __pyx_v_x = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":525
 *                 vc2c1 = chrom_sc2c1[ x ]
 *                 x += 1                  # index for the next point
 *                 if vc1i1 >= cutoff and vc2i2 >= cutoff and vc1c2 <= cutoff and vc2c1 <= cutoff:             # <<<<<<<<<<<<<<
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 *                     pre_p = p
 */
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc1i1, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_9) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc2i2, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_7) {
          __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc1c2, __pyx_v_cutoff, Py_LE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (__pyx_t_8) {
            __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc2c1, __pyx_v_cutoff, Py_LE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_11 = __pyx_t_10;
          } else {
            __pyx_t_11 = __pyx_t_8;
          }
          __pyx_t_8 = __pyx_t_11;
        } else {
          __pyx_t_8 = __pyx_t_7;
        }
        __pyx_t_7 = __pyx_t_8;
      } else {
        __pyx_t_7 = __pyx_t_9;
      }
      if (__pyx_t_7) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":526
 *                 x += 1                  # index for the next point
 *                 if vc1i1 >= cutoff and vc2i2 >= cutoff and vc1c2 <= cutoff and vc2c1 <= cutoff:
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...             # <<<<<<<<<<<<<<
 *                     pre_p = p
 *                     break               # found the first range above cutoff
 */
        __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_pre_p);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_pre_p);
        __Pyx_GIVEREF(__pyx_v_pre_p);
        __Pyx_INCREF(__pyx_v_p);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_p);
        __Pyx_GIVEREF(__pyx_v_p);
        __Pyx_INCREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        __Pyx_INCREF(__pyx_v_x);
        PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_x);
        __Pyx_GIVEREF(__pyx_v_x);
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_peak_content);
        __pyx_v_peak_content = ((PyObject *)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":527
 *                 if vc1i1 >= cutoff and vc2i2 >= cutoff and vc1c2 <= cutoff and vc2c1 <= cutoff:
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 *                     pre_p = p             # <<<<<<<<<<<<<<
 *                     break               # found the first range above cutoff
 *                 else:
 */
        __Pyx_INCREF(__pyx_v_p);
        __Pyx_DECREF(__pyx_v_pre_p);
        __pyx_v_pre_p = __pyx_v_p;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":528
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 *                     pre_p = p
 *                     break               # found the first range above cutoff             # <<<<<<<<<<<<<<
 *                 else:
 *                     pre_p = p
 */
        goto __pyx_L6_break;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":530
 *                     break               # found the first range above cutoff
 *                 else:
 *                     pre_p = p             # <<<<<<<<<<<<<<
 * 
 *             for i in xrange( x, chrom_pointer ):
 */
        __Pyx_INCREF(__pyx_v_p);
        __Pyx_DECREF(__pyx_v_pre_p);
        __pyx_v_pre_p = __pyx_v_p;
      }
      __pyx_L7:;
    }
    __pyx_L6_break:;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":532
 *                     pre_p = p
 * 
 *             for i in xrange( x, chrom_pointer ):             # <<<<<<<<<<<<<<
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]
 */
    __pyx_t_2 = PyTuple_New(2); 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_INCREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    __Pyx_INCREF(__pyx_v_chrom_pointer);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_chrom_pointer);
    __Pyx_GIVEREF(__pyx_v_chrom_pointer);
    __pyx_t_6 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __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_13 = 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 = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_13 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++;
      } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++;
      } else {
        __pyx_t_6 = __pyx_t_13(__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 = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":534
 *             for i in xrange( x, chrom_pointer ):
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]             # <<<<<<<<<<<<<<
 *                 vc1i1 = chrom_sc1i1[ i ]
 *                 vc2i2 = chrom_sc2i2[ i ]
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_pos, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_p);
      __pyx_v_p = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":535
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]
 *                 vc1i1 = chrom_sc1i1[ i ]             # <<<<<<<<<<<<<<
 *                 vc2i2 = chrom_sc2i2[ i ]
 *                 vc1c2 = chrom_sc1c2[ i ]
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc1i1, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc1i1);
      __pyx_v_vc1i1 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":536
 *                 p = chrom_pos[ i ]
 *                 vc1i1 = chrom_sc1i1[ i ]
 *                 vc2i2 = chrom_sc2i2[ i ]             # <<<<<<<<<<<<<<
 *                 vc1c2 = chrom_sc1c2[ i ]
 *                 vc2c1 = chrom_sc2c1[ i ]
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc2i2, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc2i2);
      __pyx_v_vc2i2 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":537
 *                 vc1i1 = chrom_sc1i1[ i ]
 *                 vc2i2 = chrom_sc2i2[ i ]
 *                 vc1c2 = chrom_sc1c2[ i ]             # <<<<<<<<<<<<<<
 *                 vc2c1 = chrom_sc2c1[ i ]
 *                 if vc1i1 < cutoff or vc2i2 < cutoff or vc1c2 > cutoff or vc2c1 > cutoff:
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc1c2, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc1c2);
      __pyx_v_vc1c2 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":538
 *                 vc2i2 = chrom_sc2i2[ i ]
 *                 vc1c2 = chrom_sc1c2[ i ]
 *                 vc2c1 = chrom_sc2c1[ i ]             # <<<<<<<<<<<<<<
 *                 if vc1i1 < cutoff or vc2i2 < cutoff or vc1c2 > cutoff or vc2c1 > cutoff:
 *                     pre_p = p
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc2c1, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc2c1);
      __pyx_v_vc2c1 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":539
 *                 vc1c2 = chrom_sc1c2[ i ]
 *                 vc2c1 = chrom_sc2c1[ i ]
 *                 if vc1i1 < cutoff or vc2i2 < cutoff or vc1c2 > cutoff or vc2c1 > cutoff:             # <<<<<<<<<<<<<<
 *                     pre_p = p
 *                     continue
 */
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc1i1, __pyx_v_cutoff, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!__pyx_t_7) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc2i2, __pyx_v_cutoff, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!__pyx_t_9) {
          __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc1c2, __pyx_v_cutoff, Py_GT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (!__pyx_t_8) {
            __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc2c1, __pyx_v_cutoff, Py_GT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_10 = __pyx_t_11;
          } else {
            __pyx_t_10 = __pyx_t_8;
          }
          __pyx_t_8 = __pyx_t_10;
        } else {
          __pyx_t_8 = __pyx_t_9;
        }
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_7;
      }
      if (__pyx_t_9) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":540
 *                 vc2c1 = chrom_sc2c1[ i ]
 *                 if vc1i1 < cutoff or vc2i2 < cutoff or vc1c2 > cutoff or vc2c1 > cutoff:
 *                     pre_p = p             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
        __Pyx_INCREF(__pyx_v_p);
        __Pyx_DECREF(__pyx_v_pre_p);
        __pyx_v_pre_p = __pyx_v_p;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":541
 *                 if vc1i1 < cutoff or vc2i2 < cutoff or vc1c2 > cutoff or vc2c1 > cutoff:
 *                     pre_p = p
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 # for points met all criteria
 */
        goto __pyx_L8_continue;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":545
 *                 # for points met all criteria
 *                 # if the gap is allowed
 *                 if pre_p - peak_content[ -1 ][ 1 ] <= max_gap:             # <<<<<<<<<<<<<<
 *                     peak_content.append( ( pre_p, p, 0, i ) )
 *                 else:
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Subtract(__pyx_v_pre_p, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_max_gap, Py_LE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_9) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":546
 *                 # if the gap is allowed
 *                 if pre_p - peak_content[ -1 ][ 1 ] <= max_gap:
 *                     peak_content.append( ( pre_p, p, 0, i ) )             # <<<<<<<<<<<<<<
 *                 else:
 *                     # when the gap is not allowed, close this peak
 */
        __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(__pyx_v_pre_p);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pre_p);
        __Pyx_GIVEREF(__pyx_v_pre_p);
        __Pyx_INCREF(__pyx_v_p);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_p);
        __Pyx_GIVEREF(__pyx_v_p);
        __Pyx_INCREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        __Pyx_INCREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":549
 *                 else:
 *                     # when the gap is not allowed, close this peak
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,
 */
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_14); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_v_peak_length);
        __pyx_v_peak_length = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":550
 *                     # when the gap is not allowed, close this peak
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *                     if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *                         peaks.add( chrom,
 *                                    peak_content[0][0],
 */
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_9) {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":551
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                    peak_content[0][0],
 *                                    peak_content[-1][1],
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);

          /* "MACS2/IO/cCompositeScoreTrack.pyx":552
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,
 *                                    peak_content[0][0],             # <<<<<<<<<<<<<<
 *                                    peak_content[-1][1],
 *                                    summit      = 0,
 */
          __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_14, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":553
 *                         peaks.add( chrom,
 *                                    peak_content[0][0],
 *                                    peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                    summit      = 0,
 *                                    peak_score  = 0,
 */
          __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_14, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __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);
          PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_15);
          __Pyx_GIVEREF(__pyx_t_15);
          __pyx_t_5 = 0;
          __pyx_t_15 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":551
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                    peak_content[0][0],
 *                                    peak_content[-1][1],
 */
          __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_15));
          if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__summit), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__peak_score), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_14), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(((PyObject *)__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;
          goto __pyx_L12;
        }
        __pyx_L12:;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":562
 *                                    )
 *                     # start a new peak
 *                     peak_content = [ ( pre_p, p, 0, i ), ]             # <<<<<<<<<<<<<<
 *                 pre_p = p
 * 
 */
        __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_pre_p);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pre_p);
        __Pyx_GIVEREF(__pyx_v_pre_p);
        __Pyx_INCREF(__pyx_v_p);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_p);
        __Pyx_GIVEREF(__pyx_v_p);
        __Pyx_INCREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        __Pyx_INCREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        __pyx_t_15 = PyList_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        PyList_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_t_5));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
        __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_v_peak_content);
        __pyx_v_peak_content = ((PyObject *)__pyx_t_15);
        __pyx_t_15 = 0;
      }
      __pyx_L11:;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":563
 *                     # start a new peak
 *                     peak_content = [ ( pre_p, p, 0, i ), ]
 *                 pre_p = p             # <<<<<<<<<<<<<<
 * 
 *             # save the last peak
 */
      __Pyx_INCREF(__pyx_v_p);
      __Pyx_DECREF(__pyx_v_pre_p);
      __pyx_v_pre_p = __pyx_v_p;
      __pyx_L8_continue:;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":566
 * 
 *             # save the last peak
 *             if not peak_content:             # <<<<<<<<<<<<<<
 *                 continue
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_peak_content); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = (!__pyx_t_9);
    if (__pyx_t_7) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":567
 *             # save the last peak
 *             if not peak_content:
 *                 continue             # <<<<<<<<<<<<<<
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it
 */
      goto __pyx_L3_continue;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":568
 *             if not peak_content:
 *                 continue
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_15, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_peak_length);
    __pyx_v_peak_length = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":569
 *                 continue
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *                 peaks.add( chrom,
 *                            peak_content[0][0],
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":570
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                            peak_content[0][0],
 *                            peak_content[-1][1],
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);

      /* "MACS2/IO/cCompositeScoreTrack.pyx":571
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,
 *                            peak_content[0][0],             # <<<<<<<<<<<<<<
 *                            peak_content[-1][1],
 *                            summit      = 0,
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":572
 *                 peaks.add( chrom,
 *                            peak_content[0][0],
 *                            peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                            summit      = 0,
 *                            peak_score  = 0,
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_t_15 = 0;
      __pyx_t_14 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":570
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                            peak_content[0][0],
 *                            peak_content[-1][1],
 */
      __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      if (PyDict_SetItem(__pyx_t_14, ((PyObject *)__pyx_n_s__summit), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_14, ((PyObject *)__pyx_n_s__peak_score), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_14, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_14, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_14, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_14, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __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_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      goto __pyx_L14;
    }
    __pyx_L14:;
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":581
 *                            )
 * 
 *         return peaks             # <<<<<<<<<<<<<<
 * 
 *     def call_condition1_unique (self, cutoff=50, min_length=200, max_gap=50):
 */
  __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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.call_consistent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF(__pyx_v_peaks);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_chrom_pointer);
  __Pyx_XDECREF(__pyx_v_chrom_d);
  __Pyx_XDECREF(__pyx_v_chrom_pos);
  __Pyx_XDECREF(__pyx_v_chrom_sc1i1);
  __Pyx_XDECREF(__pyx_v_chrom_sc2i2);
  __Pyx_XDECREF(__pyx_v_chrom_sc1c2);
  __Pyx_XDECREF(__pyx_v_chrom_sc2c1);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_pre_p);
  __Pyx_XDECREF(__pyx_v_peak_content);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_vc1i1);
  __Pyx_XDECREF(__pyx_v_vc2i2);
  __Pyx_XDECREF(__pyx_v_vc1c2);
  __Pyx_XDECREF(__pyx_v_vc2c1);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_peak_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_13call_condition1_unique(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_12call_condition1_unique[] = "This function try to find regions within which, scores\n        are continuously higher than a given cutoff.\n\n        Condition 1 unique peaks are those met all the following criteria\n\n        1. sc1i1 >= cutoff\n        2. sc1c2 >= cutoff\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_13call_condition1_unique = {__Pyx_NAMESTR("call_condition1_unique"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_13call_condition1_unique, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_12call_condition1_unique)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_13call_condition1_unique(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_cutoff = 0;
  PyObject *__pyx_v_min_length = 0;
  PyObject *__pyx_v_max_gap = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__cutoff,&__pyx_n_s__min_length,&__pyx_n_s__max_gap,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_condition1_unique (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_50));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_200));
    values[3] = ((PyObject *)((PyObject *)__pyx_int_50));
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__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__max_gap);
          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_condition1_unique") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_cutoff = values[1];
    __pyx_v_min_length = values[2];
    __pyx_v_max_gap = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_condition1_unique", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.call_condition1_unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_12call_condition1_unique(__pyx_self, __pyx_v_self, __pyx_v_cutoff, __pyx_v_min_length, __pyx_v_max_gap);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":583
 *         return peaks
 * 
 *     def call_condition1_unique (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_12call_condition1_unique(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_max_gap) {
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_v_peaks = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_chrom_pointer = NULL;
  PyObject *__pyx_v_chrom_d = NULL;
  PyObject *__pyx_v_chrom_pos = NULL;
  PyObject *__pyx_v_chrom_sc1i1 = NULL;
  PyObject *__pyx_v_chrom_sc1c2 = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_pre_p = NULL;
  PyObject *__pyx_v_peak_content = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_vc1i1 = NULL;
  PyObject *__pyx_v_vc1c2 = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_peak_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("call_condition1_unique", 0);
  __Pyx_TraceCall("call_condition1_unique", __pyx_f[0], 583);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":592
 *         2. sc1c2 >= cutoff
 *         """
 *         chrs  = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         peaks = PeakIO()                      # dictionary to save peaks
 *         for chrom in chrs:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __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 = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_chrs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":593
 *         """
 *         chrs  = self.get_chr_names()
 *         peaks = PeakIO()                      # dictionary to save peaks             # <<<<<<<<<<<<<<
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__PeakIO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __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 = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_peaks = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":594
 *         chrs  = self.get_chr_names()
 *         peaks = PeakIO()                      # dictionary to save peaks
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_1 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } 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 = 594; __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/cCompositeScoreTrack.pyx":595
 *         peaks = PeakIO()                      # dictionary to save peaks
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]             # <<<<<<<<<<<<<<
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_2, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_chrom_pointer);
    __pyx_v_chrom_pointer = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":596
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values             # <<<<<<<<<<<<<<
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_chrom_d);
    __pyx_v_chrom_d = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":597
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]             # <<<<<<<<<<<<<<
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_pos);
    __pyx_v_chrom_pos = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":598
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]             # <<<<<<<<<<<<<<
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]
 * 
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc1i1)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc1i1);
    __pyx_v_chrom_sc1i1 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":599
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]             # <<<<<<<<<<<<<<
 * 
 *             x     = 0                   # index in compositeScoreTrackI
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc1c2)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc1c2);
    __pyx_v_chrom_sc1c2 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":601
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]
 * 
 *             x     = 0                   # index in compositeScoreTrackI             # <<<<<<<<<<<<<<
 *             pre_p = 0                   # remember previous position
 *             peak_content = None         # to store points above cutoff
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":602
 * 
 *             x     = 0                   # index in compositeScoreTrackI
 *             pre_p = 0                   # remember previous position             # <<<<<<<<<<<<<<
 *             peak_content = None         # to store points above cutoff
 * 
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_pre_p);
    __pyx_v_pre_p = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":603
 *             x     = 0                   # index in compositeScoreTrackI
 *             pre_p = 0                   # remember previous position
 *             peak_content = None         # to store points above cutoff             # <<<<<<<<<<<<<<
 * 
 *             while True and x < chrom_pointer:
 */
    __Pyx_INCREF(Py_None);
    __Pyx_XDECREF(__pyx_v_peak_content);
    __pyx_v_peak_content = Py_None;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":605
 *             peak_content = None         # to store points above cutoff
 * 
 *             while True and x < chrom_pointer:             # <<<<<<<<<<<<<<
 *                 # find the first region above cutoff
 *                 # try to read the first data range for this chrom
 */
    while (1) {
      __pyx_t_7 = 1;
      if (__pyx_t_7) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_x, __pyx_v_chrom_pointer, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_7;
      }
      if (!__pyx_t_9) break;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":608
 *                 # find the first region above cutoff
 *                 # try to read the first data range for this chrom
 *                 p = chrom_pos[ x ]             # <<<<<<<<<<<<<<
 *                 vc1i1 = chrom_sc1i1[ x ]
 *                 vc1c2 = chrom_sc1c2[ x ]
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_pos, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_p);
      __pyx_v_p = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":609
 *                 # try to read the first data range for this chrom
 *                 p = chrom_pos[ x ]
 *                 vc1i1 = chrom_sc1i1[ x ]             # <<<<<<<<<<<<<<
 *                 vc1c2 = chrom_sc1c2[ x ]
 *                 x += 1                  # index for the next point
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc1i1, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc1i1);
      __pyx_v_vc1i1 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":610
 *                 p = chrom_pos[ x ]
 *                 vc1i1 = chrom_sc1i1[ x ]
 *                 vc1c2 = chrom_sc1c2[ x ]             # <<<<<<<<<<<<<<
 *                 x += 1                  # index for the next point
 *                 if vc1i1 >= cutoff and vc1c2 >= cutoff:
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc1c2, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc1c2);
      __pyx_v_vc1c2 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":611
 *                 vc1i1 = chrom_sc1i1[ x ]
 *                 vc1c2 = chrom_sc1c2[ x ]
 *                 x += 1                  # index for the next point             # <<<<<<<<<<<<<<
 *                 if vc1i1 >= cutoff and vc1c2 >= cutoff:
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 */
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_x, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_v_x);
      __pyx_v_x = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":612
 *                 vc1c2 = chrom_sc1c2[ x ]
 *                 x += 1                  # index for the next point
 *                 if vc1i1 >= cutoff and vc1c2 >= cutoff:             # <<<<<<<<<<<<<<
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 *                     pre_p = p
 */
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc1i1, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_9) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc1c2, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_8 = __pyx_t_7;
      } else {
        __pyx_t_8 = __pyx_t_9;
      }
      if (__pyx_t_8) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":613
 *                 x += 1                  # index for the next point
 *                 if vc1i1 >= cutoff and vc1c2 >= cutoff:
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...             # <<<<<<<<<<<<<<
 *                     pre_p = p
 *                     break               # found the first range above cutoff
 */
        __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_pre_p);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_pre_p);
        __Pyx_GIVEREF(__pyx_v_pre_p);
        __Pyx_INCREF(__pyx_v_p);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_p);
        __Pyx_GIVEREF(__pyx_v_p);
        __Pyx_INCREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        __Pyx_INCREF(__pyx_v_x);
        PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_x);
        __Pyx_GIVEREF(__pyx_v_x);
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_peak_content);
        __pyx_v_peak_content = ((PyObject *)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":614
 *                 if vc1i1 >= cutoff and vc1c2 >= cutoff:
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 *                     pre_p = p             # <<<<<<<<<<<<<<
 *                     break               # found the first range above cutoff
 *                 else:
 */
        __Pyx_INCREF(__pyx_v_p);
        __Pyx_DECREF(__pyx_v_pre_p);
        __pyx_v_pre_p = __pyx_v_p;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":615
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 *                     pre_p = p
 *                     break               # found the first range above cutoff             # <<<<<<<<<<<<<<
 *                 else:
 *                     pre_p = p
 */
        goto __pyx_L6_break;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":617
 *                     break               # found the first range above cutoff
 *                 else:
 *                     pre_p = p             # <<<<<<<<<<<<<<
 * 
 *             for i in xrange( x, chrom_pointer ):
 */
        __Pyx_INCREF(__pyx_v_p);
        __Pyx_DECREF(__pyx_v_pre_p);
        __pyx_v_pre_p = __pyx_v_p;
      }
      __pyx_L7:;
    }
    __pyx_L6_break:;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":619
 *                     pre_p = p
 * 
 *             for i in xrange( x, chrom_pointer ):             # <<<<<<<<<<<<<<
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    __Pyx_INCREF(__pyx_v_chrom_pointer);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_chrom_pointer);
    __Pyx_GIVEREF(__pyx_v_chrom_pointer);
    __pyx_t_6 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __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_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++;
      } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++;
      } else {
        __pyx_t_6 = __pyx_t_11(__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 = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":621
 *             for i in xrange( x, chrom_pointer ):
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]             # <<<<<<<<<<<<<<
 *                 vc1i1 = chrom_sc1i1[ i ]
 *                 vc1c2 = chrom_sc1c2[ i ]
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_pos, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_p);
      __pyx_v_p = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":622
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]
 *                 vc1i1 = chrom_sc1i1[ i ]             # <<<<<<<<<<<<<<
 *                 vc1c2 = chrom_sc1c2[ i ]
 *                 if vc1i1 < cutoff or vc1c2 < cutoff:
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc1i1, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc1i1);
      __pyx_v_vc1i1 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":623
 *                 p = chrom_pos[ i ]
 *                 vc1i1 = chrom_sc1i1[ i ]
 *                 vc1c2 = chrom_sc1c2[ i ]             # <<<<<<<<<<<<<<
 *                 if vc1i1 < cutoff or vc1c2 < cutoff:
 *                     pre_p = p
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc1c2, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc1c2);
      __pyx_v_vc1c2 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":624
 *                 vc1i1 = chrom_sc1i1[ i ]
 *                 vc1c2 = chrom_sc1c2[ i ]
 *                 if vc1i1 < cutoff or vc1c2 < cutoff:             # <<<<<<<<<<<<<<
 *                     pre_p = p
 *                     continue
 */
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc1i1, __pyx_v_cutoff, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!__pyx_t_8) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc1c2, __pyx_v_cutoff, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_7 = __pyx_t_9;
      } else {
        __pyx_t_7 = __pyx_t_8;
      }
      if (__pyx_t_7) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":625
 *                 vc1c2 = chrom_sc1c2[ i ]
 *                 if vc1i1 < cutoff or vc1c2 < cutoff:
 *                     pre_p = p             # <<<<<<<<<<<<<<
 *                     continue
 *                 # for points met all criteria
 */
        __Pyx_INCREF(__pyx_v_p);
        __Pyx_DECREF(__pyx_v_pre_p);
        __pyx_v_pre_p = __pyx_v_p;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":626
 *                 if vc1i1 < cutoff or vc1c2 < cutoff:
 *                     pre_p = p
 *                     continue             # <<<<<<<<<<<<<<
 *                 # for points met all criteria
 *                 # if the gap is allowed
 */
        goto __pyx_L8_continue;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":629
 *                 # for points met all criteria
 *                 # if the gap is allowed
 *                 if pre_p - peak_content[ -1 ][ 1 ] <= max_gap:             # <<<<<<<<<<<<<<
 *                     peak_content.append( ( pre_p, p, 0, i ) )
 *                 else:
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Subtract(__pyx_v_pre_p, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_max_gap, Py_LE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":630
 *                 # if the gap is allowed
 *                 if pre_p - peak_content[ -1 ][ 1 ] <= max_gap:
 *                     peak_content.append( ( pre_p, p, 0, i ) )             # <<<<<<<<<<<<<<
 *                 else:
 *                     # when the gap is not allowed, close this peak
 */
        __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_pre_p);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pre_p);
        __Pyx_GIVEREF(__pyx_v_pre_p);
        __Pyx_INCREF(__pyx_v_p);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_p);
        __Pyx_GIVEREF(__pyx_v_p);
        __Pyx_INCREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        __Pyx_INCREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":633
 *                 else:
 *                     # when the gap is not allowed, close this peak
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,
 */
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_v_peak_length);
        __pyx_v_peak_length = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":634
 *                     # when the gap is not allowed, close this peak
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *                     if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *                         peaks.add( chrom,
 *                                    peak_content[0][0],
 */
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_7) {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":635
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                    peak_content[0][0],
 *                                    peak_content[-1][1],
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);

          /* "MACS2/IO/cCompositeScoreTrack.pyx":636
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,
 *                                    peak_content[0][0],             # <<<<<<<<<<<<<<
 *                                    peak_content[-1][1],
 *                                    summit      = 0,
 */
          __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":637
 *                         peaks.add( chrom,
 *                                    peak_content[0][0],
 *                                    peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                    summit      = 0,
 *                                    peak_score  = 0,
 */
          __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_12, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_v_chrom);
          PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_chrom);
          __Pyx_GIVEREF(__pyx_v_chrom);
          PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_5 = 0;
          __pyx_t_13 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":635
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                    peak_content[0][0],
 *                                    peak_content[-1][1],
 */
          __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __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_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __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 = 635; __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 = 635; __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 = 635; __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 = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_12), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L12;
        }
        __pyx_L12:;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":646
 *                                    )
 *                     # start a new peak
 *                     peak_content = [ ( pre_p, p, 0, i ), ]             # <<<<<<<<<<<<<<
 *                 pre_p = p
 * 
 */
        __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_pre_p);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pre_p);
        __Pyx_GIVEREF(__pyx_v_pre_p);
        __Pyx_INCREF(__pyx_v_p);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_p);
        __Pyx_GIVEREF(__pyx_v_p);
        __Pyx_INCREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        __Pyx_INCREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        PyList_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_5));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
        __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_v_peak_content);
        __pyx_v_peak_content = ((PyObject *)__pyx_t_13);
        __pyx_t_13 = 0;
      }
      __pyx_L11:;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":647
 *                     # start a new peak
 *                     peak_content = [ ( pre_p, p, 0, i ), ]
 *                 pre_p = p             # <<<<<<<<<<<<<<
 * 
 *             # save the last peak
 */
      __Pyx_INCREF(__pyx_v_p);
      __Pyx_DECREF(__pyx_v_pre_p);
      __pyx_v_pre_p = __pyx_v_p;
      __pyx_L8_continue:;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":650
 * 
 *             # save the last peak
 *             if not peak_content:             # <<<<<<<<<<<<<<
 *                 continue
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_peak_content); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = (!__pyx_t_7);
    if (__pyx_t_8) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":651
 *             # save the last peak
 *             if not peak_content:
 *                 continue             # <<<<<<<<<<<<<<
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it
 */
      goto __pyx_L3_continue;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":652
 *             if not peak_content:
 *                 continue
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __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 = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_13, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_peak_length);
    __pyx_v_peak_length = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":653
 *                 continue
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *                 peaks.add( chrom,
 *                            peak_content[0][0],
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_8) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":654
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                            peak_content[0][0],
 *                            peak_content[-1][1],
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);

      /* "MACS2/IO/cCompositeScoreTrack.pyx":655
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,
 *                            peak_content[0][0],             # <<<<<<<<<<<<<<
 *                            peak_content[-1][1],
 *                            summit      = 0,
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":656
 *                 peaks.add( chrom,
 *                            peak_content[0][0],
 *                            peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                            summit      = 0,
 *                            peak_score  = 0,
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_13 = 0;
      __pyx_t_12 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":654
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                            peak_content[0][0],
 *                            peak_content[-1][1],
 */
      __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_12));
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__summit), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__peak_score), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L14;
    }
    __pyx_L14:;
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":665
 *                            )
 * 
 *         return peaks             # <<<<<<<<<<<<<<
 * 
 *     def call_condition2_unique (self, cutoff=50, min_length=200, max_gap=50):
 */
  __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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.call_condition1_unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF(__pyx_v_peaks);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_chrom_pointer);
  __Pyx_XDECREF(__pyx_v_chrom_d);
  __Pyx_XDECREF(__pyx_v_chrom_pos);
  __Pyx_XDECREF(__pyx_v_chrom_sc1i1);
  __Pyx_XDECREF(__pyx_v_chrom_sc1c2);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_pre_p);
  __Pyx_XDECREF(__pyx_v_peak_content);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_vc1i1);
  __Pyx_XDECREF(__pyx_v_vc1c2);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_peak_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_15call_condition2_unique(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_14call_condition2_unique[] = "This function try to find regions within which, scores\n        are continuously higher than a given cutoff.\n\n        Condition 2 unique peaks are those met all the following criteria\n\n        1. sc2i2 >= cutoff\n        2. sc2c1 >= cutoff\n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_15call_condition2_unique = {__Pyx_NAMESTR("call_condition2_unique"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_15call_condition2_unique, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_14call_condition2_unique)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_15call_condition2_unique(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_cutoff = 0;
  PyObject *__pyx_v_min_length = 0;
  PyObject *__pyx_v_max_gap = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__cutoff,&__pyx_n_s__min_length,&__pyx_n_s__max_gap,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_condition2_unique (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_50));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_200));
    values[3] = ((PyObject *)((PyObject *)__pyx_int_50));
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__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__max_gap);
          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_condition2_unique") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_cutoff = values[1];
    __pyx_v_min_length = values[2];
    __pyx_v_max_gap = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_condition2_unique", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.call_condition2_unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_14call_condition2_unique(__pyx_self, __pyx_v_self, __pyx_v_cutoff, __pyx_v_min_length, __pyx_v_max_gap);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":667
 *         return peaks
 * 
 *     def call_condition2_unique (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_14call_condition2_unique(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_max_gap) {
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_v_peaks = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_chrom_pointer = NULL;
  PyObject *__pyx_v_chrom_d = NULL;
  PyObject *__pyx_v_chrom_pos = NULL;
  PyObject *__pyx_v_chrom_sc2i2 = NULL;
  PyObject *__pyx_v_chrom_sc2c1 = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_pre_p = NULL;
  PyObject *__pyx_v_peak_content = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_vc2i2 = NULL;
  PyObject *__pyx_v_vc2c1 = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_peak_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("call_condition2_unique", 0);
  __Pyx_TraceCall("call_condition2_unique", __pyx_f[0], 667);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":676
 *         2. sc2c1 >= cutoff
 *         """
 *         chrs  = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         peaks = PeakIO()                      # dictionary to save peaks
 *         for chrom in chrs:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __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 = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_chrs = __pyx_t_2;
  __pyx_t_2 = 0;

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

  /* "MACS2/IO/cCompositeScoreTrack.pyx":678
 *         chrs  = self.get_chr_names()
 *         peaks = PeakIO()                      # dictionary to save peaks
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_1 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } 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 = 678; __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/cCompositeScoreTrack.pyx":679
 *         peaks = PeakIO()                      # dictionary to save peaks
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]             # <<<<<<<<<<<<<<
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_2, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_chrom_pointer);
    __pyx_v_chrom_pointer = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":680
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values             # <<<<<<<<<<<<<<
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc2i2   = chrom_d[ 'sc2i2' ]
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_chrom_d);
    __pyx_v_chrom_d = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":681
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]             # <<<<<<<<<<<<<<
 *             chrom_sc2i2   = chrom_d[ 'sc2i2' ]
 *             chrom_sc2c1 = chrom_d[ 'sc2c1' ]
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_pos);
    __pyx_v_chrom_pos = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":682
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc2i2   = chrom_d[ 'sc2i2' ]             # <<<<<<<<<<<<<<
 *             chrom_sc2c1 = chrom_d[ 'sc2c1' ]
 *             x     = 0                   # index in compositeScoreTrackI
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc2i2)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc2i2);
    __pyx_v_chrom_sc2i2 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":683
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc2i2   = chrom_d[ 'sc2i2' ]
 *             chrom_sc2c1 = chrom_d[ 'sc2c1' ]             # <<<<<<<<<<<<<<
 *             x     = 0                   # index in compositeScoreTrackI
 *             pre_p = 0                   # remember previous position
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc2c1)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc2c1);
    __pyx_v_chrom_sc2c1 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":684
 *             chrom_sc2i2   = chrom_d[ 'sc2i2' ]
 *             chrom_sc2c1 = chrom_d[ 'sc2c1' ]
 *             x     = 0                   # index in compositeScoreTrackI             # <<<<<<<<<<<<<<
 *             pre_p = 0                   # remember previous position
 *             peak_content = None         # to store points above cutoff
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":685
 *             chrom_sc2c1 = chrom_d[ 'sc2c1' ]
 *             x     = 0                   # index in compositeScoreTrackI
 *             pre_p = 0                   # remember previous position             # <<<<<<<<<<<<<<
 *             peak_content = None         # to store points above cutoff
 * 
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_pre_p);
    __pyx_v_pre_p = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":686
 *             x     = 0                   # index in compositeScoreTrackI
 *             pre_p = 0                   # remember previous position
 *             peak_content = None         # to store points above cutoff             # <<<<<<<<<<<<<<
 * 
 *             while True and x < chrom_pointer:
 */
    __Pyx_INCREF(Py_None);
    __Pyx_XDECREF(__pyx_v_peak_content);
    __pyx_v_peak_content = Py_None;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":688
 *             peak_content = None         # to store points above cutoff
 * 
 *             while True and x < chrom_pointer:             # <<<<<<<<<<<<<<
 *                 # find the first region above cutoff
 *                 # try to read the first data range for this chrom
 */
    while (1) {
      __pyx_t_7 = 1;
      if (__pyx_t_7) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_x, __pyx_v_chrom_pointer, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_7;
      }
      if (!__pyx_t_9) break;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":691
 *                 # find the first region above cutoff
 *                 # try to read the first data range for this chrom
 *                 p = chrom_pos[ x ]             # <<<<<<<<<<<<<<
 *                 vc2i2 = chrom_sc2i2[ x ]
 *                 vc2c1 = chrom_sc2c1[ x ]
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_pos, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_p);
      __pyx_v_p = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":692
 *                 # try to read the first data range for this chrom
 *                 p = chrom_pos[ x ]
 *                 vc2i2 = chrom_sc2i2[ x ]             # <<<<<<<<<<<<<<
 *                 vc2c1 = chrom_sc2c1[ x ]
 *                 x += 1                  # index for the next point
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc2i2, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc2i2);
      __pyx_v_vc2i2 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":693
 *                 p = chrom_pos[ x ]
 *                 vc2i2 = chrom_sc2i2[ x ]
 *                 vc2c1 = chrom_sc2c1[ x ]             # <<<<<<<<<<<<<<
 *                 x += 1                  # index for the next point
 *                 if vc2i2 >= cutoff and vc2c1 >= cutoff:
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc2c1, __pyx_v_x); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc2c1);
      __pyx_v_vc2c1 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":694
 *                 vc2i2 = chrom_sc2i2[ x ]
 *                 vc2c1 = chrom_sc2c1[ x ]
 *                 x += 1                  # index for the next point             # <<<<<<<<<<<<<<
 *                 if vc2i2 >= cutoff and vc2c1 >= cutoff:
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 */
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_x, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_v_x);
      __pyx_v_x = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":695
 *                 vc2c1 = chrom_sc2c1[ x ]
 *                 x += 1                  # index for the next point
 *                 if vc2i2 >= cutoff and vc2c1 >= cutoff:             # <<<<<<<<<<<<<<
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 *                     pre_p = p
 */
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc2i2, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_9) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc2c1, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_8 = __pyx_t_7;
      } else {
        __pyx_t_8 = __pyx_t_9;
      }
      if (__pyx_t_8) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":696
 *                 x += 1                  # index for the next point
 *                 if vc2i2 >= cutoff and vc2c1 >= cutoff:
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...             # <<<<<<<<<<<<<<
 *                     pre_p = p
 *                     break               # found the first range above cutoff
 */
        __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_pre_p);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_pre_p);
        __Pyx_GIVEREF(__pyx_v_pre_p);
        __Pyx_INCREF(__pyx_v_p);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_p);
        __Pyx_GIVEREF(__pyx_v_p);
        __Pyx_INCREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        __Pyx_INCREF(__pyx_v_x);
        PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_x);
        __Pyx_GIVEREF(__pyx_v_x);
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_peak_content);
        __pyx_v_peak_content = ((PyObject *)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":697
 *                 if vc2i2 >= cutoff and vc2c1 >= cutoff:
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 *                     pre_p = p             # <<<<<<<<<<<<<<
 *                     break               # found the first range above cutoff
 *                 else:
 */
        __Pyx_INCREF(__pyx_v_p);
        __Pyx_DECREF(__pyx_v_pre_p);
        __pyx_v_pre_p = __pyx_v_p;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":698
 *                     peak_content = [ ( pre_p, p, 0, x ), ] # remember the index too...
 *                     pre_p = p
 *                     break               # found the first range above cutoff             # <<<<<<<<<<<<<<
 *                 else:
 *                     pre_p = p
 */
        goto __pyx_L6_break;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":700
 *                     break               # found the first range above cutoff
 *                 else:
 *                     pre_p = p             # <<<<<<<<<<<<<<
 * 
 *             for i in xrange( x, chrom_pointer ):
 */
        __Pyx_INCREF(__pyx_v_p);
        __Pyx_DECREF(__pyx_v_pre_p);
        __pyx_v_pre_p = __pyx_v_p;
      }
      __pyx_L7:;
    }
    __pyx_L6_break:;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":702
 *                     pre_p = p
 * 
 *             for i in xrange( x, chrom_pointer ):             # <<<<<<<<<<<<<<
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    __Pyx_INCREF(__pyx_v_chrom_pointer);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_chrom_pointer);
    __Pyx_GIVEREF(__pyx_v_chrom_pointer);
    __pyx_t_6 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __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_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++;
      } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++;
      } else {
        __pyx_t_6 = __pyx_t_11(__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 = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":704
 *             for i in xrange( x, chrom_pointer ):
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]             # <<<<<<<<<<<<<<
 *                 vc2i2 = chrom_sc2i2[ i ]
 *                 vc2c1 = chrom_sc2c1[ i ]
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_pos, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_p);
      __pyx_v_p = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":705
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]
 *                 vc2i2 = chrom_sc2i2[ i ]             # <<<<<<<<<<<<<<
 *                 vc2c1 = chrom_sc2c1[ i ]
 *                 if vc2i2 < cutoff or vc2c1 < cutoff:
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc2i2, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc2i2);
      __pyx_v_vc2i2 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":706
 *                 p = chrom_pos[ i ]
 *                 vc2i2 = chrom_sc2i2[ i ]
 *                 vc2c1 = chrom_sc2c1[ i ]             # <<<<<<<<<<<<<<
 *                 if vc2i2 < cutoff or vc2c1 < cutoff:
 *                     pre_p = p
 */
      __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_sc2c1, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_vc2c1);
      __pyx_v_vc2c1 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":707
 *                 vc2i2 = chrom_sc2i2[ i ]
 *                 vc2c1 = chrom_sc2c1[ i ]
 *                 if vc2i2 < cutoff or vc2c1 < cutoff:             # <<<<<<<<<<<<<<
 *                     pre_p = p
 *                     continue
 */
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc2i2, __pyx_v_cutoff, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!__pyx_t_8) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_vc2c1, __pyx_v_cutoff, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_7 = __pyx_t_9;
      } else {
        __pyx_t_7 = __pyx_t_8;
      }
      if (__pyx_t_7) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":708
 *                 vc2c1 = chrom_sc2c1[ i ]
 *                 if vc2i2 < cutoff or vc2c1 < cutoff:
 *                     pre_p = p             # <<<<<<<<<<<<<<
 *                     continue
 *                 # for points met all criteria
 */
        __Pyx_INCREF(__pyx_v_p);
        __Pyx_DECREF(__pyx_v_pre_p);
        __pyx_v_pre_p = __pyx_v_p;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":709
 *                 if vc2i2 < cutoff or vc2c1 < cutoff:
 *                     pre_p = p
 *                     continue             # <<<<<<<<<<<<<<
 *                 # for points met all criteria
 *                 # if the gap is allowed
 */
        goto __pyx_L8_continue;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":712
 *                 # for points met all criteria
 *                 # if the gap is allowed
 *                 if pre_p - peak_content[ -1 ][ 1 ] <= max_gap:             # <<<<<<<<<<<<<<
 *                     peak_content.append( ( pre_p, p, 0, i ) )
 *                 else:
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Subtract(__pyx_v_pre_p, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_max_gap, Py_LE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":713
 *                 # if the gap is allowed
 *                 if pre_p - peak_content[ -1 ][ 1 ] <= max_gap:
 *                     peak_content.append( ( pre_p, p, 0, i ) )             # <<<<<<<<<<<<<<
 *                 else:
 *                     # when the gap is not allowed, close this peak
 */
        __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_pre_p);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pre_p);
        __Pyx_GIVEREF(__pyx_v_pre_p);
        __Pyx_INCREF(__pyx_v_p);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_p);
        __Pyx_GIVEREF(__pyx_v_p);
        __Pyx_INCREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        __Pyx_INCREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_peak_content, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":716
 *                 else:
 *                     # when the gap is not allowed, close this peak
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,
 */
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_v_peak_length);
        __pyx_v_peak_length = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":717
 *                     # when the gap is not allowed, close this peak
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *                     if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *                         peaks.add( chrom,
 *                                    peak_content[0][0],
 */
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_7) {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":718
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                    peak_content[0][0],
 *                                    peak_content[-1][1],
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);

          /* "MACS2/IO/cCompositeScoreTrack.pyx":719
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,
 *                                    peak_content[0][0],             # <<<<<<<<<<<<<<
 *                                    peak_content[-1][1],
 *                                    summit      = 0,
 */
          __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":720
 *                         peaks.add( chrom,
 *                                    peak_content[0][0],
 *                                    peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                    summit      = 0,
 *                                    peak_score  = 0,
 */
          __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_12, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_v_chrom);
          PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_chrom);
          __Pyx_GIVEREF(__pyx_v_chrom);
          PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_5 = 0;
          __pyx_t_13 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":718
 *                     peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *                     if peak_length >= min_length: # if the peak is too small, reject it
 *                         peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                    peak_content[0][0],
 *                                    peak_content[-1][1],
 */
          __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __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_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __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 = 718; __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 = 718; __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 = 718; __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 = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_12), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L12;
        }
        __pyx_L12:;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":729
 *                                    )
 *                     # start a new peak
 *                     peak_content = [ ( pre_p, p, 0, i ), ]             # <<<<<<<<<<<<<<
 *                 pre_p = p
 * 
 */
        __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_pre_p);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pre_p);
        __Pyx_GIVEREF(__pyx_v_pre_p);
        __Pyx_INCREF(__pyx_v_p);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_p);
        __Pyx_GIVEREF(__pyx_v_p);
        __Pyx_INCREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        __Pyx_INCREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        PyList_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_5));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
        __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_v_peak_content);
        __pyx_v_peak_content = ((PyObject *)__pyx_t_13);
        __pyx_t_13 = 0;
      }
      __pyx_L11:;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":730
 *                     # start a new peak
 *                     peak_content = [ ( pre_p, p, 0, i ), ]
 *                 pre_p = p             # <<<<<<<<<<<<<<
 * 
 *             # save the last peak
 */
      __Pyx_INCREF(__pyx_v_p);
      __Pyx_DECREF(__pyx_v_pre_p);
      __pyx_v_pre_p = __pyx_v_p;
      __pyx_L8_continue:;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":733
 * 
 *             # save the last peak
 *             if not peak_content:             # <<<<<<<<<<<<<<
 *                 continue
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_peak_content); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = (!__pyx_t_7);
    if (__pyx_t_8) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":734
 *             # save the last peak
 *             if not peak_content:
 *                 continue             # <<<<<<<<<<<<<<
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it
 */
      goto __pyx_L3_continue;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":735
 *             if not peak_content:
 *                 continue
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __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 = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_13, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_peak_length);
    __pyx_v_peak_length = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":736
 *                 continue
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *                 peaks.add( chrom,
 *                            peak_content[0][0],
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_8) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":737
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                            peak_content[0][0],
 *                            peak_content[-1][1],
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);

      /* "MACS2/IO/cCompositeScoreTrack.pyx":738
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,
 *                            peak_content[0][0],             # <<<<<<<<<<<<<<
 *                            peak_content[-1][1],
 *                            summit      = 0,
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":739
 *                 peaks.add( chrom,
 *                            peak_content[0][0],
 *                            peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                            summit      = 0,
 *                            peak_score  = 0,
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_13 = 0;
      __pyx_t_12 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":737
 *             peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *             if peak_length >= min_length: # if the peak is too small, reject it
 *                 peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                            peak_content[0][0],
 *                            peak_content[-1][1],
 */
      __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_12));
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__summit), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__peak_score), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L14;
    }
    __pyx_L14:;
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":747
 *                            qscore      = 0,
 *                            )
 *         return peaks             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.call_condition2_unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF(__pyx_v_peaks);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_chrom_pointer);
  __Pyx_XDECREF(__pyx_v_chrom_d);
  __Pyx_XDECREF(__pyx_v_chrom_pos);
  __Pyx_XDECREF(__pyx_v_chrom_sc2i2);
  __Pyx_XDECREF(__pyx_v_chrom_sc2c1);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_pre_p);
  __Pyx_XDECREF(__pyx_v_peak_content);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_vc2i2);
  __Pyx_XDECREF(__pyx_v_vc2c1);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_peak_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_17call_diff_regions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_16call_diff_regions[] = "A function to call differential regions and common regions together.\n\n        Return: common_regions, condition1_unique, and condition2_unique regions\n        \n        ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_17call_diff_regions = {__Pyx_NAMESTR("call_diff_regions"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_17call_diff_regions, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_16call_diff_regions)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_17call_diff_regions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_cutoff = 0;
  PyObject *__pyx_v_min_length = 0;
  PyObject *__pyx_v_max_gap = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__cutoff,&__pyx_n_s__min_length,&__pyx_n_s__max_gap,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_diff_regions (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_50));
    values[2] = ((PyObject *)((PyObject *)__pyx_int_200));
    values[3] = ((PyObject *)((PyObject *)__pyx_int_50));
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__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__max_gap);
          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_diff_regions") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_cutoff = values[1];
    __pyx_v_min_length = values[2];
    __pyx_v_max_gap = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_diff_regions", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.call_diff_regions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_16call_diff_regions(__pyx_self, __pyx_v_self, __pyx_v_cutoff, __pyx_v_min_length, __pyx_v_max_gap);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":750
 * 
 * 
 *     def call_diff_regions (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """A function to call differential regions and common regions together.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_16call_diff_regions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_min_length, PyObject *__pyx_v_max_gap) {
  PyObject *__pyx_v_chrs = NULL;
  PyObject *__pyx_v_consistent_peaks = NULL;
  PyObject *__pyx_v_condition1_peaks = NULL;
  PyObject *__pyx_v_condition2_peaks = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_chrom_pointer = NULL;
  PyObject *__pyx_v_chrom_d = NULL;
  PyObject *__pyx_v_chrom_pos = NULL;
  PyObject *__pyx_v_chrom_sc1i1 = NULL;
  PyObject *__pyx_v_chrom_sc2i2 = NULL;
  PyObject *__pyx_v_chrom_sc1c2 = NULL;
  PyObject *__pyx_v_chrom_sc2c1 = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_pre_p = NULL;
  PyObject *__pyx_v_consistent_peak_content = NULL;
  PyObject *__pyx_v_condition1_peak_content = NULL;
  PyObject *__pyx_v_condition2_peak_content = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_vc1i1 = NULL;
  PyObject *__pyx_v_vc2i2 = NULL;
  PyObject *__pyx_v_vc1c2 = NULL;
  PyObject *__pyx_v_vc2c1 = NULL;
  PyObject *__pyx_v_peak_length = NULL;
  PyObject *__pyx_v_m_c1c2 = NULL;
  PyObject *__pyx_v_m_c2c1 = NULL;
  PyObject *__pyx_v_diff_score = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("call_diff_regions", 0);
  __Pyx_TraceCall("call_diff_regions", __pyx_f[0], 750);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":756
 * 
 *         """
 *         chrs  = self.get_chr_names()             # <<<<<<<<<<<<<<
 *         consistent_peaks = PeakIO()                      # dictionary to save peaks
 *         condition1_peaks = PeakIO()                      # dictionary to save peaks
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __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 = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_chrs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":757
 *         """
 *         chrs  = self.get_chr_names()
 *         consistent_peaks = PeakIO()                      # dictionary to save peaks             # <<<<<<<<<<<<<<
 *         condition1_peaks = PeakIO()                      # dictionary to save peaks
 *         condition2_peaks = PeakIO()                      # dictionary to save peaks
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__PeakIO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __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 = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_consistent_peaks = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":758
 *         chrs  = self.get_chr_names()
 *         consistent_peaks = PeakIO()                      # dictionary to save peaks
 *         condition1_peaks = PeakIO()                      # dictionary to save peaks             # <<<<<<<<<<<<<<
 *         condition2_peaks = PeakIO()                      # dictionary to save peaks
 *         for chrom in chrs:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PeakIO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __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 = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_condition1_peaks = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":759
 *         consistent_peaks = PeakIO()                      # dictionary to save peaks
 *         condition1_peaks = PeakIO()                      # dictionary to save peaks
 *         condition2_peaks = PeakIO()                      # dictionary to save peaks             # <<<<<<<<<<<<<<
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__PeakIO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __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 = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_condition2_peaks = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":760
 *         condition1_peaks = PeakIO()                      # dictionary to save peaks
 *         condition2_peaks = PeakIO()                      # dictionary to save peaks
 *         for chrom in chrs:             # <<<<<<<<<<<<<<
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 */
  if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
    __pyx_t_1 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chrs); 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_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } 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 = 760; __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/cCompositeScoreTrack.pyx":761
 *         condition2_peaks = PeakIO()                      # dictionary to save peaks
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]             # <<<<<<<<<<<<<<
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pointer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_2, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_chrom_pointer);
    __pyx_v_chrom_pointer = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":762
 *         for chrom in chrs:
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values             # <<<<<<<<<<<<<<
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_chrom_d);
    __pyx_v_chrom_d = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":763
 *             chrom_pointer = self.pointer[chrom]
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]             # <<<<<<<<<<<<<<
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]
 *             chrom_sc2i2  = chrom_d[ 'sc2i2' ]
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_pos);
    __pyx_v_chrom_pos = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":764
 *             chrom_d       = self.get_data_by_chr( chrom ) # arrays for position and values
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]             # <<<<<<<<<<<<<<
 *             chrom_sc2i2  = chrom_d[ 'sc2i2' ]
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc1i1)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc1i1);
    __pyx_v_chrom_sc1i1 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":765
 *             chrom_pos     = chrom_d[ 'pos' ]
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]
 *             chrom_sc2i2  = chrom_d[ 'sc2i2' ]             # <<<<<<<<<<<<<<
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]
 *             chrom_sc2c1  = chrom_d[ 'sc2c1' ]
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc2i2)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc2i2);
    __pyx_v_chrom_sc2i2 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":766
 *             chrom_sc1i1   = chrom_d[ 'sc1i1' ]
 *             chrom_sc2i2  = chrom_d[ 'sc2i2' ]
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]             # <<<<<<<<<<<<<<
 *             chrom_sc2c1  = chrom_d[ 'sc2c1' ]
 * 
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc1c2)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc1c2);
    __pyx_v_chrom_sc1c2 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":767
 *             chrom_sc2i2  = chrom_d[ 'sc2i2' ]
 *             chrom_sc1c2 = chrom_d[ 'sc1c2' ]
 *             chrom_sc2c1  = chrom_d[ 'sc2c1' ]             # <<<<<<<<<<<<<<
 * 
 *             x     = 0                   # index in compositeScoreTrackI
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_chrom_d, ((PyObject *)__pyx_n_s__sc2c1)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_chrom_sc2c1);
    __pyx_v_chrom_sc2c1 = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":769
 *             chrom_sc2c1  = chrom_d[ 'sc2c1' ]
 * 
 *             x     = 0                   # index in compositeScoreTrackI             # <<<<<<<<<<<<<<
 *             pre_p = 0                   # remember previous position
 *             consistent_peak_content = None         # to store points above cutoff
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":770
 * 
 *             x     = 0                   # index in compositeScoreTrackI
 *             pre_p = 0                   # remember previous position             # <<<<<<<<<<<<<<
 *             consistent_peak_content = None         # to store points above cutoff
 *             condition1_peak_content = None         # to store points above cutoff
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_pre_p);
    __pyx_v_pre_p = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":771
 *             x     = 0                   # index in compositeScoreTrackI
 *             pre_p = 0                   # remember previous position
 *             consistent_peak_content = None         # to store points above cutoff             # <<<<<<<<<<<<<<
 *             condition1_peak_content = None         # to store points above cutoff
 *             condition2_peak_content = None         # to store points above cutoff
 */
    __Pyx_INCREF(Py_None);
    __Pyx_XDECREF(__pyx_v_consistent_peak_content);
    __pyx_v_consistent_peak_content = Py_None;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":772
 *             pre_p = 0                   # remember previous position
 *             consistent_peak_content = None         # to store points above cutoff
 *             condition1_peak_content = None         # to store points above cutoff             # <<<<<<<<<<<<<<
 *             condition2_peak_content = None         # to store points above cutoff
 * 
 */
    __Pyx_INCREF(Py_None);
    __Pyx_XDECREF(__pyx_v_condition1_peak_content);
    __pyx_v_condition1_peak_content = Py_None;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":773
 *             consistent_peak_content = None         # to store points above cutoff
 *             condition1_peak_content = None         # to store points above cutoff
 *             condition2_peak_content = None         # to store points above cutoff             # <<<<<<<<<<<<<<
 * 
 *             for i in xrange( x, chrom_pointer ):
 */
    __Pyx_INCREF(Py_None);
    __Pyx_XDECREF(__pyx_v_condition2_peak_content);
    __pyx_v_condition2_peak_content = Py_None;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":775
 *             condition2_peak_content = None         # to store points above cutoff
 * 
 *             for i in xrange( x, chrom_pointer ):             # <<<<<<<<<<<<<<
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    __Pyx_INCREF(__pyx_v_chrom_pointer);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_chrom_pointer);
    __Pyx_GIVEREF(__pyx_v_chrom_pointer);
    __pyx_t_2 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_6 = __pyx_t_2; __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_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __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_2); __pyx_t_2 = 0;
    for (;;) {
      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_6)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
      } else {
        __pyx_t_2 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_2)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":777
 *             for i in xrange( x, chrom_pointer ):
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]             # <<<<<<<<<<<<<<
 *                 vc1i1 = chrom_sc1i1[ i ]
 *                 vc2i2 = chrom_sc2i2[ i ]
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_chrom_pos, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_v_p);
      __pyx_v_p = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":778
 *                 # continue scan the rest regions
 *                 p = chrom_pos[ i ]
 *                 vc1i1 = chrom_sc1i1[ i ]             # <<<<<<<<<<<<<<
 *                 vc2i2 = chrom_sc2i2[ i ]
 *                 vc1c2 = chrom_sc1c2[ i ]
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_chrom_sc1i1, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_v_vc1i1);
      __pyx_v_vc1i1 = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":779
 *                 p = chrom_pos[ i ]
 *                 vc1i1 = chrom_sc1i1[ i ]
 *                 vc2i2 = chrom_sc2i2[ i ]             # <<<<<<<<<<<<<<
 *                 vc1c2 = chrom_sc1c2[ i ]
 *                 vc2c1 = chrom_sc2c1[ i ]
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_chrom_sc2i2, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_v_vc2i2);
      __pyx_v_vc2i2 = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":780
 *                 vc1i1 = chrom_sc1i1[ i ]
 *                 vc2i2 = chrom_sc2i2[ i ]
 *                 vc1c2 = chrom_sc1c2[ i ]             # <<<<<<<<<<<<<<
 *                 vc2c1 = chrom_sc2c1[ i ]
 * 
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_chrom_sc1c2, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_v_vc1c2);
      __pyx_v_vc1c2 = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":781
 *                 vc2i2 = chrom_sc2i2[ i ]
 *                 vc1c2 = chrom_sc1c2[ i ]
 *                 vc2c1 = chrom_sc2c1[ i ]             # <<<<<<<<<<<<<<
 * 
 *                 if vc1i1 >= cutoff and vc2i2 >= cutoff and vc1c2 <= cutoff and vc2c1 <= cutoff:
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_chrom_sc2c1, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_v_vc2c1);
      __pyx_v_vc2c1 = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":783
 *                 vc2c1 = chrom_sc2c1[ i ]
 * 
 *                 if vc1i1 >= cutoff and vc2i2 >= cutoff and vc1c2 <= cutoff and vc2c1 <= cutoff:             # <<<<<<<<<<<<<<
 *                     # for points met all criteria
 *                     # if the gap is allowed
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_vc1i1, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_9) {
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_vc2i2, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_10) {
          __pyx_t_2 = PyObject_RichCompare(__pyx_v_vc1c2, __pyx_v_cutoff, Py_LE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_11) {
            __pyx_t_2 = PyObject_RichCompare(__pyx_v_vc2c1, __pyx_v_cutoff, Py_LE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_13 = __pyx_t_12;
          } else {
            __pyx_t_13 = __pyx_t_11;
          }
          __pyx_t_11 = __pyx_t_13;
        } else {
          __pyx_t_11 = __pyx_t_10;
        }
        __pyx_t_10 = __pyx_t_11;
      } else {
        __pyx_t_10 = __pyx_t_9;
      }
      if (__pyx_t_10) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":786
 *                     # for points met all criteria
 *                     # if the gap is allowed
 *                     if not consistent_peak_content:             # <<<<<<<<<<<<<<
 *                         consistent_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ] # for consistent region, summit is decided by condition 1
 *                     if pre_p - consistent_peak_content[ -1 ][ 1 ] <= max_gap:
 */
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_consistent_peak_content); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_9 = (!__pyx_t_10);
        if (__pyx_t_9) {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":787
 *                     # if the gap is allowed
 *                     if not consistent_peak_content:
 *                         consistent_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ] # for consistent region, summit is decided by condition 1             # <<<<<<<<<<<<<<
 *                     if pre_p - consistent_peak_content[ -1 ][ 1 ] <= max_gap:
 *                         consistent_peak_content.append( ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ) )
 */
          __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_pre_p);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pre_p);
          __Pyx_GIVEREF(__pyx_v_pre_p);
          __Pyx_INCREF(__pyx_v_p);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_p);
          __Pyx_GIVEREF(__pyx_v_p);
          __Pyx_INCREF(__pyx_v_vc1i1);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_vc1i1);
          __Pyx_GIVEREF(__pyx_v_vc1i1);
          __Pyx_INCREF(__pyx_v_vc2i2);
          PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_vc2i2);
          __Pyx_GIVEREF(__pyx_v_vc2i2);
          __Pyx_INCREF(__pyx_v_vc1c2);
          PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_vc1c2);
          __Pyx_GIVEREF(__pyx_v_vc1c2);
          __Pyx_INCREF(__pyx_v_vc2c1);
          PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_vc2c1);
          __Pyx_GIVEREF(__pyx_v_vc2c1);
          __Pyx_INCREF(__pyx_v_i);
          PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_i);
          __Pyx_GIVEREF(__pyx_v_i);
          __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
          __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_v_consistent_peak_content);
          __pyx_v_consistent_peak_content = ((PyObject *)__pyx_t_5);
          __pyx_t_5 = 0;
          goto __pyx_L8;
        }
        __pyx_L8:;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":788
 *                     if not consistent_peak_content:
 *                         consistent_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ] # for consistent region, summit is decided by condition 1
 *                     if pre_p - consistent_peak_content[ -1 ][ 1 ] <= max_gap:             # <<<<<<<<<<<<<<
 *                         consistent_peak_content.append( ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ) )
 *                     else:
 */
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_consistent_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Subtract(__pyx_v_pre_p, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_v_max_gap, Py_LE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_9) {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":789
 *                         consistent_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ] # for consistent region, summit is decided by condition 1
 *                     if pre_p - consistent_peak_content[ -1 ][ 1 ] <= max_gap:
 *                         consistent_peak_content.append( ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ) )             # <<<<<<<<<<<<<<
 *                     else:
 *                         # when the gap is not allowed, close this peak
 */
          __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_pre_p);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pre_p);
          __Pyx_GIVEREF(__pyx_v_pre_p);
          __Pyx_INCREF(__pyx_v_p);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_p);
          __Pyx_GIVEREF(__pyx_v_p);
          __Pyx_INCREF(__pyx_v_vc1i1);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_vc1i1);
          __Pyx_GIVEREF(__pyx_v_vc1i1);
          __Pyx_INCREF(__pyx_v_vc2i2);
          PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_vc2i2);
          __Pyx_GIVEREF(__pyx_v_vc2i2);
          __Pyx_INCREF(__pyx_v_vc1c2);
          PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_vc1c2);
          __Pyx_GIVEREF(__pyx_v_vc1c2);
          __Pyx_INCREF(__pyx_v_vc2c1);
          PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_vc2c1);
          __Pyx_GIVEREF(__pyx_v_vc2c1);
          __Pyx_INCREF(__pyx_v_i);
          PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_i);
          __Pyx_GIVEREF(__pyx_v_i);
          __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_consistent_peak_content, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L9;
        }
        /*else*/ {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":794
 *                         # this is common region.
 * 
 *                         peak_length = consistent_peak_content[ -1 ][ 1 ] - consistent_peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *                         if peak_length >= min_length: # if the peak is too small, reject it
 * 
 */
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_consistent_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_consistent_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_v_peak_length);
          __pyx_v_peak_length = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":795
 * 
 *                         peak_length = consistent_peak_content[ -1 ][ 1 ] - consistent_peak_content[ 0 ][ 0 ]
 *                         if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 * 
 *                             # the absolute of peak score or the diff
 */
          __pyx_t_5 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (__pyx_t_9) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":803
 *                             # '+'. Otherwise, the sign is '-'
 * 
 *                             m_c1c2 = max([x[4] for x in consistent_peak_content ])             # <<<<<<<<<<<<<<
 *                             m_c2c1 = max([x[5] for x in consistent_peak_content ])
 *                             if m_c1c2 >= m_c2c1:
 */
            __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_5);
            if (PyList_CheckExact(__pyx_v_consistent_peak_content) || PyTuple_CheckExact(__pyx_v_consistent_peak_content)) {
              __pyx_t_14 = __pyx_v_consistent_peak_content; __Pyx_INCREF(__pyx_t_14); __pyx_t_15 = 0;
              __pyx_t_16 = NULL;
            } else {
              __pyx_t_15 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_consistent_peak_content); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
            }
            for (;;) {
              if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) {
                if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_14)) break;
                __pyx_t_2 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++;
              } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) {
                if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
                __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++;
              } else {
                __pyx_t_2 = __pyx_t_16(__pyx_t_14);
                if (unlikely(!__pyx_t_2)) {
                  if (PyErr_Occurred()) {
                    if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                    else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_2);
              }
              __Pyx_DECREF(__pyx_v_x);
              __pyx_v_x = __pyx_t_2;
              __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (unlikely(PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_INCREF(((PyObject *)__pyx_t_5));
            PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_5));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
            __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
            __pyx_t_5 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_v_m_c1c2);
            __pyx_v_m_c1c2 = __pyx_t_5;
            __pyx_t_5 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":804
 * 
 *                             m_c1c2 = max([x[4] for x in consistent_peak_content ])
 *                             m_c2c1 = max([x[5] for x in consistent_peak_content ])             # <<<<<<<<<<<<<<
 *                             if m_c1c2 >= m_c2c1:
 *                                 diff_score = m_c1c2
 */
            __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_5);
            if (PyList_CheckExact(__pyx_v_consistent_peak_content) || PyTuple_CheckExact(__pyx_v_consistent_peak_content)) {
              __pyx_t_14 = __pyx_v_consistent_peak_content; __Pyx_INCREF(__pyx_t_14); __pyx_t_15 = 0;
              __pyx_t_16 = NULL;
            } else {
              __pyx_t_15 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_consistent_peak_content); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
            }
            for (;;) {
              if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) {
                if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_14)) break;
                __pyx_t_2 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++;
              } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) {
                if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
                __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++;
              } else {
                __pyx_t_2 = __pyx_t_16(__pyx_t_14);
                if (unlikely(!__pyx_t_2)) {
                  if (PyErr_Occurred()) {
                    if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                    else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_2);
              }
              __Pyx_DECREF(__pyx_v_x);
              __pyx_v_x = __pyx_t_2;
              __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 5, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (unlikely(PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_INCREF(((PyObject *)__pyx_t_5));
            PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_5));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
            __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
            __pyx_t_5 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_v_m_c2c1);
            __pyx_v_m_c2c1 = __pyx_t_5;
            __pyx_t_5 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":805
 *                             m_c1c2 = max([x[4] for x in consistent_peak_content ])
 *                             m_c2c1 = max([x[5] for x in consistent_peak_content ])
 *                             if m_c1c2 >= m_c2c1:             # <<<<<<<<<<<<<<
 *                                 diff_score = m_c1c2
 *                             else:
 */
            __pyx_t_5 = PyObject_RichCompare(__pyx_v_m_c1c2, __pyx_v_m_c2c1, Py_GE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (__pyx_t_9) {

              /* "MACS2/IO/cCompositeScoreTrack.pyx":806
 *                             m_c2c1 = max([x[5] for x in consistent_peak_content ])
 *                             if m_c1c2 >= m_c2c1:
 *                                 diff_score = m_c1c2             # <<<<<<<<<<<<<<
 *                             else:
 *                                 diff_score = -1* m_c2c1
 */
              __Pyx_INCREF(__pyx_v_m_c1c2);
              __Pyx_XDECREF(__pyx_v_diff_score);
              __pyx_v_diff_score = __pyx_v_m_c1c2;
              goto __pyx_L15;
            }
            /*else*/ {

              /* "MACS2/IO/cCompositeScoreTrack.pyx":808
 *                                 diff_score = m_c1c2
 *                             else:
 *                                 diff_score = -1* m_c2c1             # <<<<<<<<<<<<<<
 * 
 *                             consistent_peaks.add( chrom,
 */
              __pyx_t_5 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_v_m_c2c1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_XDECREF(__pyx_v_diff_score);
              __pyx_v_diff_score = __pyx_t_5;
              __pyx_t_5 = 0;
            }
            __pyx_L15:;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":810
 *                                 diff_score = -1* m_c2c1
 * 
 *                             consistent_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                                   consistent_peak_content[0][0],
 *                                                   consistent_peak_content[-1][1],
 */
            __pyx_t_5 = PyObject_GetAttr(__pyx_v_consistent_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_5);

            /* "MACS2/IO/cCompositeScoreTrack.pyx":811
 * 
 *                             consistent_peaks.add( chrom,
 *                                                   consistent_peak_content[0][0],             # <<<<<<<<<<<<<<
 *                                                   consistent_peak_content[-1][1],
 *                                                   summit      = 0,
 */
            __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_consistent_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_14, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":812
 *                             consistent_peaks.add( chrom,
 *                                                   consistent_peak_content[0][0],
 *                                                   consistent_peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                                   summit      = 0,
 *                                                   peak_score  = diff_score,
 */
            __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_consistent_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_14, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __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);
            PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_17);
            __Pyx_GIVEREF(__pyx_t_17);
            __pyx_t_2 = 0;
            __pyx_t_17 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":810
 *                                 diff_score = -1* m_c2c1
 * 
 *                             consistent_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                                   consistent_peak_content[0][0],
 *                                                   consistent_peak_content[-1][1],
 */
            __pyx_t_17 = PyDict_New(); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_17));
            if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__summit), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

            /* "MACS2/IO/cCompositeScoreTrack.pyx":814
 *                                                   consistent_peak_content[-1][1],
 *                                                   summit      = 0,
 *                                                   peak_score  = diff_score,             # <<<<<<<<<<<<<<
 *                                                   pileup      = 0,
 *                                                   pscore      = 0,
 */
            if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__peak_score), __pyx_v_diff_score) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_14), ((PyObject *)__pyx_t_17)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            goto __pyx_L10;
          }
          __pyx_L10:;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":821
 *                                                   )
 *                         # start a new peak
 *                         consistent_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]             # <<<<<<<<<<<<<<
 *                 elif vc1i1 >= cutoff and vc1c2 >= cutoff:
 *                     if not condition1_peak_content:
 */
          __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_pre_p);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pre_p);
          __Pyx_GIVEREF(__pyx_v_pre_p);
          __Pyx_INCREF(__pyx_v_p);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_p);
          __Pyx_GIVEREF(__pyx_v_p);
          __Pyx_INCREF(__pyx_v_vc1i1);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_vc1i1);
          __Pyx_GIVEREF(__pyx_v_vc1i1);
          __Pyx_INCREF(__pyx_v_vc2i2);
          PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_vc2i2);
          __Pyx_GIVEREF(__pyx_v_vc2i2);
          __Pyx_INCREF(__pyx_v_vc1c2);
          PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_vc1c2);
          __Pyx_GIVEREF(__pyx_v_vc1c2);
          __Pyx_INCREF(__pyx_v_vc2c1);
          PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_vc2c1);
          __Pyx_GIVEREF(__pyx_v_vc2c1);
          __Pyx_INCREF(__pyx_v_i);
          PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_i);
          __Pyx_GIVEREF(__pyx_v_i);
          __pyx_t_17 = PyList_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          PyList_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_t_2));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
          __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_v_consistent_peak_content);
          __pyx_v_consistent_peak_content = ((PyObject *)__pyx_t_17);
          __pyx_t_17 = 0;
        }
        __pyx_L9:;
        goto __pyx_L7;
      }

      /* "MACS2/IO/cCompositeScoreTrack.pyx":822
 *                         # start a new peak
 *                         consistent_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]
 *                 elif vc1i1 >= cutoff and vc1c2 >= cutoff:             # <<<<<<<<<<<<<<
 *                     if not condition1_peak_content:
 *                         condition1_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ),  ]
 */
      __pyx_t_17 = PyObject_RichCompare(__pyx_v_vc1i1, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      if (__pyx_t_9) {
        __pyx_t_17 = PyObject_RichCompare(__pyx_v_vc1c2, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_11 = __pyx_t_10;
      } else {
        __pyx_t_11 = __pyx_t_9;
      }
      if (__pyx_t_11) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":823
 *                         consistent_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]
 *                 elif vc1i1 >= cutoff and vc1c2 >= cutoff:
 *                     if not condition1_peak_content:             # <<<<<<<<<<<<<<
 *                         condition1_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ),  ]
 *                     if pre_p - condition1_peak_content[ -1 ][ 1 ] <= max_gap:
 */
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_condition1_peak_content); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_9 = (!__pyx_t_11);
        if (__pyx_t_9) {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":824
 *                 elif vc1i1 >= cutoff and vc1c2 >= cutoff:
 *                     if not condition1_peak_content:
 *                         condition1_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ),  ]             # <<<<<<<<<<<<<<
 *                     if pre_p - condition1_peak_content[ -1 ][ 1 ] <= max_gap:
 *                         condition1_peak_content.append( ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i )  )
 */
          __pyx_t_17 = PyTuple_New(7); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_INCREF(__pyx_v_pre_p);
          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_pre_p);
          __Pyx_GIVEREF(__pyx_v_pre_p);
          __Pyx_INCREF(__pyx_v_p);
          PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_v_p);
          __Pyx_GIVEREF(__pyx_v_p);
          __Pyx_INCREF(__pyx_v_vc1i1);
          PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_v_vc1i1);
          __Pyx_GIVEREF(__pyx_v_vc1i1);
          __Pyx_INCREF(__pyx_v_vc2i2);
          PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_v_vc2i2);
          __Pyx_GIVEREF(__pyx_v_vc2i2);
          __Pyx_INCREF(__pyx_v_vc1c2);
          PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_v_vc1c2);
          __Pyx_GIVEREF(__pyx_v_vc1c2);
          __Pyx_INCREF(__pyx_v_vc2c1);
          PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_v_vc2c1);
          __Pyx_GIVEREF(__pyx_v_vc2c1);
          __Pyx_INCREF(__pyx_v_i);
          PyTuple_SET_ITEM(__pyx_t_17, 6, __pyx_v_i);
          __Pyx_GIVEREF(__pyx_v_i);
          __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_17));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
          __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_v_condition1_peak_content);
          __pyx_v_condition1_peak_content = ((PyObject *)__pyx_t_2);
          __pyx_t_2 = 0;
          goto __pyx_L16;
        }
        __pyx_L16:;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":825
 *                     if not condition1_peak_content:
 *                         condition1_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ),  ]
 *                     if pre_p - condition1_peak_content[ -1 ][ 1 ] <= max_gap:             # <<<<<<<<<<<<<<
 *                         condition1_peak_content.append( ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i )  )
 *                     else:
 */
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_condition1_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Subtract(__pyx_v_pre_p, __pyx_t_17); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = PyObject_RichCompare(__pyx_t_2, __pyx_v_max_gap, Py_LE); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (__pyx_t_9) {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":826
 *                         condition1_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ),  ]
 *                     if pre_p - condition1_peak_content[ -1 ][ 1 ] <= max_gap:
 *                         condition1_peak_content.append( ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i )  )             # <<<<<<<<<<<<<<
 *                     else:
 *                         # when the gap is not allowed, close this peak
 */
          __pyx_t_17 = PyTuple_New(7); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_INCREF(__pyx_v_pre_p);
          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_pre_p);
          __Pyx_GIVEREF(__pyx_v_pre_p);
          __Pyx_INCREF(__pyx_v_p);
          PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_v_p);
          __Pyx_GIVEREF(__pyx_v_p);
          __Pyx_INCREF(__pyx_v_vc1i1);
          PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_v_vc1i1);
          __Pyx_GIVEREF(__pyx_v_vc1i1);
          __Pyx_INCREF(__pyx_v_vc2i2);
          PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_v_vc2i2);
          __Pyx_GIVEREF(__pyx_v_vc2i2);
          __Pyx_INCREF(__pyx_v_vc1c2);
          PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_v_vc1c2);
          __Pyx_GIVEREF(__pyx_v_vc1c2);
          __Pyx_INCREF(__pyx_v_vc2c1);
          PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_v_vc2c1);
          __Pyx_GIVEREF(__pyx_v_vc2c1);
          __Pyx_INCREF(__pyx_v_i);
          PyTuple_SET_ITEM(__pyx_t_17, 6, __pyx_v_i);
          __Pyx_GIVEREF(__pyx_v_i);
          __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_condition1_peak_content, ((PyObject *)__pyx_t_17)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L17;
        }
        /*else*/ {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":830
 *                         # when the gap is not allowed, close this peak
 *                         # this is condition1 unique region
 *                         peak_length = condition1_peak_content[ -1 ][ 1 ] - condition1_peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *                         if peak_length >= min_length: # if the peak is too small, reject it
 *                             # the absolute of peak score or the diff
 */
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_condition1_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_condition1_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyNumber_Subtract(__pyx_t_17, __pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_v_peak_length);
          __pyx_v_peak_length = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":831
 *                         # this is condition1 unique region
 *                         peak_length = condition1_peak_content[ -1 ][ 1 ] - condition1_peak_content[ 0 ][ 0 ]
 *                         if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *                             # the absolute of peak score or the diff
 *                             # score is the maximum of max[vc1c2,] and
 */
          __pyx_t_2 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_9) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":838
 *                             # '+'. Otherwise, the sign is '-'
 * 
 *                             diff_score = max([x[4] for x in condition1_peak_content ])             # <<<<<<<<<<<<<<
 *                             #m_c2c1 = max([x[5] in condition2_peak_content ])
 *                             #if m_c1c2 >= m_c2c1:
 */
            __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            if (PyList_CheckExact(__pyx_v_condition1_peak_content) || PyTuple_CheckExact(__pyx_v_condition1_peak_content)) {
              __pyx_t_14 = __pyx_v_condition1_peak_content; __Pyx_INCREF(__pyx_t_14); __pyx_t_15 = 0;
              __pyx_t_16 = NULL;
            } else {
              __pyx_t_15 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_condition1_peak_content); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
            }
            for (;;) {
              if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) {
                if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_14)) break;
                __pyx_t_17 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_17); __pyx_t_15++;
              } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) {
                if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
                __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_17); __pyx_t_15++;
              } else {
                __pyx_t_17 = __pyx_t_16(__pyx_t_14);
                if (unlikely(!__pyx_t_17)) {
                  if (PyErr_Occurred()) {
                    if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                    else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_17);
              }
              __Pyx_DECREF(__pyx_v_x);
              __pyx_v_x = __pyx_t_17;
              __pyx_t_17 = 0;
              __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_x, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_17);
              if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_17))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 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 = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_INCREF(((PyObject *)__pyx_t_2));
            PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_2));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
            __pyx_t_2 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_v_diff_score);
            __pyx_v_diff_score = __pyx_t_2;
            __pyx_t_2 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":845
 *                             #    diff_score = -1* m_c2c1
 * 
 *                             condition1_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                                   condition1_peak_content[0][0],
 *                                                   condition1_peak_content[-1][1],
 */
            __pyx_t_2 = PyObject_GetAttr(__pyx_v_condition1_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);

            /* "MACS2/IO/cCompositeScoreTrack.pyx":846
 * 
 *                             condition1_peaks.add( chrom,
 *                                                   condition1_peak_content[0][0],             # <<<<<<<<<<<<<<
 *                                                   condition1_peak_content[-1][1],
 *                                                   summit      = 0,
 */
            __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_condition1_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_14, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":847
 *                             condition1_peaks.add( chrom,
 *                                                   condition1_peak_content[0][0],
 *                                                   condition1_peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                                   summit      = 0,
 *                                                   peak_score  = diff_score,
 */
            __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_condition1_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_14, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __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);
            PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_17);
            __Pyx_GIVEREF(__pyx_t_17);
            PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            __pyx_t_17 = 0;
            __pyx_t_5 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":845
 *                             #    diff_score = -1* m_c2c1
 * 
 *                             condition1_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                                   condition1_peak_content[0][0],
 *                                                   condition1_peak_content[-1][1],
 */
            __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_5));
            if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__summit), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

            /* "MACS2/IO/cCompositeScoreTrack.pyx":849
 *                                                   condition1_peak_content[-1][1],
 *                                                   summit      = 0,
 *                                                   peak_score  = diff_score,             # <<<<<<<<<<<<<<
 *                                                   pileup      = 0,
 *                                                   pscore      = 0,
 */
            if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__peak_score), __pyx_v_diff_score) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_17 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_14), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            goto __pyx_L18;
          }
          __pyx_L18:;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":856
 *                                                   )
 *                         # start a new peak
 *                         condition1_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]             # <<<<<<<<<<<<<<
 *                 elif vc2i2 >= cutoff and vc2c1 >= cutoff:
 *                     if not condition2_peak_content:
 */
          __pyx_t_17 = PyTuple_New(7); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_INCREF(__pyx_v_pre_p);
          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_pre_p);
          __Pyx_GIVEREF(__pyx_v_pre_p);
          __Pyx_INCREF(__pyx_v_p);
          PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_v_p);
          __Pyx_GIVEREF(__pyx_v_p);
          __Pyx_INCREF(__pyx_v_vc1i1);
          PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_v_vc1i1);
          __Pyx_GIVEREF(__pyx_v_vc1i1);
          __Pyx_INCREF(__pyx_v_vc2i2);
          PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_v_vc2i2);
          __Pyx_GIVEREF(__pyx_v_vc2i2);
          __Pyx_INCREF(__pyx_v_vc1c2);
          PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_v_vc1c2);
          __Pyx_GIVEREF(__pyx_v_vc1c2);
          __Pyx_INCREF(__pyx_v_vc2c1);
          PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_v_vc2c1);
          __Pyx_GIVEREF(__pyx_v_vc2c1);
          __Pyx_INCREF(__pyx_v_i);
          PyTuple_SET_ITEM(__pyx_t_17, 6, __pyx_v_i);
          __Pyx_GIVEREF(__pyx_v_i);
          __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_17));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
          __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_v_condition1_peak_content);
          __pyx_v_condition1_peak_content = ((PyObject *)__pyx_t_5);
          __pyx_t_5 = 0;
        }
        __pyx_L17:;
        goto __pyx_L7;
      }

      /* "MACS2/IO/cCompositeScoreTrack.pyx":857
 *                         # start a new peak
 *                         condition1_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]
 *                 elif vc2i2 >= cutoff and vc2c1 >= cutoff:             # <<<<<<<<<<<<<<
 *                     if not condition2_peak_content:
 *                         condition2_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]
 */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_vc2i2, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_9) {
        __pyx_t_5 = PyObject_RichCompare(__pyx_v_vc2c1, __pyx_v_cutoff, Py_GE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_10 = __pyx_t_11;
      } else {
        __pyx_t_10 = __pyx_t_9;
      }
      if (__pyx_t_10) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":858
 *                         condition1_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]
 *                 elif vc2i2 >= cutoff and vc2c1 >= cutoff:
 *                     if not condition2_peak_content:             # <<<<<<<<<<<<<<
 *                         condition2_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]
 *                     if pre_p - condition2_peak_content[ -1 ][ 1 ] <= max_gap:
 */
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_condition2_peak_content); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_9 = (!__pyx_t_10);
        if (__pyx_t_9) {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":859
 *                 elif vc2i2 >= cutoff and vc2c1 >= cutoff:
 *                     if not condition2_peak_content:
 *                         condition2_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]             # <<<<<<<<<<<<<<
 *                     if pre_p - condition2_peak_content[ -1 ][ 1 ] <= max_gap:
 *                         condition2_peak_content.append( ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ) )
 */
          __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_v_pre_p);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pre_p);
          __Pyx_GIVEREF(__pyx_v_pre_p);
          __Pyx_INCREF(__pyx_v_p);
          PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_p);
          __Pyx_GIVEREF(__pyx_v_p);
          __Pyx_INCREF(__pyx_v_vc1i1);
          PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_vc1i1);
          __Pyx_GIVEREF(__pyx_v_vc1i1);
          __Pyx_INCREF(__pyx_v_vc2i2);
          PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_vc2i2);
          __Pyx_GIVEREF(__pyx_v_vc2i2);
          __Pyx_INCREF(__pyx_v_vc1c2);
          PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_vc1c2);
          __Pyx_GIVEREF(__pyx_v_vc1c2);
          __Pyx_INCREF(__pyx_v_vc2c1);
          PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_vc2c1);
          __Pyx_GIVEREF(__pyx_v_vc2c1);
          __Pyx_INCREF(__pyx_v_i);
          PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_i);
          __Pyx_GIVEREF(__pyx_v_i);
          __pyx_t_17 = PyList_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          PyList_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_t_5));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
          __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_v_condition2_peak_content);
          __pyx_v_condition2_peak_content = ((PyObject *)__pyx_t_17);
          __pyx_t_17 = 0;
          goto __pyx_L21;
        }
        __pyx_L21:;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":860
 *                     if not condition2_peak_content:
 *                         condition2_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]
 *                     if pre_p - condition2_peak_content[ -1 ][ 1 ] <= max_gap:             # <<<<<<<<<<<<<<
 *                         condition2_peak_content.append( ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ) )
 *                     else:
 */
        __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_condition2_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_17, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = PyNumber_Subtract(__pyx_v_pre_p, __pyx_t_5); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_17, __pyx_v_max_gap, Py_LE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_9) {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":861
 *                         condition2_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]
 *                     if pre_p - condition2_peak_content[ -1 ][ 1 ] <= max_gap:
 *                         condition2_peak_content.append( ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ) )             # <<<<<<<<<<<<<<
 *                     else:
 *                         # when the gap is not allowed, close this peak
 */
          __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_v_pre_p);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pre_p);
          __Pyx_GIVEREF(__pyx_v_pre_p);
          __Pyx_INCREF(__pyx_v_p);
          PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_p);
          __Pyx_GIVEREF(__pyx_v_p);
          __Pyx_INCREF(__pyx_v_vc1i1);
          PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_vc1i1);
          __Pyx_GIVEREF(__pyx_v_vc1i1);
          __Pyx_INCREF(__pyx_v_vc2i2);
          PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_vc2i2);
          __Pyx_GIVEREF(__pyx_v_vc2i2);
          __Pyx_INCREF(__pyx_v_vc1c2);
          PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_vc1c2);
          __Pyx_GIVEREF(__pyx_v_vc1c2);
          __Pyx_INCREF(__pyx_v_vc2c1);
          PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_vc2c1);
          __Pyx_GIVEREF(__pyx_v_vc2c1);
          __Pyx_INCREF(__pyx_v_i);
          PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_i);
          __Pyx_GIVEREF(__pyx_v_i);
          __pyx_t_17 = __Pyx_PyObject_Append(__pyx_v_condition2_peak_content, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          goto __pyx_L22;
        }
        /*else*/ {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":865
 *                         # when the gap is not allowed, close this peak
 *                         # condition 2 unique peaks
 *                         peak_length = condition2_peak_content[ -1 ][ 1 ] - condition2_peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *                         if peak_length >= min_length: # if the peak is too small, reject it
 *                             diff_score = -1 * max([x[5] for x in condition2_peak_content ])
 */
          __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_condition2_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_17, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_condition2_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_17, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_17 = PyNumber_Subtract(__pyx_t_5, __pyx_t_14); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_v_peak_length);
          __pyx_v_peak_length = __pyx_t_17;
          __pyx_t_17 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":866
 *                         # condition 2 unique peaks
 *                         peak_length = condition2_peak_content[ -1 ][ 1 ] - condition2_peak_content[ 0 ][ 0 ]
 *                         if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *                             diff_score = -1 * max([x[5] for x in condition2_peak_content ])
 *                             condition2_peaks.add( chrom,
 */
          __pyx_t_17 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (__pyx_t_9) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":867
 *                         peak_length = condition2_peak_content[ -1 ][ 1 ] - condition2_peak_content[ 0 ][ 0 ]
 *                         if peak_length >= min_length: # if the peak is too small, reject it
 *                             diff_score = -1 * max([x[5] for x in condition2_peak_content ])             # <<<<<<<<<<<<<<
 *                             condition2_peaks.add( chrom,
 *                                                   condition2_peak_content[0][0],
 */
            __pyx_t_17 = PyList_New(0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            if (PyList_CheckExact(__pyx_v_condition2_peak_content) || PyTuple_CheckExact(__pyx_v_condition2_peak_content)) {
              __pyx_t_14 = __pyx_v_condition2_peak_content; __Pyx_INCREF(__pyx_t_14); __pyx_t_15 = 0;
              __pyx_t_16 = NULL;
            } else {
              __pyx_t_15 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_condition2_peak_content); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
            }
            for (;;) {
              if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) {
                if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_14)) break;
                __pyx_t_5 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_5); __pyx_t_15++;
              } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) {
                if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
                __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_5); __pyx_t_15++;
              } else {
                __pyx_t_5 = __pyx_t_16(__pyx_t_14);
                if (unlikely(!__pyx_t_5)) {
                  if (PyErr_Occurred()) {
                    if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                    else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_5);
              }
              __Pyx_DECREF(__pyx_v_x);
              __pyx_v_x = __pyx_t_5;
              __pyx_t_5 = 0;
              __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_x, 5, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_5);
              if (unlikely(PyList_Append(__pyx_t_17, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_INCREF(((PyObject *)__pyx_t_17));
            PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_17));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
            __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
            __pyx_t_17 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
            __pyx_t_14 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_17); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_XDECREF(__pyx_v_diff_score);
            __pyx_v_diff_score = __pyx_t_14;
            __pyx_t_14 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":868
 *                         if peak_length >= min_length: # if the peak is too small, reject it
 *                             diff_score = -1 * max([x[5] for x in condition2_peak_content ])
 *                             condition2_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                                   condition2_peak_content[0][0],
 *                                                   condition2_peak_content[-1][1],
 */
            __pyx_t_14 = PyObject_GetAttr(__pyx_v_condition2_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);

            /* "MACS2/IO/cCompositeScoreTrack.pyx":869
 *                             diff_score = -1 * max([x[5] for x in condition2_peak_content ])
 *                             condition2_peaks.add( chrom,
 *                                                   condition2_peak_content[0][0],             # <<<<<<<<<<<<<<
 *                                                   condition2_peak_content[-1][1],
 *                                                   summit      = 0,
 */
            __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_condition2_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_17, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":870
 *                             condition2_peaks.add( chrom,
 *                                                   condition2_peak_content[0][0],
 *                                                   condition2_peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                                   summit      = 0,
 *                                                   peak_score  = diff_score,
 */
            __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_condition2_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_17, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_v_chrom);
            PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_chrom);
            __Pyx_GIVEREF(__pyx_v_chrom);
            PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            __pyx_t_5 = 0;
            __pyx_t_2 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":868
 *                         if peak_length >= min_length: # if the peak is too small, reject it
 *                             diff_score = -1 * max([x[5] for x in condition2_peak_content ])
 *                             condition2_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                                   condition2_peak_content[0][0],
 *                                                   condition2_peak_content[-1][1],
 */
            __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __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_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

            /* "MACS2/IO/cCompositeScoreTrack.pyx":872
 *                                                   condition2_peak_content[-1][1],
 *                                                   summit      = 0,
 *                                                   peak_score  = diff_score,             # <<<<<<<<<<<<<<
 *                                                   pileup      = 0,
 *                                                   pscore      = 0,
 */
            if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__peak_score), __pyx_v_diff_score) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __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 = 868; __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 = 868; __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 = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_5 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_17), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            goto __pyx_L23;
          }
          __pyx_L23:;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":879
 *                                                   )
 *                         # start a new peak
 *                         condition2_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]             # <<<<<<<<<<<<<<
 *                 pre_p = p
 * 
 */
          __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_v_pre_p);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pre_p);
          __Pyx_GIVEREF(__pyx_v_pre_p);
          __Pyx_INCREF(__pyx_v_p);
          PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_p);
          __Pyx_GIVEREF(__pyx_v_p);
          __Pyx_INCREF(__pyx_v_vc1i1);
          PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_vc1i1);
          __Pyx_GIVEREF(__pyx_v_vc1i1);
          __Pyx_INCREF(__pyx_v_vc2i2);
          PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_vc2i2);
          __Pyx_GIVEREF(__pyx_v_vc2i2);
          __Pyx_INCREF(__pyx_v_vc1c2);
          PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_vc1c2);
          __Pyx_GIVEREF(__pyx_v_vc1c2);
          __Pyx_INCREF(__pyx_v_vc2c1);
          PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_vc2c1);
          __Pyx_GIVEREF(__pyx_v_vc2c1);
          __Pyx_INCREF(__pyx_v_i);
          PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_i);
          __Pyx_GIVEREF(__pyx_v_i);
          __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_5));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
          __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_v_condition2_peak_content);
          __pyx_v_condition2_peak_content = ((PyObject *)__pyx_t_2);
          __pyx_t_2 = 0;
        }
        __pyx_L22:;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":880
 *                         # start a new peak
 *                         condition2_peak_content = [ ( pre_p, p, vc1i1, vc2i2, vc1c2, vc2c1, i ), ]
 *                 pre_p = p             # <<<<<<<<<<<<<<
 * 
 *             # save the last regions
 */
      __Pyx_INCREF(__pyx_v_p);
      __Pyx_DECREF(__pyx_v_pre_p);
      __pyx_v_pre_p = __pyx_v_p;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":883
 * 
 *             # save the last regions
 *             if consistent_peak_content:             # <<<<<<<<<<<<<<
 *                 peak_length = consistent_peak_content[ -1 ][ 1 ] - consistent_peak_content[ 0 ][ 0 ]
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_consistent_peak_content); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_9) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":884
 *             # save the last regions
 *             if consistent_peak_content:
 *                 peak_length = consistent_peak_content[ -1 ][ 1 ] - consistent_peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 *                     m_c1c2 = max([x[4] for x in consistent_peak_content ])
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_consistent_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_consistent_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_v_peak_length);
      __pyx_v_peak_length = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":885
 *             if consistent_peak_content:
 *                 peak_length = consistent_peak_content[ -1 ][ 1 ] - consistent_peak_content[ 0 ][ 0 ]
 *                 if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *                     m_c1c2 = max([x[4] for x in consistent_peak_content ])
 *                     m_c2c1 = max([x[5] for x in consistent_peak_content ])
 */
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_9) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":886
 *                 peak_length = consistent_peak_content[ -1 ][ 1 ] - consistent_peak_content[ 0 ][ 0 ]
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 *                     m_c1c2 = max([x[4] for x in consistent_peak_content ])             # <<<<<<<<<<<<<<
 *                     m_c2c1 = max([x[5] for x in consistent_peak_content ])
 *                     if m_c1c2 >= m_c2c1:
 */
        __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        if (PyList_CheckExact(__pyx_v_consistent_peak_content) || PyTuple_CheckExact(__pyx_v_consistent_peak_content)) {
          __pyx_t_5 = __pyx_v_consistent_peak_content; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
          __pyx_t_8 = NULL;
        } else {
          __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_consistent_peak_content); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
        }
        for (;;) {
          if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_5)) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
          } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_5)) {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
          } else {
            __pyx_t_2 = __pyx_t_8(__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 = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_v_x);
          __pyx_v_x = __pyx_t_2;
          __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          if (unlikely(PyList_Append(__pyx_t_6, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(((PyObject *)__pyx_t_6));
        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_v_m_c1c2);
        __pyx_v_m_c1c2 = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":887
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 *                     m_c1c2 = max([x[4] for x in consistent_peak_content ])
 *                     m_c2c1 = max([x[5] for x in consistent_peak_content ])             # <<<<<<<<<<<<<<
 *                     if m_c1c2 >= m_c2c1:
 *                         diff_score = m_c1c2
 */
        __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        if (PyList_CheckExact(__pyx_v_consistent_peak_content) || PyTuple_CheckExact(__pyx_v_consistent_peak_content)) {
          __pyx_t_5 = __pyx_v_consistent_peak_content; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
          __pyx_t_8 = NULL;
        } else {
          __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_consistent_peak_content); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
        }
        for (;;) {
          if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_5)) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
          } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_5)) {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
          } else {
            __pyx_t_2 = __pyx_t_8(__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 = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_v_x);
          __pyx_v_x = __pyx_t_2;
          __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 5, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          if (unlikely(PyList_Append(__pyx_t_6, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(((PyObject *)__pyx_t_6));
        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_v_m_c2c1);
        __pyx_v_m_c2c1 = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":888
 *                     m_c1c2 = max([x[4] for x in consistent_peak_content ])
 *                     m_c2c1 = max([x[5] for x in consistent_peak_content ])
 *                     if m_c1c2 >= m_c2c1:             # <<<<<<<<<<<<<<
 *                         diff_score = m_c1c2
 *                     else:
 */
        __pyx_t_6 = PyObject_RichCompare(__pyx_v_m_c1c2, __pyx_v_m_c2c1, Py_GE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_9) {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":889
 *                     m_c2c1 = max([x[5] for x in consistent_peak_content ])
 *                     if m_c1c2 >= m_c2c1:
 *                         diff_score = m_c1c2             # <<<<<<<<<<<<<<
 *                     else:
 *                         diff_score = -1* m_c2c1
 */
          __Pyx_INCREF(__pyx_v_m_c1c2);
          __Pyx_XDECREF(__pyx_v_diff_score);
          __pyx_v_diff_score = __pyx_v_m_c1c2;
          goto __pyx_L32;
        }
        /*else*/ {

          /* "MACS2/IO/cCompositeScoreTrack.pyx":891
 *                         diff_score = m_c1c2
 *                     else:
 *                         diff_score = -1* m_c2c1             # <<<<<<<<<<<<<<
 *                     consistent_peaks.add( chrom,
 *                                           consistent_peak_content[0][0],
 */
          __pyx_t_6 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_v_m_c2c1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_XDECREF(__pyx_v_diff_score);
          __pyx_v_diff_score = __pyx_t_6;
          __pyx_t_6 = 0;
        }
        __pyx_L32:;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":892
 *                     else:
 *                         diff_score = -1* m_c2c1
 *                     consistent_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                           consistent_peak_content[0][0],
 *                                           consistent_peak_content[-1][1],
 */
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_consistent_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);

        /* "MACS2/IO/cCompositeScoreTrack.pyx":893
 *                         diff_score = -1* m_c2c1
 *                     consistent_peaks.add( chrom,
 *                                           consistent_peak_content[0][0],             # <<<<<<<<<<<<<<
 *                                           consistent_peak_content[-1][1],
 *                                           summit      = 0,
 */
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_consistent_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":894
 *                     consistent_peaks.add( chrom,
 *                                           consistent_peak_content[0][0],
 *                                           consistent_peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                           summit      = 0,
 *                                           peak_score  = diff_score,
 */
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_consistent_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_chrom);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
        __Pyx_GIVEREF(__pyx_v_chrom);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_17);
        __Pyx_GIVEREF(__pyx_t_17);
        __pyx_t_2 = 0;
        __pyx_t_17 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":892
 *                     else:
 *                         diff_score = -1* m_c2c1
 *                     consistent_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                           consistent_peak_content[0][0],
 *                                           consistent_peak_content[-1][1],
 */
        __pyx_t_17 = PyDict_New(); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_17));
        if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__summit), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "MACS2/IO/cCompositeScoreTrack.pyx":896
 *                                           consistent_peak_content[-1][1],
 *                                           summit      = 0,
 *                                           peak_score  = diff_score,             # <<<<<<<<<<<<<<
 *                                           pileup      = 0,
 *                                           pscore      = 0,
 */
        if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__peak_score), __pyx_v_diff_score) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_17)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L27;
      }
      __pyx_L27:;
      goto __pyx_L26;
    }

    /* "MACS2/IO/cCompositeScoreTrack.pyx":902
 *                                           qscore      = 0,
 *                                           )
 *             elif condition1_peak_content:             # <<<<<<<<<<<<<<
 *                 peak_length = condition1_peak_content[ -1 ][ 1 ] - condition1_peak_content[ 0 ][ 0 ]
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_condition1_peak_content); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_9) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":903
 *                                           )
 *             elif condition1_peak_content:
 *                 peak_length = condition1_peak_content[ -1 ][ 1 ] - condition1_peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 *                     diff_score = max([x[4] for x in condition1_peak_content ])
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_condition1_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_condition1_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Subtract(__pyx_t_17, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_v_peak_length);
      __pyx_v_peak_length = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":904
 *             elif condition1_peak_content:
 *                 peak_length = condition1_peak_content[ -1 ][ 1 ] - condition1_peak_content[ 0 ][ 0 ]
 *                 if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *                     diff_score = max([x[4] for x in condition1_peak_content ])
 *                     condition1_peaks.add( chrom,
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_9) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":905
 *                 peak_length = condition1_peak_content[ -1 ][ 1 ] - condition1_peak_content[ 0 ][ 0 ]
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 *                     diff_score = max([x[4] for x in condition1_peak_content ])             # <<<<<<<<<<<<<<
 *                     condition1_peaks.add( chrom,
 *                                           condition1_peak_content[0][0],
 */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        if (PyList_CheckExact(__pyx_v_condition1_peak_content) || PyTuple_CheckExact(__pyx_v_condition1_peak_content)) {
          __pyx_t_5 = __pyx_v_condition1_peak_content; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
          __pyx_t_8 = NULL;
        } else {
          __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_condition1_peak_content); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
        }
        for (;;) {
          if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_5)) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
            __pyx_t_17 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_17); __pyx_t_7++;
          } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_5)) {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_17); __pyx_t_7++;
          } else {
            __pyx_t_17 = __pyx_t_8(__pyx_t_5);
            if (unlikely(!__pyx_t_17)) {
              if (PyErr_Occurred()) {
                if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_17);
          }
          __Pyx_DECREF(__pyx_v_x);
          __pyx_v_x = __pyx_t_17;
          __pyx_t_17 = 0;
          __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_x, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_17))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(((PyObject *)__pyx_t_2));
        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_v_diff_score);
        __pyx_v_diff_score = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":906
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 *                     diff_score = max([x[4] for x in condition1_peak_content ])
 *                     condition1_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                           condition1_peak_content[0][0],
 *                                           condition1_peak_content[-1][1],
 */
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_condition1_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);

        /* "MACS2/IO/cCompositeScoreTrack.pyx":907
 *                     diff_score = max([x[4] for x in condition1_peak_content ])
 *                     condition1_peaks.add( chrom,
 *                                           condition1_peak_content[0][0],             # <<<<<<<<<<<<<<
 *                                           condition1_peak_content[-1][1],
 *                                           summit      = 0,
 */
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_condition1_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":908
 *                     condition1_peaks.add( chrom,
 *                                           condition1_peak_content[0][0],
 *                                           condition1_peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                           summit      = 0,
 *                                           peak_score  = diff_score,
 */
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_condition1_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_chrom);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
        __Pyx_GIVEREF(__pyx_v_chrom);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_17);
        __Pyx_GIVEREF(__pyx_t_17);
        PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_17 = 0;
        __pyx_t_6 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":906
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 *                     diff_score = max([x[4] for x in condition1_peak_content ])
 *                     condition1_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                           condition1_peak_content[0][0],
 *                                           condition1_peak_content[-1][1],
 */
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__summit), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "MACS2/IO/cCompositeScoreTrack.pyx":910
 *                                           condition1_peak_content[-1][1],
 *                                           summit      = 0,
 *                                           peak_score  = diff_score,             # <<<<<<<<<<<<<<
 *                                           pileup      = 0,
 *                                           pscore      = 0,
 */
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__peak_score), __pyx_v_diff_score) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__pileup), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__pscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__fold_change), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_17 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_17); __pyx_t_17 = 0;
        goto __pyx_L33;
      }
      __pyx_L33:;
      goto __pyx_L26;
    }

    /* "MACS2/IO/cCompositeScoreTrack.pyx":916
 *                                           qscore      = 0,
 *                                           )
 *             elif condition2_peak_content:             # <<<<<<<<<<<<<<
 *                 peak_length = condition2_peak_content[ -1 ][ 1 ] - condition2_peak_content[ 0 ][ 0 ]
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_condition2_peak_content); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_9) {

      /* "MACS2/IO/cCompositeScoreTrack.pyx":917
 *                                           )
 *             elif condition2_peak_content:
 *                 peak_length = condition2_peak_content[ -1 ][ 1 ] - condition2_peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 *                     diff_score = -1 * max([x[5] for x in condition2_peak_content ])
 */
      __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_condition2_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_17, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_condition2_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_17, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = PyNumber_Subtract(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_v_peak_length);
      __pyx_v_peak_length = __pyx_t_17;
      __pyx_t_17 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":918
 *             elif condition2_peak_content:
 *                 peak_length = condition2_peak_content[ -1 ][ 1 ] - condition2_peak_content[ 0 ][ 0 ]
 *                 if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
 *                     diff_score = -1 * max([x[5] for x in condition2_peak_content ])
 *                     condition2_peaks.add( chrom,
 */
      __pyx_t_17 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_v_min_length, Py_GE); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      if (__pyx_t_9) {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":919
 *                 peak_length = condition2_peak_content[ -1 ][ 1 ] - condition2_peak_content[ 0 ][ 0 ]
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 *                     diff_score = -1 * max([x[5] for x in condition2_peak_content ])             # <<<<<<<<<<<<<<
 *                     condition2_peaks.add( chrom,
 *                                           condition2_peak_content[0][0],
 */
        __pyx_t_17 = PyList_New(0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        if (PyList_CheckExact(__pyx_v_condition2_peak_content) || PyTuple_CheckExact(__pyx_v_condition2_peak_content)) {
          __pyx_t_5 = __pyx_v_condition2_peak_content; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
          __pyx_t_8 = NULL;
        } else {
          __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_condition2_peak_content); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
        }
        for (;;) {
          if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_5)) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++;
          } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_5)) {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++;
          } else {
            __pyx_t_6 = __pyx_t_8(__pyx_t_5);
            if (unlikely(!__pyx_t_6)) {
              if (PyErr_Occurred()) {
                if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_v_x);
          __pyx_v_x = __pyx_t_6;
          __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_x, 5, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          if (unlikely(PyList_Append(__pyx_t_17, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(((PyObject *)__pyx_t_17));
        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_17));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
        __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
        __pyx_t_17 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_17); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_v_diff_score);
        __pyx_v_diff_score = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":920
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 *                     diff_score = -1 * max([x[5] for x in condition2_peak_content ])
 *                     condition2_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                           condition2_peak_content[0][0],
 *                                           condition2_peak_content[-1][1],
 */
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_condition2_peaks, __pyx_n_s__add); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);

        /* "MACS2/IO/cCompositeScoreTrack.pyx":921
 *                     diff_score = -1 * max([x[5] for x in condition2_peak_content ])
 *                     condition2_peaks.add( chrom,
 *                                           condition2_peak_content[0][0],             # <<<<<<<<<<<<<<
 *                                           condition2_peak_content[-1][1],
 *                                           summit      = 0,
 */
        __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_condition2_peak_content, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_17, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":922
 *                     condition2_peaks.add( chrom,
 *                                           condition2_peak_content[0][0],
 *                                           condition2_peak_content[-1][1],             # <<<<<<<<<<<<<<
 *                                           summit      = 0,
 *                                           peak_score  = 0,
 */
        __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_condition2_peak_content, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_17, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_INCREF(__pyx_v_chrom);
        PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_chrom);
        __Pyx_GIVEREF(__pyx_v_chrom);
        PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_6 = 0;
        __pyx_t_2 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":920
 *                 if peak_length >= min_length: # if the peak is too small, reject it
 *                     diff_score = -1 * max([x[5] for x in condition2_peak_content ])
 *                     condition2_peaks.add( chrom,             # <<<<<<<<<<<<<<
 *                                           condition2_peak_content[0][0],
 *                                           condition2_peak_content[-1][1],
 */
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __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_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __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 = 920; __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 = 920; __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 = 920; __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 = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__qscore), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_17), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L36;
      }
      __pyx_L36:;
      goto __pyx_L26;
    }
    __pyx_L26:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":931
 *                                           )
 * 
 *         return ( consistent_peaks, condition1_peaks, condition2_peaks )             # <<<<<<<<<<<<<<
 * 
 *     def total ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_consistent_peaks);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_consistent_peaks);
  __Pyx_GIVEREF(__pyx_v_consistent_peaks);
  __Pyx_INCREF(__pyx_v_condition1_peaks);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_condition1_peaks);
  __Pyx_GIVEREF(__pyx_v_condition1_peaks);
  __Pyx_INCREF(__pyx_v_condition2_peaks);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_condition2_peaks);
  __Pyx_GIVEREF(__pyx_v_condition2_peaks);
  __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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.call_diff_regions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrs);
  __Pyx_XDECREF(__pyx_v_consistent_peaks);
  __Pyx_XDECREF(__pyx_v_condition1_peaks);
  __Pyx_XDECREF(__pyx_v_condition2_peaks);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_chrom_pointer);
  __Pyx_XDECREF(__pyx_v_chrom_d);
  __Pyx_XDECREF(__pyx_v_chrom_pos);
  __Pyx_XDECREF(__pyx_v_chrom_sc1i1);
  __Pyx_XDECREF(__pyx_v_chrom_sc2i2);
  __Pyx_XDECREF(__pyx_v_chrom_sc1c2);
  __Pyx_XDECREF(__pyx_v_chrom_sc2c1);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_pre_p);
  __Pyx_XDECREF(__pyx_v_consistent_peak_content);
  __Pyx_XDECREF(__pyx_v_condition1_peak_content);
  __Pyx_XDECREF(__pyx_v_condition2_peak_content);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_vc1i1);
  __Pyx_XDECREF(__pyx_v_vc2i2);
  __Pyx_XDECREF(__pyx_v_vc1c2);
  __Pyx_XDECREF(__pyx_v_vc2c1);
  __Pyx_XDECREF(__pyx_v_peak_length);
  __Pyx_XDECREF(__pyx_v_m_c1c2);
  __Pyx_XDECREF(__pyx_v_m_c2c1);
  __Pyx_XDECREF(__pyx_v_diff_score);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* "MACS2/IO/cCompositeScoreTrack.pyx":933
 *         return ( consistent_peaks, condition1_peaks, condition2_peaks )
 * 
 *     def total ( self ):             # <<<<<<<<<<<<<<
 *         """Return the number of regions in this object.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_18total(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_t = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("total", 0);
  __Pyx_TraceCall("total", __pyx_f[0], 933);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":937
 * 
 *         """
 *         t = 0             # <<<<<<<<<<<<<<
 *         for chrom in self.data.keys():
 *             t += self.pointer[chrom]
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_t = __pyx_int_0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":938
 *         """
 *         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 = 938; __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 = 938; __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 = 938; __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 = 938; __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;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } 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 = 938; __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/cCompositeScoreTrack.pyx":939
 *         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__pointer); 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_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_chrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __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_InPlaceAdd(__pyx_v_t, __pyx_t_5); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_t);
    __pyx_v_t = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":940
 *         for chrom in self.data.keys():
 *             t += self.pointer[chrom]
 *         return t             # <<<<<<<<<<<<<<
 * 
 *     #def dump ( self ):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  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_AddTraceback("MACS2.IO.cCompositeScoreTrack.compositeScoreTrackI.total", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_1make_compositeScoreTrack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_make_compositeScoreTrack[] = "A modified overlie function for MACS DIFF.\n    \n    ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_1make_compositeScoreTrack = {__Pyx_NAMESTR("make_compositeScoreTrack"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_1make_compositeScoreTrack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_make_compositeScoreTrack)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_1make_compositeScoreTrack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bdgTrack1 = 0;
  PyObject *__pyx_v_bdgTrack2 = 0;
  PyObject *__pyx_v_bdgTrack3 = 0;
  PyObject *__pyx_v_bdgTrack4 = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__bdgTrack1,&__pyx_n_s__bdgTrack2,&__pyx_n_s__bdgTrack3,&__pyx_n_s__bdgTrack4,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_compositeScoreTrack (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bdgTrack1);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bdgTrack2);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("make_compositeScoreTrack", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bdgTrack3);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("make_compositeScoreTrack", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bdgTrack4);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("make_compositeScoreTrack", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "make_compositeScoreTrack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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_bdgTrack1 = values[0];
    __pyx_v_bdgTrack2 = values[1];
    __pyx_v_bdgTrack3 = values[2];
    __pyx_v_bdgTrack4 = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_compositeScoreTrack", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.make_compositeScoreTrack", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_make_compositeScoreTrack(__pyx_self, __pyx_v_bdgTrack1, __pyx_v_bdgTrack2, __pyx_v_bdgTrack3, __pyx_v_bdgTrack4);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":946
 *     #
 * 
 * def make_compositeScoreTrack (bdgTrack1, bdgTrack2, bdgTrack3, bdgTrack4 ):             # <<<<<<<<<<<<<<
 *     """A modified overlie function for MACS DIFF.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_make_compositeScoreTrack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bdgTrack1, PyObject *__pyx_v_bdgTrack2, PyObject *__pyx_v_bdgTrack3, PyObject *__pyx_v_bdgTrack4) {
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_retadd = NULL;
  PyObject *__pyx_v_chr1 = NULL;
  PyObject *__pyx_v_chr2 = NULL;
  PyObject *__pyx_v_chr3 = NULL;
  PyObject *__pyx_v_chr4 = NULL;
  PyObject *__pyx_v_common_chr = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_p1s = NULL;
  PyObject *__pyx_v_v1s = NULL;
  PyObject *__pyx_v_p1n = NULL;
  PyObject *__pyx_v_v1n = NULL;
  PyObject *__pyx_v_p2s = NULL;
  PyObject *__pyx_v_v2s = NULL;
  PyObject *__pyx_v_p2n = NULL;
  PyObject *__pyx_v_v2n = NULL;
  PyObject *__pyx_v_p3s = NULL;
  PyObject *__pyx_v_v3s = NULL;
  PyObject *__pyx_v_p3n = NULL;
  PyObject *__pyx_v_v3n = NULL;
  PyObject *__pyx_v_p4s = NULL;
  PyObject *__pyx_v_v4s = NULL;
  PyObject *__pyx_v_p4n = NULL;
  PyObject *__pyx_v_v4n = NULL;
  PyObject *__pyx_v_chrom_max_len = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_pre_p = NULL;
  PyObject *__pyx_v_p1 = NULL;
  PyObject *__pyx_v_v1 = NULL;
  PyObject *__pyx_v_p2 = NULL;
  PyObject *__pyx_v_v2 = NULL;
  PyObject *__pyx_v_p3 = NULL;
  PyObject *__pyx_v_v3 = NULL;
  PyObject *__pyx_v_p4 = NULL;
  PyObject *__pyx_v_v4 = NULL;
  PyObject *__pyx_v_min_p = 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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("make_compositeScoreTrack", 0);
  __Pyx_TraceCall("make_compositeScoreTrack", __pyx_f[0], 946);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":950
 * 
 *     """
 *     assert isinstance(bdgTrack1,bedGraphTrackI), "bdgTrack1 is not a bedGraphTrackI object"             # <<<<<<<<<<<<<<
 *     assert isinstance(bdgTrack2,bedGraphTrackI), "bdgTrack2 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack3,bedGraphTrackI), "bdgTrack3 is not a bedGraphTrackI object"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__bedGraphTrackI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_bdgTrack1, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_28));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cCompositeScoreTrack.pyx":951
 *     """
 *     assert isinstance(bdgTrack1,bedGraphTrackI), "bdgTrack1 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack2,bedGraphTrackI), "bdgTrack2 is not a bedGraphTrackI object"             # <<<<<<<<<<<<<<
 *     assert isinstance(bdgTrack3,bedGraphTrackI), "bdgTrack3 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack4,bedGraphTrackI), "bdgTrack4 is not a bedGraphTrackI object"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__bedGraphTrackI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_bdgTrack2, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_29));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cCompositeScoreTrack.pyx":952
 *     assert isinstance(bdgTrack1,bedGraphTrackI), "bdgTrack1 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack2,bedGraphTrackI), "bdgTrack2 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack3,bedGraphTrackI), "bdgTrack3 is not a bedGraphTrackI object"             # <<<<<<<<<<<<<<
 *     assert isinstance(bdgTrack4,bedGraphTrackI), "bdgTrack4 is not a bedGraphTrackI object"
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__bedGraphTrackI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_bdgTrack3, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_30));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cCompositeScoreTrack.pyx":953
 *     assert isinstance(bdgTrack2,bedGraphTrackI), "bdgTrack2 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack3,bedGraphTrackI), "bdgTrack3 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack4,bedGraphTrackI), "bdgTrack4 is not a bedGraphTrackI object"             # <<<<<<<<<<<<<<
 * 
 *     ret = compositeScoreTrackI()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__bedGraphTrackI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_bdgTrack4, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_31));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cCompositeScoreTrack.pyx":955
 *     assert isinstance(bdgTrack4,bedGraphTrackI), "bdgTrack4 is not a bedGraphTrackI object"
 * 
 *     ret = compositeScoreTrackI()             # <<<<<<<<<<<<<<
 *     retadd = ret.add
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __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 = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":956
 * 
 *     ret = compositeScoreTrackI()
 *     retadd = ret.add             # <<<<<<<<<<<<<<
 * 
 *     chr1 = set(bdgTrack1.get_chr_names())
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_ret, __pyx_n_s__add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_retadd = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":958
 *     retadd = ret.add
 * 
 *     chr1 = set(bdgTrack1.get_chr_names())             # <<<<<<<<<<<<<<
 *     chr2 = set(bdgTrack2.get_chr_names())
 *     chr3 = set(bdgTrack3.get_chr_names())
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_bdgTrack1, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __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 = 958; __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 = 958; __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*)(&PySet_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_chr1 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":959
 * 
 *     chr1 = set(bdgTrack1.get_chr_names())
 *     chr2 = set(bdgTrack2.get_chr_names())             # <<<<<<<<<<<<<<
 *     chr3 = set(bdgTrack3.get_chr_names())
 *     chr4 = set(bdgTrack4.get_chr_names())
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_bdgTrack2, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __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 = 959; __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 = 959; __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*)(&PySet_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_chr2 = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":960
 *     chr1 = set(bdgTrack1.get_chr_names())
 *     chr2 = set(bdgTrack2.get_chr_names())
 *     chr3 = set(bdgTrack3.get_chr_names())             # <<<<<<<<<<<<<<
 *     chr4 = set(bdgTrack4.get_chr_names())
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_bdgTrack3, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __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 = 960; __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 = 960; __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*)(&PySet_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_chr3 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":961
 *     chr2 = set(bdgTrack2.get_chr_names())
 *     chr3 = set(bdgTrack3.get_chr_names())
 *     chr4 = set(bdgTrack4.get_chr_names())             # <<<<<<<<<<<<<<
 * 
 *     common_chr = chr1.intersection(chr2).intersection(chr3).intersection(chr4)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_bdgTrack4, __pyx_n_s__get_chr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __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 = 961; __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 = 961; __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*)(&PySet_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_chr4 = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":963
 *     chr4 = set(bdgTrack4.get_chr_names())
 * 
 *     common_chr = chr1.intersection(chr2).intersection(chr3).intersection(chr4)             # <<<<<<<<<<<<<<
 *     for chrom in common_chr:
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_chr1), __pyx_n_s__intersection); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __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 = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_chr2));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_chr2));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chr2));
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__intersection); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __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 = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_chr3));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_chr3));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chr3));
  __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 = 963; __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_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__intersection); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_chr4));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_chr4));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chr4));
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __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_3)); __pyx_t_3 = 0;
  __pyx_v_common_chr = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":964
 * 
 *     common_chr = chr1.intersection(chr2).intersection(chr3).intersection(chr4)
 *     for chrom in common_chr:             # <<<<<<<<<<<<<<
 * 
 *         (p1s,v1s) = bdgTrack1.get_data_by_chr(chrom) # arrays for position and values
 */
  if (PyList_CheckExact(__pyx_v_common_chr) || PyTuple_CheckExact(__pyx_v_common_chr)) {
    __pyx_t_1 = __pyx_v_common_chr; __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_common_chr); 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);
    __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;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
    } else {
      __pyx_t_3 = __pyx_t_6(__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 = 964; __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/cCompositeScoreTrack.pyx":966
 *     for chrom in common_chr:
 * 
 *         (p1s,v1s) = bdgTrack1.get_data_by_chr(chrom) # arrays for position and values             # <<<<<<<<<<<<<<
 *         p1n = iter(p1s).next         # assign the next function to a viable to speed up
 *         v1n = iter(v1s).next
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_bdgTrack1, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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 = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
      PyObject* sequence = __pyx_t_7;
      if (likely(PyTuple_CheckExact(sequence))) {
        if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
          if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
          if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
      if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_p1s);
    __pyx_v_p1s = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_v1s);
    __pyx_v_v1s = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":967
 * 
 *         (p1s,v1s) = bdgTrack1.get_data_by_chr(chrom) # arrays for position and values
 *         p1n = iter(p1s).next         # assign the next function to a viable to speed up             # <<<<<<<<<<<<<<
 *         v1n = iter(v1s).next
 * 
 */
    __pyx_t_7 = PyObject_GetIter(__pyx_v_p1s); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__next); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_p1n);
    __pyx_v_p1n = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":968
 *         (p1s,v1s) = bdgTrack1.get_data_by_chr(chrom) # arrays for position and values
 *         p1n = iter(p1s).next         # assign the next function to a viable to speed up
 *         v1n = iter(v1s).next             # <<<<<<<<<<<<<<
 * 
 *         (p2s,v2s) = bdgTrack2.get_data_by_chr(chrom) # arrays for position and values
 */
    __pyx_t_3 = PyObject_GetIter(__pyx_v_v1s); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__next); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_v1n);
    __pyx_v_v1n = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":970
 *         v1n = iter(v1s).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_7 = PyObject_GetAttr(__pyx_v_bdgTrack2, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      if (likely(PyTuple_CheckExact(sequence))) {
        if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
          if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
          if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
      if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_p2s);
    __pyx_v_p2s = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_v2s);
    __pyx_v_v2s = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":971
 * 
 *         (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_GetIter(__pyx_v_p2s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__next); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_p2n);
    __pyx_v_p2n = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":972
 *         (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             # <<<<<<<<<<<<<<
 * 
 *         (p3s,v3s) = bdgTrack3.get_data_by_chr(chrom) # arrays for position and values
 */
    __pyx_t_7 = PyObject_GetIter(__pyx_v_v2s); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __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_v2n);
    __pyx_v_v2n = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":974
 *         v2n = iter(v2s).next
 * 
 *         (p3s,v3s) = bdgTrack3.get_data_by_chr(chrom) # arrays for position and values             # <<<<<<<<<<<<<<
 *         p3n = iter(p3s).next         # assign the next function to a viable to speed up
 *         v3n = iter(v3s).next
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_bdgTrack3, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __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 = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __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_7)); __pyx_t_7 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      if (likely(PyTuple_CheckExact(sequence))) {
        if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
          if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
          if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __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);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
      if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L10_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_p3s);
    __pyx_v_p3s = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_v3s);
    __pyx_v_v3s = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":975
 * 
 *         (p3s,v3s) = bdgTrack3.get_data_by_chr(chrom) # arrays for position and values
 *         p3n = iter(p3s).next         # assign the next function to a viable to speed up             # <<<<<<<<<<<<<<
 *         v3n = iter(v3s).next
 * 
 */
    __pyx_t_3 = PyObject_GetIter(__pyx_v_p3s); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __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_p3n);
    __pyx_v_p3n = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":976
 *         (p3s,v3s) = bdgTrack3.get_data_by_chr(chrom) # arrays for position and values
 *         p3n = iter(p3s).next         # assign the next function to a viable to speed up
 *         v3n = iter(v3s).next             # <<<<<<<<<<<<<<
 * 
 *         (p4s,v4s) = bdgTrack4.get_data_by_chr(chrom) # arrays for position and values
 */
    __pyx_t_4 = PyObject_GetIter(__pyx_v_v3s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__next); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_v3n);
    __pyx_v_v3n = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":978
 *         v3n = iter(v3s).next
 * 
 *         (p4s,v4s) = bdgTrack4.get_data_by_chr(chrom) # arrays for position and values             # <<<<<<<<<<<<<<
 *         p4n = iter(p4s).next         # assign the next function to a viable to speed up
 *         v4n = iter(v4s).next
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_bdgTrack4, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __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 = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
      PyObject* sequence = __pyx_t_7;
      if (likely(PyTuple_CheckExact(sequence))) {
        if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
          if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
          if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L12_unpacking_done;
      __pyx_L11_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
      if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L12_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_p4s);
    __pyx_v_p4s = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_v4s);
    __pyx_v_v4s = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":979
 * 
 *         (p4s,v4s) = bdgTrack4.get_data_by_chr(chrom) # arrays for position and values
 *         p4n = iter(p4s).next         # assign the next function to a viable to speed up             # <<<<<<<<<<<<<<
 *         v4n = iter(v4s).next
 * 
 */
    __pyx_t_7 = PyObject_GetIter(__pyx_v_p4s); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__next); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_p4n);
    __pyx_v_p4n = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":980
 *         (p4s,v4s) = bdgTrack4.get_data_by_chr(chrom) # arrays for position and values
 *         p4n = iter(p4s).next         # assign the next function to a viable to speed up
 *         v4n = iter(v4s).next             # <<<<<<<<<<<<<<
 * 
 *         chrom_max_len = len(p1s)+len(p2s)+len(p3s)+len(p4s) # this is the maximum number of locations needed to be recorded in scoreTrackI for this chromosome.
 */
    __pyx_t_3 = PyObject_GetIter(__pyx_v_v4s); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__next); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_v4n);
    __pyx_v_v4n = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":982
 *         v4n = iter(v4s).next
 * 
 *         chrom_max_len = len(p1s)+len(p2s)+len(p3s)+len(p4s) # this is the maximum number of locations needed to be recorded in scoreTrackI for this chromosome.             # <<<<<<<<<<<<<<
 * 
 *         ret.add_chromosome(chrom,chrom_max_len)
 */
    __pyx_t_10 = PyObject_Length(__pyx_v_p1s); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = PyObject_Length(__pyx_v_p2s); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = PyObject_Length(__pyx_v_p3s); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = PyObject_Length(__pyx_v_p4s); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = PyInt_FromSsize_t((((__pyx_t_10 + __pyx_t_11) + __pyx_t_12) + __pyx_t_13)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_v_chrom_max_len);
    __pyx_v_chrom_max_len = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":984
 *         chrom_max_len = len(p1s)+len(p2s)+len(p3s)+len(p4s) # this is the maximum number of locations needed to be recorded in scoreTrackI for this chromosome.
 * 
 *         ret.add_chromosome(chrom,chrom_max_len)             # <<<<<<<<<<<<<<
 * 
 *         pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret
 */
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_ret, __pyx_n_s__add_chromosome); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __Pyx_INCREF(__pyx_v_chrom_max_len);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_chrom_max_len);
    __Pyx_GIVEREF(__pyx_v_chrom_max_len);
    __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":986
 *         ret.add_chromosome(chrom,chrom_max_len)
 * 
 *         pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_pre_p);
    __pyx_v_pre_p = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":988
 *         pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             p1 = p1n()
 *             v1 = v1n()
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      /*try:*/ {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":989
 * 
 *         try:
 *             p1 = p1n()             # <<<<<<<<<<<<<<
 *             v1 = v1n()
 * 
 */
        __pyx_t_4 = PyObject_Call(__pyx_v_p1n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF(__pyx_v_p1);
        __pyx_v_p1 = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":990
 *         try:
 *             p1 = p1n()
 *             v1 = v1n()             # <<<<<<<<<<<<<<
 * 
 *             p2 = p2n()
 */
        __pyx_t_4 = PyObject_Call(__pyx_v_v1n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF(__pyx_v_v1);
        __pyx_v_v1 = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":992
 *             v1 = v1n()
 * 
 *             p2 = p2n()             # <<<<<<<<<<<<<<
 *             v2 = v2n()
 * 
 */
        __pyx_t_4 = PyObject_Call(__pyx_v_p2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF(__pyx_v_p2);
        __pyx_v_p2 = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":993
 * 
 *             p2 = p2n()
 *             v2 = v2n()             # <<<<<<<<<<<<<<
 * 
 *             p3 = p3n()
 */
        __pyx_t_4 = PyObject_Call(__pyx_v_v2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF(__pyx_v_v2);
        __pyx_v_v2 = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":995
 *             v2 = v2n()
 * 
 *             p3 = p3n()             # <<<<<<<<<<<<<<
 *             v3 = v3n()
 * 
 */
        __pyx_t_4 = PyObject_Call(__pyx_v_p3n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF(__pyx_v_p3);
        __pyx_v_p3 = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":996
 * 
 *             p3 = p3n()
 *             v3 = v3n()             # <<<<<<<<<<<<<<
 * 
 *             p4 = p4n()
 */
        __pyx_t_4 = PyObject_Call(__pyx_v_v3n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF(__pyx_v_v3);
        __pyx_v_v3 = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":998
 *             v3 = v3n()
 * 
 *             p4 = p4n()             # <<<<<<<<<<<<<<
 *             v4 = v4n()
 * 
 */
        __pyx_t_4 = PyObject_Call(__pyx_v_p4n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF(__pyx_v_p4);
        __pyx_v_p4 = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":999
 * 
 *             p4 = p4n()
 *             v4 = v4n()             # <<<<<<<<<<<<<<
 * 
 *             while True:
 */
        __pyx_t_4 = PyObject_Call(__pyx_v_v4n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF(__pyx_v_v4);
        __pyx_v_v4 = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":1001
 *             v4 = v4n()
 * 
 *             while True:             # <<<<<<<<<<<<<<
 *                 min_p = min( p1, p2, p3, p4 )
 *                 retadd( chrom, min_p, v1, v2, v3, v4 )
 */
        while (1) {
          if (!1) break;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1002
 * 
 *             while True:
 *                 min_p = min( p1, p2, p3, p4 )             # <<<<<<<<<<<<<<
 *                 retadd( chrom, min_p, v1, v2, v3, v4 )
 *                 pre_p = min_p
 */
          __Pyx_INCREF(__pyx_v_p2);
          __pyx_t_4 = __pyx_v_p2;
          __Pyx_INCREF(__pyx_v_p3);
          __pyx_t_3 = __pyx_v_p3;
          __Pyx_INCREF(__pyx_v_p4);
          __pyx_t_7 = __pyx_v_p4;
          __Pyx_INCREF(__pyx_v_p1);
          __pyx_t_8 = __pyx_v_p1;
          __pyx_t_18 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (__pyx_t_2) {
            __Pyx_INCREF(__pyx_t_4);
            __pyx_t_17 = __pyx_t_4;
          } else {
            __Pyx_INCREF(__pyx_t_8);
            __pyx_t_17 = __pyx_t_8;
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_INCREF(__pyx_t_17);
          __pyx_t_8 = __pyx_t_17;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_18 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_LT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (__pyx_t_2) {
            __Pyx_INCREF(__pyx_t_3);
            __pyx_t_17 = __pyx_t_3;
          } else {
            __Pyx_INCREF(__pyx_t_8);
            __pyx_t_17 = __pyx_t_8;
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_INCREF(__pyx_t_17);
          __pyx_t_8 = __pyx_t_17;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_18 = PyObject_RichCompare(__pyx_t_7, __pyx_t_8, Py_LT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (__pyx_t_2) {
            __Pyx_INCREF(__pyx_t_7);
            __pyx_t_17 = __pyx_t_7;
          } else {
            __Pyx_INCREF(__pyx_t_8);
            __pyx_t_17 = __pyx_t_8;
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_INCREF(__pyx_t_17);
          __Pyx_XDECREF(__pyx_v_min_p);
          __pyx_v_min_p = __pyx_t_17;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1003
 *             while True:
 *                 min_p = min( p1, p2, p3, p4 )
 *                 retadd( chrom, min_p, v1, v2, v3, v4 )             # <<<<<<<<<<<<<<
 *                 pre_p = min_p
 * 
 */
          __pyx_t_17 = PyTuple_New(6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_INCREF(__pyx_v_chrom);
          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_chrom);
          __Pyx_GIVEREF(__pyx_v_chrom);
          __Pyx_INCREF(__pyx_v_min_p);
          PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_v_min_p);
          __Pyx_GIVEREF(__pyx_v_min_p);
          __Pyx_INCREF(__pyx_v_v1);
          PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_v_v1);
          __Pyx_GIVEREF(__pyx_v_v1);
          __Pyx_INCREF(__pyx_v_v2);
          PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_v_v2);
          __Pyx_GIVEREF(__pyx_v_v2);
          __Pyx_INCREF(__pyx_v_v3);
          PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_v_v3);
          __Pyx_GIVEREF(__pyx_v_v3);
          __Pyx_INCREF(__pyx_v_v4);
          PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_v_v4);
          __Pyx_GIVEREF(__pyx_v_v4);
          __pyx_t_4 = PyObject_Call(__pyx_v_retadd, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1004
 *                 min_p = min( p1, p2, p3, p4 )
 *                 retadd( chrom, min_p, v1, v2, v3, v4 )
 *                 pre_p = min_p             # <<<<<<<<<<<<<<
 * 
 *                 if p1 == min_p:
 */
          __Pyx_INCREF(__pyx_v_min_p);
          __Pyx_DECREF(__pyx_v_pre_p);
          __pyx_v_pre_p = __pyx_v_min_p;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1006
 *                 pre_p = min_p
 * 
 *                 if p1 == min_p:             # <<<<<<<<<<<<<<
 *                     p1 = p1n()
 *                     v1 = v1n()
 */
          __pyx_t_4 = PyObject_RichCompare(__pyx_v_p1, __pyx_v_min_p, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_2) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1007
 * 
 *                 if p1 == min_p:
 *                     p1 = p1n()             # <<<<<<<<<<<<<<
 *                     v1 = v1n()
 *                 if p2 == min_p:
 */
            __pyx_t_4 = PyObject_Call(__pyx_v_p1n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_v_p1);
            __pyx_v_p1 = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1008
 *                 if p1 == min_p:
 *                     p1 = p1n()
 *                     v1 = v1n()             # <<<<<<<<<<<<<<
 *                 if p2 == min_p:
 *                     p2 = p2n()
 */
            __pyx_t_4 = PyObject_Call(__pyx_v_v1n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_v_v1);
            __pyx_v_v1 = __pyx_t_4;
            __pyx_t_4 = 0;
            goto __pyx_L23;
          }
          __pyx_L23:;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1009
 *                     p1 = p1n()
 *                     v1 = v1n()
 *                 if p2 == min_p:             # <<<<<<<<<<<<<<
 *                     p2 = p2n()
 *                     v2 = v2n()
 */
          __pyx_t_4 = PyObject_RichCompare(__pyx_v_p2, __pyx_v_min_p, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_2) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1010
 *                     v1 = v1n()
 *                 if p2 == min_p:
 *                     p2 = p2n()             # <<<<<<<<<<<<<<
 *                     v2 = v2n()
 *                 if p3 == min_p:
 */
            __pyx_t_4 = PyObject_Call(__pyx_v_p2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_v_p2);
            __pyx_v_p2 = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1011
 *                 if p2 == min_p:
 *                     p2 = p2n()
 *                     v2 = v2n()             # <<<<<<<<<<<<<<
 *                 if p3 == min_p:
 *                     p3 = p3n()
 */
            __pyx_t_4 = PyObject_Call(__pyx_v_v2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_v_v2);
            __pyx_v_v2 = __pyx_t_4;
            __pyx_t_4 = 0;
            goto __pyx_L24;
          }
          __pyx_L24:;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1012
 *                     p2 = p2n()
 *                     v2 = v2n()
 *                 if p3 == min_p:             # <<<<<<<<<<<<<<
 *                     p3 = p3n()
 *                     v3 = v3n()
 */
          __pyx_t_4 = PyObject_RichCompare(__pyx_v_p3, __pyx_v_min_p, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_2) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1013
 *                     v2 = v2n()
 *                 if p3 == min_p:
 *                     p3 = p3n()             # <<<<<<<<<<<<<<
 *                     v3 = v3n()
 *                 if p4 == min_p:
 */
            __pyx_t_4 = PyObject_Call(__pyx_v_p3n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_v_p3);
            __pyx_v_p3 = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1014
 *                 if p3 == min_p:
 *                     p3 = p3n()
 *                     v3 = v3n()             # <<<<<<<<<<<<<<
 *                 if p4 == min_p:
 *                     p4 = p4n()
 */
            __pyx_t_4 = PyObject_Call(__pyx_v_v3n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_v_v3);
            __pyx_v_v3 = __pyx_t_4;
            __pyx_t_4 = 0;
            goto __pyx_L25;
          }
          __pyx_L25:;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1015
 *                     p3 = p3n()
 *                     v3 = v3n()
 *                 if p4 == min_p:             # <<<<<<<<<<<<<<
 *                     p4 = p4n()
 *                     v4 = v4n()
 */
          __pyx_t_4 = PyObject_RichCompare(__pyx_v_p4, __pyx_v_min_p, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_2) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1016
 *                     v3 = v3n()
 *                 if p4 == min_p:
 *                     p4 = p4n()             # <<<<<<<<<<<<<<
 *                     v4 = v4n()
 *         except StopIteration:
 */
            __pyx_t_4 = PyObject_Call(__pyx_v_p4n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_v_p4);
            __pyx_v_p4 = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1017
 *                 if p4 == min_p:
 *                     p4 = p4n()
 *                     v4 = v4n()             # <<<<<<<<<<<<<<
 *         except StopIteration:
 *             # meet the end of either bedGraphTrackI, simply exit
 */
            __pyx_t_4 = PyObject_Call(__pyx_v_v4n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_v_v4);
            __pyx_v_v4 = __pyx_t_4;
            __pyx_t_4 = 0;
            goto __pyx_L26;
          }
          __pyx_L26:;
        }
      }
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      goto __pyx_L20_try_end;
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":1018
 *                     p4 = p4n()
 *                     v4 = v4n()
 *         except StopIteration:             # <<<<<<<<<<<<<<
 *             # meet the end of either bedGraphTrackI, simply exit
 *             pass
 */
      __pyx_t_19 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
      if (__pyx_t_19) {
        PyErr_Restore(0,0,0);
        goto __pyx_L14_exception_handled;
      }
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      goto __pyx_L1_error;
      __pyx_L14_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      __pyx_L20_try_end:;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1022
 *             pass
 * 
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.make_compositeScoreTrack", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_retadd);
  __Pyx_XDECREF(__pyx_v_chr1);
  __Pyx_XDECREF(__pyx_v_chr2);
  __Pyx_XDECREF(__pyx_v_chr3);
  __Pyx_XDECREF(__pyx_v_chr4);
  __Pyx_XDECREF(__pyx_v_common_chr);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_p1s);
  __Pyx_XDECREF(__pyx_v_v1s);
  __Pyx_XDECREF(__pyx_v_p1n);
  __Pyx_XDECREF(__pyx_v_v1n);
  __Pyx_XDECREF(__pyx_v_p2s);
  __Pyx_XDECREF(__pyx_v_v2s);
  __Pyx_XDECREF(__pyx_v_p2n);
  __Pyx_XDECREF(__pyx_v_v2n);
  __Pyx_XDECREF(__pyx_v_p3s);
  __Pyx_XDECREF(__pyx_v_v3s);
  __Pyx_XDECREF(__pyx_v_p3n);
  __Pyx_XDECREF(__pyx_v_v3n);
  __Pyx_XDECREF(__pyx_v_p4s);
  __Pyx_XDECREF(__pyx_v_v4s);
  __Pyx_XDECREF(__pyx_v_p4n);
  __Pyx_XDECREF(__pyx_v_v4n);
  __Pyx_XDECREF(__pyx_v_chrom_max_len);
  __Pyx_XDECREF(__pyx_v_pre_p);
  __Pyx_XDECREF(__pyx_v_p1);
  __Pyx_XDECREF(__pyx_v_v1);
  __Pyx_XDECREF(__pyx_v_p2);
  __Pyx_XDECREF(__pyx_v_v2);
  __Pyx_XDECREF(__pyx_v_p3);
  __Pyx_XDECREF(__pyx_v_v3);
  __Pyx_XDECREF(__pyx_v_p4);
  __Pyx_XDECREF(__pyx_v_v4);
  __Pyx_XDECREF(__pyx_v_min_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_3make_compositeScoreTrack2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_2make_compositeScoreTrack2[] = "A modified overlie function for MACS DIFF.\n    \n    ";
static PyMethodDef __pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_3make_compositeScoreTrack2 = {__Pyx_NAMESTR("make_compositeScoreTrack2"), (PyCFunction)__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_3make_compositeScoreTrack2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_2IO_20cCompositeScoreTrack_2make_compositeScoreTrack2)};
static PyObject *__pyx_pw_5MACS2_2IO_20cCompositeScoreTrack_3make_compositeScoreTrack2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bdgTrack1 = 0;
  PyObject *__pyx_v_bdgTrack2 = 0;
  PyObject *__pyx_v_bdgTrack3 = 0;
  PyObject *__pyx_v_bdgTrack4 = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__bdgTrack1,&__pyx_n_s__bdgTrack2,&__pyx_n_s__bdgTrack3,&__pyx_n_s__bdgTrack4,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_compositeScoreTrack2 (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bdgTrack1);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bdgTrack2);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("make_compositeScoreTrack2", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bdgTrack3);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("make_compositeScoreTrack2", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bdgTrack4);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("make_compositeScoreTrack2", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "make_compositeScoreTrack2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __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_bdgTrack1 = values[0];
    __pyx_v_bdgTrack2 = values[1];
    __pyx_v_bdgTrack3 = values[2];
    __pyx_v_bdgTrack4 = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_compositeScoreTrack2", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.make_compositeScoreTrack2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_2make_compositeScoreTrack2(__pyx_self, __pyx_v_bdgTrack1, __pyx_v_bdgTrack2, __pyx_v_bdgTrack3, __pyx_v_bdgTrack4);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "MACS2/IO/cCompositeScoreTrack.pyx":1026
 * 
 * 
 * def make_compositeScoreTrack2 (bdgTrack1, bdgTrack2, bdgTrack3, bdgTrack4 ):             # <<<<<<<<<<<<<<
 *     """A modified overlie function for MACS DIFF.
 * 
 */

static PyObject *__pyx_pf_5MACS2_2IO_20cCompositeScoreTrack_2make_compositeScoreTrack2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bdgTrack1, PyObject *__pyx_v_bdgTrack2, PyObject *__pyx_v_bdgTrack3, PyObject *__pyx_v_bdgTrack4) {
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_retadd = NULL;
  PyObject *__pyx_v_score_btrack1 = NULL;
  PyObject *__pyx_v_pqtable1 = NULL;
  PyObject *__pyx_v_score_btrack2 = NULL;
  PyObject *__pyx_v_pqtable2 = NULL;
  PyObject *__pyx_v_common_chr = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_p1s = NULL;
  PyObject *__pyx_v_v1s = NULL;
  PyObject *__pyx_v_p1n = NULL;
  PyObject *__pyx_v_v1n = NULL;
  PyObject *__pyx_v_p2s = NULL;
  PyObject *__pyx_v_v2s = NULL;
  PyObject *__pyx_v_p2n = NULL;
  PyObject *__pyx_v_v2n = NULL;
  PyObject *__pyx_v_p3s = NULL;
  PyObject *__pyx_v_v3s = NULL;
  PyObject *__pyx_v_p3n = NULL;
  PyObject *__pyx_v_v3n = NULL;
  PyObject *__pyx_v_p4s = NULL;
  PyObject *__pyx_v_v4s = NULL;
  PyObject *__pyx_v_p4n = NULL;
  PyObject *__pyx_v_v4n = NULL;
  PyObject *__pyx_v_chrom_max_len = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_pre_p = NULL;
  PyObject *__pyx_v_p1 = NULL;
  PyObject *__pyx_v_v1 = NULL;
  PyObject *__pyx_v_p2 = NULL;
  PyObject *__pyx_v_v2 = NULL;
  PyObject *__pyx_v_p3 = NULL;
  PyObject *__pyx_v_v3 = NULL;
  PyObject *__pyx_v_p4 = NULL;
  PyObject *__pyx_v_v4 = NULL;
  PyObject *__pyx_v_min_p = 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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("make_compositeScoreTrack2", 0);
  __Pyx_TraceCall("make_compositeScoreTrack2", __pyx_f[0], 1026);

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1030
 * 
 *     """
 *     assert isinstance(bdgTrack1,bedGraphTrackI), "bdgTrack1 is not a bedGraphTrackI object"             # <<<<<<<<<<<<<<
 *     assert isinstance(bdgTrack2,bedGraphTrackI), "bdgTrack2 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack3,bedGraphTrackI), "bdgTrack3 is not a bedGraphTrackI object"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__bedGraphTrackI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_bdgTrack1, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_28));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1031
 *     """
 *     assert isinstance(bdgTrack1,bedGraphTrackI), "bdgTrack1 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack2,bedGraphTrackI), "bdgTrack2 is not a bedGraphTrackI object"             # <<<<<<<<<<<<<<
 *     assert isinstance(bdgTrack3,bedGraphTrackI), "bdgTrack3 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack4,bedGraphTrackI), "bdgTrack4 is not a bedGraphTrackI object"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__bedGraphTrackI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_bdgTrack2, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_29));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1032
 *     assert isinstance(bdgTrack1,bedGraphTrackI), "bdgTrack1 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack2,bedGraphTrackI), "bdgTrack2 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack3,bedGraphTrackI), "bdgTrack3 is not a bedGraphTrackI object"             # <<<<<<<<<<<<<<
 *     assert isinstance(bdgTrack4,bedGraphTrackI), "bdgTrack4 is not a bedGraphTrackI object"
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__bedGraphTrackI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_bdgTrack3, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_30));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1033
 *     assert isinstance(bdgTrack2,bedGraphTrackI), "bdgTrack2 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack3,bedGraphTrackI), "bdgTrack3 is not a bedGraphTrackI object"
 *     assert isinstance(bdgTrack4,bedGraphTrackI), "bdgTrack4 is not a bedGraphTrackI object"             # <<<<<<<<<<<<<<
 * 
 *     ret = compositeScoreTrackII()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__bedGraphTrackI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_bdgTrack4, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_31));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1035
 *     assert isinstance(bdgTrack4,bedGraphTrackI), "bdgTrack4 is not a bedGraphTrackI object"
 * 
 *     ret = compositeScoreTrackII()             # <<<<<<<<<<<<<<
 *     retadd = ret.add
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_33); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1036
 * 
 *     ret = compositeScoreTrackII()
 *     retadd = ret.add             # <<<<<<<<<<<<<<
 * 
 *     score_btrack1 = bdgTrack1.make_scoreTrack_for_macs( bdgTrack3 )
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_ret, __pyx_n_s__add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_retadd = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1038
 *     retadd = ret.add
 * 
 *     score_btrack1 = bdgTrack1.make_scoreTrack_for_macs( bdgTrack3 )             # <<<<<<<<<<<<<<
 *     pqtable1 = score_btrack1.make_pq_table()
 *     score_btrack1.assign_qvalue(pqtable1)
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_bdgTrack1, __pyx_n_s_34); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __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 = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_bdgTrack3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bdgTrack3);
  __Pyx_GIVEREF(__pyx_v_bdgTrack3);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_score_btrack1 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1039
 * 
 *     score_btrack1 = bdgTrack1.make_scoreTrack_for_macs( bdgTrack3 )
 *     pqtable1 = score_btrack1.make_pq_table()             # <<<<<<<<<<<<<<
 *     score_btrack1.assign_qvalue(pqtable1)
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_score_btrack1, __pyx_n_s__make_pq_table); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_pqtable1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1040
 *     score_btrack1 = bdgTrack1.make_scoreTrack_for_macs( bdgTrack3 )
 *     pqtable1 = score_btrack1.make_pq_table()
 *     score_btrack1.assign_qvalue(pqtable1)             # <<<<<<<<<<<<<<
 * 
 *     score_btrack2 = bdgTrack2.make_scoreTrack_for_macs( bdgTrack4 )
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_score_btrack1, __pyx_n_s__assign_qvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __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 = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_pqtable1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pqtable1);
  __Pyx_GIVEREF(__pyx_v_pqtable1);
  __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 = 1040; __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_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1042
 *     score_btrack1.assign_qvalue(pqtable1)
 * 
 *     score_btrack2 = bdgTrack2.make_scoreTrack_for_macs( bdgTrack4 )             # <<<<<<<<<<<<<<
 *     pqtable2 = score_btrack2.make_pq_table()
 *     score_btrack2.assign_qvalue(pqtable2)
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_bdgTrack2, __pyx_n_s_34); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __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 = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_bdgTrack4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_bdgTrack4);
  __Pyx_GIVEREF(__pyx_v_bdgTrack4);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __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_4)); __pyx_t_4 = 0;
  __pyx_v_score_btrack2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1043
 * 
 *     score_btrack2 = bdgTrack2.make_scoreTrack_for_macs( bdgTrack4 )
 *     pqtable2 = score_btrack2.make_pq_table()             # <<<<<<<<<<<<<<
 *     score_btrack2.assign_qvalue(pqtable2)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_score_btrack2, __pyx_n_s__make_pq_table); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pqtable2 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1044
 *     score_btrack2 = bdgTrack2.make_scoreTrack_for_macs( bdgTrack4 )
 *     pqtable2 = score_btrack2.make_pq_table()
 *     score_btrack2.assign_qvalue(pqtable2)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_score_btrack2, __pyx_n_s__assign_qvalue); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __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 = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_pqtable2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pqtable2);
  __Pyx_GIVEREF(__pyx_v_pqtable2);
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1048
 * 
 * 
 *     common_chr = chr1.intersection(chr2).intersection(chr3).intersection(chr4)             # <<<<<<<<<<<<<<
 *     for chrom in common_chr:
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__chr1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__intersection); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __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__chr2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __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 = 1048; __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_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __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_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__intersection); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__chr3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __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 = 1048; __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_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __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_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__intersection); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __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__chr4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __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 = 1048; __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_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __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_4)); __pyx_t_4 = 0;
  __pyx_v_common_chr = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1049
 * 
 *     common_chr = chr1.intersection(chr2).intersection(chr3).intersection(chr4)
 *     for chrom in common_chr:             # <<<<<<<<<<<<<<
 * 
 *         (p1s,v1s) = bdgTrack1.get_data_by_chr(chrom) # arrays for position and values
 */
  if (PyList_CheckExact(__pyx_v_common_chr) || PyTuple_CheckExact(__pyx_v_common_chr)) {
    __pyx_t_3 = __pyx_v_common_chr; __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_common_chr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __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;
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
    } else {
      __pyx_t_4 = __pyx_t_6(__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 = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1051
 *     for chrom in common_chr:
 * 
 *         (p1s,v1s) = bdgTrack1.get_data_by_chr(chrom) # arrays for position and values             # <<<<<<<<<<<<<<
 *         p1n = iter(p1s).next         # assign the next function to a viable to speed up
 *         v1n = iter(v1s).next
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_bdgTrack1, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __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 = 1051; __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_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
      PyObject* sequence = __pyx_t_7;
      if (likely(PyTuple_CheckExact(sequence))) {
        if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
          if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
          if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
      if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_p1s);
    __pyx_v_p1s = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_v1s);
    __pyx_v_v1s = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1052
 * 
 *         (p1s,v1s) = bdgTrack1.get_data_by_chr(chrom) # arrays for position and values
 *         p1n = iter(p1s).next         # assign the next function to a viable to speed up             # <<<<<<<<<<<<<<
 *         v1n = iter(v1s).next
 * 
 */
    __pyx_t_7 = PyObject_GetIter(__pyx_v_p1s); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __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/cCompositeScoreTrack.pyx":1053
 *         (p1s,v1s) = bdgTrack1.get_data_by_chr(chrom) # arrays for position and values
 *         p1n = iter(p1s).next         # assign the next function to a viable to speed up
 *         v1n = iter(v1s).next             # <<<<<<<<<<<<<<
 * 
 *         (p2s,v2s) = bdgTrack2.get_data_by_chr(chrom) # arrays for position and values
 */
    __pyx_t_4 = PyObject_GetIter(__pyx_v_v1s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__next); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_v1n);
    __pyx_v_v1n = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1055
 *         v1n = iter(v1s).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_7 = PyObject_GetAttr(__pyx_v_bdgTrack2, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __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_4)); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      if (likely(PyTuple_CheckExact(sequence))) {
        if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
          if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
          if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
      if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_p2s);
    __pyx_v_p2s = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_v2s);
    __pyx_v_v2s = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1056
 * 
 *         (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_1 = PyObject_GetIter(__pyx_v_p2s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __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_p2n);
    __pyx_v_p2n = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1057
 *         (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             # <<<<<<<<<<<<<<
 * 
 *         (p3s,v3s) = bdgTrack3.get_data_by_chr(chrom) # arrays for position and values
 */
    __pyx_t_7 = PyObject_GetIter(__pyx_v_v2s); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_v2n);
    __pyx_v_v2n = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1059
 *         v2n = iter(v2s).next
 * 
 *         (p3s,v3s) = bdgTrack3.get_data_by_chr(chrom) # arrays for position and values             # <<<<<<<<<<<<<<
 *         p3n = iter(p3s).next         # assign the next function to a viable to speed up
 *         v3n = iter(v3s).next
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_bdgTrack3, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __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 = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __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_7)); __pyx_t_7 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      if (likely(PyTuple_CheckExact(sequence))) {
        if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
          if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
          if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
      if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L10_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_p3s);
    __pyx_v_p3s = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_v3s);
    __pyx_v_v3s = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1060
 * 
 *         (p3s,v3s) = bdgTrack3.get_data_by_chr(chrom) # arrays for position and values
 *         p3n = iter(p3s).next         # assign the next function to a viable to speed up             # <<<<<<<<<<<<<<
 *         v3n = iter(v3s).next
 * 
 */
    __pyx_t_4 = PyObject_GetIter(__pyx_v_p3s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __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_p3n);
    __pyx_v_p3n = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1061
 *         (p3s,v3s) = bdgTrack3.get_data_by_chr(chrom) # arrays for position and values
 *         p3n = iter(p3s).next         # assign the next function to a viable to speed up
 *         v3n = iter(v3s).next             # <<<<<<<<<<<<<<
 * 
 *         (p4s,v4s) = bdgTrack4.get_data_by_chr(chrom) # arrays for position and values
 */
    __pyx_t_1 = PyObject_GetIter(__pyx_v_v3s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __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_v3n);
    __pyx_v_v3n = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1063
 *         v3n = iter(v3s).next
 * 
 *         (p4s,v4s) = bdgTrack4.get_data_by_chr(chrom) # arrays for position and values             # <<<<<<<<<<<<<<
 *         p4n = iter(p4s).next         # assign the next function to a viable to speed up
 *         v4n = iter(v4s).next
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_bdgTrack4, __pyx_n_s__get_data_by_chr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __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 = 1063; __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_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
      PyObject* sequence = __pyx_t_7;
      if (likely(PyTuple_CheckExact(sequence))) {
        if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
          if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
          if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
          else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L12_unpacking_done;
      __pyx_L11_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
      if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L12_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_p4s);
    __pyx_v_p4s = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_v4s);
    __pyx_v_v4s = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1064
 * 
 *         (p4s,v4s) = bdgTrack4.get_data_by_chr(chrom) # arrays for position and values
 *         p4n = iter(p4s).next         # assign the next function to a viable to speed up             # <<<<<<<<<<<<<<
 *         v4n = iter(v4s).next
 * 
 */
    __pyx_t_7 = PyObject_GetIter(__pyx_v_p4s); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __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_p4n);
    __pyx_v_p4n = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1065
 *         (p4s,v4s) = bdgTrack4.get_data_by_chr(chrom) # arrays for position and values
 *         p4n = iter(p4s).next         # assign the next function to a viable to speed up
 *         v4n = iter(v4s).next             # <<<<<<<<<<<<<<
 * 
 *         chrom_max_len = len(p1s)+len(p2s)+len(p3s)+len(p4s) # this is the maximum number of locations needed to be recorded in scoreTrackI for this chromosome.
 */
    __pyx_t_4 = PyObject_GetIter(__pyx_v_v4s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__next); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_v4n);
    __pyx_v_v4n = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1067
 *         v4n = iter(v4s).next
 * 
 *         chrom_max_len = len(p1s)+len(p2s)+len(p3s)+len(p4s) # this is the maximum number of locations needed to be recorded in scoreTrackI for this chromosome.             # <<<<<<<<<<<<<<
 * 
 *         ret.add_chromosome(chrom,chrom_max_len)
 */
    __pyx_t_10 = PyObject_Length(__pyx_v_p1s); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = PyObject_Length(__pyx_v_p2s); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = PyObject_Length(__pyx_v_p3s); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = PyObject_Length(__pyx_v_p4s); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = PyInt_FromSsize_t((((__pyx_t_10 + __pyx_t_11) + __pyx_t_12) + __pyx_t_13)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_v_chrom_max_len);
    __pyx_v_chrom_max_len = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1069
 *         chrom_max_len = len(p1s)+len(p2s)+len(p3s)+len(p4s) # this is the maximum number of locations needed to be recorded in scoreTrackI for this chromosome.
 * 
 *         ret.add_chromosome(chrom,chrom_max_len)             # <<<<<<<<<<<<<<
 * 
 *         pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret
 */
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_ret, __pyx_n_s__add_chromosome); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_chrom);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    __Pyx_INCREF(__pyx_v_chrom_max_len);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_chrom_max_len);
    __Pyx_GIVEREF(__pyx_v_chrom_max_len);
    __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1071
 *         ret.add_chromosome(chrom,chrom_max_len)
 * 
 *         pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_pre_p);
    __pyx_v_pre_p = __pyx_int_0;

    /* "MACS2/IO/cCompositeScoreTrack.pyx":1073
 *         pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             p1 = p1n()
 *             v1 = v1n()
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      /*try:*/ {

        /* "MACS2/IO/cCompositeScoreTrack.pyx":1074
 * 
 *         try:
 *             p1 = p1n()             # <<<<<<<<<<<<<<
 *             v1 = v1n()
 * 
 */
        __pyx_t_1 = PyObject_Call(__pyx_v_p1n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_p1);
        __pyx_v_p1 = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":1075
 *         try:
 *             p1 = p1n()
 *             v1 = v1n()             # <<<<<<<<<<<<<<
 * 
 *             p2 = p2n()
 */
        __pyx_t_1 = PyObject_Call(__pyx_v_v1n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_v1);
        __pyx_v_v1 = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":1077
 *             v1 = v1n()
 * 
 *             p2 = p2n()             # <<<<<<<<<<<<<<
 *             v2 = v2n()
 * 
 */
        __pyx_t_1 = PyObject_Call(__pyx_v_p2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_p2);
        __pyx_v_p2 = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":1078
 * 
 *             p2 = p2n()
 *             v2 = v2n()             # <<<<<<<<<<<<<<
 * 
 *             p3 = p3n()
 */
        __pyx_t_1 = PyObject_Call(__pyx_v_v2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_v2);
        __pyx_v_v2 = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":1080
 *             v2 = v2n()
 * 
 *             p3 = p3n()             # <<<<<<<<<<<<<<
 *             v3 = v3n()
 * 
 */
        __pyx_t_1 = PyObject_Call(__pyx_v_p3n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_p3);
        __pyx_v_p3 = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":1081
 * 
 *             p3 = p3n()
 *             v3 = v3n()             # <<<<<<<<<<<<<<
 * 
 *             p4 = p4n()
 */
        __pyx_t_1 = PyObject_Call(__pyx_v_v3n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_v3);
        __pyx_v_v3 = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":1083
 *             v3 = v3n()
 * 
 *             p4 = p4n()             # <<<<<<<<<<<<<<
 *             v4 = v4n()
 * 
 */
        __pyx_t_1 = PyObject_Call(__pyx_v_p4n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_p4);
        __pyx_v_p4 = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":1084
 * 
 *             p4 = p4n()
 *             v4 = v4n()             # <<<<<<<<<<<<<<
 * 
 *             while True:
 */
        __pyx_t_1 = PyObject_Call(__pyx_v_v4n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_v4);
        __pyx_v_v4 = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "MACS2/IO/cCompositeScoreTrack.pyx":1086
 *             v4 = v4n()
 * 
 *             while True:             # <<<<<<<<<<<<<<
 *                 min_p = min( p1, p2, p3, p4 )
 *                 retadd( chrom, min_p, v1, v2, v3, v4 )
 */
        while (1) {
          if (!1) break;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1087
 * 
 *             while True:
 *                 min_p = min( p1, p2, p3, p4 )             # <<<<<<<<<<<<<<
 *                 retadd( chrom, min_p, v1, v2, v3, v4 )
 *                 pre_p = min_p
 */
          __Pyx_INCREF(__pyx_v_p2);
          __pyx_t_1 = __pyx_v_p2;
          __Pyx_INCREF(__pyx_v_p3);
          __pyx_t_4 = __pyx_v_p3;
          __Pyx_INCREF(__pyx_v_p4);
          __pyx_t_7 = __pyx_v_p4;
          __Pyx_INCREF(__pyx_v_p1);
          __pyx_t_8 = __pyx_v_p1;
          __pyx_t_18 = PyObject_RichCompare(__pyx_t_1, __pyx_t_8, Py_LT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (__pyx_t_2) {
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_17 = __pyx_t_1;
          } else {
            __Pyx_INCREF(__pyx_t_8);
            __pyx_t_17 = __pyx_t_8;
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_INCREF(__pyx_t_17);
          __pyx_t_8 = __pyx_t_17;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_18 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (__pyx_t_2) {
            __Pyx_INCREF(__pyx_t_4);
            __pyx_t_17 = __pyx_t_4;
          } else {
            __Pyx_INCREF(__pyx_t_8);
            __pyx_t_17 = __pyx_t_8;
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_INCREF(__pyx_t_17);
          __pyx_t_8 = __pyx_t_17;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_18 = PyObject_RichCompare(__pyx_t_7, __pyx_t_8, Py_LT); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (__pyx_t_2) {
            __Pyx_INCREF(__pyx_t_7);
            __pyx_t_17 = __pyx_t_7;
          } else {
            __Pyx_INCREF(__pyx_t_8);
            __pyx_t_17 = __pyx_t_8;
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_INCREF(__pyx_t_17);
          __Pyx_XDECREF(__pyx_v_min_p);
          __pyx_v_min_p = __pyx_t_17;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1088
 *             while True:
 *                 min_p = min( p1, p2, p3, p4 )
 *                 retadd( chrom, min_p, v1, v2, v3, v4 )             # <<<<<<<<<<<<<<
 *                 pre_p = min_p
 * 
 */
          __pyx_t_17 = PyTuple_New(6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_INCREF(__pyx_v_chrom);
          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_chrom);
          __Pyx_GIVEREF(__pyx_v_chrom);
          __Pyx_INCREF(__pyx_v_min_p);
          PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_v_min_p);
          __Pyx_GIVEREF(__pyx_v_min_p);
          __Pyx_INCREF(__pyx_v_v1);
          PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_v_v1);
          __Pyx_GIVEREF(__pyx_v_v1);
          __Pyx_INCREF(__pyx_v_v2);
          PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_v_v2);
          __Pyx_GIVEREF(__pyx_v_v2);
          __Pyx_INCREF(__pyx_v_v3);
          PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_v_v3);
          __Pyx_GIVEREF(__pyx_v_v3);
          __Pyx_INCREF(__pyx_v_v4);
          PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_v_v4);
          __Pyx_GIVEREF(__pyx_v_v4);
          __pyx_t_1 = PyObject_Call(__pyx_v_retadd, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1089
 *                 min_p = min( p1, p2, p3, p4 )
 *                 retadd( chrom, min_p, v1, v2, v3, v4 )
 *                 pre_p = min_p             # <<<<<<<<<<<<<<
 * 
 *                 if p1 == min_p:
 */
          __Pyx_INCREF(__pyx_v_min_p);
          __Pyx_DECREF(__pyx_v_pre_p);
          __pyx_v_pre_p = __pyx_v_min_p;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1091
 *                 pre_p = min_p
 * 
 *                 if p1 == min_p:             # <<<<<<<<<<<<<<
 *                     p1 = p1n()
 *                     v1 = v1n()
 */
          __pyx_t_1 = PyObject_RichCompare(__pyx_v_p1, __pyx_v_min_p, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L13_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 = 1091; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_2) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1092
 * 
 *                 if p1 == min_p:
 *                     p1 = p1n()             # <<<<<<<<<<<<<<
 *                     v1 = v1n()
 *                 if p2 == min_p:
 */
            __pyx_t_1 = PyObject_Call(__pyx_v_p1n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_v_p1);
            __pyx_v_p1 = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1093
 *                 if p1 == min_p:
 *                     p1 = p1n()
 *                     v1 = v1n()             # <<<<<<<<<<<<<<
 *                 if p2 == min_p:
 *                     p2 = p2n()
 */
            __pyx_t_1 = PyObject_Call(__pyx_v_v1n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_v_v1);
            __pyx_v_v1 = __pyx_t_1;
            __pyx_t_1 = 0;
            goto __pyx_L23;
          }
          __pyx_L23:;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1094
 *                     p1 = p1n()
 *                     v1 = v1n()
 *                 if p2 == min_p:             # <<<<<<<<<<<<<<
 *                     p2 = p2n()
 *                     v2 = v2n()
 */
          __pyx_t_1 = PyObject_RichCompare(__pyx_v_p2, __pyx_v_min_p, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L13_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 = 1094; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_2) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1095
 *                     v1 = v1n()
 *                 if p2 == min_p:
 *                     p2 = p2n()             # <<<<<<<<<<<<<<
 *                     v2 = v2n()
 *                 if p3 == min_p:
 */
            __pyx_t_1 = PyObject_Call(__pyx_v_p2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_v_p2);
            __pyx_v_p2 = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1096
 *                 if p2 == min_p:
 *                     p2 = p2n()
 *                     v2 = v2n()             # <<<<<<<<<<<<<<
 *                 if p3 == min_p:
 *                     p3 = p3n()
 */
            __pyx_t_1 = PyObject_Call(__pyx_v_v2n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_v_v2);
            __pyx_v_v2 = __pyx_t_1;
            __pyx_t_1 = 0;
            goto __pyx_L24;
          }
          __pyx_L24:;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1097
 *                     p2 = p2n()
 *                     v2 = v2n()
 *                 if p3 == min_p:             # <<<<<<<<<<<<<<
 *                     p3 = p3n()
 *                     v3 = v3n()
 */
          __pyx_t_1 = PyObject_RichCompare(__pyx_v_p3, __pyx_v_min_p, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L13_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 = 1097; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_2) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1098
 *                     v2 = v2n()
 *                 if p3 == min_p:
 *                     p3 = p3n()             # <<<<<<<<<<<<<<
 *                     v3 = v3n()
 *                 if p4 == min_p:
 */
            __pyx_t_1 = PyObject_Call(__pyx_v_p3n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_v_p3);
            __pyx_v_p3 = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1099
 *                 if p3 == min_p:
 *                     p3 = p3n()
 *                     v3 = v3n()             # <<<<<<<<<<<<<<
 *                 if p4 == min_p:
 *                     p4 = p4n()
 */
            __pyx_t_1 = PyObject_Call(__pyx_v_v3n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_v_v3);
            __pyx_v_v3 = __pyx_t_1;
            __pyx_t_1 = 0;
            goto __pyx_L25;
          }
          __pyx_L25:;

          /* "MACS2/IO/cCompositeScoreTrack.pyx":1100
 *                     p3 = p3n()
 *                     v3 = v3n()
 *                 if p4 == min_p:             # <<<<<<<<<<<<<<
 *                     p4 = p4n()
 *                     v4 = v4n()
 */
          __pyx_t_1 = PyObject_RichCompare(__pyx_v_p4, __pyx_v_min_p, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L13_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 = 1100; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_2) {

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1101
 *                     v3 = v3n()
 *                 if p4 == min_p:
 *                     p4 = p4n()             # <<<<<<<<<<<<<<
 *                     v4 = v4n()
 *         except StopIteration:
 */
            __pyx_t_1 = PyObject_Call(__pyx_v_p4n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_v_p4);
            __pyx_v_p4 = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "MACS2/IO/cCompositeScoreTrack.pyx":1102
 *                 if p4 == min_p:
 *                     p4 = p4n()
 *                     v4 = v4n()             # <<<<<<<<<<<<<<
 *         except StopIteration:
 *             # meet the end of either bedGraphTrackI, simply exit
 */
            __pyx_t_1 = PyObject_Call(__pyx_v_v4n, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_v_v4);
            __pyx_v_v4 = __pyx_t_1;
            __pyx_t_1 = 0;
            goto __pyx_L26;
          }
          __pyx_L26:;
        }
      }
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      goto __pyx_L20_try_end;
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "MACS2/IO/cCompositeScoreTrack.pyx":1103
 *                     p4 = p4n()
 *                     v4 = v4n()
 *         except StopIteration:             # <<<<<<<<<<<<<<
 *             # meet the end of either bedGraphTrackI, simply exit
 *             pass
 */
      __pyx_t_19 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
      if (__pyx_t_19) {
        PyErr_Restore(0,0,0);
        goto __pyx_L14_exception_handled;
      }
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      goto __pyx_L1_error;
      __pyx_L14_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      __pyx_L20_try_end:;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1107
 *             pass
 * 
 *     return ret             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("MACS2.IO.cCompositeScoreTrack.make_compositeScoreTrack2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_retadd);
  __Pyx_XDECREF(__pyx_v_score_btrack1);
  __Pyx_XDECREF(__pyx_v_pqtable1);
  __Pyx_XDECREF(__pyx_v_score_btrack2);
  __Pyx_XDECREF(__pyx_v_pqtable2);
  __Pyx_XDECREF(__pyx_v_common_chr);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_p1s);
  __Pyx_XDECREF(__pyx_v_v1s);
  __Pyx_XDECREF(__pyx_v_p1n);
  __Pyx_XDECREF(__pyx_v_v1n);
  __Pyx_XDECREF(__pyx_v_p2s);
  __Pyx_XDECREF(__pyx_v_v2s);
  __Pyx_XDECREF(__pyx_v_p2n);
  __Pyx_XDECREF(__pyx_v_v2n);
  __Pyx_XDECREF(__pyx_v_p3s);
  __Pyx_XDECREF(__pyx_v_v3s);
  __Pyx_XDECREF(__pyx_v_p3n);
  __Pyx_XDECREF(__pyx_v_v3n);
  __Pyx_XDECREF(__pyx_v_p4s);
  __Pyx_XDECREF(__pyx_v_v4s);
  __Pyx_XDECREF(__pyx_v_p4n);
  __Pyx_XDECREF(__pyx_v_v4n);
  __Pyx_XDECREF(__pyx_v_chrom_max_len);
  __Pyx_XDECREF(__pyx_v_pre_p);
  __Pyx_XDECREF(__pyx_v_p1);
  __Pyx_XDECREF(__pyx_v_v1);
  __Pyx_XDECREF(__pyx_v_p2);
  __Pyx_XDECREF(__pyx_v_v2);
  __Pyx_XDECREF(__pyx_v_p3);
  __Pyx_XDECREF(__pyx_v_v3);
  __Pyx_XDECREF(__pyx_v_p4);
  __Pyx_XDECREF(__pyx_v_v4);
  __Pyx_XDECREF(__pyx_v_min_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *)o);
  p->__pyx_v_start = 0;
  return o;
}

static void __pyx_tp_dealloc_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak(PyObject *o) {
  struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *p = (struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *)o;
  Py_XDECREF(p->__pyx_v_start);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *p = (struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *)o;
  if (p->__pyx_v_start) {
    e = (*v)(p->__pyx_v_start, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak(PyObject *o) {
  struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *p = (struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_start);
  p->__pyx_v_start = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5MACS2_2IO_20cCompositeScoreTrack___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_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("MACS2.IO.cCompositeScoreTrack.__pyx_scope_struct____add_broadpeak"), /*tp_name*/
  sizeof(struct __pyx_obj_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5MACS2_2IO_20cCompositeScoreTrack___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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak, /*tp_traverse*/
  __pyx_tp_clear_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5MACS2_2IO_20cCompositeScoreTrack___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_20cCompositeScoreTrack___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 PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

char* __pyx_import_star_type_names[] = {
  "__pyx_scope_struct____add_broadpeak",
  0
};

static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) {
  char** type_name = __pyx_import_star_type_names;
  while (*type_name) {
    if (__Pyx_StrEq(name, *type_name)) {
      PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);
      goto bad;
    }
    type_name++;
  }
  if (0);
  else {
    if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad;
  }
  return 0;
  bad:
  return -1;
}


/* import_all_from is an unexposed function from ceval.c */

static int
__Pyx_import_all_from(PyObject *locals, PyObject *v)
{
    PyObject *all = __Pyx_GetAttrString(v, "__all__");
    PyObject *dict, *name, *value;
    int skip_leading_underscores = 0;
    int pos, err;

    if (all == NULL) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            return -1; /* Unexpected error */
        PyErr_Clear();
        dict = __Pyx_GetAttrString(v, "__dict__");
        if (dict == NULL) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError))
                return -1;
            PyErr_SetString(PyExc_ImportError,
            "from-import-* object has no __dict__ and no __all__");
            return -1;
        }
#if PY_MAJOR_VERSION < 3
        all = PyObject_CallMethod(dict, (char *)"keys", NULL);
#else
        all = PyMapping_Keys(dict);
#endif
        Py_DECREF(dict);
        if (all == NULL)
            return -1;
        skip_leading_underscores = 1;
    }

    for (pos = 0, err = 0; ; pos++) {
        name = PySequence_GetItem(all, pos);
        if (name == NULL) {
            if (!PyErr_ExceptionMatches(PyExc_IndexError))
                err = -1;
            else
                PyErr_Clear();
            break;
        }
        if (skip_leading_underscores &&
#if PY_MAJOR_VERSION < 3
            PyString_Check(name) &&
            PyString_AS_STRING(name)[0] == '_')
#else
            PyUnicode_Check(name) &&
            PyUnicode_AS_UNICODE(name)[0] == '_')
#endif
        {
            Py_DECREF(name);
            continue;
        }
        value = PyObject_GetAttr(v, name);
        if (value == NULL)
            err = -1;
        else if (PyDict_CheckExact(locals))
            err = PyDict_SetItem(locals, name, value);
        else
            err = PyObject_SetItem(locals, name, value);
        Py_DECREF(name);
        Py_XDECREF(value);
        if (err != 0)
            break;
    }
    Py_DECREF(all);
    return err;
}


static int __pyx_import_star(PyObject* m) {

    int i;
    int ret = -1;
    char* s;
    PyObject *locals = 0;
    PyObject *list = 0;
#if PY_MAJOR_VERSION >= 3
    PyObject *utf8_name = 0;
#endif
    PyObject *name;
    PyObject *item;

    locals = PyDict_New();              if (!locals) goto bad;
    if (__Pyx_import_all_from(locals, m) < 0) goto bad;
    list = PyDict_Items(locals);        if (!list) goto bad;

    for(i=0; i<PyList_GET_SIZE(list); i++) {
        name = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 0);
        item = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 1);
#if PY_MAJOR_VERSION >= 3
        utf8_name = PyUnicode_AsUTF8String(name);
        if (!utf8_name) goto bad;
        s = PyBytes_AS_STRING(utf8_name);
        if (__pyx_import_star_set(item, name, s) < 0) goto bad;
        Py_DECREF(utf8_name); utf8_name = 0;
#else
        s = PyString_AsString(name);
        if (!s) goto bad;
        if (__pyx_import_star_set(item, name, s) < 0) goto bad;
#endif
    }
    ret = 0;

bad:
    Py_XDECREF(locals);
    Py_XDECREF(list);
#if PY_MAJOR_VERSION >= 3
    Py_XDECREF(utf8_name);
#endif
    return ret;
}


#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("cCompositeScoreTrack"),
    __Pyx_DOCSTR(__pyx_k_35), /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_n_s_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 0, 1, 1},
  {&__pyx_n_s_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 1, 1},
  {&__pyx_kp_s_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 1, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_n_s_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 1, 1},
  {&__pyx_n_s_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 0, 1, 1},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_n_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 1},
  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
  {&__pyx_n_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 1},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_n_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 1},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
  {&__pyx_n_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 1},
  {&__pyx_n_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 1},
  {&__pyx_n_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 1},
  {&__pyx_n_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 1},
  {&__pyx_n_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 1},
  {&__pyx_n_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 1},
  {&__pyx_n_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 1},
  {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
  {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
  {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
  {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
  {&__pyx_n_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 1},
  {&__pyx_n_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 1},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_n_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 1},
  {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
  {&__pyx_n_s_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 1, 1},
  {&__pyx_n_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 1},
  {&__pyx_n_s_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 1, 1},
  {&__pyx_n_s__BroadPeakIO, __pyx_k__BroadPeakIO, sizeof(__pyx_k__BroadPeakIO), 0, 0, 1, 1},
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
  {&__pyx_n_s__N, __pyx_k__N, sizeof(__pyx_k__N), 0, 0, 1, 1},
  {&__pyx_n_s__PeakIO, __pyx_k__PeakIO, sizeof(__pyx_k__PeakIO), 0, 0, 1, 1},
  {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 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____close_peak, __pyx_k____close_peak, sizeof(__pyx_k____close_peak), 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____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__above_cutoff, __pyx_k__above_cutoff, sizeof(__pyx_k__above_cutoff), 0, 0, 1, 1},
  {&__pyx_n_s__above_cutoff_endpos, __pyx_k__above_cutoff_endpos, sizeof(__pyx_k__above_cutoff_endpos), 0, 0, 1, 1},
  {&__pyx_n_s__above_cutoff_sv, __pyx_k__above_cutoff_sv, sizeof(__pyx_k__above_cutoff_sv), 0, 0, 1, 1},
  {&__pyx_n_s__above_cutoff_v, __pyx_k__above_cutoff_v, sizeof(__pyx_k__above_cutoff_v), 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__assign_qvalue, __pyx_k__assign_qvalue, sizeof(__pyx_k__assign_qvalue), 0, 0, 1, 1},
  {&__pyx_n_s__bdgTrack1, __pyx_k__bdgTrack1, sizeof(__pyx_k__bdgTrack1), 0, 0, 1, 1},
  {&__pyx_n_s__bdgTrack2, __pyx_k__bdgTrack2, sizeof(__pyx_k__bdgTrack2), 0, 0, 1, 1},
  {&__pyx_n_s__bdgTrack3, __pyx_k__bdgTrack3, sizeof(__pyx_k__bdgTrack3), 0, 0, 1, 1},
  {&__pyx_n_s__bdgTrack4, __pyx_k__bdgTrack4, sizeof(__pyx_k__bdgTrack4), 0, 0, 1, 1},
  {&__pyx_n_s__bedGraphTrackI, __pyx_k__bedGraphTrackI, sizeof(__pyx_k__bedGraphTrackI), 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__bpeaks, __pyx_k__bpeaks, sizeof(__pyx_k__bpeaks), 0, 0, 1, 1},
  {&__pyx_n_s__broadpeaks, __pyx_k__broadpeaks, sizeof(__pyx_k__broadpeaks), 0, 0, 1, 1},
  {&__pyx_n_s__c, __pyx_k__c, sizeof(__pyx_k__c), 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_consistent, __pyx_k__call_consistent, sizeof(__pyx_k__call_consistent), 0, 0, 1, 1},
  {&__pyx_n_s__call_diff_regions, __pyx_k__call_diff_regions, sizeof(__pyx_k__call_diff_regions), 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__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__chr3, __pyx_k__chr3, sizeof(__pyx_k__chr3), 0, 0, 1, 1},
  {&__pyx_n_s__chr4, __pyx_k__chr4, sizeof(__pyx_k__chr4), 0, 0, 1, 1},
  {&__pyx_n_s__chrom, __pyx_k__chrom, sizeof(__pyx_k__chrom), 0, 0, 1, 1},
  {&__pyx_n_s__chrom_d, __pyx_k__chrom_d, sizeof(__pyx_k__chrom_d), 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__chrom_pointer, __pyx_k__chrom_pointer, sizeof(__pyx_k__chrom_pointer), 0, 0, 1, 1},
  {&__pyx_n_s__chrom_pos, __pyx_k__chrom_pos, sizeof(__pyx_k__chrom_pos), 0, 0, 1, 1},
  {&__pyx_n_s__chrom_sc1c2, __pyx_k__chrom_sc1c2, sizeof(__pyx_k__chrom_sc1c2), 0, 0, 1, 1},
  {&__pyx_n_s__chrom_sc1i1, __pyx_k__chrom_sc1i1, sizeof(__pyx_k__chrom_sc1i1), 0, 0, 1, 1},
  {&__pyx_n_s__chrom_sc2c1, __pyx_k__chrom_sc2c1, sizeof(__pyx_k__chrom_sc2c1), 0, 0, 1, 1},
  {&__pyx_n_s__chrom_sc2i2, __pyx_k__chrom_sc2i2, sizeof(__pyx_k__chrom_sc2i2), 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__common_chr, __pyx_k__common_chr, sizeof(__pyx_k__common_chr), 0, 0, 1, 1},
  {&__pyx_n_s__condition1_peaks, __pyx_k__condition1_peaks, sizeof(__pyx_k__condition1_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__condition2_peaks, __pyx_k__condition2_peaks, sizeof(__pyx_k__condition2_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__consistent_peaks, __pyx_k__consistent_peaks, sizeof(__pyx_k__consistent_peaks), 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__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__description, __pyx_k__description, sizeof(__pyx_k__description), 0, 0, 1, 1},
  {&__pyx_n_s__diff_score, __pyx_k__diff_score, sizeof(__pyx_k__diff_score), 0, 0, 1, 1},
  {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
  {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
  {&__pyx_n_s__endpos, __pyx_k__endpos, sizeof(__pyx_k__endpos), 0, 0, 1, 1},
  {&__pyx_n_s__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1},
  {&__pyx_n_s__fhd, __pyx_k__fhd, sizeof(__pyx_k__fhd), 0, 0, 1, 1},
  {&__pyx_n_s__flag100, __pyx_k__flag100, sizeof(__pyx_k__flag100), 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__get_chr_names, __pyx_k__get_chr_names, sizeof(__pyx_k__get_chr_names), 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_pscore, __pyx_k__get_pscore, sizeof(__pyx_k__get_pscore), 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__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
  {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1},
  {&__pyx_n_s__int32, __pyx_k__int32, sizeof(__pyx_k__int32), 0, 0, 1, 1},
  {&__pyx_n_s__int64, __pyx_k__int64, sizeof(__pyx_k__int64), 0, 0, 1, 1},
  {&__pyx_n_s__intersection, __pyx_k__intersection, sizeof(__pyx_k__intersection), 0, 0, 1, 1},
  {&__pyx_n_s__j, __pyx_k__j, sizeof(__pyx_k__j), 0, 0, 1, 1},
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
  {&__pyx_n_s__k, __pyx_k__k, sizeof(__pyx_k__k), 0, 0, 1, 1},
  {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1},
  {&__pyx_n_s__l, __pyx_k__l, sizeof(__pyx_k__l), 0, 0, 1, 1},
  {&__pyx_n_s__length, __pyx_k__length, sizeof(__pyx_k__length), 0, 0, 1, 1},
  {&__pyx_n_s__lvl1, __pyx_k__lvl1, sizeof(__pyx_k__lvl1), 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__lvl1_peaks, __pyx_k__lvl1_peaks, sizeof(__pyx_k__lvl1_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__lvl1peakschrom, __pyx_k__lvl1peakschrom, sizeof(__pyx_k__lvl1peakschrom), 0, 0, 1, 1},
  {&__pyx_n_s__lvl1peakschrom_next, __pyx_k__lvl1peakschrom_next, sizeof(__pyx_k__lvl1peakschrom_next), 0, 0, 1, 1},
  {&__pyx_n_s__lvl1peakset, __pyx_k__lvl1peakset, sizeof(__pyx_k__lvl1peakset), 0, 0, 1, 1},
  {&__pyx_n_s__lvl2, __pyx_k__lvl2, sizeof(__pyx_k__lvl2), 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__lvl2_peaks, __pyx_k__lvl2_peaks, sizeof(__pyx_k__lvl2_peaks), 0, 0, 1, 1},
  {&__pyx_n_s__lvl2peak, __pyx_k__lvl2peak, sizeof(__pyx_k__lvl2peak), 0, 0, 1, 1},
  {&__pyx_n_s__lvl2peakschrom, __pyx_k__lvl2peakschrom, sizeof(__pyx_k__lvl2peakschrom), 0, 0, 1, 1},
  {&__pyx_n_s__m_c1c2, __pyx_k__m_c1c2, sizeof(__pyx_k__m_c1c2), 0, 0, 1, 1},
  {&__pyx_n_s__m_c2c1, __pyx_k__m_c2c1, sizeof(__pyx_k__m_c2c1), 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__middle_summit, __pyx_k__middle_summit, sizeof(__pyx_k__middle_summit), 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__min_p, __pyx_k__min_p, sizeof(__pyx_k__min_p), 0, 0, 1, 1},
  {&__pyx_n_s__n, __pyx_k__n, sizeof(__pyx_k__n), 0, 0, 1, 1},
  {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 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__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__p1n, __pyx_k__p1n, sizeof(__pyx_k__p1n), 0, 0, 1, 1},
  {&__pyx_n_s__p1s, __pyx_k__p1s, sizeof(__pyx_k__p1s), 0, 0, 1, 1},
  {&__pyx_n_s__p2, __pyx_k__p2, sizeof(__pyx_k__p2), 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__p3, __pyx_k__p3, sizeof(__pyx_k__p3), 0, 0, 1, 1},
  {&__pyx_n_s__p3n, __pyx_k__p3n, sizeof(__pyx_k__p3n), 0, 0, 1, 1},
  {&__pyx_n_s__p3s, __pyx_k__p3s, sizeof(__pyx_k__p3s), 0, 0, 1, 1},
  {&__pyx_n_s__p4, __pyx_k__p4, sizeof(__pyx_k__p4), 0, 0, 1, 1},
  {&__pyx_n_s__p4n, __pyx_k__p4n, sizeof(__pyx_k__p4n), 0, 0, 1, 1},
  {&__pyx_n_s__p4s, __pyx_k__p4s, sizeof(__pyx_k__p4s), 0, 0, 1, 1},
  {&__pyx_n_s__peak_content, __pyx_k__peak_content, sizeof(__pyx_k__peak_content), 0, 0, 1, 1},
  {&__pyx_n_s__peak_length, __pyx_k__peak_length, sizeof(__pyx_k__peak_length), 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__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__pop, __pyx_k__pop, sizeof(__pyx_k__pop), 0, 0, 1, 1},
  {&__pyx_n_s__pos, __pyx_k__pos, sizeof(__pyx_k__pos), 0, 0, 1, 1},
  {&__pyx_n_s__pqtable1, __pyx_k__pqtable1, sizeof(__pyx_k__pqtable1), 0, 0, 1, 1},
  {&__pyx_n_s__pqtable2, __pyx_k__pqtable2, sizeof(__pyx_k__pqtable2), 0, 0, 1, 1},
  {&__pyx_n_s__pre, __pyx_k__pre, sizeof(__pyx_k__pre), 0, 0, 1, 1},
  {&__pyx_n_s__pre_l, __pyx_k__pre_l, sizeof(__pyx_k__pre_l), 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__pre_q, __pyx_k__pre_q, sizeof(__pyx_k__pre_q), 0, 0, 1, 1},
  {&__pyx_n_s__pre_v, __pyx_k__pre_v, sizeof(__pyx_k__pre_v), 0, 0, 1, 1},
  {&__pyx_n_s__pscore, __pyx_k__pscore, sizeof(__pyx_k__pscore), 0, 0, 1, 1},
  {&__pyx_n_s__pvalue, __pyx_k__pvalue, sizeof(__pyx_k__pvalue), 0, 0, 1, 1},
  {&__pyx_n_s__pvalue2qvalue, __pyx_k__pvalue2qvalue, sizeof(__pyx_k__pvalue2qvalue), 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__qvalue, __pyx_k__qvalue, sizeof(__pyx_k__qvalue), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__ret, __pyx_k__ret, sizeof(__pyx_k__ret), 0, 0, 1, 1},
  {&__pyx_n_s__retadd, __pyx_k__retadd, sizeof(__pyx_k__retadd), 0, 0, 1, 1},
  {&__pyx_n_s__reverse, __pyx_k__reverse, sizeof(__pyx_k__reverse), 0, 0, 1, 1},
  {&__pyx_n_s__sample, __pyx_k__sample, sizeof(__pyx_k__sample), 0, 0, 1, 1},
  {&__pyx_n_s__sample1, __pyx_k__sample1, sizeof(__pyx_k__sample1), 0, 0, 1, 1},
  {&__pyx_n_s__sample2, __pyx_k__sample2, sizeof(__pyx_k__sample2), 0, 0, 1, 1},
  {&__pyx_n_s__sc1c2, __pyx_k__sc1c2, sizeof(__pyx_k__sc1c2), 0, 0, 1, 1},
  {&__pyx_n_s__sc1i1, __pyx_k__sc1i1, sizeof(__pyx_k__sc1i1), 0, 0, 1, 1},
  {&__pyx_n_s__sc2c1, __pyx_k__sc2c1, sizeof(__pyx_k__sc2c1), 0, 0, 1, 1},
  {&__pyx_n_s__sc2i2, __pyx_k__sc2i2, sizeof(__pyx_k__sc2i2), 0, 0, 1, 1},
  {&__pyx_n_s__score, __pyx_k__score, sizeof(__pyx_k__score), 0, 0, 1, 1},
  {&__pyx_n_s__score_btrack1, __pyx_k__score_btrack1, sizeof(__pyx_k__score_btrack1), 0, 0, 1, 1},
  {&__pyx_n_s__score_btrack2, __pyx_k__score_btrack2, sizeof(__pyx_k__score_btrack2), 0, 0, 1, 1},
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
  {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
  {&__pyx_n_s__sorted, __pyx_k__sorted, sizeof(__pyx_k__sorted), 0, 0, 1, 1},
  {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 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__summit_index, __pyx_k__summit_index, sizeof(__pyx_k__summit_index), 0, 0, 1, 1},
  {&__pyx_n_s__summit_pos, __pyx_k__summit_pos, sizeof(__pyx_k__summit_pos), 0, 0, 1, 1},
  {&__pyx_n_s__summit_value, __pyx_k__summit_value, sizeof(__pyx_k__summit_value), 0, 0, 1, 1},
  {&__pyx_n_s__t, __pyx_k__t, sizeof(__pyx_k__t), 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__this_p, __pyx_k__this_p, sizeof(__pyx_k__this_p), 0, 0, 1, 1},
  {&__pyx_n_s__this_v, __pyx_k__this_v, sizeof(__pyx_k__this_v), 0, 0, 1, 1},
  {&__pyx_n_s__tmpend, __pyx_k__tmpend, sizeof(__pyx_k__tmpend), 0, 0, 1, 1},
  {&__pyx_n_s__tmpindex, __pyx_k__tmpindex, sizeof(__pyx_k__tmpindex), 0, 0, 1, 1},
  {&__pyx_n_s__tmppeakset, __pyx_k__tmppeakset, sizeof(__pyx_k__tmppeakset), 0, 0, 1, 1},
  {&__pyx_n_s__tmpstart, __pyx_k__tmpstart, sizeof(__pyx_k__tmpstart), 0, 0, 1, 1},
  {&__pyx_n_s__tmpsummit, __pyx_k__tmpsummit, sizeof(__pyx_k__tmpsummit), 0, 0, 1, 1},
  {&__pyx_n_s__tmpsummit_index, __pyx_k__tmpsummit_index, sizeof(__pyx_k__tmpsummit_index), 0, 0, 1, 1},
  {&__pyx_n_s__tmpsummitvalue, __pyx_k__tmpsummitvalue, sizeof(__pyx_k__tmpsummitvalue), 0, 0, 1, 1},
  {&__pyx_n_s__tmpvalue, __pyx_k__tmpvalue, sizeof(__pyx_k__tmpvalue), 0, 0, 1, 1},
  {&__pyx_n_s__total, __pyx_k__total, sizeof(__pyx_k__total), 0, 0, 1, 1},
  {&__pyx_n_s__v, __pyx_k__v, sizeof(__pyx_k__v), 0, 0, 1, 1},
  {&__pyx_n_s__v1, __pyx_k__v1, sizeof(__pyx_k__v1), 0, 0, 1, 1},
  {&__pyx_n_s__v1n, __pyx_k__v1n, sizeof(__pyx_k__v1n), 0, 0, 1, 1},
  {&__pyx_n_s__v1s, __pyx_k__v1s, sizeof(__pyx_k__v1s), 0, 0, 1, 1},
  {&__pyx_n_s__v2, __pyx_k__v2, sizeof(__pyx_k__v2), 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__v3, __pyx_k__v3, sizeof(__pyx_k__v3), 0, 0, 1, 1},
  {&__pyx_n_s__v3n, __pyx_k__v3n, sizeof(__pyx_k__v3n), 0, 0, 1, 1},
  {&__pyx_n_s__v3s, __pyx_k__v3s, sizeof(__pyx_k__v3s), 0, 0, 1, 1},
  {&__pyx_n_s__v4, __pyx_k__v4, sizeof(__pyx_k__v4), 0, 0, 1, 1},
  {&__pyx_n_s__v4n, __pyx_k__v4n, sizeof(__pyx_k__v4n), 0, 0, 1, 1},
  {&__pyx_n_s__v4s, __pyx_k__v4s, sizeof(__pyx_k__v4s), 0, 0, 1, 1},
  {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
  {&__pyx_n_s__value_dict, __pyx_k__value_dict, sizeof(__pyx_k__value_dict), 0, 0, 1, 1},
  {&__pyx_n_s__vc1c2, __pyx_k__vc1c2, sizeof(__pyx_k__vc1c2), 0, 0, 1, 1},
  {&__pyx_n_s__vc1i1, __pyx_k__vc1i1, sizeof(__pyx_k__vc1i1), 0, 0, 1, 1},
  {&__pyx_n_s__vc2c1, __pyx_k__vc2c1, sizeof(__pyx_k__vc2c1), 0, 0, 1, 1},
  {&__pyx_n_s__vc2i2, __pyx_k__vc2i2, sizeof(__pyx_k__vc2i2), 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__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1},
  {&__pyx_n_s__xrange, __pyx_k__xrange, sizeof(__pyx_k__xrange), 0, 0, 1, 1},
  {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __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[0]; __pyx_lineno = 143; __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[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin_sum = __Pyx_GetName(__pyx_b, __pyx_n_s__sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __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 = 199; __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 = 362; __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 = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_max = __Pyx_GetName(__pyx_b, __pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __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/cCompositeScoreTrack.pyx":79
 *     def add_chromosome ( self, chrom, chrom_max_len ):
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
 *                                                              ('sample1','float32'),
 *                                                              ('sample2','float32'),
 */
  __pyx_k_tuple_1 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos));
  PyTuple_SET_ITEM(__pyx_k_tuple_1, 0, ((PyObject *)__pyx_n_s__pos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__int32));
  PyTuple_SET_ITEM(__pyx_k_tuple_1, 1, ((PyObject *)__pyx_n_s__int32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_1));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":80
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 *                                                              ('sample1','float32'),             # <<<<<<<<<<<<<<
 *                                                              ('sample2','float32'),
 *                                                              ('control1','float32'),
 */
  __pyx_k_tuple_2 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sample1));
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_n_s__sample1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sample1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 1, ((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":81
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 *                                                              ('sample1','float32'),
 *                                                              ('sample2','float32'),             # <<<<<<<<<<<<<<
 *                                                              ('control1','float32'),
 *                                                              ('control2','float32'),
 */
  __pyx_k_tuple_3 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sample2));
  PyTuple_SET_ITEM(__pyx_k_tuple_3, 0, ((PyObject *)__pyx_n_s__sample2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sample2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
  PyTuple_SET_ITEM(__pyx_k_tuple_3, 1, ((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":82
 *                                                              ('sample1','float32'),
 *                                                              ('sample2','float32'),
 *                                                              ('control1','float32'),             # <<<<<<<<<<<<<<
 *                                                              ('control2','float32'),
 *                                                              ('-100logq1','int32'),
 */
  __pyx_k_tuple_4 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_4);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__control1));
  PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_n_s__control1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__control1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
  PyTuple_SET_ITEM(__pyx_k_tuple_4, 1, ((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":83
 *                                                              ('sample2','float32'),
 *                                                              ('control1','float32'),
 *                                                              ('control2','float32'),             # <<<<<<<<<<<<<<
 *                                                              ('-100logq1','int32'),
 *                                                              ('-100logq2','int32')])
 */
  __pyx_k_tuple_5 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_5);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__control2));
  PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_n_s__control2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__control2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
  PyTuple_SET_ITEM(__pyx_k_tuple_5, 1, ((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":84
 *                                                              ('control1','float32'),
 *                                                              ('control2','float32'),
 *                                                              ('-100logq1','int32'),             # <<<<<<<<<<<<<<
 *                                                              ('-100logq2','int32')])
 *             self.pointer[chrom] = 0
 */
  __pyx_k_tuple_7 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_7);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
  PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_kp_s_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__int32));
  PyTuple_SET_ITEM(__pyx_k_tuple_7, 1, ((PyObject *)__pyx_n_s__int32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":85
 *                                                              ('control2','float32'),
 *                                                              ('-100logq1','int32'),
 *                                                              ('-100logq2','int32')])             # <<<<<<<<<<<<<<
 *             self.pointer[chrom] = 0
 * 
 */
  __pyx_k_tuple_9 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_9);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
  PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_s_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__int32));
  PyTuple_SET_ITEM(__pyx_k_tuple_9, 1, ((PyObject *)__pyx_n_s__int32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":452
 *     def add_chromosome ( self, chrom, chrom_max_len ):
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
 *                                                              ('sc1i1','float32'),
 *                                                              ('sc2i2','float32'),
 */
  __pyx_k_tuple_23 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_23);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos));
  PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, ((PyObject *)__pyx_n_s__pos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__int32));
  PyTuple_SET_ITEM(__pyx_k_tuple_23, 1, ((PyObject *)__pyx_n_s__int32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":453
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 *                                                              ('sc1i1','float32'),             # <<<<<<<<<<<<<<
 *                                                              ('sc2i2','float32'),
 *                                                              ('sc1c2','float32'),
 */
  __pyx_k_tuple_24 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_24);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sc1i1));
  PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_n_s__sc1i1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sc1i1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
  PyTuple_SET_ITEM(__pyx_k_tuple_24, 1, ((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":454
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 *                                                              ('sc1i1','float32'),
 *                                                              ('sc2i2','float32'),             # <<<<<<<<<<<<<<
 *                                                              ('sc1c2','float32'),
 *                                                              ('sc2c1','float32')])
 */
  __pyx_k_tuple_25 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_25);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sc2i2));
  PyTuple_SET_ITEM(__pyx_k_tuple_25, 0, ((PyObject *)__pyx_n_s__sc2i2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sc2i2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
  PyTuple_SET_ITEM(__pyx_k_tuple_25, 1, ((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":455
 *                                                              ('sc1i1','float32'),
 *                                                              ('sc2i2','float32'),
 *                                                              ('sc1c2','float32'),             # <<<<<<<<<<<<<<
 *                                                              ('sc2c1','float32')])
 *             self.pointer[chrom] = 0
 */
  __pyx_k_tuple_26 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_26);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sc1c2));
  PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_n_s__sc1c2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sc1c2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
  PyTuple_SET_ITEM(__pyx_k_tuple_26, 1, ((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":456
 *                                                              ('sc2i2','float32'),
 *                                                              ('sc1c2','float32'),
 *                                                              ('sc2c1','float32')])             # <<<<<<<<<<<<<<
 *             self.pointer[chrom] = 0
 * 
 */
  __pyx_k_tuple_27 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_27);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sc2c1));
  PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_n_s__sc2c1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sc2c1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
  PyTuple_SET_ITEM(__pyx_k_tuple_27, 1, ((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":69
 * 
 *     """
 *     def __init__ (self):             # <<<<<<<<<<<<<<
 *         """Different with bedGraphTrackI, missing values are simply
 *         replaced with 0.
 */
  __pyx_k_tuple_43 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_43);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));
  __pyx_k_codeobj_44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s____init__, 69, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":77
 *         self.pointer = {}
 * 
 *     def add_chromosome ( self, chrom, chrom_max_len ):             # <<<<<<<<<<<<<<
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 */
  __pyx_k_tuple_46 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_46);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_46, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_46, 1, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_max_len));
  PyTuple_SET_ITEM(__pyx_k_tuple_46, 2, ((PyObject *)__pyx_n_s__chrom_max_len));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_max_len));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));
  __pyx_k_codeobj_47 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__add_chromosome, 77, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":88
 *             self.pointer[chrom] = 0
 * 
 *     def add (self,chromosome,endpos,sample,control):             # <<<<<<<<<<<<<<
 *         """Add a chr-endpos-sample-control block into data
 *         dictionary. At the mean time, calculate pvalues.
 */
  __pyx_k_tuple_48 = PyTuple_New(7); if (unlikely(!__pyx_k_tuple_48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_48);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_48, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chromosome));
  PyTuple_SET_ITEM(__pyx_k_tuple_48, 1, ((PyObject *)__pyx_n_s__chromosome));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chromosome));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__endpos));
  PyTuple_SET_ITEM(__pyx_k_tuple_48, 2, ((PyObject *)__pyx_n_s__endpos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__endpos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sample));
  PyTuple_SET_ITEM(__pyx_k_tuple_48, 3, ((PyObject *)__pyx_n_s__sample));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sample));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__control));
  PyTuple_SET_ITEM(__pyx_k_tuple_48, 4, ((PyObject *)__pyx_n_s__control));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__control));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__c));
  PyTuple_SET_ITEM(__pyx_k_tuple_48, 5, ((PyObject *)__pyx_n_s__c));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__c));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_48, 6, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_48));
  __pyx_k_codeobj_49 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__add, 88, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":100
 *         self.pointer[chromosome] += 1
 * 
 *     def get_data_by_chr (self, chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */
  __pyx_k_tuple_50 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_50);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_50, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chromosome));
  PyTuple_SET_ITEM(__pyx_k_tuple_50, 1, ((PyObject *)__pyx_n_s__chromosome));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chromosome));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));
  __pyx_k_codeobj_51 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__get_data_by_chr, 100, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":111
 *             return None
 * 
 *     def get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */
  __pyx_k_tuple_52 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_52);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_52, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__l));
  PyTuple_SET_ITEM(__pyx_k_tuple_52, 1, ((PyObject *)__pyx_n_s__l));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__l));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52));
  __pyx_k_codeobj_53 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__get_chr_names, 111, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":118
 *         return l
 * 
 *     def write_bedGraph (self, fhd, name, description, colname):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in Wiggle Format.
 * 
 */
  __pyx_k_tuple_54 = PyTuple_New(14); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_54);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fhd));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 1, ((PyObject *)__pyx_n_s__fhd));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fhd));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__name));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 2, ((PyObject *)__pyx_n_s__name));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__name));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__description));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 3, ((PyObject *)__pyx_n_s__description));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__description));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__colname));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 4, ((PyObject *)__pyx_n_s__colname));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__colname));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__flag100));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 5, ((PyObject *)__pyx_n_s__flag100));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__flag100));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrs));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 6, ((PyObject *)__pyx_n_s__chrs));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrs));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 7, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 8, ((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__l));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 9, ((PyObject *)__pyx_n_s__l));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__l));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pre));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 10, ((PyObject *)__pyx_n_s__pre));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pre));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 11, ((PyObject *)__pyx_n_s__pos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__value));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 12, ((PyObject *)__pyx_n_s__value));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__value));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 13, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));
  __pyx_k_codeobj_55 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__write_bedGraph, 118, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":149
 *         return True
 * 
 *     def __calculate_fold_change ( self, chrom, index ):             # <<<<<<<<<<<<<<
 *         """From 'sample' and 'control' columns, calculate foldchanges.
 * 
 */
  __pyx_k_tuple_56 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_56);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_56, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_56, 1, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__index));
  PyTuple_SET_ITEM(__pyx_k_tuple_56, 2, ((PyObject *)__pyx_n_s__index));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__index));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));
  __pyx_k_codeobj_57 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s_58, 149, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":158
 *         return self.data[chrom]['sample'][index]/self.data[chrom]['control'][index]
 * 
 *     def make_pq_table ( self ):             # <<<<<<<<<<<<<<
 *         """Make pvalue-qvalue table.
 * 
 */
  __pyx_k_tuple_60 = PyTuple_New(21); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_60);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__n));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 1, ((PyObject *)__pyx_n_s__n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__value_dict));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 2, ((PyObject *)__pyx_n_s__value_dict));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__value_dict));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 3, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pre_p));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 4, ((PyObject *)__pyx_n_s__pre_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pre_p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 5, ((PyObject *)__pyx_n_s__pos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__value));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 6, ((PyObject *)__pyx_n_s__value));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__value));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__length));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 7, ((PyObject *)__pyx_n_s__length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__length));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__j));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 8, ((PyObject *)__pyx_n_s__j));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__j));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__this_p));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 9, ((PyObject *)__pyx_n_s__this_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__this_p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__this_v));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 10, ((PyObject *)__pyx_n_s__this_v));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__this_v));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__N));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 11, ((PyObject *)__pyx_n_s__N));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__N));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__k));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 12, ((PyObject *)__pyx_n_s__k));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__k));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__f));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 13, ((PyObject *)__pyx_n_s__f));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pre_v));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 14, ((PyObject *)__pyx_n_s__pre_v));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pre_v));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pre_l));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 15, ((PyObject *)__pyx_n_s__pre_l));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pre_l));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pre_q));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 16, ((PyObject *)__pyx_n_s__pre_q));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pre_q));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pvalue2qvalue));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 17, ((PyObject *)__pyx_n_s__pvalue2qvalue));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pvalue2qvalue));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 18, ((PyObject *)__pyx_n_s__v));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__l));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 19, ((PyObject *)__pyx_n_s__l));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__l));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__q));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 20, ((PyObject *)__pyx_n_s__q));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__q));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60));
  __pyx_k_codeobj_61 = (PyObject*)__Pyx_PyCode_New(1, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__make_pq_table, 158, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":215
 *         return pvalue2qvalue
 * 
 *     def assign_qvalue ( self , pvalue2qvalue ):             # <<<<<<<<<<<<<<
 *         """Assign -100log10qvalue to every point.
 * 
 */
  __pyx_k_tuple_62 = PyTuple_New(7); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_62);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_62, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pvalue2qvalue));
  PyTuple_SET_ITEM(__pyx_k_tuple_62, 1, ((PyObject *)__pyx_n_s__pvalue2qvalue));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pvalue2qvalue));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__t));
  PyTuple_SET_ITEM(__pyx_k_tuple_62, 2, ((PyObject *)__pyx_n_s__t));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__t));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_62, 3, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pvalue));
  PyTuple_SET_ITEM(__pyx_k_tuple_62, 4, ((PyObject *)__pyx_n_s__pvalue));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pvalue));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__qvalue));
  PyTuple_SET_ITEM(__pyx_k_tuple_62, 5, ((PyObject *)__pyx_n_s__qvalue));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__qvalue));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_62, 6, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));
  __pyx_k_codeobj_63 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__assign_qvalue, 215, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":228
 *         return True
 * 
 *     def call_peaks (self, cutoff=500, min_length=200, max_gap=50, colname='-100logp'):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
  __pyx_k_tuple_65 = PyTuple_New(16); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_65);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__cutoff));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 1, ((PyObject *)__pyx_n_s__cutoff));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cutoff));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__min_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 2, ((PyObject *)__pyx_n_s__min_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min_length));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__max_gap));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 3, ((PyObject *)__pyx_n_s__max_gap));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__max_gap));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__colname));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 4, ((PyObject *)__pyx_n_s__colname));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__colname));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrs));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 5, ((PyObject *)__pyx_n_s__chrs));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrs));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 6, ((PyObject *)__pyx_n_s__peaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 7, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_pointer));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 8, ((PyObject *)__pyx_n_s__chrom_pointer));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_pointer));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peak_content));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 9, ((PyObject *)__pyx_n_s__peak_content));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peak_content));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__above_cutoff));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 10, ((PyObject *)__pyx_n_s__above_cutoff));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__above_cutoff));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__above_cutoff_v));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 11, ((PyObject *)__pyx_n_s__above_cutoff_v));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__above_cutoff_v));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__above_cutoff_endpos));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 12, ((PyObject *)__pyx_n_s__above_cutoff_endpos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__above_cutoff_endpos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s_64));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 13, ((PyObject *)__pyx_n_s_64));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_64));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__above_cutoff_sv));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 14, ((PyObject *)__pyx_n_s__above_cutoff_sv));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__above_cutoff_sv));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 15, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));
  __pyx_k_codeobj_66 = (PyObject*)__Pyx_PyCode_New(5, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__call_peaks, 228, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_tuple_67 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_67);
  __Pyx_INCREF(((PyObject *)__pyx_int_500));
  PyTuple_SET_ITEM(__pyx_k_tuple_67, 0, ((PyObject *)__pyx_int_500));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_500));
  __Pyx_INCREF(((PyObject *)__pyx_int_200));
  PyTuple_SET_ITEM(__pyx_k_tuple_67, 1, ((PyObject *)__pyx_int_200));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_200));
  __Pyx_INCREF(((PyObject *)__pyx_int_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_67, 2, ((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_50));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_kp_s_10)));
  PyTuple_SET_ITEM(__pyx_k_tuple_67, 3, ((PyObject *)((PyObject*)__pyx_kp_s_10)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_kp_s_10)));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":292
 *         return peaks
 * 
 *     def __close_peak (self, peak_content, peaks, min_length, chrom, colname):             # <<<<<<<<<<<<<<
 *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *         if peak_length >= min_length: # if the peak is too small, reject it
 */
  __pyx_k_tuple_68 = PyTuple_New(18); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_68);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peak_content));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 1, ((PyObject *)__pyx_n_s__peak_content));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peak_content));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 2, ((PyObject *)__pyx_n_s__peaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__min_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 3, ((PyObject *)__pyx_n_s__min_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min_length));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 4, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__colname));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 5, ((PyObject *)__pyx_n_s__colname));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__colname));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peak_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 6, ((PyObject *)__pyx_n_s__peak_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peak_length));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tmpsummit));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 7, ((PyObject *)__pyx_n_s__tmpsummit));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tmpsummit));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__summit_pos));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 8, ((PyObject *)__pyx_n_s__summit_pos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__summit_pos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__summit_value));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 9, ((PyObject *)__pyx_n_s__summit_value));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__summit_value));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tmpstart));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 10, ((PyObject *)__pyx_n_s__tmpstart));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tmpstart));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tmpend));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 11, ((PyObject *)__pyx_n_s__tmpend));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tmpend));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tmpvalue));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 12, ((PyObject *)__pyx_n_s__tmpvalue));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tmpvalue));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tmpsummitvalue));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 13, ((PyObject *)__pyx_n_s__tmpsummitvalue));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tmpsummitvalue));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tmpindex));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 14, ((PyObject *)__pyx_n_s__tmpindex));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tmpindex));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tmpsummit_index));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 15, ((PyObject *)__pyx_n_s__tmpsummit_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tmpsummit_index));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__middle_summit));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 16, ((PyObject *)__pyx_n_s__middle_summit));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__middle_summit));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__summit_index));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 17, ((PyObject *)__pyx_n_s__summit_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__summit_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));
  __pyx_k_codeobj_69 = (PyObject*)__Pyx_PyCode_New(6, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s____close_peak, 292, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":331
 *             return True
 * 
 *     def call_broadpeaks (self, lvl1_cutoff=500, lvl2_cutoff=100, min_length=200, lvl1_max_gap=50, lvl2_max_gap=400, colname='-100logq'):             # <<<<<<<<<<<<<<
 *         """This function try to find enriched regions within which,
 *         scores are continuously higher than a given cutoff for level
 */
  __pyx_k_tuple_70 = PyTuple_New(18); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_70);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl1_cutoff));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 1, ((PyObject *)__pyx_n_s__lvl1_cutoff));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl1_cutoff));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl2_cutoff));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 2, ((PyObject *)__pyx_n_s__lvl2_cutoff));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl2_cutoff));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__min_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 3, ((PyObject *)__pyx_n_s__min_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min_length));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl1_max_gap));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 4, ((PyObject *)__pyx_n_s__lvl1_max_gap));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl1_max_gap));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl2_max_gap));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 5, ((PyObject *)__pyx_n_s__lvl2_max_gap));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl2_max_gap));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__colname));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 6, ((PyObject *)__pyx_n_s__colname));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__colname));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl1_peaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 7, ((PyObject *)__pyx_n_s__lvl1_peaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl1_peaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl2_peaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 8, ((PyObject *)__pyx_n_s__lvl2_peaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl2_peaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrs));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 9, ((PyObject *)__pyx_n_s__chrs));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrs));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__broadpeaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 10, ((PyObject *)__pyx_n_s__broadpeaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__broadpeaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 11, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl1peakschrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 12, ((PyObject *)__pyx_n_s__lvl1peakschrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl1peakschrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl2peakschrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 13, ((PyObject *)__pyx_n_s__lvl2peakschrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl2peakschrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl1peakschrom_next));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 14, ((PyObject *)__pyx_n_s__lvl1peakschrom_next));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl1peakschrom_next));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tmppeakset));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 15, ((PyObject *)__pyx_n_s__tmppeakset));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tmppeakset));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl1));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 16, ((PyObject *)__pyx_n_s__lvl1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl2));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 17, ((PyObject *)__pyx_n_s__lvl2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl2));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));
  __pyx_k_codeobj_71 = (PyObject*)__Pyx_PyCode_New(7, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__call_broadpeaks, 331, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_tuple_72 = PyTuple_New(6); if (unlikely(!__pyx_k_tuple_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_72);
  __Pyx_INCREF(((PyObject *)__pyx_int_500));
  PyTuple_SET_ITEM(__pyx_k_tuple_72, 0, ((PyObject *)__pyx_int_500));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_500));
  __Pyx_INCREF(((PyObject *)__pyx_int_100));
  PyTuple_SET_ITEM(__pyx_k_tuple_72, 1, ((PyObject *)__pyx_int_100));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_100));
  __Pyx_INCREF(((PyObject *)__pyx_int_200));
  PyTuple_SET_ITEM(__pyx_k_tuple_72, 2, ((PyObject *)__pyx_int_200));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_200));
  __Pyx_INCREF(((PyObject *)__pyx_int_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_72, 3, ((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_50));
  __Pyx_INCREF(((PyObject *)__pyx_int_400));
  PyTuple_SET_ITEM(__pyx_k_tuple_72, 4, ((PyObject *)__pyx_int_400));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_400));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_kp_s_11)));
  PyTuple_SET_ITEM(__pyx_k_tuple_72, 5, ((PyObject *)((PyObject*)__pyx_kp_s_11)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_kp_s_11)));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_72));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":383
 *         return lvl1_peaks, broadpeaks
 * 
 *     def __add_broadpeak (self, bpeaks, chrom, lvl2peak, lvl1peakset):             # <<<<<<<<<<<<<<
 *         """Internal function to create broad peak.
 * 
 */
  __pyx_k_tuple_73 = PyTuple_New(12); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_73);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bpeaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 1, ((PyObject *)__pyx_n_s__bpeaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bpeaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 2, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl2peak));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 3, ((PyObject *)__pyx_n_s__lvl2peak));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl2peak));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lvl1peakset));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 4, ((PyObject *)__pyx_n_s__lvl1peakset));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lvl1peakset));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__start));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 5, ((PyObject *)__pyx_n_s__start));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__start));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__end));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 6, ((PyObject *)__pyx_n_s__end));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__end));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__thickStart));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 7, ((PyObject *)__pyx_n_s__thickStart));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__thickStart));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__thickEnd));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 8, ((PyObject *)__pyx_n_s__thickEnd));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__thickEnd));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__blockNum));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 9, ((PyObject *)__pyx_n_s__blockNum));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__blockNum));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__blockSizes));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 10, ((PyObject *)__pyx_n_s__blockSizes));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__blockSizes));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__blockStarts));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 11, ((PyObject *)__pyx_n_s__blockStarts));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__blockStarts));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73));
  __pyx_k_codeobj_74 = (PyObject*)__Pyx_PyCode_New(5, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s____add_broadpeak, 383, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":409
 *         return bpeaks
 * 
 *     def total ( self ):             # <<<<<<<<<<<<<<
 *         """Return the number of regions in this object.
 * 
 */
  __pyx_k_tuple_75 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_75);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_75, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__t));
  PyTuple_SET_ITEM(__pyx_k_tuple_75, 1, ((PyObject *)__pyx_n_s__t));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__t));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_75, 2, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75));
  __pyx_k_codeobj_76 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__total, 409, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":442
 * 
 *     """
 *     def __init__ (self):             # <<<<<<<<<<<<<<
 *         """Different with bedGraphTrackI, missing values are simply
 *         replaced with 0.
 */
  __pyx_k_tuple_78 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_78);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_78, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_78));
  __pyx_k_codeobj_79 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s____init__, 442, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":450
 *         self.pointer = {}
 * 
 *     def add_chromosome ( self, chrom, chrom_max_len ):             # <<<<<<<<<<<<<<
 *         if not self.data.has_key(chrom):
 *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
 */
  __pyx_k_tuple_80 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_80);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_80, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_80, 1, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_max_len));
  PyTuple_SET_ITEM(__pyx_k_tuple_80, 2, ((PyObject *)__pyx_n_s__chrom_max_len));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_max_len));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80));
  __pyx_k_codeobj_81 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__add_chromosome, 450, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":459
 *             self.pointer[chrom] = 0
 * 
 *     def add (self,chromosome,endpos,sc1i1,sc2i2,sc1c2,sc2c1):             # <<<<<<<<<<<<<<
 *         """Add a chr-endpos-score-score-score-score block into data
 *         dictionary.
 */
  __pyx_k_tuple_82 = PyTuple_New(9); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_82);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_82, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chromosome));
  PyTuple_SET_ITEM(__pyx_k_tuple_82, 1, ((PyObject *)__pyx_n_s__chromosome));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chromosome));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__endpos));
  PyTuple_SET_ITEM(__pyx_k_tuple_82, 2, ((PyObject *)__pyx_n_s__endpos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__endpos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sc1i1));
  PyTuple_SET_ITEM(__pyx_k_tuple_82, 3, ((PyObject *)__pyx_n_s__sc1i1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sc1i1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sc2i2));
  PyTuple_SET_ITEM(__pyx_k_tuple_82, 4, ((PyObject *)__pyx_n_s__sc2i2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sc2i2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sc1c2));
  PyTuple_SET_ITEM(__pyx_k_tuple_82, 5, ((PyObject *)__pyx_n_s__sc1c2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sc1c2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sc2c1));
  PyTuple_SET_ITEM(__pyx_k_tuple_82, 6, ((PyObject *)__pyx_n_s__sc2c1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sc2c1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__c));
  PyTuple_SET_ITEM(__pyx_k_tuple_82, 7, ((PyObject *)__pyx_n_s__c));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__c));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_82, 8, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82));
  __pyx_k_codeobj_83 = (PyObject*)__Pyx_PyCode_New(7, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__add, 459, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":470
 *         self.pointer[chromosome] += 1
 * 
 *     def get_data_by_chr (self, chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */
  __pyx_k_tuple_84 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_84);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_84, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chromosome));
  PyTuple_SET_ITEM(__pyx_k_tuple_84, 1, ((PyObject *)__pyx_n_s__chromosome));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chromosome));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_84));
  __pyx_k_codeobj_85 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__get_data_by_chr, 470, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":481
 *             return None
 * 
 *     def get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */
  __pyx_k_tuple_86 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_86);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_86, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__l));
  PyTuple_SET_ITEM(__pyx_k_tuple_86, 1, ((PyObject *)__pyx_n_s__l));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__l));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_86));
  __pyx_k_codeobj_87 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__get_chr_names, 481, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":488
 *         return l
 * 
 *     def call_consistent (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
  __pyx_k_tuple_88 = PyTuple_New(24); if (unlikely(!__pyx_k_tuple_88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_88);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__cutoff));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 1, ((PyObject *)__pyx_n_s__cutoff));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cutoff));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__min_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 2, ((PyObject *)__pyx_n_s__min_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min_length));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__max_gap));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 3, ((PyObject *)__pyx_n_s__max_gap));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__max_gap));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrs));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 4, ((PyObject *)__pyx_n_s__chrs));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrs));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 5, ((PyObject *)__pyx_n_s__peaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 6, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_pointer));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 7, ((PyObject *)__pyx_n_s__chrom_pointer));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_pointer));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_d));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 8, ((PyObject *)__pyx_n_s__chrom_d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_d));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_pos));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 9, ((PyObject *)__pyx_n_s__chrom_pos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_pos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc1i1));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 10, ((PyObject *)__pyx_n_s__chrom_sc1i1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc1i1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc2i2));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 11, ((PyObject *)__pyx_n_s__chrom_sc2i2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc2i2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc1c2));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 12, ((PyObject *)__pyx_n_s__chrom_sc1c2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc1c2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc2c1));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 13, ((PyObject *)__pyx_n_s__chrom_sc2c1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc2c1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__x));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 14, ((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__x));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pre_p));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 15, ((PyObject *)__pyx_n_s__pre_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pre_p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peak_content));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 16, ((PyObject *)__pyx_n_s__peak_content));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peak_content));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 17, ((PyObject *)__pyx_n_s__p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc1i1));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 18, ((PyObject *)__pyx_n_s__vc1i1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc1i1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc2i2));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 19, ((PyObject *)__pyx_n_s__vc2i2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc2i2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc1c2));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 20, ((PyObject *)__pyx_n_s__vc1c2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc1c2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc2c1));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 21, ((PyObject *)__pyx_n_s__vc2c1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc2c1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 22, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peak_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 23, ((PyObject *)__pyx_n_s__peak_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peak_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_88));
  __pyx_k_codeobj_89 = (PyObject*)__Pyx_PyCode_New(4, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__call_consistent, 488, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_tuple_90 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_90);
  __Pyx_INCREF(((PyObject *)__pyx_int_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_90, 0, ((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_50));
  __Pyx_INCREF(((PyObject *)__pyx_int_200));
  PyTuple_SET_ITEM(__pyx_k_tuple_90, 1, ((PyObject *)__pyx_int_200));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_200));
  __Pyx_INCREF(((PyObject *)__pyx_int_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_90, 2, ((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_90));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":583
 *         return peaks
 * 
 *     def call_condition1_unique (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
  __pyx_k_tuple_91 = PyTuple_New(20); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_91);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__cutoff));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 1, ((PyObject *)__pyx_n_s__cutoff));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cutoff));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__min_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 2, ((PyObject *)__pyx_n_s__min_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min_length));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__max_gap));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 3, ((PyObject *)__pyx_n_s__max_gap));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__max_gap));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrs));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 4, ((PyObject *)__pyx_n_s__chrs));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrs));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 5, ((PyObject *)__pyx_n_s__peaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 6, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_pointer));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 7, ((PyObject *)__pyx_n_s__chrom_pointer));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_pointer));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_d));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 8, ((PyObject *)__pyx_n_s__chrom_d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_d));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_pos));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 9, ((PyObject *)__pyx_n_s__chrom_pos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_pos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc1i1));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 10, ((PyObject *)__pyx_n_s__chrom_sc1i1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc1i1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc1c2));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 11, ((PyObject *)__pyx_n_s__chrom_sc1c2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc1c2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__x));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 12, ((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__x));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pre_p));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 13, ((PyObject *)__pyx_n_s__pre_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pre_p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peak_content));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 14, ((PyObject *)__pyx_n_s__peak_content));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peak_content));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 15, ((PyObject *)__pyx_n_s__p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc1i1));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 16, ((PyObject *)__pyx_n_s__vc1i1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc1i1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc1c2));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 17, ((PyObject *)__pyx_n_s__vc1c2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc1c2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 18, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peak_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 19, ((PyObject *)__pyx_n_s__peak_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peak_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_91));
  __pyx_k_codeobj_92 = (PyObject*)__Pyx_PyCode_New(4, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s_93, 583, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_tuple_94 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_94);
  __Pyx_INCREF(((PyObject *)__pyx_int_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_94, 0, ((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_50));
  __Pyx_INCREF(((PyObject *)__pyx_int_200));
  PyTuple_SET_ITEM(__pyx_k_tuple_94, 1, ((PyObject *)__pyx_int_200));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_200));
  __Pyx_INCREF(((PyObject *)__pyx_int_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_94, 2, ((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_94));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":667
 *         return peaks
 * 
 *     def call_condition2_unique (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
  __pyx_k_tuple_95 = PyTuple_New(20); if (unlikely(!__pyx_k_tuple_95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_95);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__cutoff));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 1, ((PyObject *)__pyx_n_s__cutoff));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cutoff));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__min_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 2, ((PyObject *)__pyx_n_s__min_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min_length));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__max_gap));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 3, ((PyObject *)__pyx_n_s__max_gap));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__max_gap));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrs));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 4, ((PyObject *)__pyx_n_s__chrs));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrs));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 5, ((PyObject *)__pyx_n_s__peaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 6, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_pointer));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 7, ((PyObject *)__pyx_n_s__chrom_pointer));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_pointer));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_d));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 8, ((PyObject *)__pyx_n_s__chrom_d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_d));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_pos));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 9, ((PyObject *)__pyx_n_s__chrom_pos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_pos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc2i2));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 10, ((PyObject *)__pyx_n_s__chrom_sc2i2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc2i2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc2c1));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 11, ((PyObject *)__pyx_n_s__chrom_sc2c1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc2c1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__x));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 12, ((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__x));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pre_p));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 13, ((PyObject *)__pyx_n_s__pre_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pre_p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peak_content));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 14, ((PyObject *)__pyx_n_s__peak_content));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peak_content));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 15, ((PyObject *)__pyx_n_s__p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc2i2));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 16, ((PyObject *)__pyx_n_s__vc2i2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc2i2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc2c1));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 17, ((PyObject *)__pyx_n_s__vc2c1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc2c1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 18, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peak_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 19, ((PyObject *)__pyx_n_s__peak_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peak_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_95));
  __pyx_k_codeobj_96 = (PyObject*)__Pyx_PyCode_New(4, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s_97, 667, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_tuple_98 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_98);
  __Pyx_INCREF(((PyObject *)__pyx_int_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_98, 0, ((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_50));
  __Pyx_INCREF(((PyObject *)__pyx_int_200));
  PyTuple_SET_ITEM(__pyx_k_tuple_98, 1, ((PyObject *)__pyx_int_200));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_200));
  __Pyx_INCREF(((PyObject *)__pyx_int_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_98, 2, ((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":750
 * 
 * 
 *     def call_diff_regions (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """A function to call differential regions and common regions together.
 * 
 */
  __pyx_k_tuple_102 = PyTuple_New(31); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_102);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__cutoff));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 1, ((PyObject *)__pyx_n_s__cutoff));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cutoff));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__min_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 2, ((PyObject *)__pyx_n_s__min_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min_length));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__max_gap));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 3, ((PyObject *)__pyx_n_s__max_gap));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__max_gap));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrs));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 4, ((PyObject *)__pyx_n_s__chrs));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrs));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__consistent_peaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 5, ((PyObject *)__pyx_n_s__consistent_peaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__consistent_peaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__condition1_peaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 6, ((PyObject *)__pyx_n_s__condition1_peaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__condition1_peaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__condition2_peaks));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 7, ((PyObject *)__pyx_n_s__condition2_peaks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__condition2_peaks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 8, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_pointer));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 9, ((PyObject *)__pyx_n_s__chrom_pointer));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_pointer));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_d));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 10, ((PyObject *)__pyx_n_s__chrom_d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_d));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_pos));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 11, ((PyObject *)__pyx_n_s__chrom_pos));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_pos));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc1i1));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 12, ((PyObject *)__pyx_n_s__chrom_sc1i1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc1i1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc2i2));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 13, ((PyObject *)__pyx_n_s__chrom_sc2i2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc2i2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc1c2));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 14, ((PyObject *)__pyx_n_s__chrom_sc1c2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc1c2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_sc2c1));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 15, ((PyObject *)__pyx_n_s__chrom_sc2c1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_sc2c1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__x));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 16, ((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__x));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pre_p));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 17, ((PyObject *)__pyx_n_s__pre_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pre_p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s_99));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 18, ((PyObject *)__pyx_n_s_99));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_99));
  __Pyx_INCREF(((PyObject *)__pyx_n_s_100));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 19, ((PyObject *)__pyx_n_s_100));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_100));
  __Pyx_INCREF(((PyObject *)__pyx_n_s_101));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 20, ((PyObject *)__pyx_n_s_101));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_101));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 21, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 22, ((PyObject *)__pyx_n_s__p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc1i1));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 23, ((PyObject *)__pyx_n_s__vc1i1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc1i1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc2i2));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 24, ((PyObject *)__pyx_n_s__vc2i2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc2i2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc1c2));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 25, ((PyObject *)__pyx_n_s__vc1c2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc1c2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__vc2c1));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 26, ((PyObject *)__pyx_n_s__vc2c1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__vc2c1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__peak_length));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 27, ((PyObject *)__pyx_n_s__peak_length));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__peak_length));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__m_c1c2));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 28, ((PyObject *)__pyx_n_s__m_c1c2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__m_c1c2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__m_c2c1));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 29, ((PyObject *)__pyx_n_s__m_c2c1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__m_c2c1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__diff_score));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 30, ((PyObject *)__pyx_n_s__diff_score));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__diff_score));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102));
  __pyx_k_codeobj_103 = (PyObject*)__Pyx_PyCode_New(4, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__call_diff_regions, 750, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_tuple_104 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_104);
  __Pyx_INCREF(((PyObject *)__pyx_int_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_104, 0, ((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_50));
  __Pyx_INCREF(((PyObject *)__pyx_int_200));
  PyTuple_SET_ITEM(__pyx_k_tuple_104, 1, ((PyObject *)__pyx_int_200));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_200));
  __Pyx_INCREF(((PyObject *)__pyx_int_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_104, 2, ((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_104));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":933
 *         return ( consistent_peaks, condition1_peaks, condition2_peaks )
 * 
 *     def total ( self ):             # <<<<<<<<<<<<<<
 *         """Return the number of regions in this object.
 * 
 */
  __pyx_k_tuple_105 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_105);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
  PyTuple_SET_ITEM(__pyx_k_tuple_105, 0, ((PyObject *)__pyx_n_s__self));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__t));
  PyTuple_SET_ITEM(__pyx_k_tuple_105, 1, ((PyObject *)__pyx_n_s__t));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__t));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_105, 2, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_105));
  __pyx_k_codeobj_106 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s__total, 933, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":946
 *     #
 * 
 * def make_compositeScoreTrack (bdgTrack1, bdgTrack2, bdgTrack3, bdgTrack4 ):             # <<<<<<<<<<<<<<
 *     """A modified overlie function for MACS DIFF.
 * 
 */
  __pyx_k_tuple_108 = PyTuple_New(39); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_108);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bdgTrack1));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 0, ((PyObject *)__pyx_n_s__bdgTrack1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bdgTrack1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bdgTrack2));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 1, ((PyObject *)__pyx_n_s__bdgTrack2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bdgTrack2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bdgTrack3));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 2, ((PyObject *)__pyx_n_s__bdgTrack3));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bdgTrack3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bdgTrack4));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 3, ((PyObject *)__pyx_n_s__bdgTrack4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bdgTrack4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ret));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 4, ((PyObject *)__pyx_n_s__ret));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ret));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__retadd));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 5, ((PyObject *)__pyx_n_s__retadd));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__retadd));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chr1));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 6, ((PyObject *)__pyx_n_s__chr1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chr1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chr2));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 7, ((PyObject *)__pyx_n_s__chr2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chr2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chr3));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 8, ((PyObject *)__pyx_n_s__chr3));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chr3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chr4));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 9, ((PyObject *)__pyx_n_s__chr4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chr4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__common_chr));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 10, ((PyObject *)__pyx_n_s__common_chr));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__common_chr));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 11, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p1s));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 12, ((PyObject *)__pyx_n_s__p1s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p1s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v1s));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 13, ((PyObject *)__pyx_n_s__v1s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v1s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p1n));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 14, ((PyObject *)__pyx_n_s__p1n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p1n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v1n));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 15, ((PyObject *)__pyx_n_s__v1n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v1n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p2s));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 16, ((PyObject *)__pyx_n_s__p2s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p2s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v2s));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 17, ((PyObject *)__pyx_n_s__v2s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v2s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p2n));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 18, ((PyObject *)__pyx_n_s__p2n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p2n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v2n));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 19, ((PyObject *)__pyx_n_s__v2n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v2n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p3s));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 20, ((PyObject *)__pyx_n_s__p3s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p3s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v3s));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 21, ((PyObject *)__pyx_n_s__v3s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v3s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p3n));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 22, ((PyObject *)__pyx_n_s__p3n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p3n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v3n));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 23, ((PyObject *)__pyx_n_s__v3n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v3n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p4s));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 24, ((PyObject *)__pyx_n_s__p4s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p4s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v4s));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 25, ((PyObject *)__pyx_n_s__v4s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v4s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p4n));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 26, ((PyObject *)__pyx_n_s__p4n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p4n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v4n));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 27, ((PyObject *)__pyx_n_s__v4n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v4n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_max_len));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 28, ((PyObject *)__pyx_n_s__chrom_max_len));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_max_len));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pre_p));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 29, ((PyObject *)__pyx_n_s__pre_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pre_p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p1));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 30, ((PyObject *)__pyx_n_s__p1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v1));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 31, ((PyObject *)__pyx_n_s__v1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p2));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 32, ((PyObject *)__pyx_n_s__p2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v2));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 33, ((PyObject *)__pyx_n_s__v2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p3));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 34, ((PyObject *)__pyx_n_s__p3));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v3));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 35, ((PyObject *)__pyx_n_s__v3));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p4));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 36, ((PyObject *)__pyx_n_s__p4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v4));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 37, ((PyObject *)__pyx_n_s__v4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__min_p));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 38, ((PyObject *)__pyx_n_s__min_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_108));
  __pyx_k_codeobj_109 = (PyObject*)__Pyx_PyCode_New(4, 0, 39, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s_110, 946, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1026
 * 
 * 
 * def make_compositeScoreTrack2 (bdgTrack1, bdgTrack2, bdgTrack3, bdgTrack4 ):             # <<<<<<<<<<<<<<
 *     """A modified overlie function for MACS DIFF.
 * 
 */
  __pyx_k_tuple_111 = PyTuple_New(39); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_111);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bdgTrack1));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 0, ((PyObject *)__pyx_n_s__bdgTrack1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bdgTrack1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bdgTrack2));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 1, ((PyObject *)__pyx_n_s__bdgTrack2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bdgTrack2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bdgTrack3));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 2, ((PyObject *)__pyx_n_s__bdgTrack3));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bdgTrack3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bdgTrack4));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 3, ((PyObject *)__pyx_n_s__bdgTrack4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bdgTrack4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ret));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 4, ((PyObject *)__pyx_n_s__ret));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ret));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__retadd));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 5, ((PyObject *)__pyx_n_s__retadd));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__retadd));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__score_btrack1));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 6, ((PyObject *)__pyx_n_s__score_btrack1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__score_btrack1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pqtable1));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 7, ((PyObject *)__pyx_n_s__pqtable1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pqtable1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__score_btrack2));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 8, ((PyObject *)__pyx_n_s__score_btrack2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__score_btrack2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pqtable2));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 9, ((PyObject *)__pyx_n_s__pqtable2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pqtable2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__common_chr));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 10, ((PyObject *)__pyx_n_s__common_chr));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__common_chr));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 11, ((PyObject *)__pyx_n_s__chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p1s));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 12, ((PyObject *)__pyx_n_s__p1s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p1s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v1s));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 13, ((PyObject *)__pyx_n_s__v1s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v1s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p1n));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 14, ((PyObject *)__pyx_n_s__p1n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p1n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v1n));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 15, ((PyObject *)__pyx_n_s__v1n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v1n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p2s));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 16, ((PyObject *)__pyx_n_s__p2s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p2s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v2s));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 17, ((PyObject *)__pyx_n_s__v2s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v2s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p2n));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 18, ((PyObject *)__pyx_n_s__p2n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p2n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v2n));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 19, ((PyObject *)__pyx_n_s__v2n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v2n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p3s));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 20, ((PyObject *)__pyx_n_s__p3s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p3s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v3s));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 21, ((PyObject *)__pyx_n_s__v3s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v3s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p3n));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 22, ((PyObject *)__pyx_n_s__p3n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p3n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v3n));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 23, ((PyObject *)__pyx_n_s__v3n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v3n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p4s));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 24, ((PyObject *)__pyx_n_s__p4s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p4s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v4s));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 25, ((PyObject *)__pyx_n_s__v4s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v4s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p4n));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 26, ((PyObject *)__pyx_n_s__p4n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p4n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v4n));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 27, ((PyObject *)__pyx_n_s__v4n));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v4n));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__chrom_max_len));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 28, ((PyObject *)__pyx_n_s__chrom_max_len));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chrom_max_len));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pre_p));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 29, ((PyObject *)__pyx_n_s__pre_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pre_p));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p1));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 30, ((PyObject *)__pyx_n_s__p1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v1));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 31, ((PyObject *)__pyx_n_s__v1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p2));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 32, ((PyObject *)__pyx_n_s__p2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v2));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 33, ((PyObject *)__pyx_n_s__v2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p3));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 34, ((PyObject *)__pyx_n_s__p3));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v3));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 35, ((PyObject *)__pyx_n_s__v3));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__p4));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 36, ((PyObject *)__pyx_n_s__p4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__v4));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 37, ((PyObject *)__pyx_n_s__v4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__v4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__min_p));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 38, ((PyObject *)__pyx_n_s__min_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min_p));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_111));
  __pyx_k_codeobj_112 = (PyObject*)__Pyx_PyCode_New(4, 0, 39, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_45, __pyx_n_s_113, 1026, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_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_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_400 = PyInt_FromLong(400); if (unlikely(!__pyx_int_400)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_500 = PyInt_FromLong(500); if (unlikely(!__pyx_int_500)) {__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 initcCompositeScoreTrack(void); /*proto*/
PyMODINIT_FUNC initcCompositeScoreTrack(void)
#else
PyMODINIT_FUNC PyInit_cCompositeScoreTrack(void); /*proto*/
PyMODINIT_FUNC PyInit_cCompositeScoreTrack(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_cCompositeScoreTrack(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("cCompositeScoreTrack"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_35), 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  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__cCompositeScoreTrack) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak = &__pyx_type_5MACS2_2IO_20cCompositeScoreTrack___pyx_scope_struct____add_broadpeak;
  /*--- Type import code ---*/
  __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[1]; __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[2]; __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/cCompositeScoreTrack.pyx":21
 * # python modules
 * # ------------------------------------
 * import numpy as np             # <<<<<<<<<<<<<<
 * from numpy import int64,int32,float32
 * 
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":22
 * # ------------------------------------
 * import numpy as np
 * from numpy import int64,int32,float32             # <<<<<<<<<<<<<<
 * 
 * from libc.math cimport sqrt,log10
 */
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__int64));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__int64));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int64));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__int32));
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__int32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__int32));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
  PyList_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_n_s__float32));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __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__int64);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__int64);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__int64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __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__int32);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__int32);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__int32, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __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__float32);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__float32);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__float32, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __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/cCompositeScoreTrack.pyx":26
 * from libc.math cimport sqrt,log10
 * 
 * from MACS2.Constants import *             # <<<<<<<<<<<<<<
 * from MACS2.cProb cimport poisson_cdf
 * from MACS2.IO.cPeakIO import PeakIO
 */
  __pyx_t_3 = PyList_New(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_INCREF(((PyObject *)__pyx_n_s_37));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s_37));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_37));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_36), ((PyObject *)__pyx_t_3), -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_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (__pyx_import_star(__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;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":28
 * from MACS2.Constants import *
 * from MACS2.cProb cimport poisson_cdf
 * from MACS2.IO.cPeakIO import PeakIO             # <<<<<<<<<<<<<<
 * from MACS2.IO.cBedGraph import bedGraphTrackI
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __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_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s_38), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_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 = 28; __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 = 28; __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/cCompositeScoreTrack.pyx":29
 * from MACS2.cProb cimport poisson_cdf
 * from MACS2.IO.cPeakIO import PeakIO
 * from MACS2.IO.cBedGraph import bedGraphTrackI             # <<<<<<<<<<<<<<
 * 
 * # ------------------------------------
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bedGraphTrackI));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__bedGraphTrackI));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bedGraphTrackI));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_39), ((PyObject *)__pyx_t_3), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __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__bedGraphTrackI);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__bedGraphTrackI);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__bedGraphTrackI, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __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/cCompositeScoreTrack.pyx":34
 * # 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_40)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":35
 * # ------------------------------------
 * __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_41)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":36
 * __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_42)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "MACS2/IO/cCompositeScoreTrack.pyx":46
 * # ------------------------------------
 * 
 * class compositeScoreTrackII:             # <<<<<<<<<<<<<<
 *     """Class for scoreGraph type data. Modified from
 *     bedGraphTrackI. The only difference is that we store pvalue score,
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":69
 * 
 *     """
 *     def __init__ (self):             # <<<<<<<<<<<<<<
 *         """Different with bedGraphTrackI, missing values are simply
 *         replaced with 0.
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_1__init__, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_44)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____init__, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":77
 *         self.pointer = {}
 * 
 *     def add_chromosome ( self, chrom, 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_20cCompositeScoreTrack_21compositeScoreTrackII_3add_chromosome, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_47)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __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 = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":88
 *             self.pointer[chrom] = 0
 * 
 *     def add (self,chromosome,endpos,sample,control):             # <<<<<<<<<<<<<<
 *         """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_20cCompositeScoreTrack_21compositeScoreTrackII_5add, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_49)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__add, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":100
 *         self.pointer[chromosome] += 1
 * 
 *     def get_data_by_chr (self, chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_7get_data_by_chr, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_51)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__get_data_by_chr, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":111
 *             return None
 * 
 *     def get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_9get_chr_names, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_53)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":118
 *         return l
 * 
 *     def write_bedGraph (self, fhd, name, description, colname):             # <<<<<<<<<<<<<<
 *         """Write all data to fhd in Wiggle Format.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_11write_bedGraph, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_55)); 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);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__write_bedGraph, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":149
 *         return True
 * 
 *     def __calculate_fold_change ( self, chrom, index ):             # <<<<<<<<<<<<<<
 *         """From 'sample' and 'control' columns, calculate foldchanges.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_13__calculate_fold_change, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_57)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_59, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":158
 *         return self.data[chrom]['sample'][index]/self.data[chrom]['control'][index]
 * 
 *     def make_pq_table ( self ):             # <<<<<<<<<<<<<<
 *         """Make pvalue-qvalue table.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_15make_pq_table, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_61)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__make_pq_table, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":215
 *         return pvalue2qvalue
 * 
 *     def assign_qvalue ( self , pvalue2qvalue ):             # <<<<<<<<<<<<<<
 *         """Assign -100log10qvalue to every point.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_17assign_qvalue, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_63)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__assign_qvalue, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":228
 *         return True
 * 
 *     def call_peaks (self, cutoff=500, min_length=200, max_gap=50, colname='-100logp'):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_19call_peaks, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_66)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, ((PyObject *)__pyx_k_tuple_67));
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__call_peaks, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":292
 *         return peaks
 * 
 *     def __close_peak (self, peak_content, peaks, min_length, chrom, colname):             # <<<<<<<<<<<<<<
 *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
 *         if peak_length >= min_length: # if the peak is too small, reject it
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_21__close_peak, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_69)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_14, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":331
 *             return True
 * 
 *     def call_broadpeaks (self, lvl1_cutoff=500, lvl2_cutoff=100, min_length=200, lvl1_max_gap=50, lvl2_max_gap=400, colname='-100logq'):             # <<<<<<<<<<<<<<
 *         """This function try to find enriched regions within which,
 *         scores are continuously higher than a given cutoff for level
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_23call_broadpeaks, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_71)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, ((PyObject *)__pyx_k_tuple_72));
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__call_broadpeaks, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":383
 *         return lvl1_peaks, broadpeaks
 * 
 *     def __add_broadpeak (self, bpeaks, chrom, lvl2peak, lvl1peakset):             # <<<<<<<<<<<<<<
 *         """Internal function to create broad peak.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_25__add_broadpeak, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_74)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_17, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":409
 *         return bpeaks
 * 
 *     def total ( self ):             # <<<<<<<<<<<<<<
 *         """Return the number of regions in this object.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_21compositeScoreTrackII_27total, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_76)); 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);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__total, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":46
 * # ------------------------------------
 * 
 * class compositeScoreTrackII:             # <<<<<<<<<<<<<<
 *     """Class for scoreGraph type data. Modified from
 *     bedGraphTrackI. The only difference is that we store pvalue score,
 */
  if (PyDict_SetItemString(((PyObject *)__pyx_t_2), "__doc__", ((PyObject *)__pyx_kp_s_77)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2), __pyx_n_s_33, __pyx_n_s_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_33, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __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/cCompositeScoreTrack.pyx":419
 * 
 * 
 * class compositeScoreTrackI:             # <<<<<<<<<<<<<<
 *     """Class for composite scoreGraph type data for two
 *     conditions. Modified from bedGraphTrackI. The only difference is
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "MACS2/IO/cCompositeScoreTrack.pyx":442
 * 
 *     """
 *     def __init__ (self):             # <<<<<<<<<<<<<<
 *         """Different with bedGraphTrackI, missing values are simply
 *         replaced with 0.
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_1__init__, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_79)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____init__, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":450
 *         self.pointer = {}
 * 
 *     def add_chromosome ( self, chrom, 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_20cCompositeScoreTrack_20compositeScoreTrackI_3add_chromosome, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_81)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__add_chromosome, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":459
 *             self.pointer[chrom] = 0
 * 
 *     def add (self,chromosome,endpos,sc1i1,sc2i2,sc1c2,sc2c1):             # <<<<<<<<<<<<<<
 *         """Add a chr-endpos-score-score-score-score block into data
 *         dictionary.
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_5add, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_83)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__add, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":470
 *         self.pointer[chromosome] += 1
 * 
 *     def get_data_by_chr (self, chromosome):             # <<<<<<<<<<<<<<
 *         """Return array of counts by chromosome.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_7get_data_by_chr, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_85)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__get_data_by_chr, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":481
 *             return None
 * 
 *     def get_chr_names (self):             # <<<<<<<<<<<<<<
 *         """Return all the chromosome names stored.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_9get_chr_names, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_87)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__get_chr_names, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":488
 *         return l
 * 
 *     def call_consistent (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_11call_consistent, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_89)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, ((PyObject *)__pyx_k_tuple_90));
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__call_consistent, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":583
 *         return peaks
 * 
 *     def call_condition1_unique (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_13call_condition1_unique, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_92)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, ((PyObject *)__pyx_k_tuple_94));
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_93, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":667
 *         return peaks
 * 
 *     def call_condition2_unique (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """This function try to find regions within which, scores
 *         are continuously higher than a given cutoff.
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_15call_condition2_unique, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_96)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, ((PyObject *)__pyx_k_tuple_98));
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_97, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":750
 * 
 * 
 *     def call_diff_regions (self, cutoff=50, min_length=200, max_gap=50):             # <<<<<<<<<<<<<<
 *         """A function to call differential regions and common regions together.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_17call_diff_regions, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_103)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, ((PyObject *)__pyx_k_tuple_104));
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__call_diff_regions, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":933
 *         return ( consistent_peaks, condition1_peaks, condition2_peaks )
 * 
 *     def total ( self ):             # <<<<<<<<<<<<<<
 *         """Return the number of regions in this object.
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_20compositeScoreTrackI_19total, 0, NULL, __pyx_n_s_19, ((PyObject *)__pyx_k_codeobj_106)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __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 = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":419
 * 
 * 
 * class compositeScoreTrackI:             # <<<<<<<<<<<<<<
 *     """Class for composite scoreGraph type data for two
 *     conditions. Modified from bedGraphTrackI. The only difference is
 */
  if (PyDict_SetItemString(((PyObject *)__pyx_t_2), "__doc__", ((PyObject *)__pyx_kp_s_107)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2), __pyx_n_s_32, __pyx_n_s_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_32, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __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/cCompositeScoreTrack.pyx":946
 *     #
 * 
 * def make_compositeScoreTrack (bdgTrack1, bdgTrack2, bdgTrack3, bdgTrack4 ):             # <<<<<<<<<<<<<<
 *     """A modified overlie function for MACS DIFF.
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_1make_compositeScoreTrack, NULL, __pyx_n_s_19); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_110, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1026
 * 
 * 
 * def make_compositeScoreTrack2 (bdgTrack1, bdgTrack2, bdgTrack3, bdgTrack4 ):             # <<<<<<<<<<<<<<
 *     """A modified overlie function for MACS DIFF.
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5MACS2_2IO_20cCompositeScoreTrack_3make_compositeScoreTrack2, NULL, __pyx_n_s_19); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_113, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "MACS2/IO/cCompositeScoreTrack.pyx":1
 * # cython: profile=True             # <<<<<<<<<<<<<<
 * # Time-stamp: <2012-08-01 18:09:29 Tao Liu>
 * 
 */
  __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;
  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.cCompositeScoreTrack", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init MACS2.IO.cCompositeScoreTrack");
  }
  __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;
}

#if CYTHON_PROFILE
static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
                                   PyFrameObject** frame,
                                   const char *funcname,
                                   const char *srcfile,
                                   int firstlineno) {
    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
        if (*code == NULL) {
            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
            if (*code == NULL) return 0;
        }
        *frame = PyFrame_New(
            PyThreadState_GET(),            /*PyThreadState *tstate*/
            *code,                          /*PyCodeObject *code*/
            PyModule_GetDict(__pyx_m),      /*PyObject *globals*/
            0                               /*PyObject *locals*/
        );
        if (*frame == NULL) return 0;
    }
    else {
        (*frame)->f_tstate = PyThreadState_GET();
    }
    return PyThreadState_GET()->c_profilefunc(PyThreadState_GET()->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
}
static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyCodeObject *py_code = 0;
    #if PY_MAJOR_VERSION < 3
    py_funcname = PyString_FromString(funcname);
    py_srcfile = PyString_FromString(srcfile);
    #else
    py_funcname = PyUnicode_FromString(funcname);
    py_srcfile = PyUnicode_FromString(srcfile);
    #endif
    if (!py_funcname | !py_srcfile) goto bad;
    py_code = PyCode_New(
        0,                /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,                /*int kwonlyargcount,*/
        #endif
        0,                /*int nlocals,*/
        0,                /*int stacksize,*/
        0,                /*int flags,*/
        __pyx_empty_bytes,  /*PyObject *code,*/
        __pyx_empty_tuple,  /*PyObject *consts,*/
        __pyx_empty_tuple,  /*PyObject *names,*/
        __pyx_empty_tuple,  /*PyObject *varnames,*/
        __pyx_empty_tuple,  /*PyObject *freevars,*/
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,       /*PyObject *filename,*/
        py_funcname,      /*PyObject *name,*/
        firstlineno,      /*int firstlineno,*/
        __pyx_empty_bytes   /*PyObject *lnotab*/
    );
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return py_code;
}
#endif /* CYTHON_PROFILE */

static 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 %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_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_AS_STRING(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;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    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 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);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        Py_DECREF(value);
        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) {
    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)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        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;
        }
        if (!value) {
            value = PyObject_CallObject(type, NULL);
        }
        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:
    return;
}
#endif

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
}





static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected);
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else if (PyErr_Occurred()) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
}

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_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
    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;
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
    if (unlikely(tstate->curexc_type))
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    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 (XDECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
    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);
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
    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);
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    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, '.')) {
                /* try package relative import first */
                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);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            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
    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:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    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;
    /* Default 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 *modname) {
    PyObject *result;
    PyObject *metaclass;
    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;
    /* Python2 __metaclass__ */
    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 (op->func_doc == NULL && 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 (op->func_doc == 0) {
        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)
        op->func_doc = Py_None; /* Mark as deleted */
    else
        op->func_doc = value;
    Py_INCREF(op->func_doc);
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (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
    }
    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 (value == NULL || !PyUnicode_Check(value)) {
#else
    if (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_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 (op->func_dict == NULL) {
        op->func_dict = PyDict_New();
        if (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 (value == NULL) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (!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 (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 *) "__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 *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;
    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_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_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)
{
    PyObject *func_name = __Pyx_CyFunction_get_name(op);
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                func_name, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(func_name), (void *)op);
#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_PyCFunction_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 (PyType_Ready(&__pyx_CyFunctionType_type) < 0)
        return -1;
    __pyx_CyFunctionType = &__pyx_CyFunctionType_type;
    return 0;
}
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 void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
    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;
    }
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
    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;
    }
}

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 CYTHON_INLINE int __Pyx_StrEq(const char *s1, const char *s2) {
     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
     return *s1 == *s2;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

#ifndef __PYX_HAVE_RT_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_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;
    }
    if (!strict && (size_t)((PyTypeObject *)result)->tp_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)((PyTypeObject *)result)->tp_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_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_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;
}


/* Type Conversion Functions */

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