1 /* Generated by Cython 0.29.14 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6     #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8     #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_14"
11 #define CYTHON_HEX_VERSION 0x001D0EF0
12 #define CYTHON_FUTURE_DIVISION 1
13 #include <stddef.h>
14 #ifndef offsetof
15   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18   #ifndef __stdcall
19     #define __stdcall
20   #endif
21   #ifndef __cdecl
22     #define __cdecl
23   #endif
24   #ifndef __fastcall
25     #define __fastcall
26   #endif
27 #endif
28 #ifndef DL_IMPORT
29   #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32   #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36   #if PY_VERSION_HEX >= 0x02070000
37     #define HAVE_LONG_LONG
38   #endif
39 #endif
40 #ifndef PY_LONG_LONG
41   #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44   #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47   #define CYTHON_COMPILING_IN_PYPY 1
48   #define CYTHON_COMPILING_IN_PYSTON 0
49   #define CYTHON_COMPILING_IN_CPYTHON 0
50   #undef CYTHON_USE_TYPE_SLOTS
51   #define CYTHON_USE_TYPE_SLOTS 0
52   #undef CYTHON_USE_PYTYPE_LOOKUP
53   #define CYTHON_USE_PYTYPE_LOOKUP 0
54   #if PY_VERSION_HEX < 0x03050000
55     #undef CYTHON_USE_ASYNC_SLOTS
56     #define CYTHON_USE_ASYNC_SLOTS 0
57   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58     #define CYTHON_USE_ASYNC_SLOTS 1
59   #endif
60   #undef CYTHON_USE_PYLIST_INTERNALS
61   #define CYTHON_USE_PYLIST_INTERNALS 0
62   #undef CYTHON_USE_UNICODE_INTERNALS
63   #define CYTHON_USE_UNICODE_INTERNALS 0
64   #undef CYTHON_USE_UNICODE_WRITER
65   #define CYTHON_USE_UNICODE_WRITER 0
66   #undef CYTHON_USE_PYLONG_INTERNALS
67   #define CYTHON_USE_PYLONG_INTERNALS 0
68   #undef CYTHON_AVOID_BORROWED_REFS
69   #define CYTHON_AVOID_BORROWED_REFS 1
70   #undef CYTHON_ASSUME_SAFE_MACROS
71   #define CYTHON_ASSUME_SAFE_MACROS 0
72   #undef CYTHON_UNPACK_METHODS
73   #define CYTHON_UNPACK_METHODS 0
74   #undef CYTHON_FAST_THREAD_STATE
75   #define CYTHON_FAST_THREAD_STATE 0
76   #undef CYTHON_FAST_PYCALL
77   #define CYTHON_FAST_PYCALL 0
78   #undef CYTHON_PEP489_MULTI_PHASE_INIT
79   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80   #undef CYTHON_USE_TP_FINALIZE
81   #define CYTHON_USE_TP_FINALIZE 0
82   #undef CYTHON_USE_DICT_VERSIONS
83   #define CYTHON_USE_DICT_VERSIONS 0
84   #undef CYTHON_USE_EXC_INFO_STACK
85   #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87   #define CYTHON_COMPILING_IN_PYPY 0
88   #define CYTHON_COMPILING_IN_PYSTON 1
89   #define CYTHON_COMPILING_IN_CPYTHON 0
90   #ifndef CYTHON_USE_TYPE_SLOTS
91     #define CYTHON_USE_TYPE_SLOTS 1
92   #endif
93   #undef CYTHON_USE_PYTYPE_LOOKUP
94   #define CYTHON_USE_PYTYPE_LOOKUP 0
95   #undef CYTHON_USE_ASYNC_SLOTS
96   #define CYTHON_USE_ASYNC_SLOTS 0
97   #undef CYTHON_USE_PYLIST_INTERNALS
98   #define CYTHON_USE_PYLIST_INTERNALS 0
99   #ifndef CYTHON_USE_UNICODE_INTERNALS
100     #define CYTHON_USE_UNICODE_INTERNALS 1
101   #endif
102   #undef CYTHON_USE_UNICODE_WRITER
103   #define CYTHON_USE_UNICODE_WRITER 0
104   #undef CYTHON_USE_PYLONG_INTERNALS
105   #define CYTHON_USE_PYLONG_INTERNALS 0
106   #ifndef CYTHON_AVOID_BORROWED_REFS
107     #define CYTHON_AVOID_BORROWED_REFS 0
108   #endif
109   #ifndef CYTHON_ASSUME_SAFE_MACROS
110     #define CYTHON_ASSUME_SAFE_MACROS 1
111   #endif
112   #ifndef CYTHON_UNPACK_METHODS
113     #define CYTHON_UNPACK_METHODS 1
114   #endif
115   #undef CYTHON_FAST_THREAD_STATE
116   #define CYTHON_FAST_THREAD_STATE 0
117   #undef CYTHON_FAST_PYCALL
118   #define CYTHON_FAST_PYCALL 0
119   #undef CYTHON_PEP489_MULTI_PHASE_INIT
120   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121   #undef CYTHON_USE_TP_FINALIZE
122   #define CYTHON_USE_TP_FINALIZE 0
123   #undef CYTHON_USE_DICT_VERSIONS
124   #define CYTHON_USE_DICT_VERSIONS 0
125   #undef CYTHON_USE_EXC_INFO_STACK
126   #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128   #define CYTHON_COMPILING_IN_PYPY 0
129   #define CYTHON_COMPILING_IN_PYSTON 0
130   #define CYTHON_COMPILING_IN_CPYTHON 1
131   #ifndef CYTHON_USE_TYPE_SLOTS
132     #define CYTHON_USE_TYPE_SLOTS 1
133   #endif
134   #if PY_VERSION_HEX < 0x02070000
135     #undef CYTHON_USE_PYTYPE_LOOKUP
136     #define CYTHON_USE_PYTYPE_LOOKUP 0
137   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138     #define CYTHON_USE_PYTYPE_LOOKUP 1
139   #endif
140   #if PY_MAJOR_VERSION < 3
141     #undef CYTHON_USE_ASYNC_SLOTS
142     #define CYTHON_USE_ASYNC_SLOTS 0
143   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144     #define CYTHON_USE_ASYNC_SLOTS 1
145   #endif
146   #if PY_VERSION_HEX < 0x02070000
147     #undef CYTHON_USE_PYLONG_INTERNALS
148     #define CYTHON_USE_PYLONG_INTERNALS 0
149   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150     #define CYTHON_USE_PYLONG_INTERNALS 1
151   #endif
152   #ifndef CYTHON_USE_PYLIST_INTERNALS
153     #define CYTHON_USE_PYLIST_INTERNALS 1
154   #endif
155   #ifndef CYTHON_USE_UNICODE_INTERNALS
156     #define CYTHON_USE_UNICODE_INTERNALS 1
157   #endif
158   #if PY_VERSION_HEX < 0x030300F0
159     #undef CYTHON_USE_UNICODE_WRITER
160     #define CYTHON_USE_UNICODE_WRITER 0
161   #elif !defined(CYTHON_USE_UNICODE_WRITER)
162     #define CYTHON_USE_UNICODE_WRITER 1
163   #endif
164   #ifndef CYTHON_AVOID_BORROWED_REFS
165     #define CYTHON_AVOID_BORROWED_REFS 0
166   #endif
167   #ifndef CYTHON_ASSUME_SAFE_MACROS
168     #define CYTHON_ASSUME_SAFE_MACROS 1
169   #endif
170   #ifndef CYTHON_UNPACK_METHODS
171     #define CYTHON_UNPACK_METHODS 1
172   #endif
173   #ifndef CYTHON_FAST_THREAD_STATE
174     #define CYTHON_FAST_THREAD_STATE 1
175   #endif
176   #ifndef CYTHON_FAST_PYCALL
177     #define CYTHON_FAST_PYCALL 1
178   #endif
179   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181   #endif
182   #ifndef CYTHON_USE_TP_FINALIZE
183     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184   #endif
185   #ifndef CYTHON_USE_DICT_VERSIONS
186     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187   #endif
188   #ifndef CYTHON_USE_EXC_INFO_STACK
189     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190   #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196   #include "longintrepr.h"
197   #undef SHIFT
198   #undef BASE
199   #undef MASK
200   #ifdef SIZEOF_VOID_P
201     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202   #endif
203 #endif
204 #ifndef __has_attribute
205   #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208   #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211   #if defined(__GNUC__)
212     #define CYTHON_RESTRICT __restrict__
213   #elif defined(_MSC_VER) && _MSC_VER >= 1400
214     #define CYTHON_RESTRICT __restrict
215   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216     #define CYTHON_RESTRICT restrict
217   #else
218     #define CYTHON_RESTRICT
219   #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 #     define CYTHON_UNUSED __attribute__ ((__unused__))
225 #   else
226 #     define CYTHON_UNUSED
227 #   endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 #   define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 #   define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)236      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 #  else
238 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 #  endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 #  define CYTHON_NCP_UNUSED
244 # else
245 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250     #ifndef _MSC_STDINT_H_
251         #if _MSC_VER < 1300
252            typedef unsigned char     uint8_t;
253            typedef unsigned int      uint32_t;
254         #else
255            typedef unsigned __int8   uint8_t;
256            typedef unsigned __int32  uint32_t;
257         #endif
258     #endif
259 #else
260    #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263   #if defined(__cplusplus) && __cplusplus >= 201103L
264     #if __has_cpp_attribute(fallthrough)
265       #define CYTHON_FALLTHROUGH [[fallthrough]]
266     #elif __has_cpp_attribute(clang::fallthrough)
267       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268     #elif __has_cpp_attribute(gnu::fallthrough)
269       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270     #endif
271   #endif
272   #ifndef CYTHON_FALLTHROUGH
273     #if __has_attribute(fallthrough)
274       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275     #else
276       #define CYTHON_FALLTHROUGH
277     #endif
278   #endif
279   #if defined(__clang__ ) && defined(__apple_build_version__)
280     #if __apple_build_version__ < 7000000
281       #undef  CYTHON_FALLTHROUGH
282       #define CYTHON_FALLTHROUGH
283     #endif
284   #endif
285 #endif
286 
287 #ifndef CYTHON_INLINE
288   #if defined(__clang__)
289     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290   #elif defined(__GNUC__)
291     #define CYTHON_INLINE __inline__
292   #elif defined(_MSC_VER)
293     #define CYTHON_INLINE __inline
294   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295     #define CYTHON_INLINE inline
296   #else
297     #define CYTHON_INLINE
298   #endif
299 #endif
300 
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302   #define Py_OptimizeFlag 0
303 #endif
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310   #define __Pyx_DefaultClassType PyClass_Type
311 #else
312   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
316 #else
317   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
319 #endif
320   #define __Pyx_DefaultClassType PyType_Type
321 #endif
322 #ifndef Py_TPFLAGS_CHECKTYPES
323   #define Py_TPFLAGS_CHECKTYPES 0
324 #endif
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326   #define Py_TPFLAGS_HAVE_INDEX 0
327 #endif
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
330 #endif
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332   #define Py_TPFLAGS_HAVE_FINALIZE 0
333 #endif
334 #ifndef METH_STACKLESS
335   #define METH_STACKLESS 0
336 #endif
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338   #ifndef METH_FASTCALL
339      #define METH_FASTCALL 0x80
340   #endif
341   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
342   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
343                                                           Py_ssize_t nargs, PyObject *kwnames);
344 #else
345   #define __Pyx_PyCFunctionFast _PyCFunctionFast
346   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
347 #endif
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
351 #else
352 #define __Pyx_PyFastCFunction_Check(func) 0
353 #endif
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355   #define PyObject_Malloc(s)   PyMem_Malloc(s)
356   #define PyObject_Free(p)     PyMem_Free(p)
357   #define PyObject_Realloc(p)  PyMem_Realloc(p)
358 #endif
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
361   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
362   #define PyMem_RawFree(p)             PyMem_Free(p)
363 #endif
364 #if CYTHON_COMPILING_IN_PYSTON
365   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
366   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
367 #else
368   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
369   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
370 #endif
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372   #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376   #define __Pyx_PyThreadState_Current PyThreadState_GET()
377 #else
378   #define __Pyx_PyThreadState_Current _PyThreadState_Current
379 #endif
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)384 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
385   *key = PyThread_create_key();
386   return 0;
387 }
PyThread_tss_alloc(void)388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
389   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
390   *key = Py_tss_NEEDS_INIT;
391   return key;
392 }
PyThread_tss_free(Py_tss_t * key)393 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
394   PyObject_Free(key);
395 }
PyThread_tss_is_created(Py_tss_t * key)396 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
397   return *key != Py_tss_NEEDS_INIT;
398 }
PyThread_tss_delete(Py_tss_t * key)399 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
400   PyThread_delete_key(*key);
401   *key = Py_tss_NEEDS_INIT;
402 }
PyThread_tss_set(Py_tss_t * key,void * value)403 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
404   return PyThread_set_key_value(*key, value);
405 }
PyThread_tss_get(Py_tss_t * key)406 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
407   return PyThread_get_key_value(*key);
408 }
409 #endif
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
412 #else
413 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
414 #endif
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
417   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
418 #else
419   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
420   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
421 #endif
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
424 #else
425 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
426 #endif
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428   #define CYTHON_PEP393_ENABLED 1
429   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
430                                               0 : _PyUnicode_Ready((PyObject *)(op)))
431   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
432   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
434   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
435   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
436   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
437   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
438   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
439 #else
440   #define CYTHON_PEP393_ENABLED 0
441   #define PyUnicode_1BYTE_KIND  1
442   #define PyUnicode_2BYTE_KIND  2
443   #define PyUnicode_4BYTE_KIND  4
444   #define __Pyx_PyUnicode_READY(op)       (0)
445   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
446   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
447   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
448   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
449   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
450   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
451   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
452   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
453 #endif
454 #if CYTHON_COMPILING_IN_PYPY
455   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
456   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
457 #else
458   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
459   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
460       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
461 #endif
462 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
463   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
464 #endif
465 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
466   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
467 #endif
468 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
469   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
470 #endif
471 #define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
472 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
473 #if PY_MAJOR_VERSION >= 3
474   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
475 #else
476   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
477 #endif
478 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
479   #define PyObject_ASCII(o)            PyObject_Repr(o)
480 #endif
481 #if PY_MAJOR_VERSION >= 3
482   #define PyBaseString_Type            PyUnicode_Type
483   #define PyStringObject               PyUnicodeObject
484   #define PyString_Type                PyUnicode_Type
485   #define PyString_Check               PyUnicode_Check
486   #define PyString_CheckExact          PyUnicode_CheckExact
487   #define PyObject_Unicode             PyObject_Str
488 #endif
489 #if PY_MAJOR_VERSION >= 3
490   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
491   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
492 #else
493   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
494   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
495 #endif
496 #ifndef PySet_CheckExact
497   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
498 #endif
499 #if CYTHON_ASSUME_SAFE_MACROS
500   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
501 #else
502   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
503 #endif
504 #if PY_MAJOR_VERSION >= 3
505   #define PyIntObject                  PyLongObject
506   #define PyInt_Type                   PyLong_Type
507   #define PyInt_Check(op)              PyLong_Check(op)
508   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
509   #define PyInt_FromString             PyLong_FromString
510   #define PyInt_FromUnicode            PyLong_FromUnicode
511   #define PyInt_FromLong               PyLong_FromLong
512   #define PyInt_FromSize_t             PyLong_FromSize_t
513   #define PyInt_FromSsize_t            PyLong_FromSsize_t
514   #define PyInt_AsLong                 PyLong_AsLong
515   #define PyInt_AS_LONG                PyLong_AS_LONG
516   #define PyInt_AsSsize_t              PyLong_AsSsize_t
517   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
518   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
519   #define PyNumber_Int                 PyNumber_Long
520 #endif
521 #if PY_MAJOR_VERSION >= 3
522   #define PyBoolObject                 PyLongObject
523 #endif
524 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
525   #ifndef PyUnicode_InternFromString
526     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
527   #endif
528 #endif
529 #if PY_VERSION_HEX < 0x030200A4
530   typedef long Py_hash_t;
531   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
532   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
533 #else
534   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
535   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
536 #endif
537 #if PY_MAJOR_VERSION >= 3
538   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
539 #else
540   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
541 #endif
542 #if CYTHON_USE_ASYNC_SLOTS
543   #if PY_VERSION_HEX >= 0x030500B1
544     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
545     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
546   #else
547     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
548   #endif
549 #else
550   #define __Pyx_PyType_AsAsync(obj) NULL
551 #endif
552 #ifndef __Pyx_PyAsyncMethodsStruct
553     typedef struct {
554         unaryfunc am_await;
555         unaryfunc am_aiter;
556         unaryfunc am_anext;
557     } __Pyx_PyAsyncMethodsStruct;
558 #endif
559 
560 #if defined(WIN32) || defined(MS_WINDOWS)
561   #define _USE_MATH_DEFINES
562 #endif
563 #include <math.h>
564 #ifdef NAN
565 #define __PYX_NAN() ((float) NAN)
566 #else
__PYX_NAN()567 static CYTHON_INLINE float __PYX_NAN() {
568   float value;
569   memset(&value, 0xFF, sizeof(value));
570   return value;
571 }
572 #endif
573 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
574 #define __Pyx_truncl trunc
575 #else
576 #define __Pyx_truncl truncl
577 #endif
578 
579 
580 #define __PYX_ERR(f_index, lineno, Ln_error) \
581 { \
582   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
583 }
584 
585 #ifndef __PYX_EXTERN_C
586   #ifdef __cplusplus
587     #define __PYX_EXTERN_C extern "C"
588   #else
589     #define __PYX_EXTERN_C extern
590   #endif
591 #endif
592 
593 #define __PYX_HAVE__MACS2__IO__ScoreTrack
594 #define __PYX_HAVE_API__MACS2__IO__ScoreTrack
595 /* Early includes */
596 #include <string.h>
597 #include <stdio.h>
598 #include "numpy/arrayobject.h"
599 #include "numpy/ufuncobject.h"
600 #include "pythread.h"
601 #include <math.h>
602 #ifdef _OPENMP
603 #include <omp.h>
604 #endif /* _OPENMP */
605 
606 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
607 #define CYTHON_WITHOUT_ASSERTIONS
608 #endif
609 
610 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
611                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
612 
613 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
614 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
615 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
616 #define __PYX_DEFAULT_STRING_ENCODING ""
617 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
618 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
619 #define __Pyx_uchar_cast(c) ((unsigned char)c)
620 #define __Pyx_long_cast(x) ((long)x)
621 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
622     (sizeof(type) < sizeof(Py_ssize_t))  ||\
623     (sizeof(type) > sizeof(Py_ssize_t) &&\
624           likely(v < (type)PY_SSIZE_T_MAX ||\
625                  v == (type)PY_SSIZE_T_MAX)  &&\
626           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
627                                 v == (type)PY_SSIZE_T_MIN)))  ||\
628     (sizeof(type) == sizeof(Py_ssize_t) &&\
629           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
630                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)631 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
632     return (size_t) i < (size_t) limit;
633 }
634 #if defined (__cplusplus) && __cplusplus >= 201103L
635     #include <cstdlib>
636     #define __Pyx_sst_abs(value) std::abs(value)
637 #elif SIZEOF_INT >= SIZEOF_SIZE_T
638     #define __Pyx_sst_abs(value) abs(value)
639 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
640     #define __Pyx_sst_abs(value) labs(value)
641 #elif defined (_MSC_VER)
642     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
643 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
644     #define __Pyx_sst_abs(value) llabs(value)
645 #elif defined (__GNUC__)
646     #define __Pyx_sst_abs(value) __builtin_llabs(value)
647 #else
648     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
649 #endif
650 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
651 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
652 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
653 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
654 #define __Pyx_PyBytes_FromString        PyBytes_FromString
655 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
656 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
657 #if PY_MAJOR_VERSION < 3
658     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
659     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
660 #else
661     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
662     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
663 #endif
664 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
665 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
666 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
667 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
668 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
669 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
670 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
671 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
672 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
673 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
674 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
675 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
676 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
677 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
678 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
679 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)680 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
681     const Py_UNICODE *u_end = u;
682     while (*u_end++) ;
683     return (size_t)(u_end - u - 1);
684 }
685 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
686 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
687 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
688 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
689 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
690 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
691 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
692 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
693 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
694 #define __Pyx_PySequence_Tuple(obj)\
695     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
696 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
697 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
698 #if CYTHON_ASSUME_SAFE_MACROS
699 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
700 #else
701 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
702 #endif
703 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
704 #if PY_MAJOR_VERSION >= 3
705 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
706 #else
707 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
708 #endif
709 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
710 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
711 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)712 static int __Pyx_init_sys_getdefaultencoding_params(void) {
713     PyObject* sys;
714     PyObject* default_encoding = NULL;
715     PyObject* ascii_chars_u = NULL;
716     PyObject* ascii_chars_b = NULL;
717     const char* default_encoding_c;
718     sys = PyImport_ImportModule("sys");
719     if (!sys) goto bad;
720     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
721     Py_DECREF(sys);
722     if (!default_encoding) goto bad;
723     default_encoding_c = PyBytes_AsString(default_encoding);
724     if (!default_encoding_c) goto bad;
725     if (strcmp(default_encoding_c, "ascii") == 0) {
726         __Pyx_sys_getdefaultencoding_not_ascii = 0;
727     } else {
728         char ascii_chars[128];
729         int c;
730         for (c = 0; c < 128; c++) {
731             ascii_chars[c] = c;
732         }
733         __Pyx_sys_getdefaultencoding_not_ascii = 1;
734         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
735         if (!ascii_chars_u) goto bad;
736         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
737         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
738             PyErr_Format(
739                 PyExc_ValueError,
740                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
741                 default_encoding_c);
742             goto bad;
743         }
744         Py_DECREF(ascii_chars_u);
745         Py_DECREF(ascii_chars_b);
746     }
747     Py_DECREF(default_encoding);
748     return 0;
749 bad:
750     Py_XDECREF(default_encoding);
751     Py_XDECREF(ascii_chars_u);
752     Py_XDECREF(ascii_chars_b);
753     return -1;
754 }
755 #endif
756 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
757 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
758 #else
759 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
760 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
761 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)762 static int __Pyx_init_sys_getdefaultencoding_params(void) {
763     PyObject* sys;
764     PyObject* default_encoding = NULL;
765     char* default_encoding_c;
766     sys = PyImport_ImportModule("sys");
767     if (!sys) goto bad;
768     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
769     Py_DECREF(sys);
770     if (!default_encoding) goto bad;
771     default_encoding_c = PyBytes_AsString(default_encoding);
772     if (!default_encoding_c) goto bad;
773     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
774     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
775     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
776     Py_DECREF(default_encoding);
777     return 0;
778 bad:
779     Py_XDECREF(default_encoding);
780     return -1;
781 }
782 #endif
783 #endif
784 
785 
786 /* Test for GCC > 2.95 */
787 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
788   #define likely(x)   __builtin_expect(!!(x), 1)
789   #define unlikely(x) __builtin_expect(!!(x), 0)
790 #else /* !__GNUC__ or GCC < 2.95 */
791   #define likely(x)   (x)
792   #define unlikely(x) (x)
793 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)794 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
795 
796 static PyObject *__pyx_m = NULL;
797 static PyObject *__pyx_d;
798 static PyObject *__pyx_b;
799 static PyObject *__pyx_cython_runtime = NULL;
800 static PyObject *__pyx_empty_tuple;
801 static PyObject *__pyx_empty_bytes;
802 static PyObject *__pyx_empty_unicode;
803 static int __pyx_lineno;
804 static int __pyx_clineno = 0;
805 static const char * __pyx_cfilenm= __FILE__;
806 static const char *__pyx_filename;
807 
808 /* Header.proto */
809 #if !defined(CYTHON_CCOMPLEX)
810   #if defined(__cplusplus)
811     #define CYTHON_CCOMPLEX 1
812   #elif defined(_Complex_I)
813     #define CYTHON_CCOMPLEX 1
814   #else
815     #define CYTHON_CCOMPLEX 0
816   #endif
817 #endif
818 #if CYTHON_CCOMPLEX
819   #ifdef __cplusplus
820     #include <complex>
821   #else
822     #include <complex.h>
823   #endif
824 #endif
825 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
826   #undef _Complex_I
827   #define _Complex_I 1.0fj
828 #endif
829 
830 
831 static const char *__pyx_f[] = {
832   "MACS2/IO/ScoreTrack.pyx",
833   "stringsource",
834   "__init__.pxd",
835   "type.pxd",
836   "bool.pxd",
837   "complex.pxd",
838 };
839 /* BufferFormatStructs.proto */
840 #define IS_UNSIGNED(type) (((type) -1) > 0)
841 struct __Pyx_StructField_;
842 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
843 typedef struct {
844   const char* name;
845   struct __Pyx_StructField_* fields;
846   size_t size;
847   size_t arraysize[8];
848   int ndim;
849   char typegroup;
850   char is_unsigned;
851   int flags;
852 } __Pyx_TypeInfo;
853 typedef struct __Pyx_StructField_ {
854   __Pyx_TypeInfo* type;
855   const char* name;
856   size_t offset;
857 } __Pyx_StructField;
858 typedef struct {
859   __Pyx_StructField* field;
860   size_t parent_offset;
861 } __Pyx_BufFmt_StackElem;
862 typedef struct {
863   __Pyx_StructField root;
864   __Pyx_BufFmt_StackElem* head;
865   size_t fmt_offset;
866   size_t new_count, enc_count;
867   size_t struct_alignment;
868   int is_complex;
869   char enc_type;
870   char new_packmode;
871   char enc_packmode;
872   char is_valid_array;
873 } __Pyx_BufFmt_Context;
874 
875 
876 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":776
877  * # in Cython to enable them only on the right systems.
878  *
879  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
880  * ctypedef npy_int16      int16_t
881  * ctypedef npy_int32      int32_t
882  */
883 typedef npy_int8 __pyx_t_5numpy_int8_t;
884 
885 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":777
886  *
887  * ctypedef npy_int8       int8_t
888  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
889  * ctypedef npy_int32      int32_t
890  * ctypedef npy_int64      int64_t
891  */
892 typedef npy_int16 __pyx_t_5numpy_int16_t;
893 
894 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":778
895  * ctypedef npy_int8       int8_t
896  * ctypedef npy_int16      int16_t
897  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
898  * ctypedef npy_int64      int64_t
899  * #ctypedef npy_int96      int96_t
900  */
901 typedef npy_int32 __pyx_t_5numpy_int32_t;
902 
903 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":779
904  * ctypedef npy_int16      int16_t
905  * ctypedef npy_int32      int32_t
906  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
907  * #ctypedef npy_int96      int96_t
908  * #ctypedef npy_int128     int128_t
909  */
910 typedef npy_int64 __pyx_t_5numpy_int64_t;
911 
912 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":783
913  * #ctypedef npy_int128     int128_t
914  *
915  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
916  * ctypedef npy_uint16     uint16_t
917  * ctypedef npy_uint32     uint32_t
918  */
919 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
920 
921 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":784
922  *
923  * ctypedef npy_uint8      uint8_t
924  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
925  * ctypedef npy_uint32     uint32_t
926  * ctypedef npy_uint64     uint64_t
927  */
928 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
929 
930 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":785
931  * ctypedef npy_uint8      uint8_t
932  * ctypedef npy_uint16     uint16_t
933  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
934  * ctypedef npy_uint64     uint64_t
935  * #ctypedef npy_uint96     uint96_t
936  */
937 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
938 
939 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":786
940  * ctypedef npy_uint16     uint16_t
941  * ctypedef npy_uint32     uint32_t
942  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
943  * #ctypedef npy_uint96     uint96_t
944  * #ctypedef npy_uint128    uint128_t
945  */
946 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
947 
948 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":790
949  * #ctypedef npy_uint128    uint128_t
950  *
951  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
952  * ctypedef npy_float64    float64_t
953  * #ctypedef npy_float80    float80_t
954  */
955 typedef npy_float32 __pyx_t_5numpy_float32_t;
956 
957 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":791
958  *
959  * ctypedef npy_float32    float32_t
960  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
961  * #ctypedef npy_float80    float80_t
962  * #ctypedef npy_float128   float128_t
963  */
964 typedef npy_float64 __pyx_t_5numpy_float64_t;
965 
966 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":800
967  * # The int types are mapped a bit surprising --
968  * # numpy.int corresponds to 'l' and numpy.long to 'q'
969  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
970  * ctypedef npy_longlong   long_t
971  * ctypedef npy_longlong   longlong_t
972  */
973 typedef npy_long __pyx_t_5numpy_int_t;
974 
975 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":801
976  * # numpy.int corresponds to 'l' and numpy.long to 'q'
977  * ctypedef npy_long       int_t
978  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
979  * ctypedef npy_longlong   longlong_t
980  *
981  */
982 typedef npy_longlong __pyx_t_5numpy_long_t;
983 
984 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":802
985  * ctypedef npy_long       int_t
986  * ctypedef npy_longlong   long_t
987  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
988  *
989  * ctypedef npy_ulong      uint_t
990  */
991 typedef npy_longlong __pyx_t_5numpy_longlong_t;
992 
993 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":804
994  * ctypedef npy_longlong   longlong_t
995  *
996  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
997  * ctypedef npy_ulonglong  ulong_t
998  * ctypedef npy_ulonglong  ulonglong_t
999  */
1000 typedef npy_ulong __pyx_t_5numpy_uint_t;
1001 
1002 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":805
1003  *
1004  * ctypedef npy_ulong      uint_t
1005  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1006  * ctypedef npy_ulonglong  ulonglong_t
1007  *
1008  */
1009 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1010 
1011 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":806
1012  * ctypedef npy_ulong      uint_t
1013  * ctypedef npy_ulonglong  ulong_t
1014  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1015  *
1016  * ctypedef npy_intp       intp_t
1017  */
1018 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1019 
1020 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":808
1021  * ctypedef npy_ulonglong  ulonglong_t
1022  *
1023  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1024  * ctypedef npy_uintp      uintp_t
1025  *
1026  */
1027 typedef npy_intp __pyx_t_5numpy_intp_t;
1028 
1029 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":809
1030  *
1031  * ctypedef npy_intp       intp_t
1032  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1033  *
1034  * ctypedef npy_double     float_t
1035  */
1036 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1037 
1038 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":811
1039  * ctypedef npy_uintp      uintp_t
1040  *
1041  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1042  * ctypedef npy_double     double_t
1043  * ctypedef npy_longdouble longdouble_t
1044  */
1045 typedef npy_double __pyx_t_5numpy_float_t;
1046 
1047 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":812
1048  *
1049  * ctypedef npy_double     float_t
1050  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1051  * ctypedef npy_longdouble longdouble_t
1052  *
1053  */
1054 typedef npy_double __pyx_t_5numpy_double_t;
1055 
1056 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":813
1057  * ctypedef npy_double     float_t
1058  * ctypedef npy_double     double_t
1059  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1060  *
1061  * ctypedef npy_cfloat      cfloat_t
1062  */
1063 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1064 /* Declarations.proto */
1065 #if CYTHON_CCOMPLEX
1066   #ifdef __cplusplus
1067     typedef ::std::complex< float > __pyx_t_float_complex;
1068   #else
1069     typedef float _Complex __pyx_t_float_complex;
1070   #endif
1071 #else
1072     typedef struct { float real, imag; } __pyx_t_float_complex;
1073 #endif
1074 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1075 
1076 /* Declarations.proto */
1077 #if CYTHON_CCOMPLEX
1078   #ifdef __cplusplus
1079     typedef ::std::complex< double > __pyx_t_double_complex;
1080   #else
1081     typedef double _Complex __pyx_t_double_complex;
1082   #endif
1083 #else
1084     typedef struct { double real, imag; } __pyx_t_double_complex;
1085 #endif
1086 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1087 
1088 
1089 /*--- Type declarations ---*/
1090 struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII;
1091 struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores;
1092 
1093 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":815
1094  * ctypedef npy_longdouble longdouble_t
1095  *
1096  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1097  * ctypedef npy_cdouble     cdouble_t
1098  * ctypedef npy_clongdouble clongdouble_t
1099  */
1100 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1101 
1102 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":816
1103  *
1104  * ctypedef npy_cfloat      cfloat_t
1105  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1106  * ctypedef npy_clongdouble clongdouble_t
1107  *
1108  */
1109 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1110 
1111 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":817
1112  * ctypedef npy_cfloat      cfloat_t
1113  * ctypedef npy_cdouble     cdouble_t
1114  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1115  *
1116  * ctypedef npy_cdouble     complex_t
1117  */
1118 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1119 
1120 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":819
1121  * ctypedef npy_clongdouble clongdouble_t
1122  *
1123  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1124  *
1125  * cdef inline object PyArray_MultiIterNew1(a):
1126  */
1127 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1128 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph;
1129 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks;
1130 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak;
1131 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2;
1132 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks;
1133 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph;
1134 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks;
1135 
1136 /* "MACS2/IO/ScoreTrack.pyx":931
1137  *         return
1138  *
1139  *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
1140  *         """Write all data to fhd in bedGraph Format.
1141  *
1142  */
1143 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph {
1144   int __pyx_n;
1145   short column;
1146 };
1147 
1148 /* "MACS2/IO/ScoreTrack.pyx":978
1149  *         return True
1150  *
1151  *     cpdef call_peaks (self, float64_t cutoff=5.0, int32_t min_length=200, int32_t max_gap=50, bool call_summits=False):             # <<<<<<<<<<<<<<
1152  *         """This function try to find regions within which, scores
1153  *         are continuously higher than a given cutoff.
1154  */
1155 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks {
1156   int __pyx_n;
1157   __pyx_t_5numpy_float64_t cutoff;
1158   __pyx_t_5numpy_int32_t min_length;
1159   __pyx_t_5numpy_int32_t max_gap;
1160   PyBoolObject *call_summits;
1161 };
1162 
1163 /* "MACS2/IO/ScoreTrack.pyx":1051
1164  *         return peaks
1165  *
1166  *     cdef bool __close_peak (self, list peak_content, peaks, int32_t min_length,             # <<<<<<<<<<<<<<
1167  *                             bytes chrom, int32_t smoothlen=0):
1168  *         """Close the peak region, output peak boundaries, peak summit
1169  */
1170 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak {
1171   int __pyx_n;
1172   __pyx_t_5numpy_int32_t smoothlen;
1173 };
1174 
1175 /* "MACS2/IO/ScoreTrack.pyx":1102
1176  *             return True
1177  *
1178  *     cdef bool __close_peak2 (self, list peak_content, peaks, int32_t min_length,             # <<<<<<<<<<<<<<
1179  *                              bytes chrom, int32_t smoothlen=51,
1180  *                              float64_t min_valley = 0.9):
1181  */
1182 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2 {
1183   int __pyx_n;
1184   __pyx_t_5numpy_int32_t smoothlen;
1185   __pyx_t_5numpy_float64_t min_valley;
1186 };
1187 
1188 /* "MACS2/IO/ScoreTrack.pyx":1191
1189  *         return t
1190  *
1191  *     cpdef call_broadpeaks (self, float64_t lvl1_cutoff=5.0, float64_t lvl2_cutoff=1.0, int32_t min_length=200, int32_t lvl1_max_gap=50, int32_t lvl2_max_gap=400):             # <<<<<<<<<<<<<<
1192  *         """This function try to find enriched regions within which,
1193  *         scores are continuously higher than a given cutoff for level
1194  */
1195 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks {
1196   int __pyx_n;
1197   __pyx_t_5numpy_float64_t lvl1_cutoff;
1198   __pyx_t_5numpy_float64_t lvl2_cutoff;
1199   __pyx_t_5numpy_int32_t min_length;
1200   __pyx_t_5numpy_int32_t lvl1_max_gap;
1201   __pyx_t_5numpy_int32_t lvl2_max_gap;
1202 };
1203 
1204 /* "MACS2/IO/ScoreTrack.pyx":1512
1205  *         return l
1206  *
1207  *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
1208  *         """Write all data to fhd in bedGraph Format.
1209  *
1210  */
1211 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph {
1212   int __pyx_n;
1213   short column;
1214 };
1215 
1216 /* "MACS2/IO/ScoreTrack.pyx":1592
1217  *         return True
1218  *
1219  *     cpdef tuple call_peaks (self, float64_t cutoff=3, int32_t min_length=200, int32_t max_gap = 100,             # <<<<<<<<<<<<<<
1220  *                       bool call_summits=False):
1221  *         """This function try to find regions within which, scores
1222  */
1223 struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks {
1224   int __pyx_n;
1225   __pyx_t_5numpy_float64_t cutoff;
1226   __pyx_t_5numpy_int32_t min_length;
1227   __pyx_t_5numpy_int32_t max_gap;
1228   PyBoolObject *call_summits;
1229 };
1230 
1231 /* "MACS2/IO/ScoreTrack.pyx":399
1232  *         return ret
1233  *
1234  * cdef class scoreTrackII:             # <<<<<<<<<<<<<<
1235  *     """Class for scoreGraph type data. Modified from scoreTrackI. The
1236  *     difference is that we store a single score data, not
1237  */
1238 struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII {
1239   PyObject_HEAD
1240   struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_vtab;
1241   PyObject *data;
1242   PyObject *data_stderr;
1243   PyObject *datalength;
1244   PyBoolObject *trackline;
1245   PyBoolObject *stderr_on;
1246   __pyx_t_5numpy_float64_t treat_edm;
1247   __pyx_t_5numpy_float64_t ctrl_edm;
1248   char scoring_method;
1249   char normalization_method;
1250   __pyx_t_5numpy_float64_t pseudocount;
1251   __pyx_t_5numpy_float64_t cutoff;
1252   PyObject *pvalue_stat;
1253 };
1254 
1255 
1256 /* "MACS2/IO/ScoreTrack.pyx":1297
1257  *         return bpeaks
1258  *
1259  * cdef class TwoConditionScores:             # <<<<<<<<<<<<<<
1260  *     """Class for saving two condition comparison scores.
1261  *     """
1262  */
1263 struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores {
1264   PyObject_HEAD
1265   struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_vtab;
1266   PyObject *data;
1267   PyObject *datalength;
1268   __pyx_t_5numpy_float64_t cond1_factor;
1269   __pyx_t_5numpy_float64_t cond2_factor;
1270   __pyx_t_5numpy_float64_t pseudocount;
1271   __pyx_t_5numpy_float64_t cutoff;
1272   PyObject *t1bdg;
1273   PyObject *c1bdg;
1274   PyObject *t2bdg;
1275   PyObject *c2bdg;
1276   PyObject *pvalue_stat1;
1277   PyObject *pvalue_stat2;
1278   PyObject *pvalue_stat3;
1279 };
1280 
1281 
1282 
1283 /* "MACS2/IO/ScoreTrack.pyx":399
1284  *         return ret
1285  *
1286  * cdef class scoreTrackII:             # <<<<<<<<<<<<<<
1287  *     """Class for scoreGraph type data. Modified from scoreTrackI. The
1288  *     difference is that we store a single score data, not
1289  */
1290 
1291 struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII {
1292   PyObject *(*set_pseudocount)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch);
1293   PyObject *(*enable_trackline)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch);
1294   PyObject *(*add_chromosome)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, __pyx_t_5numpy_int32_t, int __pyx_skip_dispatch);
1295   PyObject *(*add)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch);
1296   PyObject *(*finalize)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch);
1297   PyObject *(*get_data_by_chr)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, int __pyx_skip_dispatch);
1298   PyObject *(*get_chr_names)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch);
1299   PyObject *(*change_normalization_method)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, char, int __pyx_skip_dispatch);
1300   PyObject *(*normalize)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t);
1301   PyObject *(*change_score_method)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, char, int __pyx_skip_dispatch);
1302   PyObject *(*compute_pvalue)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *);
1303   PyObject *(*compute_qvalue)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *);
1304   PyObject *(*make_pq_table)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch);
1305   PyObject *(*compute_likelihood)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *);
1306   PyObject *(*compute_sym_likelihood)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *);
1307   PyObject *(*compute_logFE)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *);
1308   PyObject *(*compute_foldenrichment)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *);
1309   PyObject *(*compute_subtraction)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *);
1310   PyObject *(*compute_SPMR)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *);
1311   PyObject *(*compute_max)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *);
1312   PyObject *(*write_bedGraph)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph *__pyx_optional_args);
1313   PyObject *(*call_peaks)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks *__pyx_optional_args);
1314   PyBoolObject *(*__pyx___close_peak)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, PyObject *, __pyx_t_5numpy_int32_t, PyObject *, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak *__pyx_optional_args);
1315   PyBoolObject *(*__pyx___close_peak2)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, PyObject *, __pyx_t_5numpy_int32_t, PyObject *, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2 *__pyx_optional_args);
1316   __pyx_t_5numpy_int64_t (*total)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *);
1317   PyObject *(*call_broadpeaks)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks *__pyx_optional_args);
1318 };
1319 static struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_vtabptr_5MACS2_2IO_10ScoreTrack_scoreTrackII;
1320 
1321 
1322 /* "MACS2/IO/ScoreTrack.pyx":1297
1323  *         return bpeaks
1324  *
1325  * cdef class TwoConditionScores:             # <<<<<<<<<<<<<<
1326  *     """Class for saving two condition comparison scores.
1327  *     """
1328  */
1329 
1330 struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores {
1331   PyObject *(*set_pseudocount)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch);
1332   PyObject *(*build)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch);
1333   PyObject *(*build_chromosome)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *);
1334   PyObject *(*add_chromosome)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, __pyx_t_5numpy_int32_t);
1335   PyObject *(*add)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t);
1336   PyObject *(*finalize)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch);
1337   PyObject *(*get_data_by_chr)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, int __pyx_skip_dispatch);
1338   PyObject *(*get_chr_names)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch);
1339   PyObject *(*write_bedGraph)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph *__pyx_optional_args);
1340   PyObject *(*write_matrix)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1341   PyObject *(*call_peaks)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks *__pyx_optional_args);
1342   PyObject *(*__pyx___add_a_peak)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t);
1343   __pyx_t_5numpy_float64_t (*mean_from_peakcontent)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *);
1344   __pyx_t_5numpy_int64_t (*total)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *);
1345 };
1346 static struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_vtabptr_5MACS2_2IO_10ScoreTrack_TwoConditionScores;
1347 
1348 /* --- Runtime support code (head) --- */
1349 /* Refnanny.proto */
1350 #ifndef CYTHON_REFNANNY
1351   #define CYTHON_REFNANNY 0
1352 #endif
1353 #if CYTHON_REFNANNY
1354   typedef struct {
1355     void (*INCREF)(void*, PyObject*, int);
1356     void (*DECREF)(void*, PyObject*, int);
1357     void (*GOTREF)(void*, PyObject*, int);
1358     void (*GIVEREF)(void*, PyObject*, int);
1359     void* (*SetupContext)(const char*, int, const char*);
1360     void (*FinishContext)(void**);
1361   } __Pyx_RefNannyAPIStruct;
1362   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1363   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1364   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1365 #ifdef WITH_THREAD
1366   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1367           if (acquire_gil) {\
1368               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1369               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1370               PyGILState_Release(__pyx_gilstate_save);\
1371           } else {\
1372               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1373           }
1374 #else
1375   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1376           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1377 #endif
1378   #define __Pyx_RefNannyFinishContext()\
1379           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1380   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1381   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1382   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1383   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1384   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1385   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1386   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1387   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1388 #else
1389   #define __Pyx_RefNannyDeclarations
1390   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1391   #define __Pyx_RefNannyFinishContext()
1392   #define __Pyx_INCREF(r) Py_INCREF(r)
1393   #define __Pyx_DECREF(r) Py_DECREF(r)
1394   #define __Pyx_GOTREF(r)
1395   #define __Pyx_GIVEREF(r)
1396   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1397   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1398   #define __Pyx_XGOTREF(r)
1399   #define __Pyx_XGIVEREF(r)
1400 #endif
1401 #define __Pyx_XDECREF_SET(r, v) do {\
1402         PyObject *tmp = (PyObject *) r;\
1403         r = v; __Pyx_XDECREF(tmp);\
1404     } while (0)
1405 #define __Pyx_DECREF_SET(r, v) do {\
1406         PyObject *tmp = (PyObject *) r;\
1407         r = v; __Pyx_DECREF(tmp);\
1408     } while (0)
1409 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1410 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1411 
1412 /* PyObjectGetAttrStr.proto */
1413 #if CYTHON_USE_TYPE_SLOTS
1414 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1415 #else
1416 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1417 #endif
1418 
1419 /* GetBuiltinName.proto */
1420 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1421 
1422 /* PyThreadStateGet.proto */
1423 #if CYTHON_FAST_THREAD_STATE
1424 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1425 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1426 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1427 #else
1428 #define __Pyx_PyThreadState_declare
1429 #define __Pyx_PyThreadState_assign
1430 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1431 #endif
1432 
1433 /* PyErrFetchRestore.proto */
1434 #if CYTHON_FAST_THREAD_STATE
1435 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1436 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1437 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1438 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1439 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1440 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1441 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1442 #if CYTHON_COMPILING_IN_CPYTHON
1443 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1444 #else
1445 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1446 #endif
1447 #else
1448 #define __Pyx_PyErr_Clear() PyErr_Clear()
1449 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1450 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1451 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1452 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1453 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1454 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1455 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1456 #endif
1457 
1458 /* Profile.proto */
1459 #ifndef CYTHON_PROFILE
1460 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1461   #define CYTHON_PROFILE 0
1462 #else
1463   #define CYTHON_PROFILE 1
1464 #endif
1465 #endif
1466 #ifndef CYTHON_TRACE_NOGIL
1467   #define CYTHON_TRACE_NOGIL 0
1468 #else
1469   #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1470     #define CYTHON_TRACE 1
1471   #endif
1472 #endif
1473 #ifndef CYTHON_TRACE
1474   #define CYTHON_TRACE 0
1475 #endif
1476 #if CYTHON_TRACE
1477   #undef CYTHON_PROFILE_REUSE_FRAME
1478 #endif
1479 #ifndef CYTHON_PROFILE_REUSE_FRAME
1480   #define CYTHON_PROFILE_REUSE_FRAME 0
1481 #endif
1482 #if CYTHON_PROFILE || CYTHON_TRACE
1483   #include "compile.h"
1484   #include "frameobject.h"
1485   #include "traceback.h"
1486   #if CYTHON_PROFILE_REUSE_FRAME
1487     #define CYTHON_FRAME_MODIFIER static
1488     #define CYTHON_FRAME_DEL(frame)
1489   #else
1490     #define CYTHON_FRAME_MODIFIER
1491     #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1492   #endif
1493   #define __Pyx_TraceDeclarations\
1494   static PyCodeObject *__pyx_frame_code = NULL;\
1495   CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1496   int __Pyx_use_tracing = 0;
1497   #define __Pyx_TraceFrameInit(codeobj)\
1498   if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1499   #ifdef WITH_THREAD
1500   #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1501   if (nogil) {\
1502       if (CYTHON_TRACE_NOGIL) {\
1503           PyThreadState *tstate;\
1504           PyGILState_STATE state = PyGILState_Ensure();\
1505           tstate = __Pyx_PyThreadState_Current;\
1506           if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1507                   (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1508               __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1509           }\
1510           PyGILState_Release(state);\
1511           if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1512       }\
1513   } else {\
1514       PyThreadState* tstate = PyThreadState_GET();\
1515       if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1516               (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1517           __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1518           if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1519       }\
1520   }
1521   #else
1522   #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1523   {   PyThreadState* tstate = PyThreadState_GET();\
1524       if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1525               (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1526           __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1527           if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1528       }\
1529   }
1530   #endif
1531   #define __Pyx_TraceException()\
1532   if (likely(!__Pyx_use_tracing)); else {\
1533       PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1534       if (tstate->use_tracing &&\
1535               (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1536           tstate->tracing++;\
1537           tstate->use_tracing = 0;\
1538           PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1539           if (exc_info) {\
1540               if (CYTHON_TRACE && tstate->c_tracefunc)\
1541                   tstate->c_tracefunc(\
1542                       tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1543               tstate->c_profilefunc(\
1544                   tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1545               Py_DECREF(exc_info);\
1546           }\
1547           tstate->use_tracing = 1;\
1548           tstate->tracing--;\
1549       }\
1550   }
__Pyx_call_return_trace_func(PyThreadState * tstate,PyFrameObject * frame,PyObject * result)1551   static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1552       PyObject *type, *value, *traceback;
1553       __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1554       tstate->tracing++;
1555       tstate->use_tracing = 0;
1556       if (CYTHON_TRACE && tstate->c_tracefunc)
1557           tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1558       if (tstate->c_profilefunc)
1559           tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1560       CYTHON_FRAME_DEL(frame);
1561       tstate->use_tracing = 1;
1562       tstate->tracing--;
1563       __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1564   }
1565   #ifdef WITH_THREAD
1566   #define __Pyx_TraceReturn(result, nogil)\
1567   if (likely(!__Pyx_use_tracing)); else {\
1568       if (nogil) {\
1569           if (CYTHON_TRACE_NOGIL) {\
1570               PyThreadState *tstate;\
1571               PyGILState_STATE state = PyGILState_Ensure();\
1572               tstate = __Pyx_PyThreadState_Current;\
1573               if (tstate->use_tracing) {\
1574                   __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1575               }\
1576               PyGILState_Release(state);\
1577           }\
1578       } else {\
1579           PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1580           if (tstate->use_tracing) {\
1581               __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1582           }\
1583       }\
1584   }
1585   #else
1586   #define __Pyx_TraceReturn(result, nogil)\
1587   if (likely(!__Pyx_use_tracing)); else {\
1588       PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1589       if (tstate->use_tracing) {\
1590           __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1591       }\
1592   }
1593   #endif
1594   static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1595   static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1596 #else
1597   #define __Pyx_TraceDeclarations
1598   #define __Pyx_TraceFrameInit(codeobj)
1599   #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)   if ((1)); else goto_error;
1600   #define __Pyx_TraceException()
1601   #define __Pyx_TraceReturn(result, nogil)
1602 #endif
1603 #if CYTHON_TRACE
__Pyx_call_line_trace_func(PyThreadState * tstate,PyFrameObject * frame,int lineno)1604   static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1605       int ret;
1606       PyObject *type, *value, *traceback;
1607       __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1608       __Pyx_PyFrame_SetLineNumber(frame, lineno);
1609       tstate->tracing++;
1610       tstate->use_tracing = 0;
1611       ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1612       tstate->use_tracing = 1;
1613       tstate->tracing--;
1614       if (likely(!ret)) {
1615           __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1616       } else {
1617           Py_XDECREF(type);
1618           Py_XDECREF(value);
1619           Py_XDECREF(traceback);
1620       }
1621       return ret;
1622   }
1623   #ifdef WITH_THREAD
1624   #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1625   if (likely(!__Pyx_use_tracing)); else {\
1626       if (nogil) {\
1627           if (CYTHON_TRACE_NOGIL) {\
1628               int ret = 0;\
1629               PyThreadState *tstate;\
1630               PyGILState_STATE state = PyGILState_Ensure();\
1631               tstate = __Pyx_PyThreadState_Current;\
1632               if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1633                   ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1634               }\
1635               PyGILState_Release(state);\
1636               if (unlikely(ret)) goto_error;\
1637           }\
1638       } else {\
1639           PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1640           if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1641               int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1642               if (unlikely(ret)) goto_error;\
1643           }\
1644       }\
1645   }
1646   #else
1647   #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1648   if (likely(!__Pyx_use_tracing)); else {\
1649       PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1650       if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1651           int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1652           if (unlikely(ret)) goto_error;\
1653       }\
1654   }
1655   #endif
1656 #else
1657   #define __Pyx_TraceLine(lineno, nogil, goto_error)   if ((1)); else goto_error;
1658 #endif
1659 
1660 /* WriteUnraisableException.proto */
1661 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1662                                   int lineno, const char *filename,
1663                                   int full_traceback, int nogil);
1664 
1665 /* PyDictVersioning.proto */
1666 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1667 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1668 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1669 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1670     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1671     (cache_var) = (value);
1672 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1673     static PY_UINT64_T __pyx_dict_version = 0;\
1674     static PyObject *__pyx_dict_cached_value = NULL;\
1675     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1676         (VAR) = __pyx_dict_cached_value;\
1677     } else {\
1678         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1679         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1680     }\
1681 }
1682 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1683 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1684 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1685 #else
1686 #define __PYX_GET_DICT_VERSION(dict)  (0)
1687 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1688 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1689 #endif
1690 
1691 /* GetModuleGlobalName.proto */
1692 #if CYTHON_USE_DICT_VERSIONS
1693 #define __Pyx_GetModuleGlobalName(var, name)  {\
1694     static PY_UINT64_T __pyx_dict_version = 0;\
1695     static PyObject *__pyx_dict_cached_value = NULL;\
1696     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1697         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1698         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1699 }
1700 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1701     PY_UINT64_T __pyx_dict_version;\
1702     PyObject *__pyx_dict_cached_value;\
1703     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1704 }
1705 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1706 #else
1707 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1708 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1709 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1710 #endif
1711 
1712 /* GetItemInt.proto */
1713 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1714     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1715     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1716     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1717                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1718 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1719     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1720     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1721     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1722 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1723                                                               int wraparound, int boundscheck);
1724 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1725     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1726     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1727     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1728 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1729                                                               int wraparound, int boundscheck);
1730 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1731 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1732                                                      int is_list, int wraparound, int boundscheck);
1733 
1734 /* ObjectGetItem.proto */
1735 #if CYTHON_USE_TYPE_SLOTS
1736 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1737 #else
1738 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
1739 #endif
1740 
1741 /* GetTopmostException.proto */
1742 #if CYTHON_USE_EXC_INFO_STACK
1743 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1744 #endif
1745 
1746 /* SaveResetException.proto */
1747 #if CYTHON_FAST_THREAD_STATE
1748 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1749 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1750 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1751 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1752 #else
1753 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1754 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1755 #endif
1756 
1757 /* PyErrExceptionMatches.proto */
1758 #if CYTHON_FAST_THREAD_STATE
1759 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1760 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1761 #else
1762 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1763 #endif
1764 
1765 /* GetException.proto */
1766 #if CYTHON_FAST_THREAD_STATE
1767 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1768 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1769 #else
1770 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1771 #endif
1772 
1773 /* PyFunctionFastCall.proto */
1774 #if CYTHON_FAST_PYCALL
1775 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1776     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1777 #if 1 || PY_VERSION_HEX < 0x030600B1
1778 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1779 #else
1780 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1781 #endif
1782 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1783     (sizeof(char [1 - 2*!(cond)]) - 1)
1784 #ifndef Py_MEMBER_SIZE
1785 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1786 #endif
1787   static size_t __pyx_pyframe_localsplus_offset = 0;
1788   #include "frameobject.h"
1789   #define __Pxy_PyFrame_Initialize_Offsets()\
1790     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1791      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1792   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1793     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1794 #endif
1795 
1796 /* PyCFunctionFastCall.proto */
1797 #if CYTHON_FAST_PYCCALL
1798 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1799 #else
1800 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1801 #endif
1802 
1803 /* PyObjectCall.proto */
1804 #if CYTHON_COMPILING_IN_CPYTHON
1805 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1806 #else
1807 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1808 #endif
1809 
1810 /* PySequenceContains.proto */
__Pyx_PySequence_ContainsTF(PyObject * item,PyObject * seq,int eq)1811 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1812     int result = PySequence_Contains(seq, item);
1813     return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1814 }
1815 
1816 /* PyObjectSetAttrStr.proto */
1817 #if CYTHON_USE_TYPE_SLOTS
1818 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1819 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1820 #else
1821 #define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
1822 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1823 #endif
1824 
1825 /* RaiseArgTupleInvalid.proto */
1826 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1827     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1828 
1829 /* RaiseDoubleKeywords.proto */
1830 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1831 
1832 /* ParseKeywords.proto */
1833 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1834     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1835     const char* function_name);
1836 
1837 /* ArgTypeTest.proto */
1838 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1839     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1840         __Pyx__ArgTypeTest(obj, type, name, exact))
1841 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1842 
1843 /* SetItemInt.proto */
1844 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1845     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1846     __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
1847     (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1848                __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1849 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1850 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
1851                                                int is_list, int wraparound, int boundscheck);
1852 
1853 /* PyIntBinop.proto */
1854 #if !CYTHON_COMPILING_IN_PYPY
1855 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1856 #else
1857 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1858     (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1859 #endif
1860 
1861 /* IterFinish.proto */
1862 static CYTHON_INLINE int __Pyx_IterFinish(void);
1863 
1864 /* PyObjectCallMethO.proto */
1865 #if CYTHON_COMPILING_IN_CPYTHON
1866 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1867 #endif
1868 
1869 /* PyObjectCallNoArg.proto */
1870 #if CYTHON_COMPILING_IN_CPYTHON
1871 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1872 #else
1873 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1874 #endif
1875 
1876 /* PyObjectCallOneArg.proto */
1877 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1878 
1879 /* PyObjectGetMethod.proto */
1880 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1881 
1882 /* PyObjectCallMethod0.proto */
1883 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
1884 
1885 /* RaiseNeedMoreValuesToUnpack.proto */
1886 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1887 
1888 /* RaiseTooManyValuesToUnpack.proto */
1889 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1890 
1891 /* UnpackItemEndCheck.proto */
1892 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1893 
1894 /* RaiseNoneIterError.proto */
1895 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1896 
1897 /* UnpackTupleError.proto */
1898 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
1899 
1900 /* UnpackTuple2.proto */
1901 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
1902     (likely(is_tuple || PyTuple_Check(tuple)) ?\
1903         (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
1904             __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
1905             (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
1906         __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
1907 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
1908     PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
1909 static int __Pyx_unpack_tuple2_generic(
1910     PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
1911 
1912 /* dict_iter.proto */
1913 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
1914                                                    Py_ssize_t* p_orig_length, int* p_is_dict);
1915 static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
1916                                               PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
1917 
1918 /* IncludeStringH.proto */
1919 #include <string.h>
1920 
1921 /* BytesEquals.proto */
1922 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1923 
1924 /* UnicodeEquals.proto */
1925 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1926 
1927 /* RaiseException.proto */
1928 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1929 
1930 /* set_iter.proto */
1931 static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
1932                                                   Py_ssize_t* p_orig_length, int* p_source_is_set);
1933 static CYTHON_INLINE int __Pyx_set_iter_next(
1934         PyObject* iter_obj, Py_ssize_t orig_length,
1935         Py_ssize_t* ppos, PyObject **value,
1936         int source_is_set);
1937 
1938 /* DictGetItem.proto */
1939 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1940 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1941 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1942     (likely(PyDict_CheckExact(obj)) ?\
1943      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1944 #else
1945 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1946 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
1947 #endif
1948 
1949 /* ExtTypeTest.proto */
1950 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1951 
1952 /* IsLittleEndian.proto */
1953 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
1954 
1955 /* BufferFormatCheck.proto */
1956 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
1957 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1958                               __Pyx_BufFmt_StackElem* stack,
1959                               __Pyx_TypeInfo* type);
1960 
1961 /* BufferGetAndValidate.proto */
1962 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1963     ((obj == Py_None || obj == NULL) ?\
1964     (__Pyx_ZeroBuffer(buf), 0) :\
1965     __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1966 static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1967     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
1968 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1969 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1970 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1971 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1972 
1973 /* BufferFallbackError.proto */
1974 static void __Pyx_RaiseBufferFallbackError(void);
1975 
1976 /* decode_c_string_utf16.proto */
__Pyx_PyUnicode_DecodeUTF16(const char * s,Py_ssize_t size,const char * errors)1977 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1978     int byteorder = 0;
1979     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1980 }
__Pyx_PyUnicode_DecodeUTF16LE(const char * s,Py_ssize_t size,const char * errors)1981 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1982     int byteorder = -1;
1983     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1984 }
__Pyx_PyUnicode_DecodeUTF16BE(const char * s,Py_ssize_t size,const char * errors)1985 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1986     int byteorder = 1;
1987     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1988 }
1989 
1990 /* decode_c_bytes.proto */
1991 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
1992          const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
1993          const char* encoding, const char* errors,
1994          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1995 
1996 /* decode_bytes.proto */
__Pyx_decode_bytes(PyObject * string,Py_ssize_t start,Py_ssize_t stop,const char * encoding,const char * errors,PyObject * (* decode_func)(const char * s,Py_ssize_t size,const char * errors))1997 static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
1998          PyObject* string, Py_ssize_t start, Py_ssize_t stop,
1999          const char* encoding, const char* errors,
2000          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
2001     return __Pyx_decode_c_bytes(
2002         PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
2003         start, stop, encoding, errors, decode_func);
2004 }
2005 
2006 /* PyObjectFormat.proto */
2007 #if CYTHON_USE_UNICODE_WRITER
2008 static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
2009 #else
2010 #define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
2011 #endif
2012 
2013 /* BufferIndexError.proto */
2014 static void __Pyx_RaiseBufferIndexError(int axis);
2015 
2016 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
2017 /* JoinPyUnicode.proto */
2018 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
2019                                       Py_UCS4 max_char);
2020 
2021 /* PyObjectCall2Args.proto */
2022 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2023 
2024 /* UnpackUnboundCMethod.proto */
2025 typedef struct {
2026     PyObject *type;
2027     PyObject **method_name;
2028     PyCFunction func;
2029     PyObject *method;
2030     int flag;
2031 } __Pyx_CachedCFunction;
2032 
2033 /* CallUnboundCMethod1.proto */
2034 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
2035 #if CYTHON_COMPILING_IN_CPYTHON
2036 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
2037 #else
2038 #define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
2039 #endif
2040 
2041 /* PyDictContains.proto */
__Pyx_PyDict_ContainsTF(PyObject * item,PyObject * dict,int eq)2042 static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
2043     int result = PyDict_Contains(dict, item);
2044     return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2045 }
2046 
2047 /* py_dict_keys.proto */
2048 static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d);
2049 
2050 /* CallUnboundCMethod0.proto */
2051 static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2052 #if CYTHON_COMPILING_IN_CPYTHON
2053 #define __Pyx_CallUnboundCMethod0(cfunc, self)\
2054     (likely((cfunc)->func) ?\
2055         (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
2056          (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
2057             (PY_VERSION_HEX >= 0x030700A0 ?\
2058                 (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
2059                 (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
2060           (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
2061             (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
2062             (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
2063                ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) :\
2064                __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
2065         __Pyx__CallUnboundCMethod0(cfunc, self))
2066 #else
2067 #define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
2068 #endif
2069 
2070 /* py_dict_values.proto */
2071 static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2072 
2073 /* PyObjectFormatAndDecref.proto */
2074 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
2075 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
2076 
2077 /* PyUnicode_Unicode.proto */
2078 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj);
2079 
2080 /* PyIntCompare.proto */
2081 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
2082 
2083 /* ListAppend.proto */
2084 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)2085 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2086     PyListObject* L = (PyListObject*) list;
2087     Py_ssize_t len = Py_SIZE(list);
2088     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2089         Py_INCREF(x);
2090         PyList_SET_ITEM(list, len, x);
2091         Py_SIZE(list) = len+1;
2092         return 0;
2093     }
2094     return PyList_Append(list, x);
2095 }
2096 #else
2097 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2098 #endif
2099 
2100 /* None.proto */
2101 static CYTHON_INLINE long __Pyx_div_long(long, long);
2102 
2103 /* PyIntFromDouble.proto */
2104 #if PY_MAJOR_VERSION < 3
2105 static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value);
2106 #else
2107 #define __Pyx_PyInt_FromDouble(value) PyLong_FromDouble(value)
2108 #endif
2109 
2110 /* None.proto */
2111 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2112 
2113 /* PyIntBinop.proto */
2114 #if !CYTHON_COMPILING_IN_PYPY
2115 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2116 #else
2117 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
2118     (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
2119 #endif
2120 
2121 /* StringJoin.proto */
2122 #if PY_MAJOR_VERSION < 3
2123 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2124 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2125 #else
2126 #define __Pyx_PyString_Join PyUnicode_Join
2127 #define __Pyx_PyBaseString_Join PyUnicode_Join
2128 #endif
2129 #if CYTHON_COMPILING_IN_CPYTHON
2130     #if PY_MAJOR_VERSION < 3
2131     #define __Pyx_PyBytes_Join _PyString_Join
2132     #else
2133     #define __Pyx_PyBytes_Join _PyBytes_Join
2134     #endif
2135 #else
2136 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2137 #endif
2138 
2139 /* ListCompAppend.proto */
2140 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)2141 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2142     PyListObject* L = (PyListObject*) list;
2143     Py_ssize_t len = Py_SIZE(list);
2144     if (likely(L->allocated > len)) {
2145         Py_INCREF(x);
2146         PyList_SET_ITEM(list, len, x);
2147         Py_SIZE(list) = len+1;
2148         return 0;
2149     }
2150     return PyList_Append(list, x);
2151 }
2152 #else
2153 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2154 #endif
2155 
2156 /* GetAttr.proto */
2157 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2158 
2159 /* GetAttr3.proto */
2160 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2161 
2162 /* FetchCommonType.proto */
2163 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2164 
2165 /* CythonFunction.proto */
2166 #define __Pyx_CyFunction_USED 1
2167 #define __Pyx_CYFUNCTION_STATICMETHOD  0x01
2168 #define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
2169 #define __Pyx_CYFUNCTION_CCLASS        0x04
2170 #define __Pyx_CyFunction_GetClosure(f)\
2171     (((__pyx_CyFunctionObject *) (f))->func_closure)
2172 #define __Pyx_CyFunction_GetClassObj(f)\
2173     (((__pyx_CyFunctionObject *) (f))->func_classobj)
2174 #define __Pyx_CyFunction_Defaults(type, f)\
2175     ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2176 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2177     ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2178 typedef struct {
2179     PyCFunctionObject func;
2180 #if PY_VERSION_HEX < 0x030500A0
2181     PyObject *func_weakreflist;
2182 #endif
2183     PyObject *func_dict;
2184     PyObject *func_name;
2185     PyObject *func_qualname;
2186     PyObject *func_doc;
2187     PyObject *func_globals;
2188     PyObject *func_code;
2189     PyObject *func_closure;
2190     PyObject *func_classobj;
2191     void *defaults;
2192     int defaults_pyobjects;
2193     int flags;
2194     PyObject *defaults_tuple;
2195     PyObject *defaults_kwdict;
2196     PyObject *(*defaults_getter)(PyObject *);
2197     PyObject *func_annotations;
2198 } __pyx_CyFunctionObject;
2199 static PyTypeObject *__pyx_CyFunctionType = 0;
2200 #define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2201 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
2202     __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
2203 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
2204                                       int flags, PyObject* qualname,
2205                                       PyObject *self,
2206                                       PyObject *module, PyObject *globals,
2207                                       PyObject* code);
2208 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2209                                                          size_t size,
2210                                                          int pyobjects);
2211 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2212                                                             PyObject *tuple);
2213 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2214                                                              PyObject *dict);
2215 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2216                                                               PyObject *dict);
2217 static int __pyx_CyFunction_init(void);
2218 
2219 /* py_abs.proto */
2220 #if CYTHON_USE_PYLONG_INTERNALS
2221 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
2222 #define __Pyx_PyNumber_Absolute(x)\
2223     ((likely(PyLong_CheckExact(x))) ?\
2224          (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\
2225          PyNumber_Absolute(x))
2226 #else
2227 #define __Pyx_PyNumber_Absolute(x)  PyNumber_Absolute(x)
2228 #endif
2229 
2230 /* Import.proto */
2231 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2232 
2233 /* ImportFrom.proto */
2234 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2235 
2236 /* HasAttr.proto */
2237 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2238 
2239 /* PyObject_GenericGetAttrNoDict.proto */
2240 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2241 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2242 #else
2243 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2244 #endif
2245 
2246 /* PyObject_GenericGetAttr.proto */
2247 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2248 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2249 #else
2250 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2251 #endif
2252 
2253 /* SetVTable.proto */
2254 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2255 
2256 /* SetupReduce.proto */
2257 static int __Pyx_setup_reduce(PyObject* type_obj);
2258 
2259 /* TypeImport.proto */
2260 #ifndef __PYX_HAVE_RT_ImportType_proto
2261 #define __PYX_HAVE_RT_ImportType_proto
2262 enum __Pyx_ImportType_CheckSize {
2263    __Pyx_ImportType_CheckSize_Error = 0,
2264    __Pyx_ImportType_CheckSize_Warn = 1,
2265    __Pyx_ImportType_CheckSize_Ignore = 2
2266 };
2267 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2268 #endif
2269 
2270 /* SetNameInClass.proto */
2271 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2272 #define __Pyx_SetNameInClass(ns, name, value)\
2273     (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2274 #elif CYTHON_COMPILING_IN_CPYTHON
2275 #define __Pyx_SetNameInClass(ns, name, value)\
2276     (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2277 #else
2278 #define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
2279 #endif
2280 
2281 /* CalculateMetaclass.proto */
2282 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2283 
2284 /* Py3ClassCreate.proto */
2285 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2286                                            PyObject *mkw, PyObject *modname, PyObject *doc);
2287 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2288                                       PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2289 
2290 /* CLineInTraceback.proto */
2291 #ifdef CYTHON_CLINE_IN_TRACEBACK
2292 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2293 #else
2294 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2295 #endif
2296 
2297 /* CodeObjectCache.proto */
2298 typedef struct {
2299     PyCodeObject* code_object;
2300     int code_line;
2301 } __Pyx_CodeObjectCacheEntry;
2302 struct __Pyx_CodeObjectCache {
2303     int count;
2304     int max_count;
2305     __Pyx_CodeObjectCacheEntry* entries;
2306 };
2307 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2308 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2309 static PyCodeObject *__pyx_find_code_object(int code_line);
2310 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2311 
2312 /* AddTraceback.proto */
2313 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2314                                int py_line, const char *filename);
2315 
2316 /* CIntToPy.proto */
2317 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);
2318 
2319 /* BufferStructDeclare.proto */
2320 typedef struct {
2321   Py_ssize_t shape, strides, suboffsets;
2322 } __Pyx_Buf_DimInfo;
2323 typedef struct {
2324   size_t refcount;
2325   Py_buffer pybuffer;
2326 } __Pyx_Buffer;
2327 typedef struct {
2328   __Pyx_Buffer *rcbuffer;
2329   char *data;
2330   __Pyx_Buf_DimInfo diminfo[8];
2331 } __Pyx_LocalBuf_ND;
2332 
2333 #if PY_MAJOR_VERSION < 3
2334     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2335     static void __Pyx_ReleaseBuffer(Py_buffer *view);
2336 #else
2337     #define __Pyx_GetBuffer PyObject_GetBuffer
2338     #define __Pyx_ReleaseBuffer PyBuffer_Release
2339 #endif
2340 
2341 
2342 /* CIntToPy.proto */
2343 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
2344 
2345 /* CIntToPy.proto */
2346 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);
2347 
2348 /* CIntToPy.proto */
2349 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2350 
2351 /* CIntToPy.proto */
2352 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value);
2353 
2354 /* RealImag.proto */
2355 #if CYTHON_CCOMPLEX
2356   #ifdef __cplusplus
2357     #define __Pyx_CREAL(z) ((z).real())
2358     #define __Pyx_CIMAG(z) ((z).imag())
2359   #else
2360     #define __Pyx_CREAL(z) (__real__(z))
2361     #define __Pyx_CIMAG(z) (__imag__(z))
2362   #endif
2363 #else
2364     #define __Pyx_CREAL(z) ((z).real)
2365     #define __Pyx_CIMAG(z) ((z).imag)
2366 #endif
2367 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2368         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2369     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2370     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2371 #else
2372     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2373     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2374 #endif
2375 
2376 /* Arithmetic.proto */
2377 #if CYTHON_CCOMPLEX
2378     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
2379     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
2380     #define __Pyx_c_diff_float(a, b) ((a)-(b))
2381     #define __Pyx_c_prod_float(a, b) ((a)*(b))
2382     #define __Pyx_c_quot_float(a, b) ((a)/(b))
2383     #define __Pyx_c_neg_float(a)     (-(a))
2384   #ifdef __cplusplus
2385     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2386     #define __Pyx_c_conj_float(z)    (::std::conj(z))
2387     #if 1
2388         #define __Pyx_c_abs_float(z)     (::std::abs(z))
2389         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
2390     #endif
2391   #else
2392     #define __Pyx_c_is_zero_float(z) ((z)==0)
2393     #define __Pyx_c_conj_float(z)    (conjf(z))
2394     #if 1
2395         #define __Pyx_c_abs_float(z)     (cabsf(z))
2396         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
2397     #endif
2398  #endif
2399 #else
2400     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2401     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2402     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2403     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2404     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2405     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2406     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2407     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2408     #if 1
2409         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2410         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2411     #endif
2412 #endif
2413 
2414 /* Arithmetic.proto */
2415 #if CYTHON_CCOMPLEX
2416     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
2417     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
2418     #define __Pyx_c_diff_double(a, b) ((a)-(b))
2419     #define __Pyx_c_prod_double(a, b) ((a)*(b))
2420     #define __Pyx_c_quot_double(a, b) ((a)/(b))
2421     #define __Pyx_c_neg_double(a)     (-(a))
2422   #ifdef __cplusplus
2423     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2424     #define __Pyx_c_conj_double(z)    (::std::conj(z))
2425     #if 1
2426         #define __Pyx_c_abs_double(z)     (::std::abs(z))
2427         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
2428     #endif
2429   #else
2430     #define __Pyx_c_is_zero_double(z) ((z)==0)
2431     #define __Pyx_c_conj_double(z)    (conj(z))
2432     #if 1
2433         #define __Pyx_c_abs_double(z)     (cabs(z))
2434         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
2435     #endif
2436  #endif
2437 #else
2438     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2439     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2440     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2441     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2442     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2443     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2444     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2445     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2446     #if 1
2447         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2448         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2449     #endif
2450 #endif
2451 
2452 /* CIntToPy.proto */
2453 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2454 
2455 /* CIntToPy.proto */
2456 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2457 
2458 /* CIntFromPy.proto */
2459 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2460 
2461 /* CIntFromPy.proto */
2462 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
2463 
2464 /* CIntFromPy.proto */
2465 static CYTHON_INLINE short __Pyx_PyInt_As_short(PyObject *);
2466 
2467 /* CIntFromPy.proto */
2468 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2469 
2470 /* CIntFromPy.proto */
2471 static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);
2472 
2473 /* CIntFromPy.proto */
2474 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2475 
2476 /* FastTypeChecks.proto */
2477 #if CYTHON_COMPILING_IN_CPYTHON
2478 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2479 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2480 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2481 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2482 #else
2483 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2484 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2485 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2486 #endif
2487 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2488 
2489 /* CheckBinaryVersion.proto */
2490 static int __Pyx_check_binary_version(void);
2491 
2492 /* InitStrings.proto */
2493 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2494 
2495 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_pseudocount, int __pyx_skip_dispatch); /* proto*/
2496 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_enable_trackline(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2497 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_add_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_5numpy_int32_t __pyx_v_chrom_max_len, int __pyx_skip_dispatch); /* proto*/
2498 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_add(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome, __pyx_t_5numpy_int32_t __pyx_v_endpos, __pyx_t_5numpy_float64_t __pyx_v_chip, __pyx_t_5numpy_float64_t __pyx_v_control, int __pyx_skip_dispatch); /* proto*/
2499 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2500 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_skip_dispatch); /* proto*/
2501 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2502 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_change_normalization_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_normalization_method, int __pyx_skip_dispatch); /* proto*/
2503 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_normalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_treat_scale, __pyx_t_5numpy_float64_t __pyx_v_control_scale); /* proto*/
2504 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_change_score_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_scoring_method, int __pyx_skip_dispatch); /* proto*/
2505 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_pvalue(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto*/
2506 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_qvalue(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto*/
2507 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_make_pq_table(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2508 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_likelihood(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto*/
2509 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_sym_likelihood(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto*/
2510 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_logFE(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto*/
2511 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_foldenrichment(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto*/
2512 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_subtraction(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto*/
2513 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_SPMR(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto*/
2514 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_max(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto*/
2515 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph *__pyx_optional_args); /* proto*/
2516 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks *__pyx_optional_args); /* proto*/
2517 static PyBoolObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_peak_content, PyObject *__pyx_v_peaks, __pyx_t_5numpy_int32_t __pyx_v_min_length, PyObject *__pyx_v_chrom, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak *__pyx_optional_args); /* proto*/
2518 static PyBoolObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_peak_content, PyObject *__pyx_v_peaks, __pyx_t_5numpy_int32_t __pyx_v_min_length, PyObject *__pyx_v_chrom, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2 *__pyx_optional_args); /* proto*/
2519 static __pyx_t_5numpy_int64_t __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_total(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto*/
2520 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks *__pyx_optional_args); /* proto*/
2521 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_pseudocount, int __pyx_skip_dispatch); /* proto*/
2522 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_build(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2523 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_build_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chrname, PyObject *__pyx_v_cond1_treat_ps, PyObject *__pyx_v_cond1_control_ps, PyObject *__pyx_v_cond2_treat_ps, PyObject *__pyx_v_cond2_control_ps, PyObject *__pyx_v_cond1_treat_vs, PyObject *__pyx_v_cond1_control_vs, PyObject *__pyx_v_cond2_treat_vs, PyObject *__pyx_v_cond2_control_vs); /* proto*/
2524 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_add_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_5numpy_int32_t __pyx_v_chrom_max_len); /* proto*/
2525 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_add(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chromosome, __pyx_t_5numpy_int32_t __pyx_v_endpos, __pyx_t_5numpy_float64_t __pyx_v_t1, __pyx_t_5numpy_float64_t __pyx_v_c1, __pyx_t_5numpy_float64_t __pyx_v_t2, __pyx_t_5numpy_float64_t __pyx_v_c2); /* proto*/
2526 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2527 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_skip_dispatch); /* proto*/
2528 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2529 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_description, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph *__pyx_optional_args); /* proto*/
2530 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_matrix(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_description, int __pyx_skip_dispatch); /* proto*/
2531 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks *__pyx_optional_args); /* proto*/
2532 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___add_a_peak(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_peaks, PyObject *__pyx_v_chrom, PyArrayObject *__pyx_v_indices, PyArrayObject *__pyx_v_startpos, PyArrayObject *__pyx_v_endpos, PyArrayObject *__pyx_v_score, __pyx_t_5numpy_int32_t __pyx_v_max_gap, __pyx_t_5numpy_int32_t __pyx_v_min_length); /* proto*/
2533 static __pyx_t_5numpy_float64_t __pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_mean_from_peakcontent(CYTHON_UNUSED struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_peakcontent); /* proto*/
2534 static __pyx_t_5numpy_int64_t __pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_total(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self); /* proto*/
2535 
2536 /* Module declarations from 'cpython.buffer' */
2537 
2538 /* Module declarations from 'libc.string' */
2539 
2540 /* Module declarations from 'libc.stdio' */
2541 
2542 /* Module declarations from '__builtin__' */
2543 
2544 /* Module declarations from 'cpython.type' */
2545 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2546 
2547 /* Module declarations from 'cpython.version' */
2548 
2549 /* Module declarations from 'cpython.exc' */
2550 
2551 /* Module declarations from 'cpython.module' */
2552 
2553 /* Module declarations from 'cpython.mem' */
2554 
2555 /* Module declarations from 'cpython.tuple' */
2556 
2557 /* Module declarations from 'cpython.list' */
2558 
2559 /* Module declarations from 'cpython.sequence' */
2560 
2561 /* Module declarations from 'cpython.mapping' */
2562 
2563 /* Module declarations from 'cpython.iterator' */
2564 
2565 /* Module declarations from 'cpython.number' */
2566 
2567 /* Module declarations from 'cpython.int' */
2568 
2569 /* Module declarations from '__builtin__' */
2570 
2571 /* Module declarations from 'cpython.bool' */
2572 static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
2573 
2574 /* Module declarations from 'cpython.long' */
2575 
2576 /* Module declarations from 'cpython.float' */
2577 
2578 /* Module declarations from '__builtin__' */
2579 
2580 /* Module declarations from 'cpython.complex' */
2581 static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
2582 
2583 /* Module declarations from 'cpython.string' */
2584 
2585 /* Module declarations from 'cpython.unicode' */
2586 
2587 /* Module declarations from 'cpython.dict' */
2588 
2589 /* Module declarations from 'cpython.instance' */
2590 
2591 /* Module declarations from 'cpython.function' */
2592 
2593 /* Module declarations from 'cpython.method' */
2594 
2595 /* Module declarations from 'cpython.weakref' */
2596 
2597 /* Module declarations from 'cpython.getargs' */
2598 
2599 /* Module declarations from 'cpython.pythread' */
2600 
2601 /* Module declarations from 'cpython.pystate' */
2602 
2603 /* Module declarations from 'cpython.cobject' */
2604 
2605 /* Module declarations from 'cpython.oldbuffer' */
2606 
2607 /* Module declarations from 'cpython.set' */
2608 
2609 /* Module declarations from 'cpython.bytes' */
2610 
2611 /* Module declarations from 'cpython.pycapsule' */
2612 
2613 /* Module declarations from 'cpython' */
2614 
2615 /* Module declarations from 'cpython.object' */
2616 
2617 /* Module declarations from 'cpython.ref' */
2618 
2619 /* Module declarations from 'numpy' */
2620 
2621 /* Module declarations from 'numpy' */
2622 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2623 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2624 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2625 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2626 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2627 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2628 
2629 /* Module declarations from 'cython' */
2630 
2631 /* Module declarations from 'libc.math' */
2632 
2633 /* Module declarations from 'MACS2.IO.ScoreTrack' */
2634 static PyTypeObject *__pyx_ptype_5MACS2_2IO_10ScoreTrack_scoreTrackII = 0;
2635 static PyTypeObject *__pyx_ptype_5MACS2_2IO_10ScoreTrack_TwoConditionScores = 0;
2636 static __pyx_t_5numpy_float64_t __pyx_f_5MACS2_2IO_10ScoreTrack_get_pscore(__pyx_t_5numpy_int32_t, __pyx_t_5numpy_float64_t); /*proto*/
2637 static __pyx_t_5numpy_float64_t __pyx_f_5MACS2_2IO_10ScoreTrack_logLR_asym(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
2638 static __pyx_t_5numpy_float64_t __pyx_f_5MACS2_2IO_10ScoreTrack_logLR_sym(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
2639 static __pyx_t_5numpy_float64_t __pyx_f_5MACS2_2IO_10ScoreTrack_get_logFE(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
2640 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack___pyx_unpickle_scoreTrackII__set_state(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *); /*proto*/
2641 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack___pyx_unpickle_TwoConditionScores__set_state(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *); /*proto*/
2642 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
2643 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 };
2644 #define __Pyx_MODULE_NAME "MACS2.IO.ScoreTrack"
2645 extern int __pyx_module_is_main_MACS2__IO__ScoreTrack;
2646 int __pyx_module_is_main_MACS2__IO__ScoreTrack = 0;
2647 
2648 /* Implementation of 'MACS2.IO.ScoreTrack' */
2649 static PyObject *__pyx_builtin_KeyError;
2650 static PyObject *__pyx_builtin_range;
2651 static PyObject *__pyx_builtin_StopIteration;
2652 static PyObject *__pyx_builtin_NotImplemented;
2653 static PyObject *__pyx_builtin_sum;
2654 static PyObject *__pyx_builtin_sorted;
2655 static PyObject *__pyx_builtin_zip;
2656 static PyObject *__pyx_builtin_ValueError;
2657 static PyObject *__pyx_builtin_RuntimeError;
2658 static PyObject *__pyx_builtin_ImportError;
2659 static const char __pyx_k_0[] = "0,";
2660 static const char __pyx_k_1[] = "1,";
2661 static const char __pyx_k_c[] = "c";
2662 static const char __pyx_k_d[] = "d";
2663 static const char __pyx_k_i[] = "i";
2664 static const char __pyx_k_l[] = "l";
2665 static const char __pyx_k_t[] = "t";
2666 static const char __pyx_k_x[] = "x";
2667 static const char __pyx_k_y[] = "y";
2668 static const char __pyx_k_5f[] = ".5f";
2669 static const char __pyx_k_V1[] = "V1";
2670 static const char __pyx_k_V2[] = "V2";
2671 static const char __pyx_k_fc[] = "fc";
2672 static const char __pyx_k_np[] = "np";
2673 static const char __pyx_k_p1[] = "p1";
2674 static const char __pyx_k_p2[] = "p2";
2675 static const char __pyx_k_v2[] = "v2";
2676 static const char __pyx_k_0_d[] = "0,%d";
2677 static const char __pyx_k_1_1[] = "1,1";
2678 static const char __pyx_k_1_2[] = ",1";
2679 static const char __pyx_k__11[] = "\t";
2680 static const char __pyx_k__12[] = "\n";
2681 static const char __pyx_k__16[] = ".";
2682 static const char __pyx_k__19[] = "\"\n";
2683 static const char __pyx_k__20[] = ",";
2684 static const char __pyx_k__21[] = ":";
2685 static const char __pyx_k__22[] = "_";
2686 static const char __pyx_k_add[] = "add";
2687 static const char __pyx_k_all[] = "all";
2688 static const char __pyx_k_d_2[] = "%d";
2689 static const char __pyx_k_doc[] = "__doc__";
2690 static const char __pyx_k_end[] = "end";
2691 static const char __pyx_k_fhd[] = "fhd";
2692 static const char __pyx_k_new[] = "__new__";
2693 static const char __pyx_k_p1n[] = "p1n";
2694 static const char __pyx_k_p2n[] = "p2n";
2695 static const char __pyx_k_p2s[] = "p2s";
2696 static const char __pyx_k_pos[] = "pos";
2697 static const char __pyx_k_pre[] = "pre";
2698 static const char __pyx_k_ret[] = "ret";
2699 static const char __pyx_k_sum[] = "sum";
2700 static const char __pyx_k_v11[] = "v11";
2701 static const char __pyx_k_v21[] = "v21";
2702 static const char __pyx_k_v2n[] = "v2n";
2703 static const char __pyx_k_v2s[] = "v2s";
2704 static const char __pyx_k_zip[] = "zip";
2705 static const char __pyx_k_None[] = "None";
2706 static const char __pyx_k_chip[] = "chip";
2707 static const char __pyx_k_chr1[] = "chr1";
2708 static const char __pyx_k_chr2[] = "chr2";
2709 static const char __pyx_k_chrs[] = "chrs";
2710 static const char __pyx_k_copy[] = "copy";
2711 static const char __pyx_k_data[] = "data";
2712 static const char __pyx_k_dict[] = "__dict__";
2713 static const char __pyx_k_flat[] = "flat";
2714 static const char __pyx_k_init[] = "__init__";
2715 static const char __pyx_k_join[] = "join";
2716 static const char __pyx_k_keys[] = "keys";
2717 static const char __pyx_k_ladd[] = "ladd";
2718 static const char __pyx_k_main[] = "__main__";
2719 static const char __pyx_k_name[] = "name";
2720 static const char __pyx_k_next[] = "__next__";
2721 static const char __pyx_k_radd[] = "radd";
2722 static const char __pyx_k_self[] = "self";
2723 static const char __pyx_k_size[] = "size";
2724 static const char __pyx_k_test[] = "__test__";
2725 static const char __pyx_k_v11n[] = "v11n";
2726 static const char __pyx_k_v21n[] = "v21n";
2727 static const char __pyx_k_BYTE4[] = "BYTE4";
2728 static const char __pyx_k_array[] = "array";
2729 static const char __pyx_k_build[] = "build";
2730 static const char __pyx_k_c1bdg[] = "c1bdg";
2731 static const char __pyx_k_c2bdg[] = "c2bdg";
2732 static const char __pyx_k_chrom[] = "chrom";
2733 static const char __pyx_k_dtype[] = "dtype";
2734 static const char __pyx_k_int32[] = "int32";
2735 static const char __pyx_k_numpy[] = "numpy";
2736 static const char __pyx_k_peaks[] = "peaks";
2737 static const char __pyx_k_pre_p[] = "pre_p";
2738 static const char __pyx_k_range[] = "range";
2739 static const char __pyx_k_right[] = "right";
2740 static const char __pyx_k_s_d_d[] = "%s\\.%d\\.%d";
2741 static const char __pyx_k_score[] = "score";
2742 static const char __pyx_k_split[] = "split";
2743 static const char __pyx_k_start[] = "start";
2744 static const char __pyx_k_t1bdg[] = "t1bdg";
2745 static const char __pyx_k_t2bdg[] = "t2bdg";
2746 static const char __pyx_k_total[] = "total";
2747 static const char __pyx_k_v1add[] = "v1add";
2748 static const char __pyx_k_v2add[] = "v2add";
2749 static const char __pyx_k_value[] = "value";
2750 static const char __pyx_k_where[] = "where";
2751 static const char __pyx_k_write[] = "write";
2752 static const char __pyx_k_zeros[] = "zeros";
2753 static const char __pyx_k_FBYTE4[] = "FBYTE4";
2754 static const char __pyx_k_PeakIO[] = "PeakIO";
2755 static const char __pyx_k_append[] = "append";
2756 static const char __pyx_k_author[] = "__author__";
2757 static const char __pyx_k_bpeaks[] = "bpeaks";
2758 static const char __pyx_k_column[] = "column";
2759 static const char __pyx_k_cutoff[] = "cutoff";
2760 static const char __pyx_k_decode[] = "decode";
2761 static const char __pyx_k_endpos[] = "endpos";
2762 static const char __pyx_k_import[] = "__import__";
2763 static const char __pyx_k_larray[] = "larray";
2764 static const char __pyx_k_length[] = "length";
2765 static const char __pyx_k_maxima[] = "maxima";
2766 static const char __pyx_k_module[] = "__module__";
2767 static const char __pyx_k_name_2[] = "__name__";
2768 static const char __pyx_k_pickle[] = "pickle";
2769 static const char __pyx_k_pileup[] = "pileup";
2770 static const char __pyx_k_pscore[] = "pscore";
2771 static const char __pyx_k_qscore[] = "qscore";
2772 static const char __pyx_k_rarray[] = "rarray";
2773 static const char __pyx_k_reduce[] = "reduce";
2774 static const char __pyx_k_resize[] = "resize";
2775 static const char __pyx_k_sorted[] = "sorted";
2776 static const char __pyx_k_summit[] = "summit";
2777 static const char __pyx_k_update[] = "update";
2778 static const char __pyx_k_values[] = "values";
2779 static const char __pyx_k_LOG10_E[] = "LOG10_E";
2780 static const char __pyx_k_colname[] = "colname";
2781 static const char __pyx_k_control[] = "control";
2782 static const char __pyx_k_float32[] = "float32";
2783 static const char __pyx_k_logging[] = "logging";
2784 static const char __pyx_k_max_gap[] = "max_gap";
2785 static const char __pyx_k_nonzero[] = "nonzero";
2786 static const char __pyx_k_pointer[] = "pointer";
2787 static const char __pyx_k_prepare[] = "__prepare__";
2788 static const char __pyx_k_reverse[] = "reverse";
2789 static const char __pyx_k_v1array[] = "v1array";
2790 static const char __pyx_k_v2array[] = "v2array";
2791 static const char __pyx_k_version[] = "__version__";
2792 static const char __pyx_k_KeyError[] = "KeyError";
2793 static const char __pyx_k_blockNum[] = "blockNum";
2794 static const char __pyx_k_finalize[] = "finalize";
2795 static const char __pyx_k_getstate[] = "__getstate__";
2796 static const char __pyx_k_lvl2peak[] = "lvl2peak";
2797 static const char __pyx_k_pyx_type[] = "__pyx_type";
2798 static const char __pyx_k_qualname[] = "__qualname__";
2799 static const char __pyx_k_reduce_2[] = "__reduce__";
2800 static const char __pyx_k_refcheck[] = "refcheck";
2801 static const char __pyx_k_setstate[] = "__setstate__";
2802 static const char __pyx_k_thickEnd[] = "thickEnd";
2803 static const char __pyx_k_bdgTrack2[] = "bdgTrack2";
2804 static const char __pyx_k_functools[] = "functools";
2805 static const char __pyx_k_metaclass[] = "__metaclass__";
2806 static const char __pyx_k_pyx_state[] = "__pyx_state";
2807 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2808 static const char __pyx_k_stderr_on[] = "stderr_on";
2809 static const char __pyx_k_MACS2_Prob[] = "MACS2.Prob";
2810 static const char __pyx_k_ValueError[] = "ValueError";
2811 static const char __pyx_k_blockSizes[] = "blockSizes";
2812 static const char __pyx_k_call_peaks[] = "call_peaks";
2813 static const char __pyx_k_chrom_data[] = "chrom_data";
2814 static const char __pyx_k_chromosome[] = "chromosome";
2815 static const char __pyx_k_common_chr[] = "common_chr";
2816 static const char __pyx_k_ctrl_depth[] = "ctrl_depth";
2817 static const char __pyx_k_cur_region[] = "cur_region";
2818 static const char __pyx_k_min_length[] = "min_length";
2819 static const char __pyx_k_peak_score[] = "peak_score";
2820 static const char __pyx_k_pyx_result[] = "__pyx_result";
2821 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2822 static const char __pyx_k_thickStart[] = "thickStart";
2823 static const char __pyx_k_BroadPeakIO[] = "BroadPeakIO";
2824 static const char __pyx_k_ImportError[] = "ImportError";
2825 static const char __pyx_k_PickleError[] = "PickleError";
2826 static const char __pyx_k_blockStarts[] = "blockStarts";
2827 static const char __pyx_k_description[] = "description";
2828 static const char __pyx_k_extract_sum[] = "extract_sum";
2829 static const char __pyx_k_fold_change[] = "fold_change";
2830 static const char __pyx_k_logical_and[] = "logical_and";
2831 static const char __pyx_k_lvl1_cutoff[] = "lvl1_cutoff";
2832 static const char __pyx_k_lvl1peakset[] = "lvl1peakset";
2833 static const char __pyx_k_lvl2_cutoff[] = "lvl2_cutoff";
2834 static const char __pyx_k_poisson_cdf[] = "poisson_cdf";
2835 static const char __pyx_k_pscore_dict[] = "pscore_dict";
2836 static const char __pyx_k_pseudocount[] = "pseudocount";
2837 static const char __pyx_k_treat_depth[] = "treat_depth";
2838 static const char __pyx_k_MACS2_Signal[] = "MACS2.Signal";
2839 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2840 static const char __pyx_k_call_summits[] = "call_summits";
2841 static const char __pyx_k_cond1_factor[] = "cond1_factor";
2842 static const char __pyx_k_cond2_factor[] = "cond2_factor";
2843 static const char __pyx_k_intersection[] = "intersection";
2844 static const char __pyx_k_lvl1_max_gap[] = "lvl1_max_gap";
2845 static const char __pyx_k_lvl2_max_gap[] = "lvl2_max_gap";
2846 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2847 static const char __pyx_k_scoreTrackII[] = "scoreTrackII";
2848 static const char __pyx_k_searchsorted[] = "searchsorted";
2849 static const char __pyx_k_stringsource[] = "stringsource";
2850 static const char __pyx_k_write_matrix[] = "write_matrix";
2851 static const char __pyx_k_StopIteration[] = "StopIteration";
2852 static const char __pyx_k_add_broadpeak[] = "__add_broadpeak";
2853 static const char __pyx_k_chrom_max_len[] = "chrom_max_len";
2854 static const char __pyx_k_description_2[] = "\" description=\"";
2855 static const char __pyx_k_extract_value[] = "extract_value";
2856 static const char __pyx_k_get_chr_names[] = "get_chr_names";
2857 static const char __pyx_k_make_pq_table[] = "make_pq_table";
2858 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2859 static const char __pyx_k_NotImplemented[] = "NotImplemented";
2860 static const char __pyx_k_add_chromosome[] = "add_chromosome";
2861 static const char __pyx_k_parse_peakname[] = "parse_peakname";
2862 static const char __pyx_k_sym_logLR_dict[] = "sym_logLR_dict";
2863 static const char __pyx_k_write_bedGraph[] = "write_bedGraph";
2864 static const char __pyx_k_MACS2_Constants[] = "MACS2.Constants";
2865 static const char __pyx_k_MACS2_IO_PeakIO[] = "MACS2.IO.PeakIO";
2866 static const char __pyx_k_asym_logLR_dict[] = "asym_logLR_dict";
2867 static const char __pyx_k_call_broadpeaks[] = "call_broadpeaks";
2868 static const char __pyx_k_enforce_valleys[] = "enforce_valleys";
2869 static const char __pyx_k_extract_average[] = "extract_average";
2870 static const char __pyx_k_get_common_chrs[] = "get_common_chrs";
2871 static const char __pyx_k_get_data_by_chr[] = "get_data_by_chr";
2872 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2873 static const char __pyx_k_s_not_supported[] = "%s not supported!";
2874 static const char __pyx_k_set_pseudocount[] = "set_pseudocount";
2875 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2876 static const char __pyx_k_CombinedTwoTrack[] = "CombinedTwoTrack";
2877 static const char __pyx_k_enable_trackline[] = "enable_trackline";
2878 static const char __pyx_k_enforce_peakyness[] = "enforce_peakyness";
2879 static const char __pyx_k_TwoConditionScores[] = "TwoConditionScores";
2880 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2881 static const char __pyx_k_scoreTrack_classes[] = "scoreTrack classes";
2882 static const char __pyx_k_MACS2_IO_ScoreTrack[] = "MACS2.IO.ScoreTrack";
2883 static const char __pyx_k_change_score_method[] = "change_score_method";
2884 static const char __pyx_k_CombinedTwoTrack_add[] = "CombinedTwoTrack.add";
2885 static const char __pyx_k_scoreTrackI_Revision[] = "scoreTrackI $Revision$";
2886 static const char __pyx_k_CombinedTwoTrack_total[] = "CombinedTwoTrack.total";
2887 static const char __pyx_k_CombinedTwoTrack___init[] = "CombinedTwoTrack.__init__";
2888 static const char __pyx_k_MACS2_IO_ScoreTrack_pyx[] = "MACS2/IO/ScoreTrack.pyx";
2889 static const char __pyx_k_track_type_bedGraph_name[] = "track type=bedGraph name=\"";
2890 static const char __pyx_k_CombinedTwoTrack_finalize[] = "CombinedTwoTrack.finalize";
2891 static const char __pyx_k_pyx_unpickle_scoreTrackII[] = "__pyx_unpickle_scoreTrackII";
2892 static const char __pyx_k_change_normalization_method[] = "change_normalization_method";
2893 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2894 static const char __pyx_k_CombinedTwoTrack_extract_sum[] = "CombinedTwoTrack.extract_sum";
2895 static const char __pyx_k_For_differential_peak_calling[] = " For differential peak calling.\n    \n    ";
2896 static const char __pyx_k_get_common_chrs_locals_lambda[] = "get_common_chrs.<locals>.<lambda>";
2897 static const char __pyx_k_CombinedTwoTrack_extract_value[] = "CombinedTwoTrack.extract_value";
2898 static const char __pyx_k_CombinedTwoTrack_get_chr_names[] = "CombinedTwoTrack.get_chr_names";
2899 static const char __pyx_k_Tao_Liu_vladimir_liu_gmail_com[] = "Tao Liu <vladimir.liu@gmail.com>";
2900 static const char __pyx_k_pyx_unpickle_TwoConditionScore[] = "__pyx_unpickle_TwoConditionScores";
2901 static const char __pyx_k_CombinedTwoTrack_add_chromosome[] = "CombinedTwoTrack.add_chromosome";
2902 static const char __pyx_k_CombinedTwoTrack_write_bedGraph[] = "CombinedTwoTrack.write_bedGraph";
2903 static const char __pyx_k_column_should_be_between_1_2_or[] = "column should be between 1, 2 or 3.";
2904 static const char __pyx_k_level_1_cutoff_should_be_larger[] = "level 1 cutoff should be larger than level 2.";
2905 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2906 static const char __pyx_k_proportion_background_empirical[] = "proportion_background_empirical_distribution";
2907 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2908 static const char __pyx_k_CombinedTwoTrack_extract_average[] = "CombinedTwoTrack.extract_average";
2909 static const char __pyx_k_CombinedTwoTrack_get_data_by_chr[] = "CombinedTwoTrack.get_data_by_chr";
2910 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2911 static const char __pyx_k_Incompatible_checksums_s_vs_0x77[] = "Incompatible checksums (%s vs 0x77c358c = (ctrl_edm, cutoff, data, data_stderr, datalength, normalization_method, pseudocount, pvalue_stat, scoring_method, stderr_on, trackline, treat_edm))";
2912 static const char __pyx_k_Incompatible_checksums_s_vs_0x84[] = "Incompatible checksums (%s vs 0x846cc7b = (c1bdg, c2bdg, cond1_factor, cond2_factor, cutoff, data, datalength, pseudocount, pvalue_stat1, pvalue_stat2, pvalue_stat3, t1bdg, t2bdg))";
2913 static const char __pyx_k_Module_for_Feature_IO_classes_Th[] = "Module for Feature IO classes.\n\nThis code is free software; you can redistribute it and/or modify it\nunder the terms of the BSD License (see the file LICENSE included with\nthe distribution).\n";
2914 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2915 static const char __pyx_k_level_2_maximum_gap_should_be_la[] = "level 2 maximum gap should be larger than level 1.";
2916 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2917 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2918 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2919 static PyObject *__pyx_kp_b_0;
2920 static PyObject *__pyx_kp_b_0_d;
2921 static PyObject *__pyx_kp_b_1;
2922 static PyObject *__pyx_kp_b_1_1;
2923 static PyObject *__pyx_kp_b_1_2;
2924 static PyObject *__pyx_kp_u_5f;
2925 static PyObject *__pyx_n_s_BYTE4;
2926 static PyObject *__pyx_n_s_BroadPeakIO;
2927 static PyObject *__pyx_n_s_CombinedTwoTrack;
2928 static PyObject *__pyx_n_s_CombinedTwoTrack___init;
2929 static PyObject *__pyx_n_s_CombinedTwoTrack_add;
2930 static PyObject *__pyx_n_s_CombinedTwoTrack_add_chromosome;
2931 static PyObject *__pyx_n_s_CombinedTwoTrack_extract_average;
2932 static PyObject *__pyx_n_s_CombinedTwoTrack_extract_sum;
2933 static PyObject *__pyx_n_s_CombinedTwoTrack_extract_value;
2934 static PyObject *__pyx_n_s_CombinedTwoTrack_finalize;
2935 static PyObject *__pyx_n_s_CombinedTwoTrack_get_chr_names;
2936 static PyObject *__pyx_n_s_CombinedTwoTrack_get_data_by_chr;
2937 static PyObject *__pyx_n_s_CombinedTwoTrack_total;
2938 static PyObject *__pyx_n_s_CombinedTwoTrack_write_bedGraph;
2939 static PyObject *__pyx_n_s_FBYTE4;
2940 static PyObject *__pyx_kp_s_For_differential_peak_calling;
2941 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2942 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2943 static PyObject *__pyx_n_s_ImportError;
2944 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x77;
2945 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x84;
2946 static PyObject *__pyx_n_s_KeyError;
2947 static PyObject *__pyx_n_s_LOG10_E;
2948 static PyObject *__pyx_n_s_MACS2_Constants;
2949 static PyObject *__pyx_n_s_MACS2_IO_PeakIO;
2950 static PyObject *__pyx_n_s_MACS2_IO_ScoreTrack;
2951 static PyObject *__pyx_kp_s_MACS2_IO_ScoreTrack_pyx;
2952 static PyObject *__pyx_n_s_MACS2_Prob;
2953 static PyObject *__pyx_n_s_MACS2_Signal;
2954 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2955 static PyObject *__pyx_kp_u_None;
2956 static PyObject *__pyx_n_s_NotImplemented;
2957 static PyObject *__pyx_n_s_PeakIO;
2958 static PyObject *__pyx_n_s_PickleError;
2959 static PyObject *__pyx_n_s_RuntimeError;
2960 static PyObject *__pyx_n_s_StopIteration;
2961 static PyObject *__pyx_kp_u_Tao_Liu_vladimir_liu_gmail_com;
2962 static PyObject *__pyx_n_s_TwoConditionScores;
2963 static PyObject *__pyx_n_s_V1;
2964 static PyObject *__pyx_n_u_V1;
2965 static PyObject *__pyx_n_s_V2;
2966 static PyObject *__pyx_n_u_V2;
2967 static PyObject *__pyx_n_s_ValueError;
2968 static PyObject *__pyx_kp_u__11;
2969 static PyObject *__pyx_kp_u__12;
2970 static PyObject *__pyx_kp_b__16;
2971 static PyObject *__pyx_kp_u__19;
2972 static PyObject *__pyx_kp_b__20;
2973 static PyObject *__pyx_kp_u__21;
2974 static PyObject *__pyx_n_u__22;
2975 static PyObject *__pyx_n_s_add;
2976 static PyObject *__pyx_n_s_add_broadpeak;
2977 static PyObject *__pyx_n_s_add_chromosome;
2978 static PyObject *__pyx_n_s_all;
2979 static PyObject *__pyx_n_s_append;
2980 static PyObject *__pyx_n_s_array;
2981 static PyObject *__pyx_n_s_asym_logLR_dict;
2982 static PyObject *__pyx_n_s_author;
2983 static PyObject *__pyx_n_s_bdgTrack2;
2984 static PyObject *__pyx_n_s_blockNum;
2985 static PyObject *__pyx_n_s_blockSizes;
2986 static PyObject *__pyx_n_s_blockStarts;
2987 static PyObject *__pyx_n_s_bpeaks;
2988 static PyObject *__pyx_n_s_build;
2989 static PyObject *__pyx_n_s_c;
2990 static PyObject *__pyx_n_s_c1bdg;
2991 static PyObject *__pyx_n_s_c2bdg;
2992 static PyObject *__pyx_n_s_call_broadpeaks;
2993 static PyObject *__pyx_n_s_call_peaks;
2994 static PyObject *__pyx_n_s_call_summits;
2995 static PyObject *__pyx_n_s_change_normalization_method;
2996 static PyObject *__pyx_n_s_change_score_method;
2997 static PyObject *__pyx_n_s_chip;
2998 static PyObject *__pyx_n_s_chr1;
2999 static PyObject *__pyx_n_s_chr2;
3000 static PyObject *__pyx_n_s_chrom;
3001 static PyObject *__pyx_n_s_chrom_data;
3002 static PyObject *__pyx_n_s_chrom_max_len;
3003 static PyObject *__pyx_n_s_chromosome;
3004 static PyObject *__pyx_n_s_chrs;
3005 static PyObject *__pyx_n_s_cline_in_traceback;
3006 static PyObject *__pyx_n_s_colname;
3007 static PyObject *__pyx_n_s_column;
3008 static PyObject *__pyx_kp_u_column_should_be_between_1_2_or;
3009 static PyObject *__pyx_n_s_common_chr;
3010 static PyObject *__pyx_n_s_cond1_factor;
3011 static PyObject *__pyx_n_s_cond2_factor;
3012 static PyObject *__pyx_n_s_control;
3013 static PyObject *__pyx_n_s_copy;
3014 static PyObject *__pyx_n_s_ctrl_depth;
3015 static PyObject *__pyx_n_s_cur_region;
3016 static PyObject *__pyx_n_s_cutoff;
3017 static PyObject *__pyx_n_s_d;
3018 static PyObject *__pyx_n_u_d;
3019 static PyObject *__pyx_kp_b_d_2;
3020 static PyObject *__pyx_n_s_data;
3021 static PyObject *__pyx_n_s_decode;
3022 static PyObject *__pyx_n_s_description;
3023 static PyObject *__pyx_kp_u_description_2;
3024 static PyObject *__pyx_n_s_dict;
3025 static PyObject *__pyx_n_s_doc;
3026 static PyObject *__pyx_n_s_dtype;
3027 static PyObject *__pyx_n_s_enable_trackline;
3028 static PyObject *__pyx_n_s_end;
3029 static PyObject *__pyx_n_u_end;
3030 static PyObject *__pyx_n_s_endpos;
3031 static PyObject *__pyx_n_s_enforce_peakyness;
3032 static PyObject *__pyx_n_s_enforce_valleys;
3033 static PyObject *__pyx_n_s_extract_average;
3034 static PyObject *__pyx_n_s_extract_sum;
3035 static PyObject *__pyx_n_s_extract_value;
3036 static PyObject *__pyx_n_u_fc;
3037 static PyObject *__pyx_n_s_fhd;
3038 static PyObject *__pyx_n_s_finalize;
3039 static PyObject *__pyx_n_s_flat;
3040 static PyObject *__pyx_n_u_float32;
3041 static PyObject *__pyx_n_s_fold_change;
3042 static PyObject *__pyx_n_s_functools;
3043 static PyObject *__pyx_n_s_get_chr_names;
3044 static PyObject *__pyx_n_s_get_common_chrs;
3045 static PyObject *__pyx_n_s_get_common_chrs_locals_lambda;
3046 static PyObject *__pyx_n_s_get_data_by_chr;
3047 static PyObject *__pyx_n_s_getstate;
3048 static PyObject *__pyx_n_s_i;
3049 static PyObject *__pyx_n_s_import;
3050 static PyObject *__pyx_n_s_init;
3051 static PyObject *__pyx_n_u_int32;
3052 static PyObject *__pyx_n_s_intersection;
3053 static PyObject *__pyx_n_s_join;
3054 static PyObject *__pyx_n_s_keys;
3055 static PyObject *__pyx_n_s_l;
3056 static PyObject *__pyx_n_s_ladd;
3057 static PyObject *__pyx_n_s_larray;
3058 static PyObject *__pyx_n_u_length;
3059 static PyObject *__pyx_kp_u_level_1_cutoff_should_be_larger;
3060 static PyObject *__pyx_kp_u_level_2_maximum_gap_should_be_la;
3061 static PyObject *__pyx_n_s_logging;
3062 static PyObject *__pyx_n_s_logical_and;
3063 static PyObject *__pyx_n_s_lvl1_cutoff;
3064 static PyObject *__pyx_n_s_lvl1_max_gap;
3065 static PyObject *__pyx_n_s_lvl1peakset;
3066 static PyObject *__pyx_n_s_lvl2_cutoff;
3067 static PyObject *__pyx_n_s_lvl2_max_gap;
3068 static PyObject *__pyx_n_s_lvl2peak;
3069 static PyObject *__pyx_n_s_main;
3070 static PyObject *__pyx_n_s_make_pq_table;
3071 static PyObject *__pyx_n_s_max_gap;
3072 static PyObject *__pyx_n_s_maxima;
3073 static PyObject *__pyx_n_s_metaclass;
3074 static PyObject *__pyx_n_s_min_length;
3075 static PyObject *__pyx_n_s_module;
3076 static PyObject *__pyx_n_s_name;
3077 static PyObject *__pyx_n_s_name_2;
3078 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
3079 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
3080 static PyObject *__pyx_n_s_new;
3081 static PyObject *__pyx_n_s_next;
3082 static PyObject *__pyx_n_s_nonzero;
3083 static PyObject *__pyx_n_s_np;
3084 static PyObject *__pyx_n_s_numpy;
3085 static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
3086 static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
3087 static PyObject *__pyx_n_s_p1;
3088 static PyObject *__pyx_n_s_p1n;
3089 static PyObject *__pyx_n_s_p2;
3090 static PyObject *__pyx_n_s_p2n;
3091 static PyObject *__pyx_n_s_p2s;
3092 static PyObject *__pyx_n_s_parse_peakname;
3093 static PyObject *__pyx_n_s_peak_score;
3094 static PyObject *__pyx_n_s_peaks;
3095 static PyObject *__pyx_n_s_pickle;
3096 static PyObject *__pyx_n_s_pileup;
3097 static PyObject *__pyx_n_u_pileup;
3098 static PyObject *__pyx_n_s_pointer;
3099 static PyObject *__pyx_n_s_poisson_cdf;
3100 static PyObject *__pyx_n_s_pos;
3101 static PyObject *__pyx_n_u_pos;
3102 static PyObject *__pyx_n_s_pre;
3103 static PyObject *__pyx_n_s_pre_p;
3104 static PyObject *__pyx_n_s_prepare;
3105 static PyObject *__pyx_n_s_proportion_background_empirical;
3106 static PyObject *__pyx_n_s_pscore;
3107 static PyObject *__pyx_n_u_pscore;
3108 static PyObject *__pyx_n_s_pscore_dict;
3109 static PyObject *__pyx_n_s_pseudocount;
3110 static PyObject *__pyx_n_s_pyx_PickleError;
3111 static PyObject *__pyx_n_s_pyx_checksum;
3112 static PyObject *__pyx_n_s_pyx_result;
3113 static PyObject *__pyx_n_s_pyx_state;
3114 static PyObject *__pyx_n_s_pyx_type;
3115 static PyObject *__pyx_n_s_pyx_unpickle_TwoConditionScore;
3116 static PyObject *__pyx_n_s_pyx_unpickle_scoreTrackII;
3117 static PyObject *__pyx_n_s_pyx_vtable;
3118 static PyObject *__pyx_n_s_qscore;
3119 static PyObject *__pyx_n_u_qscore;
3120 static PyObject *__pyx_n_s_qualname;
3121 static PyObject *__pyx_n_s_radd;
3122 static PyObject *__pyx_n_s_range;
3123 static PyObject *__pyx_n_s_rarray;
3124 static PyObject *__pyx_n_s_reduce;
3125 static PyObject *__pyx_n_s_reduce_2;
3126 static PyObject *__pyx_n_s_reduce_cython;
3127 static PyObject *__pyx_n_s_reduce_ex;
3128 static PyObject *__pyx_n_s_refcheck;
3129 static PyObject *__pyx_n_s_resize;
3130 static PyObject *__pyx_n_s_ret;
3131 static PyObject *__pyx_n_s_reverse;
3132 static PyObject *__pyx_n_u_right;
3133 static PyObject *__pyx_kp_b_s_d_d;
3134 static PyObject *__pyx_kp_u_s_not_supported;
3135 static PyObject *__pyx_n_s_score;
3136 static PyObject *__pyx_n_u_score;
3137 static PyObject *__pyx_n_s_scoreTrackII;
3138 static PyObject *__pyx_kp_u_scoreTrackI_Revision;
3139 static PyObject *__pyx_kp_u_scoreTrack_classes;
3140 static PyObject *__pyx_n_s_searchsorted;
3141 static PyObject *__pyx_n_s_self;
3142 static PyObject *__pyx_n_s_set_pseudocount;
3143 static PyObject *__pyx_n_s_setstate;
3144 static PyObject *__pyx_n_s_setstate_cython;
3145 static PyObject *__pyx_n_s_size;
3146 static PyObject *__pyx_n_s_sorted;
3147 static PyObject *__pyx_n_s_split;
3148 static PyObject *__pyx_n_s_start;
3149 static PyObject *__pyx_n_u_start;
3150 static PyObject *__pyx_n_s_stderr_on;
3151 static PyObject *__pyx_kp_s_stringsource;
3152 static PyObject *__pyx_n_s_sum;
3153 static PyObject *__pyx_n_s_summit;
3154 static PyObject *__pyx_n_s_sym_logLR_dict;
3155 static PyObject *__pyx_n_s_t;
3156 static PyObject *__pyx_n_s_t1bdg;
3157 static PyObject *__pyx_n_s_t2bdg;
3158 static PyObject *__pyx_n_s_test;
3159 static PyObject *__pyx_n_s_thickEnd;
3160 static PyObject *__pyx_n_s_thickStart;
3161 static PyObject *__pyx_n_s_total;
3162 static PyObject *__pyx_kp_u_track_type_bedGraph_name;
3163 static PyObject *__pyx_n_s_treat_depth;
3164 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
3165 static PyObject *__pyx_n_s_update;
3166 static PyObject *__pyx_n_s_v11;
3167 static PyObject *__pyx_n_s_v11n;
3168 static PyObject *__pyx_n_s_v1add;
3169 static PyObject *__pyx_n_s_v1array;
3170 static PyObject *__pyx_n_s_v2;
3171 static PyObject *__pyx_n_s_v21;
3172 static PyObject *__pyx_n_s_v21n;
3173 static PyObject *__pyx_n_s_v2add;
3174 static PyObject *__pyx_n_s_v2array;
3175 static PyObject *__pyx_n_s_v2n;
3176 static PyObject *__pyx_n_s_v2s;
3177 static PyObject *__pyx_n_s_value;
3178 static PyObject *__pyx_n_s_values;
3179 static PyObject *__pyx_n_s_version;
3180 static PyObject *__pyx_n_s_where;
3181 static PyObject *__pyx_n_s_write;
3182 static PyObject *__pyx_n_s_write_bedGraph;
3183 static PyObject *__pyx_n_s_write_matrix;
3184 static PyObject *__pyx_n_s_x;
3185 static PyObject *__pyx_n_s_y;
3186 static PyObject *__pyx_n_s_zeros;
3187 static PyObject *__pyx_n_s_zip;
3188 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
3189 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_2add_chromosome(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_5numpy_int32_t __pyx_v_chrom_max_len); /* proto */
3190 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_4add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome, __pyx_t_5numpy_int32_t __pyx_v_endpos, __pyx_t_5numpy_float64_t __pyx_v_V1, __pyx_t_5numpy_float64_t __pyx_v_V2); /* proto */
3191 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_6finalize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
3192 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_8get_data_by_chr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /* proto */
3193 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_10get_chr_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
3194 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_12write_bedGraph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fhd, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_description, PyObject *__pyx_v_colname); /* proto */
3195 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_14total(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
3196 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_16extract_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2); /* proto */
3197 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_18extract_average(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2); /* proto */
3198 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_20extract_sum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2); /* proto */
3199 static int __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII___init__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_treat_depth, __pyx_t_5numpy_float64_t __pyx_v_ctrl_depth, CYTHON_UNUSED PyBoolObject *__pyx_v_stderr_on, __pyx_t_5numpy_float64_t __pyx_v_pseudocount); /* proto */
3200 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_pseudocount); /* proto */
3201 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_4enable_trackline(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto */
3202 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_6add_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_5numpy_int32_t __pyx_v_chrom_max_len); /* proto */
3203 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_8add(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome, __pyx_t_5numpy_int32_t __pyx_v_endpos, __pyx_t_5numpy_float64_t __pyx_v_chip, __pyx_t_5numpy_float64_t __pyx_v_control); /* proto */
3204 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_10finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto */
3205 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_12get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome); /* proto */
3206 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_14get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto */
3207 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_16change_normalization_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_normalization_method); /* proto */
3208 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_18change_score_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_scoring_method); /* proto */
3209 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_20make_pq_table(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto */
3210 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_22write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column); /* proto */
3211 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_24call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_cutoff, __pyx_t_5numpy_int32_t __pyx_v_min_length, __pyx_t_5numpy_int32_t __pyx_v_max_gap, PyBoolObject *__pyx_v_call_summits); /* proto */
3212 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_26call_broadpeaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_lvl1_cutoff, __pyx_t_5numpy_float64_t __pyx_v_lvl2_cutoff, __pyx_t_5numpy_int32_t __pyx_v_min_length, __pyx_t_5numpy_int32_t __pyx_v_lvl1_max_gap, __pyx_t_5numpy_int32_t __pyx_v_lvl2_max_gap); /* proto */
3213 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_28__add_broadpeak(CYTHON_UNUSED struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_bpeaks, PyObject *__pyx_v_chrom, PyObject *__pyx_v_lvl2peak, PyObject *__pyx_v_lvl1peakset); /* proto */
3214 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_30__reduce_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self); /* proto */
3215 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_32__setstate_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3216 static int __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___init__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_t1bdg, PyObject *__pyx_v_c1bdg, PyObject *__pyx_v_t2bdg, PyObject *__pyx_v_c2bdg, __pyx_t_5numpy_float64_t __pyx_v_cond1_factor, __pyx_t_5numpy_float64_t __pyx_v_cond2_factor, __pyx_t_5numpy_float64_t __pyx_v_pseudocount, CYTHON_UNUSED PyObject *__pyx_v_proportion_background_empirical_distribution); /* proto */
3217 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_pseudocount); /* proto */
3218 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_4build(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self); /* proto */
3219 static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
3220 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_6get_common_chrs(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self); /* proto */
3221 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_8finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self); /* proto */
3222 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_10get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chromosome); /* proto */
3223 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_12get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self); /* proto */
3224 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_14write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column); /* proto */
3225 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_16write_matrix(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description); /* proto */
3226 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_18call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_cutoff, __pyx_t_5numpy_int32_t __pyx_v_min_length, __pyx_t_5numpy_int32_t __pyx_v_max_gap, PyBoolObject *__pyx_v_call_summits); /* proto */
3227 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_20__reduce_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self); /* proto */
3228 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_22__setstate_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3229 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack___pyx_unpickle_scoreTrackII(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3230 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_2__pyx_unpickle_TwoConditionScores(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3231 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3232 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
3233 static PyObject *__pyx_tp_new_5MACS2_2IO_10ScoreTrack_scoreTrackII(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3234 static PyObject *__pyx_tp_new_5MACS2_2IO_10ScoreTrack_TwoConditionScores(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3235 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, &__pyx_n_s_keys, 0, 0, 0};
3236 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values = {0, &__pyx_n_s_values, 0, 0, 0};
3237 static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_intersection = {0, &__pyx_n_s_intersection, 0, 0, 0};
3238 static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_decode = {0, &__pyx_n_s_decode, 0, 0, 0};
3239 static PyObject *__pyx_float_0_99999;
3240 static PyObject *__pyx_float_0_43429448190325176;
3241 static PyObject *__pyx_int_0;
3242 static PyObject *__pyx_int_1;
3243 static PyObject *__pyx_int_2;
3244 static PyObject *__pyx_int_4;
3245 static PyObject *__pyx_int_10;
3246 static PyObject *__pyx_int_125580684;
3247 static PyObject *__pyx_int_138857595;
3248 static PyObject *__pyx_int_neg_1;
3249 static PyObject *__pyx_codeobj_;
3250 static PyObject *__pyx_tuple__3;
3251 static PyObject *__pyx_tuple__4;
3252 static PyObject *__pyx_tuple__5;
3253 static PyObject *__pyx_tuple__18;
3254 static PyObject *__pyx_tuple__25;
3255 static PyObject *__pyx_tuple__26;
3256 static PyObject *__pyx_tuple__27;
3257 static PyObject *__pyx_tuple__28;
3258 static PyObject *__pyx_tuple__29;
3259 static PyObject *__pyx_tuple__30;
3260 static PyObject *__pyx_tuple__31;
3261 static PyObject *__pyx_tuple__32;
3262 static PyObject *__pyx_tuple__33;
3263 static PyObject *__pyx_tuple__34;
3264 static PyObject *__pyx_tuple__35;
3265 static PyObject *__pyx_tuple__36;
3266 static PyObject *__pyx_tuple__37;
3267 static PyObject *__pyx_tuple__38;
3268 static PyObject *__pyx_tuple__39;
3269 static PyObject *__pyx_tuple__40;
3270 static PyObject *__pyx_tuple__41;
3271 static PyObject *__pyx_tuple__42;
3272 static PyObject *__pyx_tuple__43;
3273 static PyObject *__pyx_tuple__44;
3274 static PyObject *__pyx_codeobj__2;
3275 static PyObject *__pyx_codeobj__6;
3276 static PyObject *__pyx_codeobj__7;
3277 static PyObject *__pyx_codeobj__8;
3278 static PyObject *__pyx_codeobj__9;
3279 static PyObject *__pyx_codeobj__10;
3280 static PyObject *__pyx_codeobj__13;
3281 static PyObject *__pyx_codeobj__14;
3282 static PyObject *__pyx_codeobj__15;
3283 static PyObject *__pyx_codeobj__17;
3284 static PyObject *__pyx_codeobj__23;
3285 static PyObject *__pyx_codeobj__24;
3286 /* Late includes */
3287 
3288 /* "MACS2/IO/ScoreTrack.pyx":53
3289  * # Misc functions
3290  * # ------------------------------------
3291  * cdef inline int32_t int_max(int32_t a, int32_t b): return a if a >= b else b             # <<<<<<<<<<<<<<
3292  * cdef inline int32_t int_min(int32_t a, int32_t b): return a if a <= b else b
3293  *
3294  */
3295 
__pyx_f_5MACS2_2IO_10ScoreTrack_int_max(__pyx_t_5numpy_int32_t __pyx_v_a,__pyx_t_5numpy_int32_t __pyx_v_b)3296 static CYTHON_INLINE __pyx_t_5numpy_int32_t __pyx_f_5MACS2_2IO_10ScoreTrack_int_max(__pyx_t_5numpy_int32_t __pyx_v_a, __pyx_t_5numpy_int32_t __pyx_v_b) {
3297   __pyx_t_5numpy_int32_t __pyx_r;
3298   __Pyx_TraceDeclarations
3299   __Pyx_RefNannyDeclarations
3300   __pyx_t_5numpy_int32_t __pyx_t_1;
3301   __Pyx_RefNannySetupContext("int_max", 0);
3302   __Pyx_TraceCall("int_max", __pyx_f[0], 53, 0, __PYX_ERR(0, 53, __pyx_L1_error));
3303   if (((__pyx_v_a >= __pyx_v_b) != 0)) {
3304     __pyx_t_1 = __pyx_v_a;
3305   } else {
3306     __pyx_t_1 = __pyx_v_b;
3307   }
3308   __pyx_r = __pyx_t_1;
3309   goto __pyx_L0;
3310 
3311   /* function exit code */
3312   __pyx_L1_error:;
3313   __Pyx_WriteUnraisable("MACS2.IO.ScoreTrack.int_max", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3314   __pyx_r = 0;
3315   __pyx_L0:;
3316   __Pyx_TraceReturn(Py_None, 0);
3317   __Pyx_RefNannyFinishContext();
3318   return __pyx_r;
3319 }
3320 
3321 /* "MACS2/IO/ScoreTrack.pyx":54
3322  * # ------------------------------------
3323  * cdef inline int32_t int_max(int32_t a, int32_t b): return a if a >= b else b
3324  * cdef inline int32_t int_min(int32_t a, int32_t b): return a if a <= b else b             # <<<<<<<<<<<<<<
3325  *
3326  * LOG10_E = 0.43429448190325176
3327  */
3328 
__pyx_f_5MACS2_2IO_10ScoreTrack_int_min(__pyx_t_5numpy_int32_t __pyx_v_a,__pyx_t_5numpy_int32_t __pyx_v_b)3329 static CYTHON_INLINE __pyx_t_5numpy_int32_t __pyx_f_5MACS2_2IO_10ScoreTrack_int_min(__pyx_t_5numpy_int32_t __pyx_v_a, __pyx_t_5numpy_int32_t __pyx_v_b) {
3330   __pyx_t_5numpy_int32_t __pyx_r;
3331   __Pyx_TraceDeclarations
3332   __Pyx_RefNannyDeclarations
3333   __pyx_t_5numpy_int32_t __pyx_t_1;
3334   __Pyx_RefNannySetupContext("int_min", 0);
3335   __Pyx_TraceCall("int_min", __pyx_f[0], 54, 0, __PYX_ERR(0, 54, __pyx_L1_error));
3336   if (((__pyx_v_a <= __pyx_v_b) != 0)) {
3337     __pyx_t_1 = __pyx_v_a;
3338   } else {
3339     __pyx_t_1 = __pyx_v_b;
3340   }
3341   __pyx_r = __pyx_t_1;
3342   goto __pyx_L0;
3343 
3344   /* function exit code */
3345   __pyx_L1_error:;
3346   __Pyx_WriteUnraisable("MACS2.IO.ScoreTrack.int_min", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3347   __pyx_r = 0;
3348   __pyx_L0:;
3349   __Pyx_TraceReturn(Py_None, 0);
3350   __Pyx_RefNannyFinishContext();
3351   return __pyx_r;
3352 }
3353 
3354 /* "MACS2/IO/ScoreTrack.pyx":60
3355  * pscore_dict = dict()
3356  *
3357  * cdef float64_t get_pscore ( int32_t observed, float64_t expectation ):             # <<<<<<<<<<<<<<
3358  *     """Get p-value score from Poisson test. First check existing
3359  *     table, if failed, call poisson_cdf function, then store the result
3360  */
3361 
__pyx_f_5MACS2_2IO_10ScoreTrack_get_pscore(__pyx_t_5numpy_int32_t __pyx_v_observed,__pyx_t_5numpy_float64_t __pyx_v_expectation)3362 static __pyx_t_5numpy_float64_t __pyx_f_5MACS2_2IO_10ScoreTrack_get_pscore(__pyx_t_5numpy_int32_t __pyx_v_observed, __pyx_t_5numpy_float64_t __pyx_v_expectation) {
3363   __pyx_t_5numpy_float64_t __pyx_v_score;
3364   __pyx_t_5numpy_float64_t __pyx_r;
3365   __Pyx_TraceDeclarations
3366   __Pyx_RefNannyDeclarations
3367   PyObject *__pyx_t_1 = NULL;
3368   PyObject *__pyx_t_2 = NULL;
3369   PyObject *__pyx_t_3 = NULL;
3370   PyObject *__pyx_t_4 = NULL;
3371   PyObject *__pyx_t_5 = NULL;
3372   PyObject *__pyx_t_6 = NULL;
3373   PyObject *__pyx_t_7 = NULL;
3374   __pyx_t_5numpy_float64_t __pyx_t_8;
3375   int __pyx_t_9;
3376   PyObject *__pyx_t_10 = NULL;
3377   PyObject *__pyx_t_11 = NULL;
3378   PyObject *__pyx_t_12 = NULL;
3379   PyObject *__pyx_t_13 = NULL;
3380   PyObject *__pyx_t_14 = NULL;
3381   __Pyx_RefNannySetupContext("get_pscore", 0);
3382   __Pyx_TraceCall("get_pscore", __pyx_f[0], 60, 0, __PYX_ERR(0, 60, __pyx_L1_error));
3383 
3384   /* "MACS2/IO/ScoreTrack.pyx":69
3385  *         float64_t score
3386  *
3387  *     try:             # <<<<<<<<<<<<<<
3388  *         return pscore_dict[(observed, expectation)]
3389  *     except KeyError:
3390  */
3391   {
3392     __Pyx_PyThreadState_declare
3393     __Pyx_PyThreadState_assign
3394     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
3395     __Pyx_XGOTREF(__pyx_t_1);
3396     __Pyx_XGOTREF(__pyx_t_2);
3397     __Pyx_XGOTREF(__pyx_t_3);
3398     /*try:*/ {
3399 
3400       /* "MACS2/IO/ScoreTrack.pyx":70
3401  *
3402  *     try:
3403  *         return pscore_dict[(observed, expectation)]             # <<<<<<<<<<<<<<
3404  *     except KeyError:
3405  *         score = -1*poisson_cdf(observed,expectation,False,True)
3406  */
3407       __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pscore_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L3_error)
3408       __Pyx_GOTREF(__pyx_t_4);
3409       __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_observed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L3_error)
3410       __Pyx_GOTREF(__pyx_t_5);
3411       __pyx_t_6 = PyFloat_FromDouble(__pyx_v_expectation); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 70, __pyx_L3_error)
3412       __Pyx_GOTREF(__pyx_t_6);
3413       __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 70, __pyx_L3_error)
3414       __Pyx_GOTREF(__pyx_t_7);
3415       __Pyx_GIVEREF(__pyx_t_5);
3416       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
3417       __Pyx_GIVEREF(__pyx_t_6);
3418       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
3419       __pyx_t_5 = 0;
3420       __pyx_t_6 = 0;
3421       __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 70, __pyx_L3_error)
3422       __Pyx_GOTREF(__pyx_t_6);
3423       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3424       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3425       __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_8 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error)
3426       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3427       __pyx_r = __pyx_t_8;
3428       goto __pyx_L7_try_return;
3429 
3430       /* "MACS2/IO/ScoreTrack.pyx":69
3431  *         float64_t score
3432  *
3433  *     try:             # <<<<<<<<<<<<<<
3434  *         return pscore_dict[(observed, expectation)]
3435  *     except KeyError:
3436  */
3437     }
3438     __pyx_L3_error:;
3439     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3440     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3441     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3442     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3443 
3444     /* "MACS2/IO/ScoreTrack.pyx":71
3445  *     try:
3446  *         return pscore_dict[(observed, expectation)]
3447  *     except KeyError:             # <<<<<<<<<<<<<<
3448  *         score = -1*poisson_cdf(observed,expectation,False,True)
3449  *         pscore_dict[(observed, expectation)] = score
3450  */
3451     __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
3452     if (__pyx_t_9) {
3453       __Pyx_AddTraceback("MACS2.IO.ScoreTrack.get_pscore", __pyx_clineno, __pyx_lineno, __pyx_filename);
3454       if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_4) < 0) __PYX_ERR(0, 71, __pyx_L5_except_error)
3455       __Pyx_GOTREF(__pyx_t_6);
3456       __Pyx_GOTREF(__pyx_t_7);
3457       __Pyx_GOTREF(__pyx_t_4);
3458 
3459       /* "MACS2/IO/ScoreTrack.pyx":72
3460  *         return pscore_dict[(observed, expectation)]
3461  *     except KeyError:
3462  *         score = -1*poisson_cdf(observed,expectation,False,True)             # <<<<<<<<<<<<<<
3463  *         pscore_dict[(observed, expectation)] = score
3464  *         return score
3465  */
3466       __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_poisson_cdf); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 72, __pyx_L5_except_error)
3467       __Pyx_GOTREF(__pyx_t_10);
3468       __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_observed); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 72, __pyx_L5_except_error)
3469       __Pyx_GOTREF(__pyx_t_11);
3470       __pyx_t_12 = PyFloat_FromDouble(__pyx_v_expectation); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 72, __pyx_L5_except_error)
3471       __Pyx_GOTREF(__pyx_t_12);
3472       __pyx_t_13 = NULL;
3473       __pyx_t_9 = 0;
3474       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
3475         __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_10);
3476         if (likely(__pyx_t_13)) {
3477           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
3478           __Pyx_INCREF(__pyx_t_13);
3479           __Pyx_INCREF(function);
3480           __Pyx_DECREF_SET(__pyx_t_10, function);
3481           __pyx_t_9 = 1;
3482         }
3483       }
3484       #if CYTHON_FAST_PYCALL
3485       if (PyFunction_Check(__pyx_t_10)) {
3486         PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_11, __pyx_t_12, Py_False, Py_True};
3487         __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L5_except_error)
3488         __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3489         __Pyx_GOTREF(__pyx_t_5);
3490         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3491         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3492       } else
3493       #endif
3494       #if CYTHON_FAST_PYCCALL
3495       if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
3496         PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_t_11, __pyx_t_12, Py_False, Py_True};
3497         __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L5_except_error)
3498         __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3499         __Pyx_GOTREF(__pyx_t_5);
3500         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3501         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3502       } else
3503       #endif
3504       {
3505         __pyx_t_14 = PyTuple_New(4+__pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 72, __pyx_L5_except_error)
3506         __Pyx_GOTREF(__pyx_t_14);
3507         if (__pyx_t_13) {
3508           __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
3509         }
3510         __Pyx_GIVEREF(__pyx_t_11);
3511         PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_9, __pyx_t_11);
3512         __Pyx_GIVEREF(__pyx_t_12);
3513         PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_9, __pyx_t_12);
3514         __Pyx_INCREF(Py_False);
3515         __Pyx_GIVEREF(Py_False);
3516         PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_9, Py_False);
3517         __Pyx_INCREF(Py_True);
3518         __Pyx_GIVEREF(Py_True);
3519         PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_9, Py_True);
3520         __pyx_t_11 = 0;
3521         __pyx_t_12 = 0;
3522         __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L5_except_error)
3523         __Pyx_GOTREF(__pyx_t_5);
3524         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3525       }
3526       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3527       __pyx_t_10 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 72, __pyx_L5_except_error)
3528       __Pyx_GOTREF(__pyx_t_10);
3529       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3530       __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_8 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L5_except_error)
3531       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3532       __pyx_v_score = __pyx_t_8;
3533 
3534       /* "MACS2/IO/ScoreTrack.pyx":73
3535  *     except KeyError:
3536  *         score = -1*poisson_cdf(observed,expectation,False,True)
3537  *         pscore_dict[(observed, expectation)] = score             # <<<<<<<<<<<<<<
3538  *         return score
3539  *
3540  */
3541       __pyx_t_10 = PyFloat_FromDouble(__pyx_v_score); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 73, __pyx_L5_except_error)
3542       __Pyx_GOTREF(__pyx_t_10);
3543       __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pscore_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L5_except_error)
3544       __Pyx_GOTREF(__pyx_t_5);
3545       __pyx_t_14 = __Pyx_PyInt_From_npy_int32(__pyx_v_observed); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 73, __pyx_L5_except_error)
3546       __Pyx_GOTREF(__pyx_t_14);
3547       __pyx_t_12 = PyFloat_FromDouble(__pyx_v_expectation); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 73, __pyx_L5_except_error)
3548       __Pyx_GOTREF(__pyx_t_12);
3549       __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 73, __pyx_L5_except_error)
3550       __Pyx_GOTREF(__pyx_t_11);
3551       __Pyx_GIVEREF(__pyx_t_14);
3552       PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_14);
3553       __Pyx_GIVEREF(__pyx_t_12);
3554       PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12);
3555       __pyx_t_14 = 0;
3556       __pyx_t_12 = 0;
3557       if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_t_11, __pyx_t_10) < 0)) __PYX_ERR(0, 73, __pyx_L5_except_error)
3558       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3559       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3560       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3561 
3562       /* "MACS2/IO/ScoreTrack.pyx":74
3563  *         score = -1*poisson_cdf(observed,expectation,False,True)
3564  *         pscore_dict[(observed, expectation)] = score
3565  *         return score             # <<<<<<<<<<<<<<
3566  *
3567  * asym_logLR_dict = dict()
3568  */
3569       __pyx_r = __pyx_v_score;
3570       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3571       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3572       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3573       goto __pyx_L6_except_return;
3574     }
3575     goto __pyx_L5_except_error;
3576     __pyx_L5_except_error:;
3577 
3578     /* "MACS2/IO/ScoreTrack.pyx":69
3579  *         float64_t score
3580  *
3581  *     try:             # <<<<<<<<<<<<<<
3582  *         return pscore_dict[(observed, expectation)]
3583  *     except KeyError:
3584  */
3585     __Pyx_XGIVEREF(__pyx_t_1);
3586     __Pyx_XGIVEREF(__pyx_t_2);
3587     __Pyx_XGIVEREF(__pyx_t_3);
3588     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3589     goto __pyx_L1_error;
3590     __pyx_L7_try_return:;
3591     __Pyx_XGIVEREF(__pyx_t_1);
3592     __Pyx_XGIVEREF(__pyx_t_2);
3593     __Pyx_XGIVEREF(__pyx_t_3);
3594     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3595     goto __pyx_L0;
3596     __pyx_L6_except_return:;
3597     __Pyx_XGIVEREF(__pyx_t_1);
3598     __Pyx_XGIVEREF(__pyx_t_2);
3599     __Pyx_XGIVEREF(__pyx_t_3);
3600     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3601     goto __pyx_L0;
3602   }
3603 
3604   /* "MACS2/IO/ScoreTrack.pyx":60
3605  * pscore_dict = dict()
3606  *
3607  * cdef float64_t get_pscore ( int32_t observed, float64_t expectation ):             # <<<<<<<<<<<<<<
3608  *     """Get p-value score from Poisson test. First check existing
3609  *     table, if failed, call poisson_cdf function, then store the result
3610  */
3611 
3612   /* function exit code */
3613   __pyx_L1_error:;
3614   __Pyx_XDECREF(__pyx_t_4);
3615   __Pyx_XDECREF(__pyx_t_5);
3616   __Pyx_XDECREF(__pyx_t_6);
3617   __Pyx_XDECREF(__pyx_t_7);
3618   __Pyx_XDECREF(__pyx_t_10);
3619   __Pyx_XDECREF(__pyx_t_11);
3620   __Pyx_XDECREF(__pyx_t_12);
3621   __Pyx_XDECREF(__pyx_t_13);
3622   __Pyx_XDECREF(__pyx_t_14);
3623   __Pyx_WriteUnraisable("MACS2.IO.ScoreTrack.get_pscore", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3624   __pyx_r = 0;
3625   __pyx_L0:;
3626   __Pyx_TraceReturn(Py_None, 0);
3627   __Pyx_RefNannyFinishContext();
3628   return __pyx_r;
3629 }
3630 
3631 /* "MACS2/IO/ScoreTrack.pyx":78
3632  * asym_logLR_dict = dict()
3633  *
3634  * cdef float64_t logLR_asym ( float64_t x, float64_t y ):             # <<<<<<<<<<<<<<
3635  *     """Calculate log10 Likelihood between H1 ( enriched ) and H0 (
3636  *     chromatin bias ). Set minus sign for depletion.
3637  */
3638 
__pyx_f_5MACS2_2IO_10ScoreTrack_logLR_asym(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y)3639 static __pyx_t_5numpy_float64_t __pyx_f_5MACS2_2IO_10ScoreTrack_logLR_asym(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y) {
3640   __pyx_t_5numpy_float64_t __pyx_v_s;
3641   __pyx_t_5numpy_float64_t __pyx_r;
3642   __Pyx_TraceDeclarations
3643   __Pyx_RefNannyDeclarations
3644   PyObject *__pyx_t_1 = NULL;
3645   PyObject *__pyx_t_2 = NULL;
3646   PyObject *__pyx_t_3 = NULL;
3647   int __pyx_t_4;
3648   int __pyx_t_5;
3649   PyObject *__pyx_t_6 = NULL;
3650   __pyx_t_5numpy_float64_t __pyx_t_7;
3651   PyObject *__pyx_t_8 = NULL;
3652   __Pyx_RefNannySetupContext("logLR_asym", 0);
3653   __Pyx_TraceCall("logLR_asym", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error));
3654 
3655   /* "MACS2/IO/ScoreTrack.pyx":88
3656  *         float64_t s
3657  *
3658  *     if (x,y) in asym_logLR_dict:             # <<<<<<<<<<<<<<
3659  *         return asym_logLR_dict[ ( x, y ) ]
3660  *     else:
3661  */
3662   __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
3663   __Pyx_GOTREF(__pyx_t_1);
3664   __pyx_t_2 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
3665   __Pyx_GOTREF(__pyx_t_2);
3666   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
3667   __Pyx_GOTREF(__pyx_t_3);
3668   __Pyx_GIVEREF(__pyx_t_1);
3669   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3670   __Pyx_GIVEREF(__pyx_t_2);
3671   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
3672   __pyx_t_1 = 0;
3673   __pyx_t_2 = 0;
3674   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asym_logLR_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
3675   __Pyx_GOTREF(__pyx_t_2);
3676   __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 88, __pyx_L1_error)
3677   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3678   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3679   __pyx_t_5 = (__pyx_t_4 != 0);
3680   if (__pyx_t_5) {
3681 
3682     /* "MACS2/IO/ScoreTrack.pyx":89
3683  *
3684  *     if (x,y) in asym_logLR_dict:
3685  *         return asym_logLR_dict[ ( x, y ) ]             # <<<<<<<<<<<<<<
3686  *     else:
3687  *         if x > y:
3688  */
3689     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asym_logLR_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
3690     __Pyx_GOTREF(__pyx_t_2);
3691     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
3692     __Pyx_GOTREF(__pyx_t_3);
3693     __pyx_t_1 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
3694     __Pyx_GOTREF(__pyx_t_1);
3695     __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
3696     __Pyx_GOTREF(__pyx_t_6);
3697     __Pyx_GIVEREF(__pyx_t_3);
3698     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
3699     __Pyx_GIVEREF(__pyx_t_1);
3700     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
3701     __pyx_t_3 = 0;
3702     __pyx_t_1 = 0;
3703     __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
3704     __Pyx_GOTREF(__pyx_t_1);
3705     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3706     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3707     __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error)
3708     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3709     __pyx_r = __pyx_t_7;
3710     goto __pyx_L0;
3711 
3712     /* "MACS2/IO/ScoreTrack.pyx":88
3713  *         float64_t s
3714  *
3715  *     if (x,y) in asym_logLR_dict:             # <<<<<<<<<<<<<<
3716  *         return asym_logLR_dict[ ( x, y ) ]
3717  *     else:
3718  */
3719   }
3720 
3721   /* "MACS2/IO/ScoreTrack.pyx":91
3722  *         return asym_logLR_dict[ ( x, y ) ]
3723  *     else:
3724  *         if x > y:             # <<<<<<<<<<<<<<
3725  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
3726  *         elif x < y:
3727  */
3728   /*else*/ {
3729     __pyx_t_5 = ((__pyx_v_x > __pyx_v_y) != 0);
3730     if (__pyx_t_5) {
3731 
3732       /* "MACS2/IO/ScoreTrack.pyx":92
3733  *     else:
3734  *         if x > y:
3735  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E             # <<<<<<<<<<<<<<
3736  *         elif x < y:
3737  *             s = (x*(-log(x)+log(y))-y+x)*LOG10_E
3738  */
3739       __pyx_t_1 = PyFloat_FromDouble((((__pyx_v_x * (log(__pyx_v_x) - log(__pyx_v_y))) + __pyx_v_y) - __pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
3740       __Pyx_GOTREF(__pyx_t_1);
3741       __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_LOG10_E); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error)
3742       __Pyx_GOTREF(__pyx_t_6);
3743       __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
3744       __Pyx_GOTREF(__pyx_t_2);
3745       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3746       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3747       __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
3748       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3749       __pyx_v_s = __pyx_t_7;
3750 
3751       /* "MACS2/IO/ScoreTrack.pyx":91
3752  *         return asym_logLR_dict[ ( x, y ) ]
3753  *     else:
3754  *         if x > y:             # <<<<<<<<<<<<<<
3755  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
3756  *         elif x < y:
3757  */
3758       goto __pyx_L4;
3759     }
3760 
3761     /* "MACS2/IO/ScoreTrack.pyx":93
3762  *         if x > y:
3763  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
3764  *         elif x < y:             # <<<<<<<<<<<<<<
3765  *             s = (x*(-log(x)+log(y))-y+x)*LOG10_E
3766  *         else:
3767  */
3768     __pyx_t_5 = ((__pyx_v_x < __pyx_v_y) != 0);
3769     if (__pyx_t_5) {
3770 
3771       /* "MACS2/IO/ScoreTrack.pyx":94
3772  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
3773  *         elif x < y:
3774  *             s = (x*(-log(x)+log(y))-y+x)*LOG10_E             # <<<<<<<<<<<<<<
3775  *         else:
3776  *             s = 0
3777  */
3778       __pyx_t_2 = PyFloat_FromDouble((((__pyx_v_x * ((-log(__pyx_v_x)) + log(__pyx_v_y))) - __pyx_v_y) + __pyx_v_x)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
3779       __Pyx_GOTREF(__pyx_t_2);
3780       __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_LOG10_E); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error)
3781       __Pyx_GOTREF(__pyx_t_6);
3782       __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
3783       __Pyx_GOTREF(__pyx_t_1);
3784       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3785       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3786       __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3787       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3788       __pyx_v_s = __pyx_t_7;
3789 
3790       /* "MACS2/IO/ScoreTrack.pyx":93
3791  *         if x > y:
3792  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
3793  *         elif x < y:             # <<<<<<<<<<<<<<
3794  *             s = (x*(-log(x)+log(y))-y+x)*LOG10_E
3795  *         else:
3796  */
3797       goto __pyx_L4;
3798     }
3799 
3800     /* "MACS2/IO/ScoreTrack.pyx":96
3801  *             s = (x*(-log(x)+log(y))-y+x)*LOG10_E
3802  *         else:
3803  *             s = 0             # <<<<<<<<<<<<<<
3804  *         asym_logLR_dict[ ( x, y ) ] = s
3805  *         return s
3806  */
3807     /*else*/ {
3808       __pyx_v_s = 0.0;
3809     }
3810     __pyx_L4:;
3811 
3812     /* "MACS2/IO/ScoreTrack.pyx":97
3813  *         else:
3814  *             s = 0
3815  *         asym_logLR_dict[ ( x, y ) ] = s             # <<<<<<<<<<<<<<
3816  *         return s
3817  *
3818  */
3819     __pyx_t_1 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
3820     __Pyx_GOTREF(__pyx_t_1);
3821     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_asym_logLR_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error)
3822     __Pyx_GOTREF(__pyx_t_6);
3823     __pyx_t_2 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
3824     __Pyx_GOTREF(__pyx_t_2);
3825     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
3826     __Pyx_GOTREF(__pyx_t_3);
3827     __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error)
3828     __Pyx_GOTREF(__pyx_t_8);
3829     __Pyx_GIVEREF(__pyx_t_2);
3830     PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
3831     __Pyx_GIVEREF(__pyx_t_3);
3832     PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
3833     __pyx_t_2 = 0;
3834     __pyx_t_3 = 0;
3835     if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_t_8, __pyx_t_1) < 0)) __PYX_ERR(0, 97, __pyx_L1_error)
3836     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3837     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3838     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3839 
3840     /* "MACS2/IO/ScoreTrack.pyx":98
3841  *             s = 0
3842  *         asym_logLR_dict[ ( x, y ) ] = s
3843  *         return s             # <<<<<<<<<<<<<<
3844  *
3845  * sym_logLR_dict = dict()
3846  */
3847     __pyx_r = __pyx_v_s;
3848     goto __pyx_L0;
3849   }
3850 
3851   /* "MACS2/IO/ScoreTrack.pyx":78
3852  * asym_logLR_dict = dict()
3853  *
3854  * cdef float64_t logLR_asym ( float64_t x, float64_t y ):             # <<<<<<<<<<<<<<
3855  *     """Calculate log10 Likelihood between H1 ( enriched ) and H0 (
3856  *     chromatin bias ). Set minus sign for depletion.
3857  */
3858 
3859   /* function exit code */
3860   __pyx_L1_error:;
3861   __Pyx_XDECREF(__pyx_t_1);
3862   __Pyx_XDECREF(__pyx_t_2);
3863   __Pyx_XDECREF(__pyx_t_3);
3864   __Pyx_XDECREF(__pyx_t_6);
3865   __Pyx_XDECREF(__pyx_t_8);
3866   __Pyx_WriteUnraisable("MACS2.IO.ScoreTrack.logLR_asym", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3867   __pyx_r = 0;
3868   __pyx_L0:;
3869   __Pyx_TraceReturn(Py_None, 0);
3870   __Pyx_RefNannyFinishContext();
3871   return __pyx_r;
3872 }
3873 
3874 /* "MACS2/IO/ScoreTrack.pyx":102
3875  * sym_logLR_dict = dict()
3876  *
3877  * cdef float64_t logLR_sym ( float64_t x, float64_t y ):             # <<<<<<<<<<<<<<
3878  *     """Calculate log10 Likelihood between H1 ( enriched ) and H0 (
3879  *     another enriched ). Set minus sign for H0>H1.
3880  */
3881 
__pyx_f_5MACS2_2IO_10ScoreTrack_logLR_sym(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y)3882 static __pyx_t_5numpy_float64_t __pyx_f_5MACS2_2IO_10ScoreTrack_logLR_sym(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y) {
3883   __pyx_t_5numpy_float64_t __pyx_v_s;
3884   __pyx_t_5numpy_float64_t __pyx_r;
3885   __Pyx_TraceDeclarations
3886   __Pyx_RefNannyDeclarations
3887   PyObject *__pyx_t_1 = NULL;
3888   PyObject *__pyx_t_2 = NULL;
3889   PyObject *__pyx_t_3 = NULL;
3890   int __pyx_t_4;
3891   int __pyx_t_5;
3892   PyObject *__pyx_t_6 = NULL;
3893   __pyx_t_5numpy_float64_t __pyx_t_7;
3894   PyObject *__pyx_t_8 = NULL;
3895   __Pyx_RefNannySetupContext("logLR_sym", 0);
3896   __Pyx_TraceCall("logLR_sym", __pyx_f[0], 102, 0, __PYX_ERR(0, 102, __pyx_L1_error));
3897 
3898   /* "MACS2/IO/ScoreTrack.pyx":112
3899  *         float64_t s
3900  *
3901  *     if (x,y) in sym_logLR_dict:             # <<<<<<<<<<<<<<
3902  *         return sym_logLR_dict[ ( x, y ) ]
3903  *     else:
3904  */
3905   __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
3906   __Pyx_GOTREF(__pyx_t_1);
3907   __pyx_t_2 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
3908   __Pyx_GOTREF(__pyx_t_2);
3909   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error)
3910   __Pyx_GOTREF(__pyx_t_3);
3911   __Pyx_GIVEREF(__pyx_t_1);
3912   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3913   __Pyx_GIVEREF(__pyx_t_2);
3914   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
3915   __pyx_t_1 = 0;
3916   __pyx_t_2 = 0;
3917   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sym_logLR_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
3918   __Pyx_GOTREF(__pyx_t_2);
3919   __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 112, __pyx_L1_error)
3920   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3921   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3922   __pyx_t_5 = (__pyx_t_4 != 0);
3923   if (__pyx_t_5) {
3924 
3925     /* "MACS2/IO/ScoreTrack.pyx":113
3926  *
3927  *     if (x,y) in sym_logLR_dict:
3928  *         return sym_logLR_dict[ ( x, y ) ]             # <<<<<<<<<<<<<<
3929  *     else:
3930  *         if x > y:
3931  */
3932     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sym_logLR_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
3933     __Pyx_GOTREF(__pyx_t_2);
3934     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
3935     __Pyx_GOTREF(__pyx_t_3);
3936     __pyx_t_1 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
3937     __Pyx_GOTREF(__pyx_t_1);
3938     __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error)
3939     __Pyx_GOTREF(__pyx_t_6);
3940     __Pyx_GIVEREF(__pyx_t_3);
3941     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
3942     __Pyx_GIVEREF(__pyx_t_1);
3943     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
3944     __pyx_t_3 = 0;
3945     __pyx_t_1 = 0;
3946     __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
3947     __Pyx_GOTREF(__pyx_t_1);
3948     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3949     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3950     __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error)
3951     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3952     __pyx_r = __pyx_t_7;
3953     goto __pyx_L0;
3954 
3955     /* "MACS2/IO/ScoreTrack.pyx":112
3956  *         float64_t s
3957  *
3958  *     if (x,y) in sym_logLR_dict:             # <<<<<<<<<<<<<<
3959  *         return sym_logLR_dict[ ( x, y ) ]
3960  *     else:
3961  */
3962   }
3963 
3964   /* "MACS2/IO/ScoreTrack.pyx":115
3965  *         return sym_logLR_dict[ ( x, y ) ]
3966  *     else:
3967  *         if x > y:             # <<<<<<<<<<<<<<
3968  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
3969  *         elif y > x:
3970  */
3971   /*else*/ {
3972     __pyx_t_5 = ((__pyx_v_x > __pyx_v_y) != 0);
3973     if (__pyx_t_5) {
3974 
3975       /* "MACS2/IO/ScoreTrack.pyx":116
3976  *     else:
3977  *         if x > y:
3978  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E             # <<<<<<<<<<<<<<
3979  *         elif y > x:
3980  *             s = (y*(log(x)-log(y))+y-x)*LOG10_E
3981  */
3982       __pyx_t_1 = PyFloat_FromDouble((((__pyx_v_x * (log(__pyx_v_x) - log(__pyx_v_y))) + __pyx_v_y) - __pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
3983       __Pyx_GOTREF(__pyx_t_1);
3984       __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_LOG10_E); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 116, __pyx_L1_error)
3985       __Pyx_GOTREF(__pyx_t_6);
3986       __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
3987       __Pyx_GOTREF(__pyx_t_2);
3988       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3989       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3990       __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
3991       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3992       __pyx_v_s = __pyx_t_7;
3993 
3994       /* "MACS2/IO/ScoreTrack.pyx":115
3995  *         return sym_logLR_dict[ ( x, y ) ]
3996  *     else:
3997  *         if x > y:             # <<<<<<<<<<<<<<
3998  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
3999  *         elif y > x:
4000  */
4001       goto __pyx_L4;
4002     }
4003 
4004     /* "MACS2/IO/ScoreTrack.pyx":117
4005  *         if x > y:
4006  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
4007  *         elif y > x:             # <<<<<<<<<<<<<<
4008  *             s = (y*(log(x)-log(y))+y-x)*LOG10_E
4009  *         else:
4010  */
4011     __pyx_t_5 = ((__pyx_v_y > __pyx_v_x) != 0);
4012     if (__pyx_t_5) {
4013 
4014       /* "MACS2/IO/ScoreTrack.pyx":118
4015  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
4016  *         elif y > x:
4017  *             s = (y*(log(x)-log(y))+y-x)*LOG10_E             # <<<<<<<<<<<<<<
4018  *         else:
4019  *             s = 0
4020  */
4021       __pyx_t_2 = PyFloat_FromDouble((((__pyx_v_y * (log(__pyx_v_x) - log(__pyx_v_y))) + __pyx_v_y) - __pyx_v_x)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
4022       __Pyx_GOTREF(__pyx_t_2);
4023       __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_LOG10_E); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error)
4024       __Pyx_GOTREF(__pyx_t_6);
4025       __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
4026       __Pyx_GOTREF(__pyx_t_1);
4027       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4028       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4029       __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error)
4030       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4031       __pyx_v_s = __pyx_t_7;
4032 
4033       /* "MACS2/IO/ScoreTrack.pyx":117
4034  *         if x > y:
4035  *             s = (x*(log(x)-log(y))+y-x)*LOG10_E
4036  *         elif y > x:             # <<<<<<<<<<<<<<
4037  *             s = (y*(log(x)-log(y))+y-x)*LOG10_E
4038  *         else:
4039  */
4040       goto __pyx_L4;
4041     }
4042 
4043     /* "MACS2/IO/ScoreTrack.pyx":120
4044  *             s = (y*(log(x)-log(y))+y-x)*LOG10_E
4045  *         else:
4046  *             s = 0             # <<<<<<<<<<<<<<
4047  *         sym_logLR_dict[ ( x, y ) ] = s
4048  *         return s
4049  */
4050     /*else*/ {
4051       __pyx_v_s = 0.0;
4052     }
4053     __pyx_L4:;
4054 
4055     /* "MACS2/IO/ScoreTrack.pyx":121
4056  *         else:
4057  *             s = 0
4058  *         sym_logLR_dict[ ( x, y ) ] = s             # <<<<<<<<<<<<<<
4059  *         return s
4060  *
4061  */
4062     __pyx_t_1 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
4063     __Pyx_GOTREF(__pyx_t_1);
4064     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sym_logLR_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error)
4065     __Pyx_GOTREF(__pyx_t_6);
4066     __pyx_t_2 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
4067     __Pyx_GOTREF(__pyx_t_2);
4068     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
4069     __Pyx_GOTREF(__pyx_t_3);
4070     __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error)
4071     __Pyx_GOTREF(__pyx_t_8);
4072     __Pyx_GIVEREF(__pyx_t_2);
4073     PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
4074     __Pyx_GIVEREF(__pyx_t_3);
4075     PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
4076     __pyx_t_2 = 0;
4077     __pyx_t_3 = 0;
4078     if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_t_8, __pyx_t_1) < 0)) __PYX_ERR(0, 121, __pyx_L1_error)
4079     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4080     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4081     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4082 
4083     /* "MACS2/IO/ScoreTrack.pyx":122
4084  *             s = 0
4085  *         sym_logLR_dict[ ( x, y ) ] = s
4086  *         return s             # <<<<<<<<<<<<<<
4087  *
4088  * cdef float64_t get_logFE ( float64_t x, float64_t y ):
4089  */
4090     __pyx_r = __pyx_v_s;
4091     goto __pyx_L0;
4092   }
4093 
4094   /* "MACS2/IO/ScoreTrack.pyx":102
4095  * sym_logLR_dict = dict()
4096  *
4097  * cdef float64_t logLR_sym ( float64_t x, float64_t y ):             # <<<<<<<<<<<<<<
4098  *     """Calculate log10 Likelihood between H1 ( enriched ) and H0 (
4099  *     another enriched ). Set minus sign for H0>H1.
4100  */
4101 
4102   /* function exit code */
4103   __pyx_L1_error:;
4104   __Pyx_XDECREF(__pyx_t_1);
4105   __Pyx_XDECREF(__pyx_t_2);
4106   __Pyx_XDECREF(__pyx_t_3);
4107   __Pyx_XDECREF(__pyx_t_6);
4108   __Pyx_XDECREF(__pyx_t_8);
4109   __Pyx_WriteUnraisable("MACS2.IO.ScoreTrack.logLR_sym", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4110   __pyx_r = 0;
4111   __pyx_L0:;
4112   __Pyx_TraceReturn(Py_None, 0);
4113   __Pyx_RefNannyFinishContext();
4114   return __pyx_r;
4115 }
4116 
4117 /* "MACS2/IO/ScoreTrack.pyx":124
4118  *         return s
4119  *
4120  * cdef float64_t get_logFE ( float64_t x, float64_t y ):             # <<<<<<<<<<<<<<
4121  *     """ return 100* log10 fold enrichment with +1 pseudocount.
4122  *     """
4123  */
4124 
__pyx_f_5MACS2_2IO_10ScoreTrack_get_logFE(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y)4125 static __pyx_t_5numpy_float64_t __pyx_f_5MACS2_2IO_10ScoreTrack_get_logFE(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y) {
4126   __pyx_t_5numpy_float64_t __pyx_r;
4127   __Pyx_TraceDeclarations
4128   __Pyx_RefNannyDeclarations
4129   __Pyx_RefNannySetupContext("get_logFE", 0);
4130   __Pyx_TraceCall("get_logFE", __pyx_f[0], 124, 0, __PYX_ERR(0, 124, __pyx_L1_error));
4131 
4132   /* "MACS2/IO/ScoreTrack.pyx":127
4133  *     """ return 100* log10 fold enrichment with +1 pseudocount.
4134  *     """
4135  *     return log10( x/y )             # <<<<<<<<<<<<<<
4136  *
4137  * cdef float64_t get_subtraction ( float64_t x, float64_t y):
4138  */
4139   if (unlikely(__pyx_v_y == 0)) {
4140     PyErr_SetString(PyExc_ZeroDivisionError, "float division");
4141     __PYX_ERR(0, 127, __pyx_L1_error)
4142   }
4143   __pyx_r = log10((__pyx_v_x / __pyx_v_y));
4144   goto __pyx_L0;
4145 
4146   /* "MACS2/IO/ScoreTrack.pyx":124
4147  *         return s
4148  *
4149  * cdef float64_t get_logFE ( float64_t x, float64_t y ):             # <<<<<<<<<<<<<<
4150  *     """ return 100* log10 fold enrichment with +1 pseudocount.
4151  *     """
4152  */
4153 
4154   /* function exit code */
4155   __pyx_L1_error:;
4156   __Pyx_WriteUnraisable("MACS2.IO.ScoreTrack.get_logFE", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4157   __pyx_r = 0;
4158   __pyx_L0:;
4159   __Pyx_TraceReturn(Py_None, 0);
4160   __Pyx_RefNannyFinishContext();
4161   return __pyx_r;
4162 }
4163 
4164 /* "MACS2/IO/ScoreTrack.pyx":129
4165  *     return log10( x/y )
4166  *
4167  * cdef float64_t get_subtraction ( float64_t x, float64_t y):             # <<<<<<<<<<<<<<
4168  *     """ return subtraction.
4169  *     """
4170  */
4171 
__pyx_f_5MACS2_2IO_10ScoreTrack_get_subtraction(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y)4172 static __pyx_t_5numpy_float64_t __pyx_f_5MACS2_2IO_10ScoreTrack_get_subtraction(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y) {
4173   __pyx_t_5numpy_float64_t __pyx_r;
4174   __Pyx_TraceDeclarations
4175   __Pyx_RefNannyDeclarations
4176   __Pyx_RefNannySetupContext("get_subtraction", 0);
4177   __Pyx_TraceCall("get_subtraction", __pyx_f[0], 129, 0, __PYX_ERR(0, 129, __pyx_L1_error));
4178 
4179   /* "MACS2/IO/ScoreTrack.pyx":132
4180  *     """ return subtraction.
4181  *     """
4182  *     return x - y             # <<<<<<<<<<<<<<
4183  *
4184  * # ------------------------------------
4185  */
4186   __pyx_r = (__pyx_v_x - __pyx_v_y);
4187   goto __pyx_L0;
4188 
4189   /* "MACS2/IO/ScoreTrack.pyx":129
4190  *     return log10( x/y )
4191  *
4192  * cdef float64_t get_subtraction ( float64_t x, float64_t y):             # <<<<<<<<<<<<<<
4193  *     """ return subtraction.
4194  *     """
4195  */
4196 
4197   /* function exit code */
4198   __pyx_L1_error:;
4199   __Pyx_WriteUnraisable("MACS2.IO.ScoreTrack.get_subtraction", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4200   __pyx_r = 0;
4201   __pyx_L0:;
4202   __Pyx_TraceReturn(Py_None, 0);
4203   __Pyx_RefNannyFinishContext();
4204   return __pyx_r;
4205 }
4206 
4207 /* "MACS2/IO/ScoreTrack.pyx":142
4208  *
4209  *     """
4210  *     def __init__ (self):             # <<<<<<<<<<<<<<
4211  *         """Different with bedGraphTrackI, missing values are simply
4212  *         replaced with 0.
4213  */
4214 
4215 /* Python wrapper */
4216 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
4217 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack___init__[] = "Different with bedGraphTrackI, missing values are simply\n        replaced with 0.\n        \n        ";
4218 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_1__init__, METH_O, __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack___init__};
__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_1__init__(PyObject * __pyx_self,PyObject * __pyx_v_self)4219 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
4220   PyObject *__pyx_r = 0;
4221   __Pyx_RefNannyDeclarations
4222   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4223   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack___init__(__pyx_self, ((PyObject *)__pyx_v_self));
4224 
4225   /* function exit code */
4226   __Pyx_RefNannyFinishContext();
4227   return __pyx_r;
4228 }
4229 
__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack___init__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self)4230 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
4231   PyObject *__pyx_r = NULL;
4232   __Pyx_TraceDeclarations
4233   __Pyx_RefNannyDeclarations
4234   PyObject *__pyx_t_1 = NULL;
4235   __Pyx_TraceFrameInit(__pyx_codeobj_)
4236   __Pyx_RefNannySetupContext("__init__", 0);
4237   __Pyx_TraceCall("__init__", __pyx_f[0], 142, 0, __PYX_ERR(0, 142, __pyx_L1_error));
4238 
4239   /* "MACS2/IO/ScoreTrack.pyx":147
4240  *
4241  *         """
4242  *         self.data = {}             # <<<<<<<<<<<<<<
4243  *         self.pointer = {}
4244  *
4245  */
4246   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
4247   __Pyx_GOTREF(__pyx_t_1);
4248   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data, __pyx_t_1) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
4249   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4250 
4251   /* "MACS2/IO/ScoreTrack.pyx":148
4252  *         """
4253  *         self.data = {}
4254  *         self.pointer = {}             # <<<<<<<<<<<<<<
4255  *
4256  *     def add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):
4257  */
4258   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4259   __Pyx_GOTREF(__pyx_t_1);
4260   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pointer, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
4261   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4262 
4263   /* "MACS2/IO/ScoreTrack.pyx":142
4264  *
4265  *     """
4266  *     def __init__ (self):             # <<<<<<<<<<<<<<
4267  *         """Different with bedGraphTrackI, missing values are simply
4268  *         replaced with 0.
4269  */
4270 
4271   /* function exit code */
4272   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4273   goto __pyx_L0;
4274   __pyx_L1_error:;
4275   __Pyx_XDECREF(__pyx_t_1);
4276   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4277   __pyx_r = NULL;
4278   __pyx_L0:;
4279   __Pyx_XGIVEREF(__pyx_r);
4280   __Pyx_TraceReturn(__pyx_r, 0);
4281   __Pyx_RefNannyFinishContext();
4282   return __pyx_r;
4283 }
4284 
4285 /* "MACS2/IO/ScoreTrack.pyx":150
4286  *         self.pointer = {}
4287  *
4288  *     def add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):             # <<<<<<<<<<<<<<
4289  *         if chrom not in self.data:
4290  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
4291  */
4292 
4293 /* Python wrapper */
4294 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_3add_chromosome(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4295 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_3add_chromosome = {"add_chromosome", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_3add_chromosome, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_3add_chromosome(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4296 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_3add_chromosome(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4297   PyObject *__pyx_v_self = 0;
4298   PyObject *__pyx_v_chrom = 0;
4299   __pyx_t_5numpy_int32_t __pyx_v_chrom_max_len;
4300   PyObject *__pyx_r = 0;
4301   __Pyx_RefNannyDeclarations
4302   __Pyx_RefNannySetupContext("add_chromosome (wrapper)", 0);
4303   {
4304     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_chrom,&__pyx_n_s_chrom_max_len,0};
4305     PyObject* values[3] = {0,0,0};
4306     if (unlikely(__pyx_kwds)) {
4307       Py_ssize_t kw_args;
4308       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4309       switch (pos_args) {
4310         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4311         CYTHON_FALLTHROUGH;
4312         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4313         CYTHON_FALLTHROUGH;
4314         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4315         CYTHON_FALLTHROUGH;
4316         case  0: break;
4317         default: goto __pyx_L5_argtuple_error;
4318       }
4319       kw_args = PyDict_Size(__pyx_kwds);
4320       switch (pos_args) {
4321         case  0:
4322         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
4323         else goto __pyx_L5_argtuple_error;
4324         CYTHON_FALLTHROUGH;
4325         case  1:
4326         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
4327         else {
4328           __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 3, 3, 1); __PYX_ERR(0, 150, __pyx_L3_error)
4329         }
4330         CYTHON_FALLTHROUGH;
4331         case  2:
4332         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom_max_len)) != 0)) kw_args--;
4333         else {
4334           __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 3, 3, 2); __PYX_ERR(0, 150, __pyx_L3_error)
4335         }
4336       }
4337       if (unlikely(kw_args > 0)) {
4338         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_chromosome") < 0)) __PYX_ERR(0, 150, __pyx_L3_error)
4339       }
4340     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4341       goto __pyx_L5_argtuple_error;
4342     } else {
4343       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4344       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4345       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4346     }
4347     __pyx_v_self = values[0];
4348     __pyx_v_chrom = ((PyObject*)values[1]);
4349     __pyx_v_chrom_max_len = __Pyx_PyInt_As_npy_int32(values[2]); if (unlikely((__pyx_v_chrom_max_len == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error)
4350   }
4351   goto __pyx_L4_argument_unpacking_done;
4352   __pyx_L5_argtuple_error:;
4353   __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 150, __pyx_L3_error)
4354   __pyx_L3_error:;
4355   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
4356   __Pyx_RefNannyFinishContext();
4357   return NULL;
4358   __pyx_L4_argument_unpacking_done:;
4359   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyBytes_Type), 1, "chrom", 1))) __PYX_ERR(0, 150, __pyx_L1_error)
4360   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_2add_chromosome(__pyx_self, __pyx_v_self, __pyx_v_chrom, __pyx_v_chrom_max_len);
4361 
4362   /* function exit code */
4363   goto __pyx_L0;
4364   __pyx_L1_error:;
4365   __pyx_r = NULL;
4366   __pyx_L0:;
4367   __Pyx_RefNannyFinishContext();
4368   return __pyx_r;
4369 }
4370 
__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_2add_chromosome(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_chrom,__pyx_t_5numpy_int32_t __pyx_v_chrom_max_len)4371 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_2add_chromosome(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_5numpy_int32_t __pyx_v_chrom_max_len) {
4372   PyObject *__pyx_r = NULL;
4373   __Pyx_TraceDeclarations
4374   __Pyx_RefNannyDeclarations
4375   PyObject *__pyx_t_1 = NULL;
4376   int __pyx_t_2;
4377   int __pyx_t_3;
4378   PyObject *__pyx_t_4 = NULL;
4379   PyObject *__pyx_t_5 = NULL;
4380   PyObject *__pyx_t_6 = NULL;
4381   __Pyx_TraceFrameInit(__pyx_codeobj__2)
4382   __Pyx_RefNannySetupContext("add_chromosome", 0);
4383   __Pyx_TraceCall("add_chromosome", __pyx_f[0], 150, 0, __PYX_ERR(0, 150, __pyx_L1_error));
4384 
4385   /* "MACS2/IO/ScoreTrack.pyx":151
4386  *
4387  *     def add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):
4388  *         if chrom not in self.data:             # <<<<<<<<<<<<<<
4389  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
4390  *                                                              ('V1','float32'), # value for the first track
4391  */
4392   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
4393   __Pyx_GOTREF(__pyx_t_1);
4394   __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_chrom, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 151, __pyx_L1_error)
4395   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4396   __pyx_t_3 = (__pyx_t_2 != 0);
4397   if (__pyx_t_3) {
4398 
4399     /* "MACS2/IO/ScoreTrack.pyx":152
4400  *     def add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):
4401  *         if chrom not in self.data:
4402  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
4403  *                                                              ('V1','float32'), # value for the first track
4404  *                                                              ('V2','float32'), # value for the second track
4405  */
4406     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
4407     __Pyx_GOTREF(__pyx_t_1);
4408     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
4409     __Pyx_GOTREF(__pyx_t_4);
4410     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4411     __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
4412     __Pyx_GOTREF(__pyx_t_1);
4413     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error)
4414     __Pyx_GOTREF(__pyx_t_5);
4415     __Pyx_GIVEREF(__pyx_t_1);
4416     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
4417     __pyx_t_1 = 0;
4418     __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
4419     __Pyx_GOTREF(__pyx_t_1);
4420 
4421     /* "MACS2/IO/ScoreTrack.pyx":154
4422  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
4423  *                                                              ('V1','float32'), # value for the first track
4424  *                                                              ('V2','float32'), # value for the second track             # <<<<<<<<<<<<<<
4425  *                                                              ])
4426  *             self.pointer[chrom] = 0
4427  */
4428     __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L1_error)
4429     __Pyx_GOTREF(__pyx_t_6);
4430     __Pyx_INCREF(__pyx_tuple__3);
4431     __Pyx_GIVEREF(__pyx_tuple__3);
4432     PyList_SET_ITEM(__pyx_t_6, 0, __pyx_tuple__3);
4433     __Pyx_INCREF(__pyx_tuple__4);
4434     __Pyx_GIVEREF(__pyx_tuple__4);
4435     PyList_SET_ITEM(__pyx_t_6, 1, __pyx_tuple__4);
4436     __Pyx_INCREF(__pyx_tuple__5);
4437     __Pyx_GIVEREF(__pyx_tuple__5);
4438     PyList_SET_ITEM(__pyx_t_6, 2, __pyx_tuple__5);
4439     if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
4440     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4441 
4442     /* "MACS2/IO/ScoreTrack.pyx":152
4443  *     def add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):
4444  *         if chrom not in self.data:
4445  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
4446  *                                                              ('V1','float32'), # value for the first track
4447  *                                                              ('V2','float32'), # value for the second track
4448  */
4449     __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L1_error)
4450     __Pyx_GOTREF(__pyx_t_6);
4451     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4452     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4453     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4454     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
4455     __Pyx_GOTREF(__pyx_t_1);
4456     if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_chrom, __pyx_t_6) < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
4457     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4458     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4459 
4460     /* "MACS2/IO/ScoreTrack.pyx":156
4461  *                                                              ('V2','float32'), # value for the second track
4462  *                                                              ])
4463  *             self.pointer[chrom] = 0             # <<<<<<<<<<<<<<
4464  *
4465  *     def add ( self, bytes chromosome, int32_t endpos, float64_t V1, float64_t V2 ):
4466  */
4467     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pointer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error)
4468     __Pyx_GOTREF(__pyx_t_6);
4469     if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_chrom, __pyx_int_0) < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
4470     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4471 
4472     /* "MACS2/IO/ScoreTrack.pyx":151
4473  *
4474  *     def add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):
4475  *         if chrom not in self.data:             # <<<<<<<<<<<<<<
4476  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
4477  *                                                              ('V1','float32'), # value for the first track
4478  */
4479   }
4480 
4481   /* "MACS2/IO/ScoreTrack.pyx":150
4482  *         self.pointer = {}
4483  *
4484  *     def add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):             # <<<<<<<<<<<<<<
4485  *         if chrom not in self.data:
4486  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
4487  */
4488 
4489   /* function exit code */
4490   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4491   goto __pyx_L0;
4492   __pyx_L1_error:;
4493   __Pyx_XDECREF(__pyx_t_1);
4494   __Pyx_XDECREF(__pyx_t_4);
4495   __Pyx_XDECREF(__pyx_t_5);
4496   __Pyx_XDECREF(__pyx_t_6);
4497   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
4498   __pyx_r = NULL;
4499   __pyx_L0:;
4500   __Pyx_XGIVEREF(__pyx_r);
4501   __Pyx_TraceReturn(__pyx_r, 0);
4502   __Pyx_RefNannyFinishContext();
4503   return __pyx_r;
4504 }
4505 
4506 /* "MACS2/IO/ScoreTrack.pyx":158
4507  *             self.pointer[chrom] = 0
4508  *
4509  *     def add ( self, bytes chromosome, int32_t endpos, float64_t V1, float64_t V2 ):             # <<<<<<<<<<<<<<
4510  *         """Add a chr-endpos-sample-control block into data
4511  *         dictionary. At the mean time, calculate pvalues.
4512  */
4513 
4514 /* Python wrapper */
4515 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_5add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4516 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_4add[] = "Add a chr-endpos-sample-control block into data\n        dictionary. At the mean time, calculate pvalues.\n\n        ";
4517 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_5add = {"add", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_5add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_4add};
__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_5add(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4518 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_5add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4519   PyObject *__pyx_v_self = 0;
4520   PyObject *__pyx_v_chromosome = 0;
4521   __pyx_t_5numpy_int32_t __pyx_v_endpos;
4522   __pyx_t_5numpy_float64_t __pyx_v_V1;
4523   __pyx_t_5numpy_float64_t __pyx_v_V2;
4524   PyObject *__pyx_r = 0;
4525   __Pyx_RefNannyDeclarations
4526   __Pyx_RefNannySetupContext("add (wrapper)", 0);
4527   {
4528     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_chromosome,&__pyx_n_s_endpos,&__pyx_n_s_V1,&__pyx_n_s_V2,0};
4529     PyObject* values[5] = {0,0,0,0,0};
4530     if (unlikely(__pyx_kwds)) {
4531       Py_ssize_t kw_args;
4532       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4533       switch (pos_args) {
4534         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4535         CYTHON_FALLTHROUGH;
4536         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4537         CYTHON_FALLTHROUGH;
4538         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4539         CYTHON_FALLTHROUGH;
4540         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4541         CYTHON_FALLTHROUGH;
4542         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4543         CYTHON_FALLTHROUGH;
4544         case  0: break;
4545         default: goto __pyx_L5_argtuple_error;
4546       }
4547       kw_args = PyDict_Size(__pyx_kwds);
4548       switch (pos_args) {
4549         case  0:
4550         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
4551         else goto __pyx_L5_argtuple_error;
4552         CYTHON_FALLTHROUGH;
4553         case  1:
4554         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chromosome)) != 0)) kw_args--;
4555         else {
4556           __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 1); __PYX_ERR(0, 158, __pyx_L3_error)
4557         }
4558         CYTHON_FALLTHROUGH;
4559         case  2:
4560         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_endpos)) != 0)) kw_args--;
4561         else {
4562           __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 2); __PYX_ERR(0, 158, __pyx_L3_error)
4563         }
4564         CYTHON_FALLTHROUGH;
4565         case  3:
4566         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V1)) != 0)) kw_args--;
4567         else {
4568           __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 3); __PYX_ERR(0, 158, __pyx_L3_error)
4569         }
4570         CYTHON_FALLTHROUGH;
4571         case  4:
4572         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V2)) != 0)) kw_args--;
4573         else {
4574           __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, 4); __PYX_ERR(0, 158, __pyx_L3_error)
4575         }
4576       }
4577       if (unlikely(kw_args > 0)) {
4578         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 158, __pyx_L3_error)
4579       }
4580     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4581       goto __pyx_L5_argtuple_error;
4582     } else {
4583       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4584       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4585       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4586       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4587       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4588     }
4589     __pyx_v_self = values[0];
4590     __pyx_v_chromosome = ((PyObject*)values[1]);
4591     __pyx_v_endpos = __Pyx_PyInt_As_npy_int32(values[2]); if (unlikely((__pyx_v_endpos == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error)
4592     __pyx_v_V1 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_V1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error)
4593     __pyx_v_V2 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_V2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error)
4594   }
4595   goto __pyx_L4_argument_unpacking_done;
4596   __pyx_L5_argtuple_error:;
4597   __Pyx_RaiseArgtupleInvalid("add", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 158, __pyx_L3_error)
4598   __pyx_L3_error:;
4599   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
4600   __Pyx_RefNannyFinishContext();
4601   return NULL;
4602   __pyx_L4_argument_unpacking_done:;
4603   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chromosome), (&PyBytes_Type), 1, "chromosome", 1))) __PYX_ERR(0, 158, __pyx_L1_error)
4604   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_4add(__pyx_self, __pyx_v_self, __pyx_v_chromosome, __pyx_v_endpos, __pyx_v_V1, __pyx_v_V2);
4605 
4606   /* function exit code */
4607   goto __pyx_L0;
4608   __pyx_L1_error:;
4609   __pyx_r = NULL;
4610   __pyx_L0:;
4611   __Pyx_RefNannyFinishContext();
4612   return __pyx_r;
4613 }
4614 
__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_4add(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_chromosome,__pyx_t_5numpy_int32_t __pyx_v_endpos,__pyx_t_5numpy_float64_t __pyx_v_V1,__pyx_t_5numpy_float64_t __pyx_v_V2)4615 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_4add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome, __pyx_t_5numpy_int32_t __pyx_v_endpos, __pyx_t_5numpy_float64_t __pyx_v_V1, __pyx_t_5numpy_float64_t __pyx_v_V2) {
4616   PyObject *__pyx_v_c = 0;
4617   __pyx_t_5numpy_int32_t __pyx_v_i;
4618   PyObject *__pyx_r = NULL;
4619   __Pyx_TraceDeclarations
4620   __Pyx_RefNannyDeclarations
4621   PyObject *__pyx_t_1 = NULL;
4622   PyObject *__pyx_t_2 = NULL;
4623   __pyx_t_5numpy_int32_t __pyx_t_3;
4624   PyObject *__pyx_t_4 = NULL;
4625   PyObject *__pyx_t_5 = NULL;
4626   PyObject *__pyx_t_6 = NULL;
4627   __Pyx_TraceFrameInit(__pyx_codeobj__6)
4628   __Pyx_RefNannySetupContext("add", 0);
4629   __Pyx_TraceCall("add", __pyx_f[0], 158, 0, __PYX_ERR(0, 158, __pyx_L1_error));
4630 
4631   /* "MACS2/IO/ScoreTrack.pyx":167
4632  *             int32_t i
4633  *
4634  *         c = self.data[chromosome]             # <<<<<<<<<<<<<<
4635  *         i = self.pointer[chromosome]
4636  *         # get the preceding region
4637  */
4638   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
4639   __Pyx_GOTREF(__pyx_t_1);
4640   __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_chromosome); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
4641   __Pyx_GOTREF(__pyx_t_2);
4642   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4643   if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 167, __pyx_L1_error)
4644   __pyx_v_c = ((PyObject*)__pyx_t_2);
4645   __pyx_t_2 = 0;
4646 
4647   /* "MACS2/IO/ScoreTrack.pyx":168
4648  *
4649  *         c = self.data[chromosome]
4650  *         i = self.pointer[chromosome]             # <<<<<<<<<<<<<<
4651  *         # get the preceding region
4652  *         c[i] = (endpos,V1,V2)
4653  */
4654   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pointer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
4655   __Pyx_GOTREF(__pyx_t_2);
4656   __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_chromosome); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
4657   __Pyx_GOTREF(__pyx_t_1);
4658   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4659   __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
4660   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4661   __pyx_v_i = __pyx_t_3;
4662 
4663   /* "MACS2/IO/ScoreTrack.pyx":170
4664  *         i = self.pointer[chromosome]
4665  *         # get the preceding region
4666  *         c[i] = (endpos,V1,V2)             # <<<<<<<<<<<<<<
4667  *         self.pointer[chromosome] += 1
4668  *
4669  */
4670   __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_endpos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
4671   __Pyx_GOTREF(__pyx_t_1);
4672   __pyx_t_2 = PyFloat_FromDouble(__pyx_v_V1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
4673   __Pyx_GOTREF(__pyx_t_2);
4674   __pyx_t_4 = PyFloat_FromDouble(__pyx_v_V2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
4675   __Pyx_GOTREF(__pyx_t_4);
4676   __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
4677   __Pyx_GOTREF(__pyx_t_5);
4678   __Pyx_GIVEREF(__pyx_t_1);
4679   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
4680   __Pyx_GIVEREF(__pyx_t_2);
4681   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
4682   __Pyx_GIVEREF(__pyx_t_4);
4683   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
4684   __pyx_t_1 = 0;
4685   __pyx_t_2 = 0;
4686   __pyx_t_4 = 0;
4687   if (unlikely(__pyx_v_c == Py_None)) {
4688     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
4689     __PYX_ERR(0, 170, __pyx_L1_error)
4690   }
4691   if (unlikely(__Pyx_SetItemInt(__pyx_v_c, __pyx_v_i, __pyx_t_5, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 1, 1, 1) < 0)) __PYX_ERR(0, 170, __pyx_L1_error)
4692   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4693 
4694   /* "MACS2/IO/ScoreTrack.pyx":171
4695  *         # get the preceding region
4696  *         c[i] = (endpos,V1,V2)
4697  *         self.pointer[chromosome] += 1             # <<<<<<<<<<<<<<
4698  *
4699  *     def finalize ( self ):
4700  */
4701   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pointer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
4702   __Pyx_GOTREF(__pyx_t_5);
4703   __Pyx_INCREF(__pyx_v_chromosome);
4704   __pyx_t_6 = __pyx_v_chromosome;
4705   __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
4706   __Pyx_GOTREF(__pyx_t_4);
4707   __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
4708   __Pyx_GOTREF(__pyx_t_2);
4709   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4710   if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_t_6, __pyx_t_2) < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
4711   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4712   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4713   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4714 
4715   /* "MACS2/IO/ScoreTrack.pyx":158
4716  *             self.pointer[chrom] = 0
4717  *
4718  *     def add ( self, bytes chromosome, int32_t endpos, float64_t V1, float64_t V2 ):             # <<<<<<<<<<<<<<
4719  *         """Add a chr-endpos-sample-control block into data
4720  *         dictionary. At the mean time, calculate pvalues.
4721  */
4722 
4723   /* function exit code */
4724   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4725   goto __pyx_L0;
4726   __pyx_L1_error:;
4727   __Pyx_XDECREF(__pyx_t_1);
4728   __Pyx_XDECREF(__pyx_t_2);
4729   __Pyx_XDECREF(__pyx_t_4);
4730   __Pyx_XDECREF(__pyx_t_5);
4731   __Pyx_XDECREF(__pyx_t_6);
4732   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
4733   __pyx_r = NULL;
4734   __pyx_L0:;
4735   __Pyx_XDECREF(__pyx_v_c);
4736   __Pyx_XGIVEREF(__pyx_r);
4737   __Pyx_TraceReturn(__pyx_r, 0);
4738   __Pyx_RefNannyFinishContext();
4739   return __pyx_r;
4740 }
4741 
4742 /* "MACS2/IO/ScoreTrack.pyx":173
4743  *         self.pointer[chromosome] += 1
4744  *
4745  *     def finalize ( self ):             # <<<<<<<<<<<<<<
4746  *         cdef bytes chrom
4747  *
4748  */
4749 
4750 /* Python wrapper */
4751 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_7finalize(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
4752 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_7finalize = {"finalize", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_7finalize, METH_O, 0};
__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_7finalize(PyObject * __pyx_self,PyObject * __pyx_v_self)4753 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_7finalize(PyObject *__pyx_self, PyObject *__pyx_v_self) {
4754   PyObject *__pyx_r = 0;
4755   __Pyx_RefNannyDeclarations
4756   __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
4757   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_6finalize(__pyx_self, ((PyObject *)__pyx_v_self));
4758 
4759   /* function exit code */
4760   __Pyx_RefNannyFinishContext();
4761   return __pyx_r;
4762 }
4763 
__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_6finalize(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self)4764 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_6finalize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
4765   PyObject *__pyx_v_chrom = 0;
4766   PyObject *__pyx_v_d = NULL;
4767   PyObject *__pyx_v_l = NULL;
4768   PyObject *__pyx_r = NULL;
4769   __Pyx_TraceDeclarations
4770   __Pyx_RefNannyDeclarations
4771   PyObject *__pyx_t_1 = NULL;
4772   Py_ssize_t __pyx_t_2;
4773   Py_ssize_t __pyx_t_3;
4774   int __pyx_t_4;
4775   PyObject *__pyx_t_5 = NULL;
4776   PyObject *__pyx_t_6 = NULL;
4777   int __pyx_t_7;
4778   PyObject *__pyx_t_8 = NULL;
4779   PyObject *__pyx_t_9 = NULL;
4780   __Pyx_TraceFrameInit(__pyx_codeobj__7)
4781   __Pyx_RefNannySetupContext("finalize", 0);
4782   __Pyx_TraceCall("finalize", __pyx_f[0], 173, 0, __PYX_ERR(0, 173, __pyx_L1_error));
4783 
4784   /* "MACS2/IO/ScoreTrack.pyx":176
4785  *         cdef bytes chrom
4786  *
4787  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
4788  *             d = self.data[chrom]
4789  *             l = self.pointer[chrom]
4790  */
4791   __pyx_t_2 = 0;
4792   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error)
4793   __Pyx_GOTREF(__pyx_t_5);
4794   if (unlikely(__pyx_t_5 == Py_None)) {
4795     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
4796     __PYX_ERR(0, 176, __pyx_L1_error)
4797   }
4798   __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_keys, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error)
4799   __Pyx_GOTREF(__pyx_t_6);
4800   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4801   __Pyx_XDECREF(__pyx_t_1);
4802   __pyx_t_1 = __pyx_t_6;
4803   __pyx_t_6 = 0;
4804   while (1) {
4805     __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, NULL, NULL, __pyx_t_4);
4806     if (unlikely(__pyx_t_7 == 0)) break;
4807     if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 176, __pyx_L1_error)
4808     __Pyx_GOTREF(__pyx_t_6);
4809     if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 176, __pyx_L1_error)
4810     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_6));
4811     __pyx_t_6 = 0;
4812 
4813     /* "MACS2/IO/ScoreTrack.pyx":177
4814  *
4815  *         for chrom in self.data.keys():
4816  *             d = self.data[chrom]             # <<<<<<<<<<<<<<
4817  *             l = self.pointer[chrom]
4818  *             d.resize(l,refcheck=False)
4819  */
4820     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
4821     __Pyx_GOTREF(__pyx_t_6);
4822     __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error)
4823     __Pyx_GOTREF(__pyx_t_5);
4824     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4825     __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_5);
4826     __pyx_t_5 = 0;
4827 
4828     /* "MACS2/IO/ScoreTrack.pyx":178
4829  *         for chrom in self.data.keys():
4830  *             d = self.data[chrom]
4831  *             l = self.pointer[chrom]             # <<<<<<<<<<<<<<
4832  *             d.resize(l,refcheck=False)
4833  *
4834  */
4835     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pointer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error)
4836     __Pyx_GOTREF(__pyx_t_5);
4837     __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error)
4838     __Pyx_GOTREF(__pyx_t_6);
4839     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4840     __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_6);
4841     __pyx_t_6 = 0;
4842 
4843     /* "MACS2/IO/ScoreTrack.pyx":179
4844  *             d = self.data[chrom]
4845  *             l = self.pointer[chrom]
4846  *             d.resize(l,refcheck=False)             # <<<<<<<<<<<<<<
4847  *
4848  *     def get_data_by_chr (self, bytes chromosome):
4849  */
4850     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_resize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error)
4851     __Pyx_GOTREF(__pyx_t_6);
4852     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 179, __pyx_L1_error)
4853     __Pyx_GOTREF(__pyx_t_5);
4854     __Pyx_INCREF(__pyx_v_l);
4855     __Pyx_GIVEREF(__pyx_v_l);
4856     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_l);
4857     __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 179, __pyx_L1_error)
4858     __Pyx_GOTREF(__pyx_t_8);
4859     if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 179, __pyx_L1_error)
4860     __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 179, __pyx_L1_error)
4861     __Pyx_GOTREF(__pyx_t_9);
4862     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4863     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4864     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4865     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4866   }
4867   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4868 
4869   /* "MACS2/IO/ScoreTrack.pyx":173
4870  *         self.pointer[chromosome] += 1
4871  *
4872  *     def finalize ( self ):             # <<<<<<<<<<<<<<
4873  *         cdef bytes chrom
4874  *
4875  */
4876 
4877   /* function exit code */
4878   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4879   goto __pyx_L0;
4880   __pyx_L1_error:;
4881   __Pyx_XDECREF(__pyx_t_1);
4882   __Pyx_XDECREF(__pyx_t_5);
4883   __Pyx_XDECREF(__pyx_t_6);
4884   __Pyx_XDECREF(__pyx_t_8);
4885   __Pyx_XDECREF(__pyx_t_9);
4886   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
4887   __pyx_r = NULL;
4888   __pyx_L0:;
4889   __Pyx_XDECREF(__pyx_v_chrom);
4890   __Pyx_XDECREF(__pyx_v_d);
4891   __Pyx_XDECREF(__pyx_v_l);
4892   __Pyx_XGIVEREF(__pyx_r);
4893   __Pyx_TraceReturn(__pyx_r, 0);
4894   __Pyx_RefNannyFinishContext();
4895   return __pyx_r;
4896 }
4897 
4898 /* "MACS2/IO/ScoreTrack.pyx":181
4899  *             d.resize(l,refcheck=False)
4900  *
4901  *     def get_data_by_chr (self, bytes chromosome):             # <<<<<<<<<<<<<<
4902  *         """Return array of counts by chromosome.
4903  *
4904  */
4905 
4906 /* Python wrapper */
4907 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_9get_data_by_chr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4908 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_8get_data_by_chr[] = "Return array of counts by chromosome.\n\n        The return value is a tuple:\n        ([end pos],[value])\n        ";
4909 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_9get_data_by_chr = {"get_data_by_chr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_9get_data_by_chr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_8get_data_by_chr};
__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_9get_data_by_chr(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4910 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_9get_data_by_chr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4911   PyObject *__pyx_v_self = 0;
4912   PyObject *__pyx_v_chromosome = 0;
4913   PyObject *__pyx_r = 0;
4914   __Pyx_RefNannyDeclarations
4915   __Pyx_RefNannySetupContext("get_data_by_chr (wrapper)", 0);
4916   {
4917     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_chromosome,0};
4918     PyObject* values[2] = {0,0};
4919     if (unlikely(__pyx_kwds)) {
4920       Py_ssize_t kw_args;
4921       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4922       switch (pos_args) {
4923         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4924         CYTHON_FALLTHROUGH;
4925         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4926         CYTHON_FALLTHROUGH;
4927         case  0: break;
4928         default: goto __pyx_L5_argtuple_error;
4929       }
4930       kw_args = PyDict_Size(__pyx_kwds);
4931       switch (pos_args) {
4932         case  0:
4933         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
4934         else goto __pyx_L5_argtuple_error;
4935         CYTHON_FALLTHROUGH;
4936         case  1:
4937         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chromosome)) != 0)) kw_args--;
4938         else {
4939           __Pyx_RaiseArgtupleInvalid("get_data_by_chr", 1, 2, 2, 1); __PYX_ERR(0, 181, __pyx_L3_error)
4940         }
4941       }
4942       if (unlikely(kw_args > 0)) {
4943         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_data_by_chr") < 0)) __PYX_ERR(0, 181, __pyx_L3_error)
4944       }
4945     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4946       goto __pyx_L5_argtuple_error;
4947     } else {
4948       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4949       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4950     }
4951     __pyx_v_self = values[0];
4952     __pyx_v_chromosome = ((PyObject*)values[1]);
4953   }
4954   goto __pyx_L4_argument_unpacking_done;
4955   __pyx_L5_argtuple_error:;
4956   __Pyx_RaiseArgtupleInvalid("get_data_by_chr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 181, __pyx_L3_error)
4957   __pyx_L3_error:;
4958   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4959   __Pyx_RefNannyFinishContext();
4960   return NULL;
4961   __pyx_L4_argument_unpacking_done:;
4962   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chromosome), (&PyBytes_Type), 1, "chromosome", 1))) __PYX_ERR(0, 181, __pyx_L1_error)
4963   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_8get_data_by_chr(__pyx_self, __pyx_v_self, __pyx_v_chromosome);
4964 
4965   /* function exit code */
4966   goto __pyx_L0;
4967   __pyx_L1_error:;
4968   __pyx_r = NULL;
4969   __pyx_L0:;
4970   __Pyx_RefNannyFinishContext();
4971   return __pyx_r;
4972 }
4973 
__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_8get_data_by_chr(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_chromosome)4974 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_8get_data_by_chr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome) {
4975   PyObject *__pyx_r = NULL;
4976   __Pyx_TraceDeclarations
4977   __Pyx_RefNannyDeclarations
4978   PyObject *__pyx_t_1 = NULL;
4979   int __pyx_t_2;
4980   int __pyx_t_3;
4981   PyObject *__pyx_t_4 = NULL;
4982   __Pyx_TraceFrameInit(__pyx_codeobj__8)
4983   __Pyx_RefNannySetupContext("get_data_by_chr", 0);
4984   __Pyx_TraceCall("get_data_by_chr", __pyx_f[0], 181, 0, __PYX_ERR(0, 181, __pyx_L1_error));
4985 
4986   /* "MACS2/IO/ScoreTrack.pyx":187
4987  *         ([end pos],[value])
4988  *         """
4989  *         if chromosome in self.data:             # <<<<<<<<<<<<<<
4990  *             return self.data[chromosome]
4991  *         else:
4992  */
4993   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
4994   __Pyx_GOTREF(__pyx_t_1);
4995   __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_chromosome, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
4996   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4997   __pyx_t_3 = (__pyx_t_2 != 0);
4998   if (__pyx_t_3) {
4999 
5000     /* "MACS2/IO/ScoreTrack.pyx":188
5001  *         """
5002  *         if chromosome in self.data:
5003  *             return self.data[chromosome]             # <<<<<<<<<<<<<<
5004  *         else:
5005  *             return None
5006  */
5007     __Pyx_XDECREF(__pyx_r);
5008     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
5009     __Pyx_GOTREF(__pyx_t_1);
5010     __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_chromosome); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
5011     __Pyx_GOTREF(__pyx_t_4);
5012     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5013     __pyx_r = __pyx_t_4;
5014     __pyx_t_4 = 0;
5015     goto __pyx_L0;
5016 
5017     /* "MACS2/IO/ScoreTrack.pyx":187
5018  *         ([end pos],[value])
5019  *         """
5020  *         if chromosome in self.data:             # <<<<<<<<<<<<<<
5021  *             return self.data[chromosome]
5022  *         else:
5023  */
5024   }
5025 
5026   /* "MACS2/IO/ScoreTrack.pyx":190
5027  *             return self.data[chromosome]
5028  *         else:
5029  *             return None             # <<<<<<<<<<<<<<
5030  *
5031  *     def get_chr_names (self):
5032  */
5033   /*else*/ {
5034     __Pyx_XDECREF(__pyx_r);
5035     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5036     goto __pyx_L0;
5037   }
5038 
5039   /* "MACS2/IO/ScoreTrack.pyx":181
5040  *             d.resize(l,refcheck=False)
5041  *
5042  *     def get_data_by_chr (self, bytes chromosome):             # <<<<<<<<<<<<<<
5043  *         """Return array of counts by chromosome.
5044  *
5045  */
5046 
5047   /* function exit code */
5048   __pyx_L1_error:;
5049   __Pyx_XDECREF(__pyx_t_1);
5050   __Pyx_XDECREF(__pyx_t_4);
5051   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5052   __pyx_r = NULL;
5053   __pyx_L0:;
5054   __Pyx_XGIVEREF(__pyx_r);
5055   __Pyx_TraceReturn(__pyx_r, 0);
5056   __Pyx_RefNannyFinishContext();
5057   return __pyx_r;
5058 }
5059 
5060 /* "MACS2/IO/ScoreTrack.pyx":192
5061  *             return None
5062  *
5063  *     def get_chr_names (self):             # <<<<<<<<<<<<<<
5064  *         """Return all the chromosome names stored.
5065  *
5066  */
5067 
5068 /* Python wrapper */
5069 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_11get_chr_names(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
5070 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_10get_chr_names[] = "Return all the chromosome names stored.\n        \n        ";
5071 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_11get_chr_names = {"get_chr_names", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_11get_chr_names, METH_O, __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_10get_chr_names};
__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_11get_chr_names(PyObject * __pyx_self,PyObject * __pyx_v_self)5072 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_11get_chr_names(PyObject *__pyx_self, PyObject *__pyx_v_self) {
5073   PyObject *__pyx_r = 0;
5074   __Pyx_RefNannyDeclarations
5075   __Pyx_RefNannySetupContext("get_chr_names (wrapper)", 0);
5076   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_10get_chr_names(__pyx_self, ((PyObject *)__pyx_v_self));
5077 
5078   /* function exit code */
5079   __Pyx_RefNannyFinishContext();
5080   return __pyx_r;
5081 }
5082 
__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_10get_chr_names(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self)5083 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_10get_chr_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
5084   PyObject *__pyx_v_l = 0;
5085   PyObject *__pyx_r = NULL;
5086   __Pyx_TraceDeclarations
5087   __Pyx_RefNannyDeclarations
5088   PyObject *__pyx_t_1 = NULL;
5089   PyObject *__pyx_t_2 = NULL;
5090   PyObject *__pyx_t_3 = NULL;
5091   __Pyx_TraceFrameInit(__pyx_codeobj__9)
5092   __Pyx_RefNannySetupContext("get_chr_names", 0);
5093   __Pyx_TraceCall("get_chr_names", __pyx_f[0], 192, 0, __PYX_ERR(0, 192, __pyx_L1_error));
5094 
5095   /* "MACS2/IO/ScoreTrack.pyx":198
5096  *         cdef set l
5097  *
5098  *         l = set(self.data.keys())             # <<<<<<<<<<<<<<
5099  *         return l
5100  *
5101  */
5102   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
5103   __Pyx_GOTREF(__pyx_t_2);
5104   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
5105   __Pyx_GOTREF(__pyx_t_3);
5106   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5107   __pyx_t_2 = NULL;
5108   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
5109     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
5110     if (likely(__pyx_t_2)) {
5111       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5112       __Pyx_INCREF(__pyx_t_2);
5113       __Pyx_INCREF(function);
5114       __Pyx_DECREF_SET(__pyx_t_3, function);
5115     }
5116   }
5117   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
5118   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5119   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
5120   __Pyx_GOTREF(__pyx_t_1);
5121   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5122   __pyx_t_3 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
5123   __Pyx_GOTREF(__pyx_t_3);
5124   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5125   __pyx_v_l = ((PyObject*)__pyx_t_3);
5126   __pyx_t_3 = 0;
5127 
5128   /* "MACS2/IO/ScoreTrack.pyx":199
5129  *
5130  *         l = set(self.data.keys())
5131  *         return l             # <<<<<<<<<<<<<<
5132  *
5133  *     def write_bedGraph (self, fhd, str name, str description, str colname):
5134  */
5135   __Pyx_XDECREF(__pyx_r);
5136   __Pyx_INCREF(__pyx_v_l);
5137   __pyx_r = __pyx_v_l;
5138   goto __pyx_L0;
5139 
5140   /* "MACS2/IO/ScoreTrack.pyx":192
5141  *             return None
5142  *
5143  *     def get_chr_names (self):             # <<<<<<<<<<<<<<
5144  *         """Return all the chromosome names stored.
5145  *
5146  */
5147 
5148   /* function exit code */
5149   __pyx_L1_error:;
5150   __Pyx_XDECREF(__pyx_t_1);
5151   __Pyx_XDECREF(__pyx_t_2);
5152   __Pyx_XDECREF(__pyx_t_3);
5153   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
5154   __pyx_r = NULL;
5155   __pyx_L0:;
5156   __Pyx_XDECREF(__pyx_v_l);
5157   __Pyx_XGIVEREF(__pyx_r);
5158   __Pyx_TraceReturn(__pyx_r, 0);
5159   __Pyx_RefNannyFinishContext();
5160   return __pyx_r;
5161 }
5162 
5163 /* "MACS2/IO/ScoreTrack.pyx":201
5164  *         return l
5165  *
5166  *     def write_bedGraph (self, fhd, str name, str description, str colname):             # <<<<<<<<<<<<<<
5167  *         """Write all data to fhd in Wiggle Format.
5168  *
5169  */
5170 
5171 /* Python wrapper */
5172 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_13write_bedGraph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5173 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_12write_bedGraph[] = "Write all data to fhd in Wiggle Format.\n\n        fhd: a filehandler to save bedGraph.\n        name/description: the name and description in track line.\n\n        colname: can be 'sample','control','-100logp','-100logq'\n\n        ";
5174 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_13write_bedGraph = {"write_bedGraph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_13write_bedGraph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_12write_bedGraph};
__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_13write_bedGraph(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5175 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_13write_bedGraph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5176   PyObject *__pyx_v_self = 0;
5177   PyObject *__pyx_v_fhd = 0;
5178   CYTHON_UNUSED PyObject *__pyx_v_name = 0;
5179   CYTHON_UNUSED PyObject *__pyx_v_description = 0;
5180   PyObject *__pyx_v_colname = 0;
5181   PyObject *__pyx_r = 0;
5182   __Pyx_RefNannyDeclarations
5183   __Pyx_RefNannySetupContext("write_bedGraph (wrapper)", 0);
5184   {
5185     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};
5186     PyObject* values[5] = {0,0,0,0,0};
5187     if (unlikely(__pyx_kwds)) {
5188       Py_ssize_t kw_args;
5189       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5190       switch (pos_args) {
5191         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5192         CYTHON_FALLTHROUGH;
5193         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5194         CYTHON_FALLTHROUGH;
5195         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5196         CYTHON_FALLTHROUGH;
5197         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5198         CYTHON_FALLTHROUGH;
5199         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5200         CYTHON_FALLTHROUGH;
5201         case  0: break;
5202         default: goto __pyx_L5_argtuple_error;
5203       }
5204       kw_args = PyDict_Size(__pyx_kwds);
5205       switch (pos_args) {
5206         case  0:
5207         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
5208         else goto __pyx_L5_argtuple_error;
5209         CYTHON_FALLTHROUGH;
5210         case  1:
5211         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fhd)) != 0)) kw_args--;
5212         else {
5213           __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 1); __PYX_ERR(0, 201, __pyx_L3_error)
5214         }
5215         CYTHON_FALLTHROUGH;
5216         case  2:
5217         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
5218         else {
5219           __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 2); __PYX_ERR(0, 201, __pyx_L3_error)
5220         }
5221         CYTHON_FALLTHROUGH;
5222         case  3:
5223         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_description)) != 0)) kw_args--;
5224         else {
5225           __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 3); __PYX_ERR(0, 201, __pyx_L3_error)
5226         }
5227         CYTHON_FALLTHROUGH;
5228         case  4:
5229         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colname)) != 0)) kw_args--;
5230         else {
5231           __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, 4); __PYX_ERR(0, 201, __pyx_L3_error)
5232         }
5233       }
5234       if (unlikely(kw_args > 0)) {
5235         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bedGraph") < 0)) __PYX_ERR(0, 201, __pyx_L3_error)
5236       }
5237     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5238       goto __pyx_L5_argtuple_error;
5239     } else {
5240       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5241       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5242       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5243       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5244       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5245     }
5246     __pyx_v_self = values[0];
5247     __pyx_v_fhd = values[1];
5248     __pyx_v_name = ((PyObject*)values[2]);
5249     __pyx_v_description = ((PyObject*)values[3]);
5250     __pyx_v_colname = ((PyObject*)values[4]);
5251   }
5252   goto __pyx_L4_argument_unpacking_done;
5253   __pyx_L5_argtuple_error:;
5254   __Pyx_RaiseArgtupleInvalid("write_bedGraph", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 201, __pyx_L3_error)
5255   __pyx_L3_error:;
5256   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
5257   __Pyx_RefNannyFinishContext();
5258   return NULL;
5259   __pyx_L4_argument_unpacking_done:;
5260   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 201, __pyx_L1_error)
5261   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_description), (&PyUnicode_Type), 1, "description", 1))) __PYX_ERR(0, 201, __pyx_L1_error)
5262   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colname), (&PyUnicode_Type), 1, "colname", 1))) __PYX_ERR(0, 201, __pyx_L1_error)
5263   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_12write_bedGraph(__pyx_self, __pyx_v_self, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_v_colname);
5264 
5265   /* function exit code */
5266   goto __pyx_L0;
5267   __pyx_L1_error:;
5268   __pyx_r = NULL;
5269   __pyx_L0:;
5270   __Pyx_RefNannyFinishContext();
5271   return __pyx_r;
5272 }
5273 
__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_12write_bedGraph(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_fhd,CYTHON_UNUSED PyObject * __pyx_v_name,CYTHON_UNUSED PyObject * __pyx_v_description,PyObject * __pyx_v_colname)5274 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_12write_bedGraph(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fhd, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_description, PyObject *__pyx_v_colname) {
5275   PyObject *__pyx_v_chrom = 0;
5276   PyObject *__pyx_v_chrs = 0;
5277   __pyx_t_5numpy_int32_t __pyx_v_pre;
5278   __pyx_t_5numpy_int32_t __pyx_v_i;
5279   __pyx_t_5numpy_int32_t __pyx_v_l;
5280   PyArrayObject *__pyx_v_pos = 0;
5281   PyArrayObject *__pyx_v_value = 0;
5282   PyObject *__pyx_v_write = NULL;
5283   PyObject *__pyx_v_d = NULL;
5284   __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
5285   __Pyx_Buffer __pyx_pybuffer_pos;
5286   __Pyx_LocalBuf_ND __pyx_pybuffernd_value;
5287   __Pyx_Buffer __pyx_pybuffer_value;
5288   PyObject *__pyx_r = NULL;
5289   __Pyx_TraceDeclarations
5290   __Pyx_RefNannyDeclarations
5291   PyObject *__pyx_t_1 = NULL;
5292   int __pyx_t_2;
5293   int __pyx_t_3;
5294   int __pyx_t_4;
5295   PyObject *__pyx_t_5 = NULL;
5296   PyObject *__pyx_t_6 = NULL;
5297   PyObject *__pyx_t_7 = NULL;
5298   Py_ssize_t __pyx_t_8;
5299   Py_ssize_t __pyx_t_9;
5300   int __pyx_t_10;
5301   int __pyx_t_11;
5302   __pyx_t_5numpy_int32_t __pyx_t_12;
5303   PyArrayObject *__pyx_t_13 = NULL;
5304   PyObject *__pyx_t_14 = NULL;
5305   PyObject *__pyx_t_15 = NULL;
5306   PyObject *__pyx_t_16 = NULL;
5307   PyArrayObject *__pyx_t_17 = NULL;
5308   __pyx_t_5numpy_int32_t __pyx_t_18;
5309   __pyx_t_5numpy_int32_t __pyx_t_19;
5310   Py_ssize_t __pyx_t_20;
5311   Py_UCS4 __pyx_t_21;
5312   PyObject *__pyx_t_22 = NULL;
5313   PyObject *__pyx_t_23 = NULL;
5314   Py_ssize_t __pyx_t_24;
5315   Py_ssize_t __pyx_t_25;
5316   Py_ssize_t __pyx_t_26;
5317   __Pyx_TraceFrameInit(__pyx_codeobj__10)
5318   __Pyx_RefNannySetupContext("write_bedGraph", 0);
5319   __Pyx_TraceCall("write_bedGraph", __pyx_f[0], 201, 0, __PYX_ERR(0, 201, __pyx_L1_error));
5320   __pyx_pybuffer_pos.pybuffer.buf = NULL;
5321   __pyx_pybuffer_pos.refcount = 0;
5322   __pyx_pybuffernd_pos.data = NULL;
5323   __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
5324   __pyx_pybuffer_value.pybuffer.buf = NULL;
5325   __pyx_pybuffer_value.refcount = 0;
5326   __pyx_pybuffernd_value.data = NULL;
5327   __pyx_pybuffernd_value.rcbuffer = &__pyx_pybuffer_value;
5328 
5329   /* "MACS2/IO/ScoreTrack.pyx":217
5330  *             np.ndarray[np.float32_t, ndim=1] value
5331  *
5332  *         if colname not in ['V1','V2']:             # <<<<<<<<<<<<<<
5333  *             raise Exception("%s not supported!" % colname)
5334  *         chrs = self.get_chr_names()
5335  */
5336   __Pyx_INCREF(__pyx_v_colname);
5337   __pyx_t_1 = __pyx_v_colname;
5338   __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_V1, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 217, __pyx_L1_error)
5339   __pyx_t_4 = (__pyx_t_3 != 0);
5340   if (__pyx_t_4) {
5341   } else {
5342     __pyx_t_2 = __pyx_t_4;
5343     goto __pyx_L4_bool_binop_done;
5344   }
5345   __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_V2, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 217, __pyx_L1_error)
5346   __pyx_t_3 = (__pyx_t_4 != 0);
5347   __pyx_t_2 = __pyx_t_3;
5348   __pyx_L4_bool_binop_done:;
5349   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5350   __pyx_t_3 = (__pyx_t_2 != 0);
5351   if (unlikely(__pyx_t_3)) {
5352 
5353     /* "MACS2/IO/ScoreTrack.pyx":218
5354  *
5355  *         if colname not in ['V1','V2']:
5356  *             raise Exception("%s not supported!" % colname)             # <<<<<<<<<<<<<<
5357  *         chrs = self.get_chr_names()
5358  *         write = fhd.write
5359  */
5360     __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s_not_supported, __pyx_v_colname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error)
5361     __Pyx_GOTREF(__pyx_t_5);
5362     __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error)
5363     __Pyx_GOTREF(__pyx_t_6);
5364     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5365     __Pyx_Raise(__pyx_t_6, 0, 0, 0);
5366     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5367     __PYX_ERR(0, 218, __pyx_L1_error)
5368 
5369     /* "MACS2/IO/ScoreTrack.pyx":217
5370  *             np.ndarray[np.float32_t, ndim=1] value
5371  *
5372  *         if colname not in ['V1','V2']:             # <<<<<<<<<<<<<<
5373  *             raise Exception("%s not supported!" % colname)
5374  *         chrs = self.get_chr_names()
5375  */
5376   }
5377 
5378   /* "MACS2/IO/ScoreTrack.pyx":219
5379  *         if colname not in ['V1','V2']:
5380  *             raise Exception("%s not supported!" % colname)
5381  *         chrs = self.get_chr_names()             # <<<<<<<<<<<<<<
5382  *         write = fhd.write
5383  *         for chrom in chrs:
5384  */
5385   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_chr_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error)
5386   __Pyx_GOTREF(__pyx_t_5);
5387   __pyx_t_7 = NULL;
5388   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
5389     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
5390     if (likely(__pyx_t_7)) {
5391       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5392       __Pyx_INCREF(__pyx_t_7);
5393       __Pyx_INCREF(function);
5394       __Pyx_DECREF_SET(__pyx_t_5, function);
5395     }
5396   }
5397   __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
5398   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5399   if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error)
5400   __Pyx_GOTREF(__pyx_t_6);
5401   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5402   if (!(likely(PySet_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 219, __pyx_L1_error)
5403   __pyx_v_chrs = ((PyObject*)__pyx_t_6);
5404   __pyx_t_6 = 0;
5405 
5406   /* "MACS2/IO/ScoreTrack.pyx":220
5407  *             raise Exception("%s not supported!" % colname)
5408  *         chrs = self.get_chr_names()
5409  *         write = fhd.write             # <<<<<<<<<<<<<<
5410  *         for chrom in chrs:
5411  *             d = self.data[chrom]
5412  */
5413   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_fhd, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 220, __pyx_L1_error)
5414   __Pyx_GOTREF(__pyx_t_6);
5415   __pyx_v_write = __pyx_t_6;
5416   __pyx_t_6 = 0;
5417 
5418   /* "MACS2/IO/ScoreTrack.pyx":221
5419  *         chrs = self.get_chr_names()
5420  *         write = fhd.write
5421  *         for chrom in chrs:             # <<<<<<<<<<<<<<
5422  *             d = self.data[chrom]
5423  *             l = self.pointer[chrom]
5424  */
5425   __pyx_t_8 = 0;
5426   __pyx_t_5 = __Pyx_set_iterator(__pyx_v_chrs, 1, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error)
5427   __Pyx_GOTREF(__pyx_t_5);
5428   __Pyx_XDECREF(__pyx_t_6);
5429   __pyx_t_6 = __pyx_t_5;
5430   __pyx_t_5 = 0;
5431   while (1) {
5432     __pyx_t_11 = __Pyx_set_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_8, &__pyx_t_5, __pyx_t_10);
5433     if (unlikely(__pyx_t_11 == 0)) break;
5434     if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 221, __pyx_L1_error)
5435     __Pyx_GOTREF(__pyx_t_5);
5436     if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 221, __pyx_L1_error)
5437     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_5));
5438     __pyx_t_5 = 0;
5439 
5440     /* "MACS2/IO/ScoreTrack.pyx":222
5441  *         write = fhd.write
5442  *         for chrom in chrs:
5443  *             d = self.data[chrom]             # <<<<<<<<<<<<<<
5444  *             l = self.pointer[chrom]
5445  *             pos   = d['pos']
5446  */
5447     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error)
5448     __Pyx_GOTREF(__pyx_t_5);
5449     __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 222, __pyx_L1_error)
5450     __Pyx_GOTREF(__pyx_t_7);
5451     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5452     __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_7);
5453     __pyx_t_7 = 0;
5454 
5455     /* "MACS2/IO/ScoreTrack.pyx":223
5456  *         for chrom in chrs:
5457  *             d = self.data[chrom]
5458  *             l = self.pointer[chrom]             # <<<<<<<<<<<<<<
5459  *             pos   = d['pos']
5460  *             value = d[colname]
5461  */
5462     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pointer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 223, __pyx_L1_error)
5463     __Pyx_GOTREF(__pyx_t_7);
5464     __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error)
5465     __Pyx_GOTREF(__pyx_t_5);
5466     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5467     __pyx_t_12 = __Pyx_PyInt_As_npy_int32(__pyx_t_5); if (unlikely((__pyx_t_12 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error)
5468     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5469     __pyx_v_l = __pyx_t_12;
5470 
5471     /* "MACS2/IO/ScoreTrack.pyx":224
5472  *             d = self.data[chrom]
5473  *             l = self.pointer[chrom]
5474  *             pos   = d['pos']             # <<<<<<<<<<<<<<
5475  *             value = d[colname]
5476  *             pre = 0
5477  */
5478     __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_d, __pyx_n_u_pos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error)
5479     __Pyx_GOTREF(__pyx_t_5);
5480     if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 224, __pyx_L1_error)
5481     __pyx_t_13 = ((PyArrayObject *)__pyx_t_5);
5482     {
5483       __Pyx_BufFmt_StackElem __pyx_stack[1];
5484       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
5485       __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
5486       if (unlikely(__pyx_t_11 < 0)) {
5487         PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
5488         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
5489           Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16);
5490           __Pyx_RaiseBufferFallbackError();
5491         } else {
5492           PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
5493         }
5494         __pyx_t_14 = __pyx_t_15 = __pyx_t_16 = 0;
5495       }
5496       __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
5497       if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 224, __pyx_L1_error)
5498     }
5499     __pyx_t_13 = 0;
5500     __Pyx_XDECREF_SET(__pyx_v_pos, ((PyArrayObject *)__pyx_t_5));
5501     __pyx_t_5 = 0;
5502 
5503     /* "MACS2/IO/ScoreTrack.pyx":225
5504  *             l = self.pointer[chrom]
5505  *             pos   = d['pos']
5506  *             value = d[colname]             # <<<<<<<<<<<<<<
5507  *             pre = 0
5508  *             for i in range( l ):
5509  */
5510     __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_d, __pyx_v_colname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error)
5511     __Pyx_GOTREF(__pyx_t_5);
5512     if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 225, __pyx_L1_error)
5513     __pyx_t_17 = ((PyArrayObject *)__pyx_t_5);
5514     {
5515       __Pyx_BufFmt_StackElem __pyx_stack[1];
5516       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value.rcbuffer->pybuffer);
5517       __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
5518       if (unlikely(__pyx_t_11 < 0)) {
5519         PyErr_Fetch(&__pyx_t_16, &__pyx_t_15, &__pyx_t_14);
5520         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value.rcbuffer->pybuffer, (PyObject*)__pyx_v_value, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
5521           Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14);
5522           __Pyx_RaiseBufferFallbackError();
5523         } else {
5524           PyErr_Restore(__pyx_t_16, __pyx_t_15, __pyx_t_14);
5525         }
5526         __pyx_t_16 = __pyx_t_15 = __pyx_t_14 = 0;
5527       }
5528       __pyx_pybuffernd_value.diminfo[0].strides = __pyx_pybuffernd_value.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value.diminfo[0].shape = __pyx_pybuffernd_value.rcbuffer->pybuffer.shape[0];
5529       if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 225, __pyx_L1_error)
5530     }
5531     __pyx_t_17 = 0;
5532     __Pyx_XDECREF_SET(__pyx_v_value, ((PyArrayObject *)__pyx_t_5));
5533     __pyx_t_5 = 0;
5534 
5535     /* "MACS2/IO/ScoreTrack.pyx":226
5536  *             pos   = d['pos']
5537  *             value = d[colname]
5538  *             pre = 0             # <<<<<<<<<<<<<<
5539  *             for i in range( l ):
5540  *                 write("%s\t%d\t%d\t%.5f\n" % (chrom.decode(),pre,pos[i],value[i]))
5541  */
5542     __pyx_v_pre = 0;
5543 
5544     /* "MACS2/IO/ScoreTrack.pyx":227
5545  *             value = d[colname]
5546  *             pre = 0
5547  *             for i in range( l ):             # <<<<<<<<<<<<<<
5548  *                 write("%s\t%d\t%d\t%.5f\n" % (chrom.decode(),pre,pos[i],value[i]))
5549  *                 pre = pos[i]
5550  */
5551     __pyx_t_12 = __pyx_v_l;
5552     __pyx_t_18 = __pyx_t_12;
5553     for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
5554       __pyx_v_i = __pyx_t_19;
5555 
5556       /* "MACS2/IO/ScoreTrack.pyx":228
5557  *             pre = 0
5558  *             for i in range( l ):
5559  *                 write("%s\t%d\t%d\t%.5f\n" % (chrom.decode(),pre,pos[i],value[i]))             # <<<<<<<<<<<<<<
5560  *                 pre = pos[i]
5561  *
5562  */
5563       __pyx_t_7 = PyTuple_New(8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error)
5564       __Pyx_GOTREF(__pyx_t_7);
5565       __pyx_t_20 = 0;
5566       __pyx_t_21 = 127;
5567       if (unlikely(__pyx_v_chrom == Py_None)) {
5568         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
5569         __PYX_ERR(0, 228, __pyx_L1_error)
5570       }
5571       __pyx_t_22 = __Pyx_decode_bytes(__pyx_v_chrom, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 228, __pyx_L1_error)
5572       __Pyx_GOTREF(__pyx_t_22);
5573       __pyx_t_21 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_22) > __pyx_t_21) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_22) : __pyx_t_21;
5574       __pyx_t_20 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_22);
5575       __Pyx_GIVEREF(__pyx_t_22);
5576       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_22);
5577       __pyx_t_22 = 0;
5578       __Pyx_INCREF(__pyx_kp_u__11);
5579       __pyx_t_20 += 1;
5580       __Pyx_GIVEREF(__pyx_kp_u__11);
5581       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_kp_u__11);
5582       __pyx_t_22 = __Pyx_PyInt_From_npy_int32(__pyx_v_pre); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 228, __pyx_L1_error)
5583       __Pyx_GOTREF(__pyx_t_22);
5584       __pyx_t_23 = __Pyx_PyObject_Format(__pyx_t_22, __pyx_n_u_d); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 228, __pyx_L1_error)
5585       __Pyx_GOTREF(__pyx_t_23);
5586       __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
5587       __pyx_t_21 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_23) > __pyx_t_21) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_23) : __pyx_t_21;
5588       __pyx_t_20 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_23);
5589       __Pyx_GIVEREF(__pyx_t_23);
5590       PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_23);
5591       __pyx_t_23 = 0;
5592       __Pyx_INCREF(__pyx_kp_u__11);
5593       __pyx_t_20 += 1;
5594       __Pyx_GIVEREF(__pyx_kp_u__11);
5595       PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_kp_u__11);
5596       __pyx_t_24 = __pyx_v_i;
5597       __pyx_t_11 = -1;
5598       if (__pyx_t_24 < 0) {
5599         __pyx_t_24 += __pyx_pybuffernd_pos.diminfo[0].shape;
5600         if (unlikely(__pyx_t_24 < 0)) __pyx_t_11 = 0;
5601       } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_11 = 0;
5602       if (unlikely(__pyx_t_11 != -1)) {
5603         __Pyx_RaiseBufferIndexError(__pyx_t_11);
5604         __PYX_ERR(0, 228, __pyx_L1_error)
5605       }
5606       __pyx_t_23 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_pos.diminfo[0].strides))); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 228, __pyx_L1_error)
5607       __Pyx_GOTREF(__pyx_t_23);
5608       __pyx_t_22 = __Pyx_PyObject_Format(__pyx_t_23, __pyx_n_u_d); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 228, __pyx_L1_error)
5609       __Pyx_GOTREF(__pyx_t_22);
5610       __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
5611       __pyx_t_21 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_22) > __pyx_t_21) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_22) : __pyx_t_21;
5612       __pyx_t_20 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_22);
5613       __Pyx_GIVEREF(__pyx_t_22);
5614       PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_22);
5615       __pyx_t_22 = 0;
5616       __Pyx_INCREF(__pyx_kp_u__11);
5617       __pyx_t_20 += 1;
5618       __Pyx_GIVEREF(__pyx_kp_u__11);
5619       PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_kp_u__11);
5620       __pyx_t_25 = __pyx_v_i;
5621       __pyx_t_11 = -1;
5622       if (__pyx_t_25 < 0) {
5623         __pyx_t_25 += __pyx_pybuffernd_value.diminfo[0].shape;
5624         if (unlikely(__pyx_t_25 < 0)) __pyx_t_11 = 0;
5625       } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_value.diminfo[0].shape)) __pyx_t_11 = 0;
5626       if (unlikely(__pyx_t_11 != -1)) {
5627         __Pyx_RaiseBufferIndexError(__pyx_t_11);
5628         __PYX_ERR(0, 228, __pyx_L1_error)
5629       }
5630       __pyx_t_22 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_value.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_value.diminfo[0].strides))); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 228, __pyx_L1_error)
5631       __Pyx_GOTREF(__pyx_t_22);
5632       __pyx_t_23 = __Pyx_PyObject_Format(__pyx_t_22, __pyx_kp_u_5f); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 228, __pyx_L1_error)
5633       __Pyx_GOTREF(__pyx_t_23);
5634       __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
5635       __pyx_t_21 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_23) > __pyx_t_21) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_23) : __pyx_t_21;
5636       __pyx_t_20 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_23);
5637       __Pyx_GIVEREF(__pyx_t_23);
5638       PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_23);
5639       __pyx_t_23 = 0;
5640       __Pyx_INCREF(__pyx_kp_u__12);
5641       __pyx_t_20 += 1;
5642       __Pyx_GIVEREF(__pyx_kp_u__12);
5643       PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_kp_u__12);
5644       __pyx_t_23 = __Pyx_PyUnicode_Join(__pyx_t_7, 8, __pyx_t_20, __pyx_t_21); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 228, __pyx_L1_error)
5645       __Pyx_GOTREF(__pyx_t_23);
5646       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5647       __Pyx_INCREF(__pyx_v_write);
5648       __pyx_t_7 = __pyx_v_write; __pyx_t_22 = NULL;
5649       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
5650         __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_7);
5651         if (likely(__pyx_t_22)) {
5652           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
5653           __Pyx_INCREF(__pyx_t_22);
5654           __Pyx_INCREF(function);
5655           __Pyx_DECREF_SET(__pyx_t_7, function);
5656         }
5657       }
5658       __pyx_t_5 = (__pyx_t_22) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_22, __pyx_t_23) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_23);
5659       __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
5660       __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
5661       if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
5662       __Pyx_GOTREF(__pyx_t_5);
5663       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5664       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5665 
5666       /* "MACS2/IO/ScoreTrack.pyx":229
5667  *             for i in range( l ):
5668  *                 write("%s\t%d\t%d\t%.5f\n" % (chrom.decode(),pre,pos[i],value[i]))
5669  *                 pre = pos[i]             # <<<<<<<<<<<<<<
5670  *
5671  *         return True
5672  */
5673       __pyx_t_26 = __pyx_v_i;
5674       __pyx_t_11 = -1;
5675       if (__pyx_t_26 < 0) {
5676         __pyx_t_26 += __pyx_pybuffernd_pos.diminfo[0].shape;
5677         if (unlikely(__pyx_t_26 < 0)) __pyx_t_11 = 0;
5678       } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_11 = 0;
5679       if (unlikely(__pyx_t_11 != -1)) {
5680         __Pyx_RaiseBufferIndexError(__pyx_t_11);
5681         __PYX_ERR(0, 229, __pyx_L1_error)
5682       }
5683       __pyx_v_pre = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_pos.diminfo[0].strides));
5684     }
5685   }
5686   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5687 
5688   /* "MACS2/IO/ScoreTrack.pyx":231
5689  *                 pre = pos[i]
5690  *
5691  *         return True             # <<<<<<<<<<<<<<
5692  *
5693  *     def total ( self ):
5694  */
5695   __Pyx_XDECREF(__pyx_r);
5696   __Pyx_INCREF(Py_True);
5697   __pyx_r = Py_True;
5698   goto __pyx_L0;
5699 
5700   /* "MACS2/IO/ScoreTrack.pyx":201
5701  *         return l
5702  *
5703  *     def write_bedGraph (self, fhd, str name, str description, str colname):             # <<<<<<<<<<<<<<
5704  *         """Write all data to fhd in Wiggle Format.
5705  *
5706  */
5707 
5708   /* function exit code */
5709   __pyx_L1_error:;
5710   __Pyx_XDECREF(__pyx_t_1);
5711   __Pyx_XDECREF(__pyx_t_5);
5712   __Pyx_XDECREF(__pyx_t_6);
5713   __Pyx_XDECREF(__pyx_t_7);
5714   __Pyx_XDECREF(__pyx_t_22);
5715   __Pyx_XDECREF(__pyx_t_23);
5716   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5717     __Pyx_PyThreadState_declare
5718     __Pyx_PyThreadState_assign
5719     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5720     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
5721     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value.rcbuffer->pybuffer);
5722   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5723   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
5724   __pyx_r = NULL;
5725   goto __pyx_L2;
5726   __pyx_L0:;
5727   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
5728   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value.rcbuffer->pybuffer);
5729   __pyx_L2:;
5730   __Pyx_XDECREF(__pyx_v_chrom);
5731   __Pyx_XDECREF(__pyx_v_chrs);
5732   __Pyx_XDECREF((PyObject *)__pyx_v_pos);
5733   __Pyx_XDECREF((PyObject *)__pyx_v_value);
5734   __Pyx_XDECREF(__pyx_v_write);
5735   __Pyx_XDECREF(__pyx_v_d);
5736   __Pyx_XGIVEREF(__pyx_r);
5737   __Pyx_TraceReturn(__pyx_r, 0);
5738   __Pyx_RefNannyFinishContext();
5739   return __pyx_r;
5740 }
5741 
5742 /* "MACS2/IO/ScoreTrack.pyx":233
5743  *         return True
5744  *
5745  *     def total ( self ):             # <<<<<<<<<<<<<<
5746  *         """Return the number of regions in this object.
5747  *
5748  */
5749 
5750 /* Python wrapper */
5751 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_15total(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
5752 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_14total[] = "Return the number of regions in this object.\n\n        ";
5753 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_15total = {"total", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_15total, METH_O, __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_14total};
__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_15total(PyObject * __pyx_self,PyObject * __pyx_v_self)5754 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_15total(PyObject *__pyx_self, PyObject *__pyx_v_self) {
5755   PyObject *__pyx_r = 0;
5756   __Pyx_RefNannyDeclarations
5757   __Pyx_RefNannySetupContext("total (wrapper)", 0);
5758   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_14total(__pyx_self, ((PyObject *)__pyx_v_self));
5759 
5760   /* function exit code */
5761   __Pyx_RefNannyFinishContext();
5762   return __pyx_r;
5763 }
5764 
__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_14total(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self)5765 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_14total(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
5766   __pyx_t_5numpy_int64_t __pyx_v_t;
5767   PyObject *__pyx_v_chrom = 0;
5768   PyObject *__pyx_r = NULL;
5769   __Pyx_TraceDeclarations
5770   __Pyx_RefNannyDeclarations
5771   PyObject *__pyx_t_1 = NULL;
5772   Py_ssize_t __pyx_t_2;
5773   Py_ssize_t __pyx_t_3;
5774   int __pyx_t_4;
5775   PyObject *__pyx_t_5 = NULL;
5776   PyObject *__pyx_t_6 = NULL;
5777   int __pyx_t_7;
5778   PyObject *__pyx_t_8 = NULL;
5779   __pyx_t_5numpy_int64_t __pyx_t_9;
5780   __Pyx_TraceFrameInit(__pyx_codeobj__13)
5781   __Pyx_RefNannySetupContext("total", 0);
5782   __Pyx_TraceCall("total", __pyx_f[0], 233, 0, __PYX_ERR(0, 233, __pyx_L1_error));
5783 
5784   /* "MACS2/IO/ScoreTrack.pyx":241
5785  *             bytes chrom
5786  *
5787  *         t = 0             # <<<<<<<<<<<<<<
5788  *         for chrom in self.data.keys():
5789  *             t += self.pointer[chrom]
5790  */
5791   __pyx_v_t = 0;
5792 
5793   /* "MACS2/IO/ScoreTrack.pyx":242
5794  *
5795  *         t = 0
5796  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
5797  *             t += self.pointer[chrom]
5798  *         return t
5799  */
5800   __pyx_t_2 = 0;
5801   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error)
5802   __Pyx_GOTREF(__pyx_t_5);
5803   if (unlikely(__pyx_t_5 == Py_None)) {
5804     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
5805     __PYX_ERR(0, 242, __pyx_L1_error)
5806   }
5807   __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_keys, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error)
5808   __Pyx_GOTREF(__pyx_t_6);
5809   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5810   __Pyx_XDECREF(__pyx_t_1);
5811   __pyx_t_1 = __pyx_t_6;
5812   __pyx_t_6 = 0;
5813   while (1) {
5814     __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, NULL, NULL, __pyx_t_4);
5815     if (unlikely(__pyx_t_7 == 0)) break;
5816     if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 242, __pyx_L1_error)
5817     __Pyx_GOTREF(__pyx_t_6);
5818     if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 242, __pyx_L1_error)
5819     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_6));
5820     __pyx_t_6 = 0;
5821 
5822     /* "MACS2/IO/ScoreTrack.pyx":243
5823  *         t = 0
5824  *         for chrom in self.data.keys():
5825  *             t += self.pointer[chrom]             # <<<<<<<<<<<<<<
5826  *         return t
5827  *
5828  */
5829     __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
5830     __Pyx_GOTREF(__pyx_t_6);
5831     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pointer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error)
5832     __Pyx_GOTREF(__pyx_t_5);
5833     __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error)
5834     __Pyx_GOTREF(__pyx_t_8);
5835     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5836     __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error)
5837     __Pyx_GOTREF(__pyx_t_5);
5838     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5839     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5840     __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 243, __pyx_L1_error)
5841     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5842     __pyx_v_t = __pyx_t_9;
5843   }
5844   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5845 
5846   /* "MACS2/IO/ScoreTrack.pyx":244
5847  *         for chrom in self.data.keys():
5848  *             t += self.pointer[chrom]
5849  *         return t             # <<<<<<<<<<<<<<
5850  *
5851  *     def extract_value ( self, bdgTrack2 ):
5852  */
5853   __Pyx_XDECREF(__pyx_r);
5854   __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
5855   __Pyx_GOTREF(__pyx_t_1);
5856   __pyx_r = __pyx_t_1;
5857   __pyx_t_1 = 0;
5858   goto __pyx_L0;
5859 
5860   /* "MACS2/IO/ScoreTrack.pyx":233
5861  *         return True
5862  *
5863  *     def total ( self ):             # <<<<<<<<<<<<<<
5864  *         """Return the number of regions in this object.
5865  *
5866  */
5867 
5868   /* function exit code */
5869   __pyx_L1_error:;
5870   __Pyx_XDECREF(__pyx_t_1);
5871   __Pyx_XDECREF(__pyx_t_5);
5872   __Pyx_XDECREF(__pyx_t_6);
5873   __Pyx_XDECREF(__pyx_t_8);
5874   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.total", __pyx_clineno, __pyx_lineno, __pyx_filename);
5875   __pyx_r = NULL;
5876   __pyx_L0:;
5877   __Pyx_XDECREF(__pyx_v_chrom);
5878   __Pyx_XGIVEREF(__pyx_r);
5879   __Pyx_TraceReturn(__pyx_r, 0);
5880   __Pyx_RefNannyFinishContext();
5881   return __pyx_r;
5882 }
5883 
5884 /* "MACS2/IO/ScoreTrack.pyx":246
5885  *         return t
5886  *
5887  *     def extract_value ( self, bdgTrack2 ):             # <<<<<<<<<<<<<<
5888  *         """It's like overlie function. THe overlapped regions between
5889  *         bdgTrack2 and self, will be recorded. The values from self in
5890  */
5891 
5892 /* Python wrapper */
5893 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_17extract_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5894 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_16extract_value[] = "It's like overlie function. THe overlapped regions between\n        bdgTrack2 and self, will be recorded. The values from self in\n        the overlapped regions will be outputed in a single array for\n        follow statistics.\n\n        ";
5895 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_17extract_value = {"extract_value", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_17extract_value, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_16extract_value};
__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_17extract_value(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5896 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_17extract_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5897   PyObject *__pyx_v_self = 0;
5898   PyObject *__pyx_v_bdgTrack2 = 0;
5899   PyObject *__pyx_r = 0;
5900   __Pyx_RefNannyDeclarations
5901   __Pyx_RefNannySetupContext("extract_value (wrapper)", 0);
5902   {
5903     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_bdgTrack2,0};
5904     PyObject* values[2] = {0,0};
5905     if (unlikely(__pyx_kwds)) {
5906       Py_ssize_t kw_args;
5907       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5908       switch (pos_args) {
5909         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5910         CYTHON_FALLTHROUGH;
5911         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5912         CYTHON_FALLTHROUGH;
5913         case  0: break;
5914         default: goto __pyx_L5_argtuple_error;
5915       }
5916       kw_args = PyDict_Size(__pyx_kwds);
5917       switch (pos_args) {
5918         case  0:
5919         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
5920         else goto __pyx_L5_argtuple_error;
5921         CYTHON_FALLTHROUGH;
5922         case  1:
5923         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bdgTrack2)) != 0)) kw_args--;
5924         else {
5925           __Pyx_RaiseArgtupleInvalid("extract_value", 1, 2, 2, 1); __PYX_ERR(0, 246, __pyx_L3_error)
5926         }
5927       }
5928       if (unlikely(kw_args > 0)) {
5929         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract_value") < 0)) __PYX_ERR(0, 246, __pyx_L3_error)
5930       }
5931     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5932       goto __pyx_L5_argtuple_error;
5933     } else {
5934       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5935       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5936     }
5937     __pyx_v_self = values[0];
5938     __pyx_v_bdgTrack2 = values[1];
5939   }
5940   goto __pyx_L4_argument_unpacking_done;
5941   __pyx_L5_argtuple_error:;
5942   __Pyx_RaiseArgtupleInvalid("extract_value", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 246, __pyx_L3_error)
5943   __pyx_L3_error:;
5944   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.extract_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
5945   __Pyx_RefNannyFinishContext();
5946   return NULL;
5947   __pyx_L4_argument_unpacking_done:;
5948   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_16extract_value(__pyx_self, __pyx_v_self, __pyx_v_bdgTrack2);
5949 
5950   /* function exit code */
5951   __Pyx_RefNannyFinishContext();
5952   return __pyx_r;
5953 }
5954 
__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_16extract_value(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_bdgTrack2)5955 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_16extract_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2) {
5956   PyObject *__pyx_v_chr1 = 0;
5957   PyObject *__pyx_v_chr2 = 0;
5958   PyObject *__pyx_v_common_chr = 0;
5959   PyObject *__pyx_v_chrom = 0;
5960   __pyx_t_5numpy_int32_t __pyx_v_pre_p;
5961   __pyx_t_5numpy_int32_t __pyx_v_p1;
5962   __pyx_t_5numpy_int32_t __pyx_v_p2;
5963   __pyx_t_5numpy_float64_t __pyx_v_v11;
5964   __pyx_t_5numpy_float64_t __pyx_v_v21;
5965   __pyx_t_5numpy_float64_t __pyx_v_v2;
5966   PyObject *__pyx_v_ret = NULL;
5967   PyObject *__pyx_v_radd = NULL;
5968   PyObject *__pyx_v_v1add = NULL;
5969   PyObject *__pyx_v_v2add = NULL;
5970   PyObject *__pyx_v_ladd = NULL;
5971   PyObject *__pyx_v_chrom_data = NULL;
5972   PyObject *__pyx_v_p1n = NULL;
5973   PyObject *__pyx_v_v11n = NULL;
5974   PyObject *__pyx_v_v21n = NULL;
5975   PyObject *__pyx_v_p2s = NULL;
5976   PyObject *__pyx_v_v2s = NULL;
5977   PyObject *__pyx_v_p2n = NULL;
5978   PyObject *__pyx_v_v2n = NULL;
5979   PyObject *__pyx_r = NULL;
5980   __Pyx_TraceDeclarations
5981   __Pyx_RefNannyDeclarations
5982   PyObject *__pyx_t_1 = NULL;
5983   PyObject *__pyx_t_2 = NULL;
5984   PyObject *__pyx_t_3 = NULL;
5985   PyObject *__pyx_t_4 = NULL;
5986   PyObject *__pyx_t_5 = NULL;
5987   PyObject *__pyx_t_6 = NULL;
5988   int __pyx_t_7;
5989   PyObject *__pyx_t_8 = NULL;
5990   PyObject *__pyx_t_9 = NULL;
5991   PyObject *__pyx_t_10 = NULL;
5992   Py_ssize_t __pyx_t_11;
5993   Py_ssize_t __pyx_t_12;
5994   int __pyx_t_13;
5995   PyObject *(*__pyx_t_14)(PyObject *);
5996   PyObject *__pyx_t_15 = NULL;
5997   PyObject *__pyx_t_16 = NULL;
5998   PyObject *__pyx_t_17 = NULL;
5999   __pyx_t_5numpy_int32_t __pyx_t_18;
6000   __pyx_t_5numpy_float64_t __pyx_t_19;
6001   int __pyx_t_20;
6002   __Pyx_TraceFrameInit(__pyx_codeobj__14)
6003   __Pyx_RefNannySetupContext("extract_value", 0);
6004   __Pyx_TraceCall("extract_value", __pyx_f[0], 246, 0, __PYX_ERR(0, 246, __pyx_L1_error));
6005 
6006   /* "MACS2/IO/ScoreTrack.pyx":261
6007  *         #assert isinstance(bdgTrack2,bedGraphTrackI), "bdgTrack2 is not a bedGraphTrackI object"
6008  *
6009  *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[]),array(BYTE4,[])] # region,V1,V1,length             # <<<<<<<<<<<<<<
6010  *         radd = ret[0].append
6011  *         v1add = ret[1].append
6012  */
6013   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
6014   __Pyx_GOTREF(__pyx_t_1);
6015   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
6016   __Pyx_GOTREF(__pyx_t_3);
6017   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FBYTE4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
6018   __Pyx_GOTREF(__pyx_t_4);
6019   __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
6020   __Pyx_GOTREF(__pyx_t_5);
6021   __pyx_t_6 = NULL;
6022   __pyx_t_7 = 0;
6023   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6024     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6025     if (likely(__pyx_t_6)) {
6026       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6027       __Pyx_INCREF(__pyx_t_6);
6028       __Pyx_INCREF(function);
6029       __Pyx_DECREF_SET(__pyx_t_3, function);
6030       __pyx_t_7 = 1;
6031     }
6032   }
6033   #if CYTHON_FAST_PYCALL
6034   if (PyFunction_Check(__pyx_t_3)) {
6035     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
6036     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
6037     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6038     __Pyx_GOTREF(__pyx_t_2);
6039     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6040     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6041   } else
6042   #endif
6043   #if CYTHON_FAST_PYCCALL
6044   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
6045     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
6046     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
6047     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6048     __Pyx_GOTREF(__pyx_t_2);
6049     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6050     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6051   } else
6052   #endif
6053   {
6054     __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
6055     __Pyx_GOTREF(__pyx_t_8);
6056     if (__pyx_t_6) {
6057       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
6058     }
6059     __Pyx_GIVEREF(__pyx_t_4);
6060     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
6061     __Pyx_GIVEREF(__pyx_t_5);
6062     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
6063     __pyx_t_4 = 0;
6064     __pyx_t_5 = 0;
6065     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
6066     __Pyx_GOTREF(__pyx_t_2);
6067     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6068   }
6069   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6070   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
6071   __Pyx_GOTREF(__pyx_t_8);
6072   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FBYTE4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
6073   __Pyx_GOTREF(__pyx_t_5);
6074   __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
6075   __Pyx_GOTREF(__pyx_t_4);
6076   __pyx_t_6 = NULL;
6077   __pyx_t_7 = 0;
6078   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
6079     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
6080     if (likely(__pyx_t_6)) {
6081       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
6082       __Pyx_INCREF(__pyx_t_6);
6083       __Pyx_INCREF(function);
6084       __Pyx_DECREF_SET(__pyx_t_8, function);
6085       __pyx_t_7 = 1;
6086     }
6087   }
6088   #if CYTHON_FAST_PYCALL
6089   if (PyFunction_Check(__pyx_t_8)) {
6090     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_4};
6091     __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
6092     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6093     __Pyx_GOTREF(__pyx_t_3);
6094     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6095     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6096   } else
6097   #endif
6098   #if CYTHON_FAST_PYCCALL
6099   if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
6100     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_4};
6101     __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
6102     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6103     __Pyx_GOTREF(__pyx_t_3);
6104     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6105     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6106   } else
6107   #endif
6108   {
6109     __pyx_t_9 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
6110     __Pyx_GOTREF(__pyx_t_9);
6111     if (__pyx_t_6) {
6112       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
6113     }
6114     __Pyx_GIVEREF(__pyx_t_5);
6115     PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_t_5);
6116     __Pyx_GIVEREF(__pyx_t_4);
6117     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_t_4);
6118     __pyx_t_5 = 0;
6119     __pyx_t_4 = 0;
6120     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
6121     __Pyx_GOTREF(__pyx_t_3);
6122     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6123   }
6124   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6125   __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
6126   __Pyx_GOTREF(__pyx_t_9);
6127   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BYTE4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
6128   __Pyx_GOTREF(__pyx_t_4);
6129   __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
6130   __Pyx_GOTREF(__pyx_t_5);
6131   __pyx_t_6 = NULL;
6132   __pyx_t_7 = 0;
6133   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
6134     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
6135     if (likely(__pyx_t_6)) {
6136       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
6137       __Pyx_INCREF(__pyx_t_6);
6138       __Pyx_INCREF(function);
6139       __Pyx_DECREF_SET(__pyx_t_9, function);
6140       __pyx_t_7 = 1;
6141     }
6142   }
6143   #if CYTHON_FAST_PYCALL
6144   if (PyFunction_Check(__pyx_t_9)) {
6145     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
6146     __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
6147     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6148     __Pyx_GOTREF(__pyx_t_8);
6149     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6150     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6151   } else
6152   #endif
6153   #if CYTHON_FAST_PYCCALL
6154   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
6155     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
6156     __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
6157     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6158     __Pyx_GOTREF(__pyx_t_8);
6159     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6160     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6161   } else
6162   #endif
6163   {
6164     __pyx_t_10 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 261, __pyx_L1_error)
6165     __Pyx_GOTREF(__pyx_t_10);
6166     if (__pyx_t_6) {
6167       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
6168     }
6169     __Pyx_GIVEREF(__pyx_t_4);
6170     PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_t_4);
6171     __Pyx_GIVEREF(__pyx_t_5);
6172     PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_t_5);
6173     __pyx_t_4 = 0;
6174     __pyx_t_5 = 0;
6175     __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
6176     __Pyx_GOTREF(__pyx_t_8);
6177     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6178   }
6179   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6180   __pyx_t_9 = PyList_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
6181   __Pyx_GOTREF(__pyx_t_9);
6182   __Pyx_GIVEREF(__pyx_t_1);
6183   PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
6184   __Pyx_GIVEREF(__pyx_t_2);
6185   PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
6186   __Pyx_GIVEREF(__pyx_t_3);
6187   PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
6188   __Pyx_GIVEREF(__pyx_t_8);
6189   PyList_SET_ITEM(__pyx_t_9, 3, __pyx_t_8);
6190   __pyx_t_1 = 0;
6191   __pyx_t_2 = 0;
6192   __pyx_t_3 = 0;
6193   __pyx_t_8 = 0;
6194   __pyx_v_ret = ((PyObject*)__pyx_t_9);
6195   __pyx_t_9 = 0;
6196 
6197   /* "MACS2/IO/ScoreTrack.pyx":262
6198  *
6199  *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[]),array(BYTE4,[])] # region,V1,V1,length
6200  *         radd = ret[0].append             # <<<<<<<<<<<<<<
6201  *         v1add = ret[1].append
6202  *         v2add = ret[2].append
6203  */
6204   __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 262, __pyx_L1_error)
6205   __Pyx_GOTREF(__pyx_t_9);
6206   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_append); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L1_error)
6207   __Pyx_GOTREF(__pyx_t_8);
6208   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6209   __pyx_v_radd = __pyx_t_8;
6210   __pyx_t_8 = 0;
6211 
6212   /* "MACS2/IO/ScoreTrack.pyx":263
6213  *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[]),array(BYTE4,[])] # region,V1,V1,length
6214  *         radd = ret[0].append
6215  *         v1add = ret[1].append             # <<<<<<<<<<<<<<
6216  *         v2add = ret[2].append
6217  *         ladd = ret[3].append
6218  */
6219   __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_ret, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 263, __pyx_L1_error)
6220   __Pyx_GOTREF(__pyx_t_8);
6221   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_append); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 263, __pyx_L1_error)
6222   __Pyx_GOTREF(__pyx_t_9);
6223   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6224   __pyx_v_v1add = __pyx_t_9;
6225   __pyx_t_9 = 0;
6226 
6227   /* "MACS2/IO/ScoreTrack.pyx":264
6228  *         radd = ret[0].append
6229  *         v1add = ret[1].append
6230  *         v2add = ret[2].append             # <<<<<<<<<<<<<<
6231  *         ladd = ret[3].append
6232  *
6233  */
6234   __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_ret, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 264, __pyx_L1_error)
6235   __Pyx_GOTREF(__pyx_t_9);
6236   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_append); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error)
6237   __Pyx_GOTREF(__pyx_t_8);
6238   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6239   __pyx_v_v2add = __pyx_t_8;
6240   __pyx_t_8 = 0;
6241 
6242   /* "MACS2/IO/ScoreTrack.pyx":265
6243  *         v1add = ret[1].append
6244  *         v2add = ret[2].append
6245  *         ladd = ret[3].append             # <<<<<<<<<<<<<<
6246  *
6247  *         chr1 = set(self.get_chr_names())
6248  */
6249   __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_ret, 3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L1_error)
6250   __Pyx_GOTREF(__pyx_t_8);
6251   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_append); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 265, __pyx_L1_error)
6252   __Pyx_GOTREF(__pyx_t_9);
6253   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6254   __pyx_v_ladd = __pyx_t_9;
6255   __pyx_t_9 = 0;
6256 
6257   /* "MACS2/IO/ScoreTrack.pyx":267
6258  *         ladd = ret[3].append
6259  *
6260  *         chr1 = set(self.get_chr_names())             # <<<<<<<<<<<<<<
6261  *         chr2 = set(bdgTrack2.get_chr_names())
6262  *         common_chr = chr1.intersection(chr2)
6263  */
6264   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_chr_names); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 267, __pyx_L1_error)
6265   __Pyx_GOTREF(__pyx_t_8);
6266   __pyx_t_3 = NULL;
6267   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
6268     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
6269     if (likely(__pyx_t_3)) {
6270       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
6271       __Pyx_INCREF(__pyx_t_3);
6272       __Pyx_INCREF(function);
6273       __Pyx_DECREF_SET(__pyx_t_8, function);
6274     }
6275   }
6276   __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
6277   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6278   if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 267, __pyx_L1_error)
6279   __Pyx_GOTREF(__pyx_t_9);
6280   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6281   __pyx_t_8 = PySet_New(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 267, __pyx_L1_error)
6282   __Pyx_GOTREF(__pyx_t_8);
6283   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6284   __pyx_v_chr1 = ((PyObject*)__pyx_t_8);
6285   __pyx_t_8 = 0;
6286 
6287   /* "MACS2/IO/ScoreTrack.pyx":268
6288  *
6289  *         chr1 = set(self.get_chr_names())
6290  *         chr2 = set(bdgTrack2.get_chr_names())             # <<<<<<<<<<<<<<
6291  *         common_chr = chr1.intersection(chr2)
6292  *         for chrom in common_chr:
6293  */
6294   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_bdgTrack2, __pyx_n_s_get_chr_names); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 268, __pyx_L1_error)
6295   __Pyx_GOTREF(__pyx_t_9);
6296   __pyx_t_3 = NULL;
6297   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
6298     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
6299     if (likely(__pyx_t_3)) {
6300       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
6301       __Pyx_INCREF(__pyx_t_3);
6302       __Pyx_INCREF(function);
6303       __Pyx_DECREF_SET(__pyx_t_9, function);
6304     }
6305   }
6306   __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
6307   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6308   if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 268, __pyx_L1_error)
6309   __Pyx_GOTREF(__pyx_t_8);
6310   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6311   __pyx_t_9 = PySet_New(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 268, __pyx_L1_error)
6312   __Pyx_GOTREF(__pyx_t_9);
6313   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6314   __pyx_v_chr2 = ((PyObject*)__pyx_t_9);
6315   __pyx_t_9 = 0;
6316 
6317   /* "MACS2/IO/ScoreTrack.pyx":269
6318  *         chr1 = set(self.get_chr_names())
6319  *         chr2 = set(bdgTrack2.get_chr_names())
6320  *         common_chr = chr1.intersection(chr2)             # <<<<<<<<<<<<<<
6321  *         for chrom in common_chr:
6322  *             chrom_data = self.get_data_by_chr(chrom) # arrays for position and values
6323  */
6324   __pyx_t_9 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_chr1, __pyx_v_chr2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 269, __pyx_L1_error)
6325   __Pyx_GOTREF(__pyx_t_9);
6326   if (!(likely(PySet_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_9)->tp_name), 0))) __PYX_ERR(0, 269, __pyx_L1_error)
6327   __pyx_v_common_chr = ((PyObject*)__pyx_t_9);
6328   __pyx_t_9 = 0;
6329 
6330   /* "MACS2/IO/ScoreTrack.pyx":270
6331  *         chr2 = set(bdgTrack2.get_chr_names())
6332  *         common_chr = chr1.intersection(chr2)
6333  *         for chrom in common_chr:             # <<<<<<<<<<<<<<
6334  *             chrom_data = self.get_data_by_chr(chrom) # arrays for position and values
6335  *             p1n = chrom_data['pos'].flat.__next__
6336  */
6337   __pyx_t_11 = 0;
6338   __pyx_t_8 = __Pyx_set_iterator(__pyx_v_common_chr, 1, (&__pyx_t_12), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 270, __pyx_L1_error)
6339   __Pyx_GOTREF(__pyx_t_8);
6340   __Pyx_XDECREF(__pyx_t_9);
6341   __pyx_t_9 = __pyx_t_8;
6342   __pyx_t_8 = 0;
6343   while (1) {
6344     __pyx_t_13 = __Pyx_set_iter_next(__pyx_t_9, __pyx_t_12, &__pyx_t_11, &__pyx_t_8, __pyx_t_7);
6345     if (unlikely(__pyx_t_13 == 0)) break;
6346     if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 270, __pyx_L1_error)
6347     __Pyx_GOTREF(__pyx_t_8);
6348     if (!(likely(PyBytes_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 270, __pyx_L1_error)
6349     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_8));
6350     __pyx_t_8 = 0;
6351 
6352     /* "MACS2/IO/ScoreTrack.pyx":271
6353  *         common_chr = chr1.intersection(chr2)
6354  *         for chrom in common_chr:
6355  *             chrom_data = self.get_data_by_chr(chrom) # arrays for position and values             # <<<<<<<<<<<<<<
6356  *             p1n = chrom_data['pos'].flat.__next__
6357  *             v11n = chrom_data['V1'].flat.__next__
6358  */
6359     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_data_by_chr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error)
6360     __Pyx_GOTREF(__pyx_t_3);
6361     __pyx_t_2 = NULL;
6362     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6363       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
6364       if (likely(__pyx_t_2)) {
6365         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6366         __Pyx_INCREF(__pyx_t_2);
6367         __Pyx_INCREF(function);
6368         __Pyx_DECREF_SET(__pyx_t_3, function);
6369       }
6370     }
6371     __pyx_t_8 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_chrom) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_chrom);
6372     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6373     if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error)
6374     __Pyx_GOTREF(__pyx_t_8);
6375     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6376     __Pyx_XDECREF_SET(__pyx_v_chrom_data, __pyx_t_8);
6377     __pyx_t_8 = 0;
6378 
6379     /* "MACS2/IO/ScoreTrack.pyx":272
6380  *         for chrom in common_chr:
6381  *             chrom_data = self.get_data_by_chr(chrom) # arrays for position and values
6382  *             p1n = chrom_data['pos'].flat.__next__             # <<<<<<<<<<<<<<
6383  *             v11n = chrom_data['V1'].flat.__next__
6384  *             v21n = chrom_data['V2'].flat.__next__
6385  */
6386     __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_chrom_data, __pyx_n_u_pos); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 272, __pyx_L1_error)
6387     __Pyx_GOTREF(__pyx_t_8);
6388     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
6389     __Pyx_GOTREF(__pyx_t_3);
6390     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6391     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_next); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 272, __pyx_L1_error)
6392     __Pyx_GOTREF(__pyx_t_8);
6393     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6394     __Pyx_XDECREF_SET(__pyx_v_p1n, __pyx_t_8);
6395     __pyx_t_8 = 0;
6396 
6397     /* "MACS2/IO/ScoreTrack.pyx":273
6398  *             chrom_data = self.get_data_by_chr(chrom) # arrays for position and values
6399  *             p1n = chrom_data['pos'].flat.__next__
6400  *             v11n = chrom_data['V1'].flat.__next__             # <<<<<<<<<<<<<<
6401  *             v21n = chrom_data['V2'].flat.__next__
6402  *
6403  */
6404     __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_chrom_data, __pyx_n_u_V1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error)
6405     __Pyx_GOTREF(__pyx_t_8);
6406     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
6407     __Pyx_GOTREF(__pyx_t_3);
6408     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6409     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_next); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error)
6410     __Pyx_GOTREF(__pyx_t_8);
6411     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6412     __Pyx_XDECREF_SET(__pyx_v_v11n, __pyx_t_8);
6413     __pyx_t_8 = 0;
6414 
6415     /* "MACS2/IO/ScoreTrack.pyx":274
6416  *             p1n = chrom_data['pos'].flat.__next__
6417  *             v11n = chrom_data['V1'].flat.__next__
6418  *             v21n = chrom_data['V2'].flat.__next__             # <<<<<<<<<<<<<<
6419  *
6420  *             (p2s,v2s) = bdgTrack2.get_data_by_chr(chrom) # arrays for position and values
6421  */
6422     __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_chrom_data, __pyx_n_u_V2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error)
6423     __Pyx_GOTREF(__pyx_t_8);
6424     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
6425     __Pyx_GOTREF(__pyx_t_3);
6426     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6427     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_next); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error)
6428     __Pyx_GOTREF(__pyx_t_8);
6429     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6430     __Pyx_XDECREF_SET(__pyx_v_v21n, __pyx_t_8);
6431     __pyx_t_8 = 0;
6432 
6433     /* "MACS2/IO/ScoreTrack.pyx":276
6434  *             v21n = chrom_data['V2'].flat.__next__
6435  *
6436  *             (p2s,v2s) = bdgTrack2.get_data_by_chr(chrom) # arrays for position and values             # <<<<<<<<<<<<<<
6437  *             p2n = iter(p2s).__next__         # assign the next function to a viable to speed up
6438  *             v2n = iter(v2s).__next__
6439  */
6440     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_bdgTrack2, __pyx_n_s_get_data_by_chr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
6441     __Pyx_GOTREF(__pyx_t_3);
6442     __pyx_t_2 = NULL;
6443     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6444       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
6445       if (likely(__pyx_t_2)) {
6446         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6447         __Pyx_INCREF(__pyx_t_2);
6448         __Pyx_INCREF(function);
6449         __Pyx_DECREF_SET(__pyx_t_3, function);
6450       }
6451     }
6452     __pyx_t_8 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_chrom) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_chrom);
6453     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6454     if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error)
6455     __Pyx_GOTREF(__pyx_t_8);
6456     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6457     if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
6458       PyObject* sequence = __pyx_t_8;
6459       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6460       if (unlikely(size != 2)) {
6461         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6462         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6463         __PYX_ERR(0, 276, __pyx_L1_error)
6464       }
6465       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6466       if (likely(PyTuple_CheckExact(sequence))) {
6467         __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6468         __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
6469       } else {
6470         __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
6471         __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
6472       }
6473       __Pyx_INCREF(__pyx_t_3);
6474       __Pyx_INCREF(__pyx_t_2);
6475       #else
6476       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
6477       __Pyx_GOTREF(__pyx_t_3);
6478       __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
6479       __Pyx_GOTREF(__pyx_t_2);
6480       #endif
6481       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6482     } else {
6483       Py_ssize_t index = -1;
6484       __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
6485       __Pyx_GOTREF(__pyx_t_1);
6486       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6487       __pyx_t_14 = Py_TYPE(__pyx_t_1)->tp_iternext;
6488       index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
6489       __Pyx_GOTREF(__pyx_t_3);
6490       index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
6491       __Pyx_GOTREF(__pyx_t_2);
6492       if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 2) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
6493       __pyx_t_14 = NULL;
6494       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6495       goto __pyx_L6_unpacking_done;
6496       __pyx_L5_unpacking_failed:;
6497       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6498       __pyx_t_14 = NULL;
6499       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6500       __PYX_ERR(0, 276, __pyx_L1_error)
6501       __pyx_L6_unpacking_done:;
6502     }
6503     __Pyx_XDECREF_SET(__pyx_v_p2s, __pyx_t_3);
6504     __pyx_t_3 = 0;
6505     __Pyx_XDECREF_SET(__pyx_v_v2s, __pyx_t_2);
6506     __pyx_t_2 = 0;
6507 
6508     /* "MACS2/IO/ScoreTrack.pyx":277
6509  *
6510  *             (p2s,v2s) = bdgTrack2.get_data_by_chr(chrom) # arrays for position and values
6511  *             p2n = iter(p2s).__next__         # assign the next function to a viable to speed up             # <<<<<<<<<<<<<<
6512  *             v2n = iter(v2s).__next__
6513  *
6514  */
6515     __pyx_t_8 = PyObject_GetIter(__pyx_v_p2s); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error)
6516     __Pyx_GOTREF(__pyx_t_8);
6517     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
6518     __Pyx_GOTREF(__pyx_t_2);
6519     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6520     __Pyx_XDECREF_SET(__pyx_v_p2n, __pyx_t_2);
6521     __pyx_t_2 = 0;
6522 
6523     /* "MACS2/IO/ScoreTrack.pyx":278
6524  *             (p2s,v2s) = bdgTrack2.get_data_by_chr(chrom) # arrays for position and values
6525  *             p2n = iter(p2s).__next__         # assign the next function to a viable to speed up
6526  *             v2n = iter(v2s).__next__             # <<<<<<<<<<<<<<
6527  *
6528  *             pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret
6529  */
6530     __pyx_t_2 = PyObject_GetIter(__pyx_v_v2s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
6531     __Pyx_GOTREF(__pyx_t_2);
6532     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_next); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error)
6533     __Pyx_GOTREF(__pyx_t_8);
6534     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6535     __Pyx_XDECREF_SET(__pyx_v_v2n, __pyx_t_8);
6536     __pyx_t_8 = 0;
6537 
6538     /* "MACS2/IO/ScoreTrack.pyx":280
6539  *             v2n = iter(v2s).__next__
6540  *
6541  *             pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret             # <<<<<<<<<<<<<<
6542  *
6543  *             try:
6544  */
6545     __pyx_v_pre_p = 0;
6546 
6547     /* "MACS2/IO/ScoreTrack.pyx":282
6548  *             pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret
6549  *
6550  *             try:             # <<<<<<<<<<<<<<
6551  *                 p1 = p1n()
6552  *                 v11 = v11n()
6553  */
6554     {
6555       __Pyx_PyThreadState_declare
6556       __Pyx_PyThreadState_assign
6557       __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
6558       __Pyx_XGOTREF(__pyx_t_15);
6559       __Pyx_XGOTREF(__pyx_t_16);
6560       __Pyx_XGOTREF(__pyx_t_17);
6561       /*try:*/ {
6562 
6563         /* "MACS2/IO/ScoreTrack.pyx":283
6564  *
6565  *             try:
6566  *                 p1 = p1n()             # <<<<<<<<<<<<<<
6567  *                 v11 = v11n()
6568  *                 v21 = v21n()
6569  */
6570         __Pyx_INCREF(__pyx_v_p1n);
6571         __pyx_t_2 = __pyx_v_p1n; __pyx_t_3 = NULL;
6572         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6573           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6574           if (likely(__pyx_t_3)) {
6575             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6576             __Pyx_INCREF(__pyx_t_3);
6577             __Pyx_INCREF(function);
6578             __Pyx_DECREF_SET(__pyx_t_2, function);
6579           }
6580         }
6581         __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6582         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6583         if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L7_error)
6584         __Pyx_GOTREF(__pyx_t_8);
6585         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6586         __pyx_t_18 = __Pyx_PyInt_As_npy_int32(__pyx_t_8); if (unlikely((__pyx_t_18 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L7_error)
6587         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6588         __pyx_v_p1 = __pyx_t_18;
6589 
6590         /* "MACS2/IO/ScoreTrack.pyx":284
6591  *             try:
6592  *                 p1 = p1n()
6593  *                 v11 = v11n()             # <<<<<<<<<<<<<<
6594  *                 v21 = v21n()
6595  *
6596  */
6597         __Pyx_INCREF(__pyx_v_v11n);
6598         __pyx_t_2 = __pyx_v_v11n; __pyx_t_3 = NULL;
6599         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6600           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6601           if (likely(__pyx_t_3)) {
6602             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6603             __Pyx_INCREF(__pyx_t_3);
6604             __Pyx_INCREF(function);
6605             __Pyx_DECREF_SET(__pyx_t_2, function);
6606           }
6607         }
6608         __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6609         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6610         if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L7_error)
6611         __Pyx_GOTREF(__pyx_t_8);
6612         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6613         __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L7_error)
6614         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6615         __pyx_v_v11 = __pyx_t_19;
6616 
6617         /* "MACS2/IO/ScoreTrack.pyx":285
6618  *                 p1 = p1n()
6619  *                 v11 = v11n()
6620  *                 v21 = v21n()             # <<<<<<<<<<<<<<
6621  *
6622  *                 p2 = p2n()
6623  */
6624         __Pyx_INCREF(__pyx_v_v21n);
6625         __pyx_t_2 = __pyx_v_v21n; __pyx_t_3 = NULL;
6626         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6627           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6628           if (likely(__pyx_t_3)) {
6629             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6630             __Pyx_INCREF(__pyx_t_3);
6631             __Pyx_INCREF(function);
6632             __Pyx_DECREF_SET(__pyx_t_2, function);
6633           }
6634         }
6635         __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6636         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6637         if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 285, __pyx_L7_error)
6638         __Pyx_GOTREF(__pyx_t_8);
6639         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6640         __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L7_error)
6641         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6642         __pyx_v_v21 = __pyx_t_19;
6643 
6644         /* "MACS2/IO/ScoreTrack.pyx":287
6645  *                 v21 = v21n()
6646  *
6647  *                 p2 = p2n()             # <<<<<<<<<<<<<<
6648  *                 v2 = v2n()
6649  *
6650  */
6651         __Pyx_INCREF(__pyx_v_p2n);
6652         __pyx_t_2 = __pyx_v_p2n; __pyx_t_3 = NULL;
6653         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6654           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6655           if (likely(__pyx_t_3)) {
6656             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6657             __Pyx_INCREF(__pyx_t_3);
6658             __Pyx_INCREF(function);
6659             __Pyx_DECREF_SET(__pyx_t_2, function);
6660           }
6661         }
6662         __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6663         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6664         if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L7_error)
6665         __Pyx_GOTREF(__pyx_t_8);
6666         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6667         __pyx_t_18 = __Pyx_PyInt_As_npy_int32(__pyx_t_8); if (unlikely((__pyx_t_18 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L7_error)
6668         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6669         __pyx_v_p2 = __pyx_t_18;
6670 
6671         /* "MACS2/IO/ScoreTrack.pyx":288
6672  *
6673  *                 p2 = p2n()
6674  *                 v2 = v2n()             # <<<<<<<<<<<<<<
6675  *
6676  *                 while True:
6677  */
6678         __Pyx_INCREF(__pyx_v_v2n);
6679         __pyx_t_2 = __pyx_v_v2n; __pyx_t_3 = NULL;
6680         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6681           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6682           if (likely(__pyx_t_3)) {
6683             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6684             __Pyx_INCREF(__pyx_t_3);
6685             __Pyx_INCREF(function);
6686             __Pyx_DECREF_SET(__pyx_t_2, function);
6687           }
6688         }
6689         __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6690         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6691         if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L7_error)
6692         __Pyx_GOTREF(__pyx_t_8);
6693         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6694         __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L7_error)
6695         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6696         __pyx_v_v2 = __pyx_t_19;
6697 
6698         /* "MACS2/IO/ScoreTrack.pyx":290
6699  *                 v2 = v2n()
6700  *
6701  *                 while True:             # <<<<<<<<<<<<<<
6702  *                     if p1 < p2:
6703  *                         # clip a region from pre_p to p1, then set pre_p as p1.
6704  */
6705         while (1) {
6706 
6707           /* "MACS2/IO/ScoreTrack.pyx":291
6708  *
6709  *                 while True:
6710  *                     if p1 < p2:             # <<<<<<<<<<<<<<
6711  *                         # clip a region from pre_p to p1, then set pre_p as p1.
6712  *                         if v2>0:
6713  */
6714           __pyx_t_20 = ((__pyx_v_p1 < __pyx_v_p2) != 0);
6715           if (__pyx_t_20) {
6716 
6717             /* "MACS2/IO/ScoreTrack.pyx":293
6718  *                     if p1 < p2:
6719  *                         # clip a region from pre_p to p1, then set pre_p as p1.
6720  *                         if v2>0:             # <<<<<<<<<<<<<<
6721  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p1))
6722  *                             v1add(v11)
6723  */
6724             __pyx_t_20 = ((__pyx_v_v2 > 0.0) != 0);
6725             if (__pyx_t_20) {
6726 
6727               /* "MACS2/IO/ScoreTrack.pyx":294
6728  *                         # clip a region from pre_p to p1, then set pre_p as p1.
6729  *                         if v2>0:
6730  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p1))             # <<<<<<<<<<<<<<
6731  *                             v1add(v11)
6732  *                             v2add(v21)
6733  */
6734               __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pre_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L7_error)
6735               __Pyx_GOTREF(__pyx_t_2);
6736               __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L7_error)
6737               __Pyx_GOTREF(__pyx_t_3);
6738               __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L7_error)
6739               __Pyx_GOTREF(__pyx_t_1);
6740               __Pyx_INCREF(__pyx_v_chrom);
6741               __Pyx_GIVEREF(__pyx_v_chrom);
6742               PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
6743               __Pyx_GIVEREF(__pyx_t_2);
6744               PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
6745               __Pyx_GIVEREF(__pyx_t_3);
6746               PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
6747               __pyx_t_2 = 0;
6748               __pyx_t_3 = 0;
6749               __pyx_t_3 = PyNumber_Remainder(__pyx_kp_b_s_d_d, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L7_error)
6750               __Pyx_GOTREF(__pyx_t_3);
6751               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6752               __Pyx_INCREF(__pyx_v_radd);
6753               __pyx_t_1 = __pyx_v_radd; __pyx_t_2 = NULL;
6754               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
6755                 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
6756                 if (likely(__pyx_t_2)) {
6757                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
6758                   __Pyx_INCREF(__pyx_t_2);
6759                   __Pyx_INCREF(function);
6760                   __Pyx_DECREF_SET(__pyx_t_1, function);
6761                 }
6762               }
6763               __pyx_t_8 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
6764               __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6765               __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6766               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L7_error)
6767               __Pyx_GOTREF(__pyx_t_8);
6768               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6769               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6770 
6771               /* "MACS2/IO/ScoreTrack.pyx":295
6772  *                         if v2>0:
6773  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p1))
6774  *                             v1add(v11)             # <<<<<<<<<<<<<<
6775  *                             v2add(v21)
6776  *                             ladd(p1-pre_p)
6777  */
6778               __pyx_t_1 = PyFloat_FromDouble(__pyx_v_v11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L7_error)
6779               __Pyx_GOTREF(__pyx_t_1);
6780               __Pyx_INCREF(__pyx_v_v1add);
6781               __pyx_t_3 = __pyx_v_v1add; __pyx_t_2 = NULL;
6782               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6783                 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
6784                 if (likely(__pyx_t_2)) {
6785                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6786                   __Pyx_INCREF(__pyx_t_2);
6787                   __Pyx_INCREF(function);
6788                   __Pyx_DECREF_SET(__pyx_t_3, function);
6789                 }
6790               }
6791               __pyx_t_8 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
6792               __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6793               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6794               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __pyx_L7_error)
6795               __Pyx_GOTREF(__pyx_t_8);
6796               __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6797               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6798 
6799               /* "MACS2/IO/ScoreTrack.pyx":296
6800  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p1))
6801  *                             v1add(v11)
6802  *                             v2add(v21)             # <<<<<<<<<<<<<<
6803  *                             ladd(p1-pre_p)
6804  *                         pre_p = p1
6805  */
6806               __pyx_t_3 = PyFloat_FromDouble(__pyx_v_v21); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L7_error)
6807               __Pyx_GOTREF(__pyx_t_3);
6808               __Pyx_INCREF(__pyx_v_v2add);
6809               __pyx_t_1 = __pyx_v_v2add; __pyx_t_2 = NULL;
6810               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
6811                 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
6812                 if (likely(__pyx_t_2)) {
6813                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
6814                   __Pyx_INCREF(__pyx_t_2);
6815                   __Pyx_INCREF(function);
6816                   __Pyx_DECREF_SET(__pyx_t_1, function);
6817                 }
6818               }
6819               __pyx_t_8 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
6820               __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6821               __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6822               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __pyx_L7_error)
6823               __Pyx_GOTREF(__pyx_t_8);
6824               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6825               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6826 
6827               /* "MACS2/IO/ScoreTrack.pyx":297
6828  *                             v1add(v11)
6829  *                             v2add(v21)
6830  *                             ladd(p1-pre_p)             # <<<<<<<<<<<<<<
6831  *                         pre_p = p1
6832  *                         # call for the next p1 and v1
6833  */
6834               __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_p1 - __pyx_v_pre_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L7_error)
6835               __Pyx_GOTREF(__pyx_t_1);
6836               __Pyx_INCREF(__pyx_v_ladd);
6837               __pyx_t_3 = __pyx_v_ladd; __pyx_t_2 = NULL;
6838               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6839                 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
6840                 if (likely(__pyx_t_2)) {
6841                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6842                   __Pyx_INCREF(__pyx_t_2);
6843                   __Pyx_INCREF(function);
6844                   __Pyx_DECREF_SET(__pyx_t_3, function);
6845                 }
6846               }
6847               __pyx_t_8 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
6848               __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6849               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6850               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 297, __pyx_L7_error)
6851               __Pyx_GOTREF(__pyx_t_8);
6852               __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6853               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6854 
6855               /* "MACS2/IO/ScoreTrack.pyx":293
6856  *                     if p1 < p2:
6857  *                         # clip a region from pre_p to p1, then set pre_p as p1.
6858  *                         if v2>0:             # <<<<<<<<<<<<<<
6859  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p1))
6860  *                             v1add(v11)
6861  */
6862             }
6863 
6864             /* "MACS2/IO/ScoreTrack.pyx":298
6865  *                             v2add(v21)
6866  *                             ladd(p1-pre_p)
6867  *                         pre_p = p1             # <<<<<<<<<<<<<<
6868  *                         # call for the next p1 and v1
6869  *                         p1 = p1n()
6870  */
6871             __pyx_v_pre_p = __pyx_v_p1;
6872 
6873             /* "MACS2/IO/ScoreTrack.pyx":300
6874  *                         pre_p = p1
6875  *                         # call for the next p1 and v1
6876  *                         p1 = p1n()             # <<<<<<<<<<<<<<
6877  *                         v11 = v11n()
6878  *                         v21 = v21n()
6879  */
6880             __Pyx_INCREF(__pyx_v_p1n);
6881             __pyx_t_3 = __pyx_v_p1n; __pyx_t_1 = NULL;
6882             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6883               __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
6884               if (likely(__pyx_t_1)) {
6885                 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6886                 __Pyx_INCREF(__pyx_t_1);
6887                 __Pyx_INCREF(function);
6888                 __Pyx_DECREF_SET(__pyx_t_3, function);
6889               }
6890             }
6891             __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6892             __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6893             if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 300, __pyx_L7_error)
6894             __Pyx_GOTREF(__pyx_t_8);
6895             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6896             __pyx_t_18 = __Pyx_PyInt_As_npy_int32(__pyx_t_8); if (unlikely((__pyx_t_18 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L7_error)
6897             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6898             __pyx_v_p1 = __pyx_t_18;
6899 
6900             /* "MACS2/IO/ScoreTrack.pyx":301
6901  *                         # call for the next p1 and v1
6902  *                         p1 = p1n()
6903  *                         v11 = v11n()             # <<<<<<<<<<<<<<
6904  *                         v21 = v21n()
6905  *                     elif p2 < p1:
6906  */
6907             __Pyx_INCREF(__pyx_v_v11n);
6908             __pyx_t_3 = __pyx_v_v11n; __pyx_t_1 = NULL;
6909             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6910               __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
6911               if (likely(__pyx_t_1)) {
6912                 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6913                 __Pyx_INCREF(__pyx_t_1);
6914                 __Pyx_INCREF(function);
6915                 __Pyx_DECREF_SET(__pyx_t_3, function);
6916               }
6917             }
6918             __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6919             __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6920             if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L7_error)
6921             __Pyx_GOTREF(__pyx_t_8);
6922             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6923             __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L7_error)
6924             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6925             __pyx_v_v11 = __pyx_t_19;
6926 
6927             /* "MACS2/IO/ScoreTrack.pyx":302
6928  *                         p1 = p1n()
6929  *                         v11 = v11n()
6930  *                         v21 = v21n()             # <<<<<<<<<<<<<<
6931  *                     elif p2 < p1:
6932  *                         # clip a region from pre_p to p2, then set pre_p as p2.
6933  */
6934             __Pyx_INCREF(__pyx_v_v21n);
6935             __pyx_t_3 = __pyx_v_v21n; __pyx_t_1 = NULL;
6936             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6937               __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
6938               if (likely(__pyx_t_1)) {
6939                 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6940                 __Pyx_INCREF(__pyx_t_1);
6941                 __Pyx_INCREF(function);
6942                 __Pyx_DECREF_SET(__pyx_t_3, function);
6943               }
6944             }
6945             __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6946             __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6947             if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 302, __pyx_L7_error)
6948             __Pyx_GOTREF(__pyx_t_8);
6949             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6950             __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L7_error)
6951             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6952             __pyx_v_v21 = __pyx_t_19;
6953 
6954             /* "MACS2/IO/ScoreTrack.pyx":291
6955  *
6956  *                 while True:
6957  *                     if p1 < p2:             # <<<<<<<<<<<<<<
6958  *                         # clip a region from pre_p to p1, then set pre_p as p1.
6959  *                         if v2>0:
6960  */
6961             goto __pyx_L17;
6962           }
6963 
6964           /* "MACS2/IO/ScoreTrack.pyx":303
6965  *                         v11 = v11n()
6966  *                         v21 = v21n()
6967  *                     elif p2 < p1:             # <<<<<<<<<<<<<<
6968  *                         # clip a region from pre_p to p2, then set pre_p as p2.
6969  *                         if v2>0:
6970  */
6971           __pyx_t_20 = ((__pyx_v_p2 < __pyx_v_p1) != 0);
6972           if (__pyx_t_20) {
6973 
6974             /* "MACS2/IO/ScoreTrack.pyx":305
6975  *                     elif p2 < p1:
6976  *                         # clip a region from pre_p to p2, then set pre_p as p2.
6977  *                         if v2>0:             # <<<<<<<<<<<<<<
6978  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p2))
6979  *                             v1add(v11)
6980  */
6981             __pyx_t_20 = ((__pyx_v_v2 > 0.0) != 0);
6982             if (__pyx_t_20) {
6983 
6984               /* "MACS2/IO/ScoreTrack.pyx":306
6985  *                         # clip a region from pre_p to p2, then set pre_p as p2.
6986  *                         if v2>0:
6987  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p2))             # <<<<<<<<<<<<<<
6988  *                             v1add(v11)
6989  *                             v2add(v21)
6990  */
6991               __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_pre_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L7_error)
6992               __Pyx_GOTREF(__pyx_t_3);
6993               __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L7_error)
6994               __Pyx_GOTREF(__pyx_t_1);
6995               __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L7_error)
6996               __Pyx_GOTREF(__pyx_t_2);
6997               __Pyx_INCREF(__pyx_v_chrom);
6998               __Pyx_GIVEREF(__pyx_v_chrom);
6999               PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
7000               __Pyx_GIVEREF(__pyx_t_3);
7001               PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
7002               __Pyx_GIVEREF(__pyx_t_1);
7003               PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
7004               __pyx_t_3 = 0;
7005               __pyx_t_1 = 0;
7006               __pyx_t_1 = PyNumber_Remainder(__pyx_kp_b_s_d_d, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L7_error)
7007               __Pyx_GOTREF(__pyx_t_1);
7008               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7009               __Pyx_INCREF(__pyx_v_radd);
7010               __pyx_t_2 = __pyx_v_radd; __pyx_t_3 = NULL;
7011               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7012                 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7013                 if (likely(__pyx_t_3)) {
7014                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7015                   __Pyx_INCREF(__pyx_t_3);
7016                   __Pyx_INCREF(function);
7017                   __Pyx_DECREF_SET(__pyx_t_2, function);
7018                 }
7019               }
7020               __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
7021               __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7022               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7023               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 306, __pyx_L7_error)
7024               __Pyx_GOTREF(__pyx_t_8);
7025               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7026               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7027 
7028               /* "MACS2/IO/ScoreTrack.pyx":307
7029  *                         if v2>0:
7030  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p2))
7031  *                             v1add(v11)             # <<<<<<<<<<<<<<
7032  *                             v2add(v21)
7033  *                             ladd(p2-pre_p)
7034  */
7035               __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L7_error)
7036               __Pyx_GOTREF(__pyx_t_2);
7037               __Pyx_INCREF(__pyx_v_v1add);
7038               __pyx_t_1 = __pyx_v_v1add; __pyx_t_3 = NULL;
7039               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7040                 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
7041                 if (likely(__pyx_t_3)) {
7042                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7043                   __Pyx_INCREF(__pyx_t_3);
7044                   __Pyx_INCREF(function);
7045                   __Pyx_DECREF_SET(__pyx_t_1, function);
7046                 }
7047               }
7048               __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
7049               __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7050               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7051               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L7_error)
7052               __Pyx_GOTREF(__pyx_t_8);
7053               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7054               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7055 
7056               /* "MACS2/IO/ScoreTrack.pyx":308
7057  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p2))
7058  *                             v1add(v11)
7059  *                             v2add(v21)             # <<<<<<<<<<<<<<
7060  *                             ladd(p2-pre_p)
7061  *                         pre_p = p2
7062  */
7063               __pyx_t_1 = PyFloat_FromDouble(__pyx_v_v21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L7_error)
7064               __Pyx_GOTREF(__pyx_t_1);
7065               __Pyx_INCREF(__pyx_v_v2add);
7066               __pyx_t_2 = __pyx_v_v2add; __pyx_t_3 = NULL;
7067               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7068                 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7069                 if (likely(__pyx_t_3)) {
7070                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7071                   __Pyx_INCREF(__pyx_t_3);
7072                   __Pyx_INCREF(function);
7073                   __Pyx_DECREF_SET(__pyx_t_2, function);
7074                 }
7075               }
7076               __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
7077               __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7078               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7079               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 308, __pyx_L7_error)
7080               __Pyx_GOTREF(__pyx_t_8);
7081               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7082               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7083 
7084               /* "MACS2/IO/ScoreTrack.pyx":309
7085  *                             v1add(v11)
7086  *                             v2add(v21)
7087  *                             ladd(p2-pre_p)             # <<<<<<<<<<<<<<
7088  *                         pre_p = p2
7089  *                         # call for the next p2 and v2
7090  */
7091               __pyx_t_2 = __Pyx_PyInt_From_npy_int32((__pyx_v_p2 - __pyx_v_pre_p)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L7_error)
7092               __Pyx_GOTREF(__pyx_t_2);
7093               __Pyx_INCREF(__pyx_v_ladd);
7094               __pyx_t_1 = __pyx_v_ladd; __pyx_t_3 = NULL;
7095               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7096                 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
7097                 if (likely(__pyx_t_3)) {
7098                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7099                   __Pyx_INCREF(__pyx_t_3);
7100                   __Pyx_INCREF(function);
7101                   __Pyx_DECREF_SET(__pyx_t_1, function);
7102                 }
7103               }
7104               __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
7105               __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7106               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7107               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L7_error)
7108               __Pyx_GOTREF(__pyx_t_8);
7109               __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7110               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7111 
7112               /* "MACS2/IO/ScoreTrack.pyx":305
7113  *                     elif p2 < p1:
7114  *                         # clip a region from pre_p to p2, then set pre_p as p2.
7115  *                         if v2>0:             # <<<<<<<<<<<<<<
7116  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p2))
7117  *                             v1add(v11)
7118  */
7119             }
7120 
7121             /* "MACS2/IO/ScoreTrack.pyx":310
7122  *                             v2add(v21)
7123  *                             ladd(p2-pre_p)
7124  *                         pre_p = p2             # <<<<<<<<<<<<<<
7125  *                         # call for the next p2 and v2
7126  *                         p2 = p2n()
7127  */
7128             __pyx_v_pre_p = __pyx_v_p2;
7129 
7130             /* "MACS2/IO/ScoreTrack.pyx":312
7131  *                         pre_p = p2
7132  *                         # call for the next p2 and v2
7133  *                         p2 = p2n()             # <<<<<<<<<<<<<<
7134  *                         v2 = v2n()
7135  *                     elif p1 == p2:
7136  */
7137             __Pyx_INCREF(__pyx_v_p2n);
7138             __pyx_t_1 = __pyx_v_p2n; __pyx_t_2 = NULL;
7139             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7140               __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
7141               if (likely(__pyx_t_2)) {
7142                 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7143                 __Pyx_INCREF(__pyx_t_2);
7144                 __Pyx_INCREF(function);
7145                 __Pyx_DECREF_SET(__pyx_t_1, function);
7146               }
7147             }
7148             __pyx_t_8 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
7149             __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7150             if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L7_error)
7151             __Pyx_GOTREF(__pyx_t_8);
7152             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7153             __pyx_t_18 = __Pyx_PyInt_As_npy_int32(__pyx_t_8); if (unlikely((__pyx_t_18 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L7_error)
7154             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7155             __pyx_v_p2 = __pyx_t_18;
7156 
7157             /* "MACS2/IO/ScoreTrack.pyx":313
7158  *                         # call for the next p2 and v2
7159  *                         p2 = p2n()
7160  *                         v2 = v2n()             # <<<<<<<<<<<<<<
7161  *                     elif p1 == p2:
7162  *                         # from pre_p to p1 or p2, then set pre_p as p1 or p2.
7163  */
7164             __Pyx_INCREF(__pyx_v_v2n);
7165             __pyx_t_1 = __pyx_v_v2n; __pyx_t_2 = NULL;
7166             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7167               __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
7168               if (likely(__pyx_t_2)) {
7169                 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7170                 __Pyx_INCREF(__pyx_t_2);
7171                 __Pyx_INCREF(function);
7172                 __Pyx_DECREF_SET(__pyx_t_1, function);
7173               }
7174             }
7175             __pyx_t_8 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
7176             __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7177             if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 313, __pyx_L7_error)
7178             __Pyx_GOTREF(__pyx_t_8);
7179             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7180             __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 313, __pyx_L7_error)
7181             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7182             __pyx_v_v2 = __pyx_t_19;
7183 
7184             /* "MACS2/IO/ScoreTrack.pyx":303
7185  *                         v11 = v11n()
7186  *                         v21 = v21n()
7187  *                     elif p2 < p1:             # <<<<<<<<<<<<<<
7188  *                         # clip a region from pre_p to p2, then set pre_p as p2.
7189  *                         if v2>0:
7190  */
7191             goto __pyx_L17;
7192           }
7193 
7194           /* "MACS2/IO/ScoreTrack.pyx":314
7195  *                         p2 = p2n()
7196  *                         v2 = v2n()
7197  *                     elif p1 == p2:             # <<<<<<<<<<<<<<
7198  *                         # from pre_p to p1 or p2, then set pre_p as p1 or p2.
7199  *                         if v2>0:
7200  */
7201           __pyx_t_20 = ((__pyx_v_p1 == __pyx_v_p2) != 0);
7202           if (__pyx_t_20) {
7203 
7204             /* "MACS2/IO/ScoreTrack.pyx":316
7205  *                     elif p1 == p2:
7206  *                         # from pre_p to p1 or p2, then set pre_p as p1 or p2.
7207  *                         if v2>0:             # <<<<<<<<<<<<<<
7208  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p1))
7209  *                             v1add(v11)
7210  */
7211             __pyx_t_20 = ((__pyx_v_v2 > 0.0) != 0);
7212             if (__pyx_t_20) {
7213 
7214               /* "MACS2/IO/ScoreTrack.pyx":317
7215  *                         # from pre_p to p1 or p2, then set pre_p as p1 or p2.
7216  *                         if v2>0:
7217  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p1))             # <<<<<<<<<<<<<<
7218  *                             v1add(v11)
7219  *                             v2add(v21)
7220  */
7221               __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_pre_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L7_error)
7222               __Pyx_GOTREF(__pyx_t_1);
7223               __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L7_error)
7224               __Pyx_GOTREF(__pyx_t_2);
7225               __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L7_error)
7226               __Pyx_GOTREF(__pyx_t_3);
7227               __Pyx_INCREF(__pyx_v_chrom);
7228               __Pyx_GIVEREF(__pyx_v_chrom);
7229               PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chrom);
7230               __Pyx_GIVEREF(__pyx_t_1);
7231               PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
7232               __Pyx_GIVEREF(__pyx_t_2);
7233               PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
7234               __pyx_t_1 = 0;
7235               __pyx_t_2 = 0;
7236               __pyx_t_2 = PyNumber_Remainder(__pyx_kp_b_s_d_d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L7_error)
7237               __Pyx_GOTREF(__pyx_t_2);
7238               __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7239               __Pyx_INCREF(__pyx_v_radd);
7240               __pyx_t_3 = __pyx_v_radd; __pyx_t_1 = NULL;
7241               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
7242                 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
7243                 if (likely(__pyx_t_1)) {
7244                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7245                   __Pyx_INCREF(__pyx_t_1);
7246                   __Pyx_INCREF(function);
7247                   __Pyx_DECREF_SET(__pyx_t_3, function);
7248                 }
7249               }
7250               __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
7251               __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7252               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7253               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L7_error)
7254               __Pyx_GOTREF(__pyx_t_8);
7255               __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7256               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7257 
7258               /* "MACS2/IO/ScoreTrack.pyx":318
7259  *                         if v2>0:
7260  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p1))
7261  *                             v1add(v11)             # <<<<<<<<<<<<<<
7262  *                             v2add(v21)
7263  *                             ladd(p1-pre_p)
7264  */
7265               __pyx_t_3 = PyFloat_FromDouble(__pyx_v_v11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L7_error)
7266               __Pyx_GOTREF(__pyx_t_3);
7267               __Pyx_INCREF(__pyx_v_v1add);
7268               __pyx_t_2 = __pyx_v_v1add; __pyx_t_1 = NULL;
7269               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7270                 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
7271                 if (likely(__pyx_t_1)) {
7272                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7273                   __Pyx_INCREF(__pyx_t_1);
7274                   __Pyx_INCREF(function);
7275                   __Pyx_DECREF_SET(__pyx_t_2, function);
7276                 }
7277               }
7278               __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
7279               __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7280               __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7281               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L7_error)
7282               __Pyx_GOTREF(__pyx_t_8);
7283               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7284               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7285 
7286               /* "MACS2/IO/ScoreTrack.pyx":319
7287  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p1))
7288  *                             v1add(v11)
7289  *                             v2add(v21)             # <<<<<<<<<<<<<<
7290  *                             ladd(p1-pre_p)
7291  *                         pre_p = p1
7292  */
7293               __pyx_t_2 = PyFloat_FromDouble(__pyx_v_v21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L7_error)
7294               __Pyx_GOTREF(__pyx_t_2);
7295               __Pyx_INCREF(__pyx_v_v2add);
7296               __pyx_t_3 = __pyx_v_v2add; __pyx_t_1 = NULL;
7297               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
7298                 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
7299                 if (likely(__pyx_t_1)) {
7300                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7301                   __Pyx_INCREF(__pyx_t_1);
7302                   __Pyx_INCREF(function);
7303                   __Pyx_DECREF_SET(__pyx_t_3, function);
7304                 }
7305               }
7306               __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
7307               __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7308               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7309               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 319, __pyx_L7_error)
7310               __Pyx_GOTREF(__pyx_t_8);
7311               __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7312               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7313 
7314               /* "MACS2/IO/ScoreTrack.pyx":320
7315  *                             v1add(v11)
7316  *                             v2add(v21)
7317  *                             ladd(p1-pre_p)             # <<<<<<<<<<<<<<
7318  *                         pre_p = p1
7319  *                         # call for the next p1, v1, p2, v2.
7320  */
7321               __pyx_t_3 = __Pyx_PyInt_From_npy_int32((__pyx_v_p1 - __pyx_v_pre_p)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L7_error)
7322               __Pyx_GOTREF(__pyx_t_3);
7323               __Pyx_INCREF(__pyx_v_ladd);
7324               __pyx_t_2 = __pyx_v_ladd; __pyx_t_1 = NULL;
7325               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7326                 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
7327                 if (likely(__pyx_t_1)) {
7328                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7329                   __Pyx_INCREF(__pyx_t_1);
7330                   __Pyx_INCREF(function);
7331                   __Pyx_DECREF_SET(__pyx_t_2, function);
7332                 }
7333               }
7334               __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
7335               __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7336               __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7337               if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 320, __pyx_L7_error)
7338               __Pyx_GOTREF(__pyx_t_8);
7339               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7340               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7341 
7342               /* "MACS2/IO/ScoreTrack.pyx":316
7343  *                     elif p1 == p2:
7344  *                         # from pre_p to p1 or p2, then set pre_p as p1 or p2.
7345  *                         if v2>0:             # <<<<<<<<<<<<<<
7346  *                             radd(b"%s\.%d\.%d" % (chrom,pre_p,p1))
7347  *                             v1add(v11)
7348  */
7349             }
7350 
7351             /* "MACS2/IO/ScoreTrack.pyx":321
7352  *                             v2add(v21)
7353  *                             ladd(p1-pre_p)
7354  *                         pre_p = p1             # <<<<<<<<<<<<<<
7355  *                         # call for the next p1, v1, p2, v2.
7356  *                         p1 = p1n()
7357  */
7358             __pyx_v_pre_p = __pyx_v_p1;
7359 
7360             /* "MACS2/IO/ScoreTrack.pyx":323
7361  *                         pre_p = p1
7362  *                         # call for the next p1, v1, p2, v2.
7363  *                         p1 = p1n()             # <<<<<<<<<<<<<<
7364  *                         v11 = v11n()
7365  *                         v21 = v21n()
7366  */
7367             __Pyx_INCREF(__pyx_v_p1n);
7368             __pyx_t_2 = __pyx_v_p1n; __pyx_t_3 = NULL;
7369             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7370               __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7371               if (likely(__pyx_t_3)) {
7372                 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7373                 __Pyx_INCREF(__pyx_t_3);
7374                 __Pyx_INCREF(function);
7375                 __Pyx_DECREF_SET(__pyx_t_2, function);
7376               }
7377             }
7378             __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
7379             __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7380             if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __pyx_L7_error)
7381             __Pyx_GOTREF(__pyx_t_8);
7382             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7383             __pyx_t_18 = __Pyx_PyInt_As_npy_int32(__pyx_t_8); if (unlikely((__pyx_t_18 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L7_error)
7384             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7385             __pyx_v_p1 = __pyx_t_18;
7386 
7387             /* "MACS2/IO/ScoreTrack.pyx":324
7388  *                         # call for the next p1, v1, p2, v2.
7389  *                         p1 = p1n()
7390  *                         v11 = v11n()             # <<<<<<<<<<<<<<
7391  *                         v21 = v21n()
7392  *                         p2 = p2n()
7393  */
7394             __Pyx_INCREF(__pyx_v_v11n);
7395             __pyx_t_2 = __pyx_v_v11n; __pyx_t_3 = NULL;
7396             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7397               __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7398               if (likely(__pyx_t_3)) {
7399                 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7400                 __Pyx_INCREF(__pyx_t_3);
7401                 __Pyx_INCREF(function);
7402                 __Pyx_DECREF_SET(__pyx_t_2, function);
7403               }
7404             }
7405             __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
7406             __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7407             if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __pyx_L7_error)
7408             __Pyx_GOTREF(__pyx_t_8);
7409             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7410             __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L7_error)
7411             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7412             __pyx_v_v11 = __pyx_t_19;
7413 
7414             /* "MACS2/IO/ScoreTrack.pyx":325
7415  *                         p1 = p1n()
7416  *                         v11 = v11n()
7417  *                         v21 = v21n()             # <<<<<<<<<<<<<<
7418  *                         p2 = p2n()
7419  *                         v2 = v2n()
7420  */
7421             __Pyx_INCREF(__pyx_v_v21n);
7422             __pyx_t_2 = __pyx_v_v21n; __pyx_t_3 = NULL;
7423             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7424               __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7425               if (likely(__pyx_t_3)) {
7426                 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7427                 __Pyx_INCREF(__pyx_t_3);
7428                 __Pyx_INCREF(function);
7429                 __Pyx_DECREF_SET(__pyx_t_2, function);
7430               }
7431             }
7432             __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
7433             __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7434             if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 325, __pyx_L7_error)
7435             __Pyx_GOTREF(__pyx_t_8);
7436             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7437             __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L7_error)
7438             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7439             __pyx_v_v21 = __pyx_t_19;
7440 
7441             /* "MACS2/IO/ScoreTrack.pyx":326
7442  *                         v11 = v11n()
7443  *                         v21 = v21n()
7444  *                         p2 = p2n()             # <<<<<<<<<<<<<<
7445  *                         v2 = v2n()
7446  *             except StopIteration:
7447  */
7448             __Pyx_INCREF(__pyx_v_p2n);
7449             __pyx_t_2 = __pyx_v_p2n; __pyx_t_3 = NULL;
7450             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7451               __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7452               if (likely(__pyx_t_3)) {
7453                 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7454                 __Pyx_INCREF(__pyx_t_3);
7455                 __Pyx_INCREF(function);
7456                 __Pyx_DECREF_SET(__pyx_t_2, function);
7457               }
7458             }
7459             __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
7460             __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7461             if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L7_error)
7462             __Pyx_GOTREF(__pyx_t_8);
7463             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7464             __pyx_t_18 = __Pyx_PyInt_As_npy_int32(__pyx_t_8); if (unlikely((__pyx_t_18 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L7_error)
7465             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7466             __pyx_v_p2 = __pyx_t_18;
7467 
7468             /* "MACS2/IO/ScoreTrack.pyx":327
7469  *                         v21 = v21n()
7470  *                         p2 = p2n()
7471  *                         v2 = v2n()             # <<<<<<<<<<<<<<
7472  *             except StopIteration:
7473  *                 # meet the end of either bedGraphTrackI, simply exit
7474  */
7475             __Pyx_INCREF(__pyx_v_v2n);
7476             __pyx_t_2 = __pyx_v_v2n; __pyx_t_3 = NULL;
7477             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7478               __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7479               if (likely(__pyx_t_3)) {
7480                 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7481                 __Pyx_INCREF(__pyx_t_3);
7482                 __Pyx_INCREF(function);
7483                 __Pyx_DECREF_SET(__pyx_t_2, function);
7484               }
7485             }
7486             __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
7487             __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7488             if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __pyx_L7_error)
7489             __Pyx_GOTREF(__pyx_t_8);
7490             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7491             __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L7_error)
7492             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7493             __pyx_v_v2 = __pyx_t_19;
7494 
7495             /* "MACS2/IO/ScoreTrack.pyx":314
7496  *                         p2 = p2n()
7497  *                         v2 = v2n()
7498  *                     elif p1 == p2:             # <<<<<<<<<<<<<<
7499  *                         # from pre_p to p1 or p2, then set pre_p as p1 or p2.
7500  *                         if v2>0:
7501  */
7502           }
7503           __pyx_L17:;
7504         }
7505 
7506         /* "MACS2/IO/ScoreTrack.pyx":282
7507  *             pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret
7508  *
7509  *             try:             # <<<<<<<<<<<<<<
7510  *                 p1 = p1n()
7511  *                 v11 = v11n()
7512  */
7513       }
7514       __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
7515       __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
7516       __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
7517       goto __pyx_L14_try_end;
7518       __pyx_L7_error:;
7519       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7520       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
7521       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7522       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7523       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7524       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7525       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7526       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7527 
7528       /* "MACS2/IO/ScoreTrack.pyx":328
7529  *                         p2 = p2n()
7530  *                         v2 = v2n()
7531  *             except StopIteration:             # <<<<<<<<<<<<<<
7532  *                 # meet the end of either bedGraphTrackI, simply exit
7533  *                 pass
7534  */
7535       __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
7536       if (__pyx_t_13) {
7537         __Pyx_ErrRestore(0,0,0);
7538         goto __pyx_L8_exception_handled;
7539       }
7540       goto __pyx_L9_except_error;
7541       __pyx_L9_except_error:;
7542 
7543       /* "MACS2/IO/ScoreTrack.pyx":282
7544  *             pre_p = 0                   # remember the previous position in the new bedGraphTrackI object ret
7545  *
7546  *             try:             # <<<<<<<<<<<<<<
7547  *                 p1 = p1n()
7548  *                 v11 = v11n()
7549  */
7550       __Pyx_XGIVEREF(__pyx_t_15);
7551       __Pyx_XGIVEREF(__pyx_t_16);
7552       __Pyx_XGIVEREF(__pyx_t_17);
7553       __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
7554       goto __pyx_L1_error;
7555       __pyx_L8_exception_handled:;
7556       __Pyx_XGIVEREF(__pyx_t_15);
7557       __Pyx_XGIVEREF(__pyx_t_16);
7558       __Pyx_XGIVEREF(__pyx_t_17);
7559       __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
7560       __pyx_L14_try_end:;
7561     }
7562   }
7563   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7564 
7565   /* "MACS2/IO/ScoreTrack.pyx":335
7566  *         #ret = np.array([ret[0],ret[1],ret[2]]).transpose()
7567  *         #ret = ret[ret[0,0,:].argsort()]
7568  *         return ret             # <<<<<<<<<<<<<<
7569  *
7570  *     def extract_average (self, bdgTrack2):
7571  */
7572   __Pyx_XDECREF(__pyx_r);
7573   __Pyx_INCREF(__pyx_v_ret);
7574   __pyx_r = __pyx_v_ret;
7575   goto __pyx_L0;
7576 
7577   /* "MACS2/IO/ScoreTrack.pyx":246
7578  *         return t
7579  *
7580  *     def extract_value ( self, bdgTrack2 ):             # <<<<<<<<<<<<<<
7581  *         """It's like overlie function. THe overlapped regions between
7582  *         bdgTrack2 and self, will be recorded. The values from self in
7583  */
7584 
7585   /* function exit code */
7586   __pyx_L1_error:;
7587   __Pyx_XDECREF(__pyx_t_1);
7588   __Pyx_XDECREF(__pyx_t_2);
7589   __Pyx_XDECREF(__pyx_t_3);
7590   __Pyx_XDECREF(__pyx_t_4);
7591   __Pyx_XDECREF(__pyx_t_5);
7592   __Pyx_XDECREF(__pyx_t_6);
7593   __Pyx_XDECREF(__pyx_t_8);
7594   __Pyx_XDECREF(__pyx_t_9);
7595   __Pyx_XDECREF(__pyx_t_10);
7596   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.extract_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
7597   __pyx_r = NULL;
7598   __pyx_L0:;
7599   __Pyx_XDECREF(__pyx_v_chr1);
7600   __Pyx_XDECREF(__pyx_v_chr2);
7601   __Pyx_XDECREF(__pyx_v_common_chr);
7602   __Pyx_XDECREF(__pyx_v_chrom);
7603   __Pyx_XDECREF(__pyx_v_ret);
7604   __Pyx_XDECREF(__pyx_v_radd);
7605   __Pyx_XDECREF(__pyx_v_v1add);
7606   __Pyx_XDECREF(__pyx_v_v2add);
7607   __Pyx_XDECREF(__pyx_v_ladd);
7608   __Pyx_XDECREF(__pyx_v_chrom_data);
7609   __Pyx_XDECREF(__pyx_v_p1n);
7610   __Pyx_XDECREF(__pyx_v_v11n);
7611   __Pyx_XDECREF(__pyx_v_v21n);
7612   __Pyx_XDECREF(__pyx_v_p2s);
7613   __Pyx_XDECREF(__pyx_v_v2s);
7614   __Pyx_XDECREF(__pyx_v_p2n);
7615   __Pyx_XDECREF(__pyx_v_v2n);
7616   __Pyx_XGIVEREF(__pyx_r);
7617   __Pyx_TraceReturn(__pyx_r, 0);
7618   __Pyx_RefNannyFinishContext();
7619   return __pyx_r;
7620 }
7621 
7622 /* "MACS2/IO/ScoreTrack.pyx":337
7623  *         return ret
7624  *
7625  *     def extract_average (self, bdgTrack2):             # <<<<<<<<<<<<<<
7626  *         cdef:
7627  *             int32_t i, l
7628  */
7629 
7630 /* Python wrapper */
7631 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_19extract_average(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7632 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_19extract_average = {"extract_average", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_19extract_average, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_19extract_average(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7633 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_19extract_average(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7634   PyObject *__pyx_v_self = 0;
7635   PyObject *__pyx_v_bdgTrack2 = 0;
7636   PyObject *__pyx_r = 0;
7637   __Pyx_RefNannyDeclarations
7638   __Pyx_RefNannySetupContext("extract_average (wrapper)", 0);
7639   {
7640     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_bdgTrack2,0};
7641     PyObject* values[2] = {0,0};
7642     if (unlikely(__pyx_kwds)) {
7643       Py_ssize_t kw_args;
7644       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7645       switch (pos_args) {
7646         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7647         CYTHON_FALLTHROUGH;
7648         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7649         CYTHON_FALLTHROUGH;
7650         case  0: break;
7651         default: goto __pyx_L5_argtuple_error;
7652       }
7653       kw_args = PyDict_Size(__pyx_kwds);
7654       switch (pos_args) {
7655         case  0:
7656         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
7657         else goto __pyx_L5_argtuple_error;
7658         CYTHON_FALLTHROUGH;
7659         case  1:
7660         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bdgTrack2)) != 0)) kw_args--;
7661         else {
7662           __Pyx_RaiseArgtupleInvalid("extract_average", 1, 2, 2, 1); __PYX_ERR(0, 337, __pyx_L3_error)
7663         }
7664       }
7665       if (unlikely(kw_args > 0)) {
7666         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract_average") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
7667       }
7668     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
7669       goto __pyx_L5_argtuple_error;
7670     } else {
7671       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7672       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7673     }
7674     __pyx_v_self = values[0];
7675     __pyx_v_bdgTrack2 = values[1];
7676   }
7677   goto __pyx_L4_argument_unpacking_done;
7678   __pyx_L5_argtuple_error:;
7679   __Pyx_RaiseArgtupleInvalid("extract_average", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error)
7680   __pyx_L3_error:;
7681   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.extract_average", __pyx_clineno, __pyx_lineno, __pyx_filename);
7682   __Pyx_RefNannyFinishContext();
7683   return NULL;
7684   __pyx_L4_argument_unpacking_done:;
7685   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_18extract_average(__pyx_self, __pyx_v_self, __pyx_v_bdgTrack2);
7686 
7687   /* function exit code */
7688   __Pyx_RefNannyFinishContext();
7689   return __pyx_r;
7690 }
7691 
__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_18extract_average(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_bdgTrack2)7692 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_18extract_average(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2) {
7693   __pyx_t_5numpy_int32_t __pyx_v_i;
7694   __pyx_t_5numpy_int32_t __pyx_v_l;
7695   PyObject *__pyx_v_chrom = 0;
7696   PyObject *__pyx_v_start = 0;
7697   PyObject *__pyx_v_end = 0;
7698   PyObject *__pyx_v_rarray = NULL;
7699   PyObject *__pyx_v_v1array = NULL;
7700   PyObject *__pyx_v_v2array = NULL;
7701   PyObject *__pyx_v_larray = NULL;
7702   PyObject *__pyx_v_ret = NULL;
7703   PyObject *__pyx_v_radd = NULL;
7704   PyObject *__pyx_v_v1add = NULL;
7705   PyObject *__pyx_v_v2add = NULL;
7706   PyObject *__pyx_v_cur_region = NULL;
7707   PyObject *__pyx_r = NULL;
7708   __Pyx_TraceDeclarations
7709   __Pyx_RefNannyDeclarations
7710   PyObject *__pyx_t_1 = NULL;
7711   PyObject *__pyx_t_2 = NULL;
7712   PyObject *__pyx_t_3 = NULL;
7713   PyObject *__pyx_t_4 = NULL;
7714   PyObject *__pyx_t_5 = NULL;
7715   PyObject *__pyx_t_6 = NULL;
7716   PyObject *(*__pyx_t_7)(PyObject *);
7717   int __pyx_t_8;
7718   PyObject *__pyx_t_9 = NULL;
7719   PyObject *__pyx_t_10 = NULL;
7720   Py_ssize_t __pyx_t_11;
7721   Py_ssize_t __pyx_t_12;
7722   __pyx_t_5numpy_int32_t __pyx_t_13;
7723   int __pyx_t_14;
7724   int __pyx_t_15;
7725   Py_ssize_t __pyx_t_16;
7726   __pyx_t_5numpy_int32_t __pyx_t_17;
7727   __Pyx_TraceFrameInit(__pyx_codeobj__15)
7728   __Pyx_RefNannySetupContext("extract_average", 0);
7729   __Pyx_TraceCall("extract_average", __pyx_f[0], 337, 0, __PYX_ERR(0, 337, __pyx_L1_error));
7730 
7731   /* "MACS2/IO/ScoreTrack.pyx":342
7732  *             bytes chrom, start, end
7733  *
7734  *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)             # <<<<<<<<<<<<<<
7735  *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
7736  *         radd = ret[0].append
7737  */
7738   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extract_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
7739   __Pyx_GOTREF(__pyx_t_2);
7740   __pyx_t_3 = NULL;
7741   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7742     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7743     if (likely(__pyx_t_3)) {
7744       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7745       __Pyx_INCREF(__pyx_t_3);
7746       __Pyx_INCREF(function);
7747       __Pyx_DECREF_SET(__pyx_t_2, function);
7748     }
7749   }
7750   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_bdgTrack2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_bdgTrack2);
7751   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7752   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
7753   __Pyx_GOTREF(__pyx_t_1);
7754   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7755   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
7756     PyObject* sequence = __pyx_t_1;
7757     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7758     if (unlikely(size != 4)) {
7759       if (size > 4) __Pyx_RaiseTooManyValuesError(4);
7760       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7761       __PYX_ERR(0, 342, __pyx_L1_error)
7762     }
7763     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7764     if (likely(PyTuple_CheckExact(sequence))) {
7765       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
7766       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
7767       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
7768       __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
7769     } else {
7770       __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
7771       __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
7772       __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
7773       __pyx_t_5 = PyList_GET_ITEM(sequence, 3);
7774     }
7775     __Pyx_INCREF(__pyx_t_2);
7776     __Pyx_INCREF(__pyx_t_3);
7777     __Pyx_INCREF(__pyx_t_4);
7778     __Pyx_INCREF(__pyx_t_5);
7779     #else
7780     {
7781       Py_ssize_t i;
7782       PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
7783       for (i=0; i < 4; i++) {
7784         PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 342, __pyx_L1_error)
7785         __Pyx_GOTREF(item);
7786         *(temps[i]) = item;
7787       }
7788     }
7789     #endif
7790     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7791   } else {
7792     Py_ssize_t index = -1;
7793     PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
7794     __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
7795     __Pyx_GOTREF(__pyx_t_6);
7796     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7797     __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
7798     for (index=0; index < 4; index++) {
7799       PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
7800       __Pyx_GOTREF(item);
7801       *(temps[index]) = item;
7802     }
7803     if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) __PYX_ERR(0, 342, __pyx_L1_error)
7804     __pyx_t_7 = NULL;
7805     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7806     goto __pyx_L4_unpacking_done;
7807     __pyx_L3_unpacking_failed:;
7808     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7809     __pyx_t_7 = NULL;
7810     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7811     __PYX_ERR(0, 342, __pyx_L1_error)
7812     __pyx_L4_unpacking_done:;
7813   }
7814   __pyx_v_rarray = __pyx_t_2;
7815   __pyx_t_2 = 0;
7816   __pyx_v_v1array = __pyx_t_3;
7817   __pyx_t_3 = 0;
7818   __pyx_v_v2array = __pyx_t_4;
7819   __pyx_t_4 = 0;
7820   __pyx_v_larray = __pyx_t_5;
7821   __pyx_t_5 = 0;
7822 
7823   /* "MACS2/IO/ScoreTrack.pyx":343
7824  *
7825  *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)
7826  *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1             # <<<<<<<<<<<<<<
7827  *         radd = ret[0].append
7828  *         v1add = ret[1].append
7829  */
7830   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
7831   __Pyx_GOTREF(__pyx_t_1);
7832   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
7833   __Pyx_GOTREF(__pyx_t_4);
7834   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FBYTE4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
7835   __Pyx_GOTREF(__pyx_t_3);
7836   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
7837   __Pyx_GOTREF(__pyx_t_2);
7838   __pyx_t_6 = NULL;
7839   __pyx_t_8 = 0;
7840   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7841     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
7842     if (likely(__pyx_t_6)) {
7843       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7844       __Pyx_INCREF(__pyx_t_6);
7845       __Pyx_INCREF(function);
7846       __Pyx_DECREF_SET(__pyx_t_4, function);
7847       __pyx_t_8 = 1;
7848     }
7849   }
7850   #if CYTHON_FAST_PYCALL
7851   if (PyFunction_Check(__pyx_t_4)) {
7852     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_2};
7853     __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error)
7854     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7855     __Pyx_GOTREF(__pyx_t_5);
7856     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7857     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7858   } else
7859   #endif
7860   #if CYTHON_FAST_PYCCALL
7861   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
7862     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_2};
7863     __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error)
7864     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7865     __Pyx_GOTREF(__pyx_t_5);
7866     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7867     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7868   } else
7869   #endif
7870   {
7871     __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L1_error)
7872     __Pyx_GOTREF(__pyx_t_9);
7873     if (__pyx_t_6) {
7874       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
7875     }
7876     __Pyx_GIVEREF(__pyx_t_3);
7877     PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
7878     __Pyx_GIVEREF(__pyx_t_2);
7879     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_2);
7880     __pyx_t_3 = 0;
7881     __pyx_t_2 = 0;
7882     __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error)
7883     __Pyx_GOTREF(__pyx_t_5);
7884     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7885   }
7886   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7887   __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L1_error)
7888   __Pyx_GOTREF(__pyx_t_9);
7889   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FBYTE4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
7890   __Pyx_GOTREF(__pyx_t_2);
7891   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
7892   __Pyx_GOTREF(__pyx_t_3);
7893   __pyx_t_6 = NULL;
7894   __pyx_t_8 = 0;
7895   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
7896     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
7897     if (likely(__pyx_t_6)) {
7898       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
7899       __Pyx_INCREF(__pyx_t_6);
7900       __Pyx_INCREF(function);
7901       __Pyx_DECREF_SET(__pyx_t_9, function);
7902       __pyx_t_8 = 1;
7903     }
7904   }
7905   #if CYTHON_FAST_PYCALL
7906   if (PyFunction_Check(__pyx_t_9)) {
7907     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_t_3};
7908     __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
7909     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7910     __Pyx_GOTREF(__pyx_t_4);
7911     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7912     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7913   } else
7914   #endif
7915   #if CYTHON_FAST_PYCCALL
7916   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
7917     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_t_3};
7918     __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
7919     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7920     __Pyx_GOTREF(__pyx_t_4);
7921     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7922     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7923   } else
7924   #endif
7925   {
7926     __pyx_t_10 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 343, __pyx_L1_error)
7927     __Pyx_GOTREF(__pyx_t_10);
7928     if (__pyx_t_6) {
7929       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
7930     }
7931     __Pyx_GIVEREF(__pyx_t_2);
7932     PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_8, __pyx_t_2);
7933     __Pyx_GIVEREF(__pyx_t_3);
7934     PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, __pyx_t_3);
7935     __pyx_t_2 = 0;
7936     __pyx_t_3 = 0;
7937     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
7938     __Pyx_GOTREF(__pyx_t_4);
7939     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7940   }
7941   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7942   __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L1_error)
7943   __Pyx_GOTREF(__pyx_t_9);
7944   __Pyx_GIVEREF(__pyx_t_1);
7945   PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
7946   __Pyx_GIVEREF(__pyx_t_5);
7947   PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_5);
7948   __Pyx_GIVEREF(__pyx_t_4);
7949   PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_4);
7950   __pyx_t_1 = 0;
7951   __pyx_t_5 = 0;
7952   __pyx_t_4 = 0;
7953   __pyx_v_ret = ((PyObject*)__pyx_t_9);
7954   __pyx_t_9 = 0;
7955 
7956   /* "MACS2/IO/ScoreTrack.pyx":344
7957  *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)
7958  *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
7959  *         radd = ret[0].append             # <<<<<<<<<<<<<<
7960  *         v1add = ret[1].append
7961  *         v2add = ret[2].append
7962  */
7963   __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 344, __pyx_L1_error)
7964   __Pyx_GOTREF(__pyx_t_9);
7965   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_append); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error)
7966   __Pyx_GOTREF(__pyx_t_4);
7967   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7968   __pyx_v_radd = __pyx_t_4;
7969   __pyx_t_4 = 0;
7970 
7971   /* "MACS2/IO/ScoreTrack.pyx":345
7972  *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
7973  *         radd = ret[0].append
7974  *         v1add = ret[1].append             # <<<<<<<<<<<<<<
7975  *         v2add = ret[2].append
7976  *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
7977  */
7978   __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_ret, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L1_error)
7979   __Pyx_GOTREF(__pyx_t_4);
7980   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_append); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 345, __pyx_L1_error)
7981   __Pyx_GOTREF(__pyx_t_9);
7982   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7983   __pyx_v_v1add = __pyx_t_9;
7984   __pyx_t_9 = 0;
7985 
7986   /* "MACS2/IO/ScoreTrack.pyx":346
7987  *         radd = ret[0].append
7988  *         v1add = ret[1].append
7989  *         v2add = ret[2].append             # <<<<<<<<<<<<<<
7990  *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
7991  *         for i in range(len(rarray)):
7992  */
7993   __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_ret, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 346, __pyx_L1_error)
7994   __Pyx_GOTREF(__pyx_t_9);
7995   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_append); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error)
7996   __Pyx_GOTREF(__pyx_t_4);
7997   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7998   __pyx_v_v2add = __pyx_t_4;
7999   __pyx_t_4 = 0;
8000 
8001   /* "MACS2/IO/ScoreTrack.pyx":347
8002  *         v1add = ret[1].append
8003  *         v2add = ret[2].append
8004  *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2             # <<<<<<<<<<<<<<
8005  *         for i in range(len(rarray)):
8006  *             (chrom,start,end) = rarray[i].split(b'.')
8007  */
8008   __pyx_t_4 = PyList_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error)
8009   __Pyx_GOTREF(__pyx_t_4);
8010   __Pyx_INCREF(Py_None);
8011   __Pyx_GIVEREF(Py_None);
8012   PyList_SET_ITEM(__pyx_t_4, 0, Py_None);
8013   __Pyx_INCREF(Py_None);
8014   __Pyx_GIVEREF(Py_None);
8015   PyList_SET_ITEM(__pyx_t_4, 1, Py_None);
8016   __Pyx_INCREF(Py_None);
8017   __Pyx_GIVEREF(Py_None);
8018   PyList_SET_ITEM(__pyx_t_4, 2, Py_None);
8019   __Pyx_INCREF(Py_None);
8020   __Pyx_GIVEREF(Py_None);
8021   PyList_SET_ITEM(__pyx_t_4, 3, Py_None);
8022   __Pyx_INCREF(Py_None);
8023   __Pyx_GIVEREF(Py_None);
8024   PyList_SET_ITEM(__pyx_t_4, 4, Py_None);
8025   __pyx_v_cur_region = ((PyObject*)__pyx_t_4);
8026   __pyx_t_4 = 0;
8027 
8028   /* "MACS2/IO/ScoreTrack.pyx":348
8029  *         v2add = ret[2].append
8030  *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
8031  *         for i in range(len(rarray)):             # <<<<<<<<<<<<<<
8032  *             (chrom,start,end) = rarray[i].split(b'.')
8033  *             if chrom == cur_region[0] and start == cur_region[2]:
8034  */
8035   __pyx_t_11 = PyObject_Length(__pyx_v_rarray); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 348, __pyx_L1_error)
8036   __pyx_t_12 = __pyx_t_11;
8037   for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
8038     __pyx_v_i = __pyx_t_13;
8039 
8040     /* "MACS2/IO/ScoreTrack.pyx":349
8041  *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
8042  *         for i in range(len(rarray)):
8043  *             (chrom,start,end) = rarray[i].split(b'.')             # <<<<<<<<<<<<<<
8044  *             if chrom == cur_region[0] and start == cur_region[2]:
8045  *                 cur_region[2] =  end
8046  */
8047     __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_rarray, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 349, __pyx_L1_error)
8048     __Pyx_GOTREF(__pyx_t_9);
8049     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error)
8050     __Pyx_GOTREF(__pyx_t_5);
8051     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8052     __pyx_t_9 = NULL;
8053     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8054       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
8055       if (likely(__pyx_t_9)) {
8056         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8057         __Pyx_INCREF(__pyx_t_9);
8058         __Pyx_INCREF(function);
8059         __Pyx_DECREF_SET(__pyx_t_5, function);
8060       }
8061     }
8062     __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_kp_b__16) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_b__16);
8063     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8064     if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 349, __pyx_L1_error)
8065     __Pyx_GOTREF(__pyx_t_4);
8066     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8067     if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
8068       PyObject* sequence = __pyx_t_4;
8069       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8070       if (unlikely(size != 3)) {
8071         if (size > 3) __Pyx_RaiseTooManyValuesError(3);
8072         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8073         __PYX_ERR(0, 349, __pyx_L1_error)
8074       }
8075       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8076       if (likely(PyTuple_CheckExact(sequence))) {
8077         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
8078         __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
8079         __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
8080       } else {
8081         __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
8082         __pyx_t_9 = PyList_GET_ITEM(sequence, 1);
8083         __pyx_t_1 = PyList_GET_ITEM(sequence, 2);
8084       }
8085       __Pyx_INCREF(__pyx_t_5);
8086       __Pyx_INCREF(__pyx_t_9);
8087       __Pyx_INCREF(__pyx_t_1);
8088       #else
8089       __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error)
8090       __Pyx_GOTREF(__pyx_t_5);
8091       __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 349, __pyx_L1_error)
8092       __Pyx_GOTREF(__pyx_t_9);
8093       __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
8094       __Pyx_GOTREF(__pyx_t_1);
8095       #endif
8096       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8097     } else {
8098       Py_ssize_t index = -1;
8099       __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 349, __pyx_L1_error)
8100       __Pyx_GOTREF(__pyx_t_10);
8101       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8102       __pyx_t_7 = Py_TYPE(__pyx_t_10)->tp_iternext;
8103       index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
8104       __Pyx_GOTREF(__pyx_t_5);
8105       index = 1; __pyx_t_9 = __pyx_t_7(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed;
8106       __Pyx_GOTREF(__pyx_t_9);
8107       index = 2; __pyx_t_1 = __pyx_t_7(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
8108       __Pyx_GOTREF(__pyx_t_1);
8109       if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_10), 3) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
8110       __pyx_t_7 = NULL;
8111       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8112       goto __pyx_L8_unpacking_done;
8113       __pyx_L7_unpacking_failed:;
8114       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8115       __pyx_t_7 = NULL;
8116       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
8117       __PYX_ERR(0, 349, __pyx_L1_error)
8118       __pyx_L8_unpacking_done:;
8119     }
8120     if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 349, __pyx_L1_error)
8121     if (!(likely(PyBytes_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_9)->tp_name), 0))) __PYX_ERR(0, 349, __pyx_L1_error)
8122     if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 349, __pyx_L1_error)
8123     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_5));
8124     __pyx_t_5 = 0;
8125     __Pyx_XDECREF_SET(__pyx_v_start, ((PyObject*)__pyx_t_9));
8126     __pyx_t_9 = 0;
8127     __Pyx_XDECREF_SET(__pyx_v_end, ((PyObject*)__pyx_t_1));
8128     __pyx_t_1 = 0;
8129 
8130     /* "MACS2/IO/ScoreTrack.pyx":350
8131  *         for i in range(len(rarray)):
8132  *             (chrom,start,end) = rarray[i].split(b'.')
8133  *             if chrom == cur_region[0] and start == cur_region[2]:             # <<<<<<<<<<<<<<
8134  *                 cur_region[2] =  end
8135  *                 cur_region[3] += v1array[i]*larray[i]
8136  */
8137     __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
8138     __Pyx_GOTREF(__pyx_t_4);
8139     __pyx_t_15 = (__Pyx_PyBytes_Equals(__pyx_v_chrom, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 350, __pyx_L1_error)
8140     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8141     if (__pyx_t_15) {
8142     } else {
8143       __pyx_t_14 = __pyx_t_15;
8144       goto __pyx_L10_bool_binop_done;
8145     }
8146     __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
8147     __Pyx_GOTREF(__pyx_t_4);
8148     __pyx_t_15 = (__Pyx_PyBytes_Equals(__pyx_v_start, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 350, __pyx_L1_error)
8149     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8150     __pyx_t_14 = __pyx_t_15;
8151     __pyx_L10_bool_binop_done:;
8152     if (__pyx_t_14) {
8153 
8154       /* "MACS2/IO/ScoreTrack.pyx":351
8155  *             (chrom,start,end) = rarray[i].split(b'.')
8156  *             if chrom == cur_region[0] and start == cur_region[2]:
8157  *                 cur_region[2] =  end             # <<<<<<<<<<<<<<
8158  *                 cur_region[3] += v1array[i]*larray[i]
8159  *                 cur_region[4] += v2array[i]*larray[i]
8160  */
8161       if (unlikely(__Pyx_SetItemInt(__pyx_v_cur_region, 2, __pyx_v_end, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
8162 
8163       /* "MACS2/IO/ScoreTrack.pyx":352
8164  *             if chrom == cur_region[0] and start == cur_region[2]:
8165  *                 cur_region[2] =  end
8166  *                 cur_region[3] += v1array[i]*larray[i]             # <<<<<<<<<<<<<<
8167  *                 cur_region[4] += v2array[i]*larray[i]
8168  *             else:
8169  */
8170       __pyx_t_16 = 3;
8171       __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_cur_region, __pyx_t_16, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error)
8172       __Pyx_GOTREF(__pyx_t_4);
8173       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_v1array, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
8174       __Pyx_GOTREF(__pyx_t_1);
8175       __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 352, __pyx_L1_error)
8176       __Pyx_GOTREF(__pyx_t_9);
8177       __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error)
8178       __Pyx_GOTREF(__pyx_t_5);
8179       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8180       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8181       __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 352, __pyx_L1_error)
8182       __Pyx_GOTREF(__pyx_t_9);
8183       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8184       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8185       if (unlikely(__Pyx_SetItemInt(__pyx_v_cur_region, __pyx_t_16, __pyx_t_9, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) __PYX_ERR(0, 352, __pyx_L1_error)
8186       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8187 
8188       /* "MACS2/IO/ScoreTrack.pyx":353
8189  *                 cur_region[2] =  end
8190  *                 cur_region[3] += v1array[i]*larray[i]
8191  *                 cur_region[4] += v2array[i]*larray[i]             # <<<<<<<<<<<<<<
8192  *             else:
8193  *                 if cur_region[0]:
8194  */
8195       __pyx_t_16 = 4;
8196       __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_cur_region, __pyx_t_16, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 353, __pyx_L1_error)
8197       __Pyx_GOTREF(__pyx_t_9);
8198       __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_v2array, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 353, __pyx_L1_error)
8199       __Pyx_GOTREF(__pyx_t_5);
8200       __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error)
8201       __Pyx_GOTREF(__pyx_t_4);
8202       __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
8203       __Pyx_GOTREF(__pyx_t_1);
8204       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8205       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8206       __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error)
8207       __Pyx_GOTREF(__pyx_t_4);
8208       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8209       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8210       if (unlikely(__Pyx_SetItemInt(__pyx_v_cur_region, __pyx_t_16, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) __PYX_ERR(0, 353, __pyx_L1_error)
8211       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8212 
8213       /* "MACS2/IO/ScoreTrack.pyx":350
8214  *         for i in range(len(rarray)):
8215  *             (chrom,start,end) = rarray[i].split(b'.')
8216  *             if chrom == cur_region[0] and start == cur_region[2]:             # <<<<<<<<<<<<<<
8217  *                 cur_region[2] =  end
8218  *                 cur_region[3] += v1array[i]*larray[i]
8219  */
8220       goto __pyx_L9;
8221     }
8222 
8223     /* "MACS2/IO/ScoreTrack.pyx":355
8224  *                 cur_region[4] += v2array[i]*larray[i]
8225  *             else:
8226  *                 if cur_region[0]:             # <<<<<<<<<<<<<<
8227  *                     l = int(cur_region[2])-int(cur_region[1])
8228  *                     radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
8229  */
8230     /*else*/ {
8231       __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
8232       __Pyx_GOTREF(__pyx_t_4);
8233       __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 355, __pyx_L1_error)
8234       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8235       if (__pyx_t_14) {
8236 
8237         /* "MACS2/IO/ScoreTrack.pyx":356
8238  *             else:
8239  *                 if cur_region[0]:
8240  *                     l = int(cur_region[2])-int(cur_region[1])             # <<<<<<<<<<<<<<
8241  *                     radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
8242  *                     v1add(cur_region[3]/<float32_t>(l))
8243  */
8244         __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error)
8245         __Pyx_GOTREF(__pyx_t_4);
8246         __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
8247         __Pyx_GOTREF(__pyx_t_1);
8248         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8249         __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error)
8250         __Pyx_GOTREF(__pyx_t_4);
8251         __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 356, __pyx_L1_error)
8252         __Pyx_GOTREF(__pyx_t_9);
8253         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8254         __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error)
8255         __Pyx_GOTREF(__pyx_t_4);
8256         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8257         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8258         __pyx_t_17 = __Pyx_PyInt_As_npy_int32(__pyx_t_4); if (unlikely((__pyx_t_17 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L1_error)
8259         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8260         __pyx_v_l = __pyx_t_17;
8261 
8262         /* "MACS2/IO/ScoreTrack.pyx":357
8263  *                 if cur_region[0]:
8264  *                     l = int(cur_region[2])-int(cur_region[1])
8265  *                     radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))             # <<<<<<<<<<<<<<
8266  *                     v1add(cur_region[3]/<float32_t>(l))
8267  *                     v2add(cur_region[4]/<float32_t>(l))
8268  */
8269         __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 357, __pyx_L1_error)
8270         __Pyx_GOTREF(__pyx_t_9);
8271         __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error)
8272         __Pyx_GOTREF(__pyx_t_1);
8273         __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
8274         __Pyx_GOTREF(__pyx_t_5);
8275         __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 357, __pyx_L1_error)
8276         __Pyx_GOTREF(__pyx_t_10);
8277         __Pyx_GIVEREF(__pyx_t_9);
8278         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
8279         __Pyx_GIVEREF(__pyx_t_1);
8280         PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1);
8281         __Pyx_GIVEREF(__pyx_t_5);
8282         PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5);
8283         __pyx_t_9 = 0;
8284         __pyx_t_1 = 0;
8285         __pyx_t_5 = 0;
8286         __pyx_t_5 = PyNumber_Remainder(__pyx_kp_b_s_d_d, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
8287         __Pyx_GOTREF(__pyx_t_5);
8288         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8289         __Pyx_INCREF(__pyx_v_radd);
8290         __pyx_t_10 = __pyx_v_radd; __pyx_t_1 = NULL;
8291         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
8292           __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
8293           if (likely(__pyx_t_1)) {
8294             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
8295             __Pyx_INCREF(__pyx_t_1);
8296             __Pyx_INCREF(function);
8297             __Pyx_DECREF_SET(__pyx_t_10, function);
8298           }
8299         }
8300         __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5);
8301         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8302         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8303         if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error)
8304         __Pyx_GOTREF(__pyx_t_4);
8305         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8306         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8307 
8308         /* "MACS2/IO/ScoreTrack.pyx":358
8309  *                     l = int(cur_region[2])-int(cur_region[1])
8310  *                     radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
8311  *                     v1add(cur_region[3]/<float32_t>(l))             # <<<<<<<<<<<<<<
8312  *                     v2add(cur_region[4]/<float32_t>(l))
8313  *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
8314  */
8315         __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 358, __pyx_L1_error)
8316         __Pyx_GOTREF(__pyx_t_10);
8317         __pyx_t_5 = PyFloat_FromDouble(((__pyx_t_5numpy_float32_t)__pyx_v_l)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error)
8318         __Pyx_GOTREF(__pyx_t_5);
8319         __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
8320         __Pyx_GOTREF(__pyx_t_1);
8321         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8322         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8323         __Pyx_INCREF(__pyx_v_v1add);
8324         __pyx_t_5 = __pyx_v_v1add; __pyx_t_10 = NULL;
8325         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8326           __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
8327           if (likely(__pyx_t_10)) {
8328             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8329             __Pyx_INCREF(__pyx_t_10);
8330             __Pyx_INCREF(function);
8331             __Pyx_DECREF_SET(__pyx_t_5, function);
8332           }
8333         }
8334         __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_10, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
8335         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
8336         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8337         if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error)
8338         __Pyx_GOTREF(__pyx_t_4);
8339         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8340         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8341 
8342         /* "MACS2/IO/ScoreTrack.pyx":359
8343  *                     radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
8344  *                     v1add(cur_region[3]/<float32_t>(l))
8345  *                     v2add(cur_region[4]/<float32_t>(l))             # <<<<<<<<<<<<<<
8346  *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
8347  *
8348  */
8349         __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 4, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
8350         __Pyx_GOTREF(__pyx_t_5);
8351         __pyx_t_1 = PyFloat_FromDouble(((__pyx_t_5numpy_float32_t)__pyx_v_l)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
8352         __Pyx_GOTREF(__pyx_t_1);
8353         __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 359, __pyx_L1_error)
8354         __Pyx_GOTREF(__pyx_t_10);
8355         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8356         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8357         __Pyx_INCREF(__pyx_v_v2add);
8358         __pyx_t_1 = __pyx_v_v2add; __pyx_t_5 = NULL;
8359         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
8360           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
8361           if (likely(__pyx_t_5)) {
8362             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
8363             __Pyx_INCREF(__pyx_t_5);
8364             __Pyx_INCREF(function);
8365             __Pyx_DECREF_SET(__pyx_t_1, function);
8366           }
8367         }
8368         __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10);
8369         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8370         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8371         if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error)
8372         __Pyx_GOTREF(__pyx_t_4);
8373         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8374         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8375 
8376         /* "MACS2/IO/ScoreTrack.pyx":355
8377  *                 cur_region[4] += v2array[i]*larray[i]
8378  *             else:
8379  *                 if cur_region[0]:             # <<<<<<<<<<<<<<
8380  *                     l = int(cur_region[2])-int(cur_region[1])
8381  *                     radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
8382  */
8383       }
8384 
8385       /* "MACS2/IO/ScoreTrack.pyx":360
8386  *                     v1add(cur_region[3]/<float32_t>(l))
8387  *                     v2add(cur_region[4]/<float32_t>(l))
8388  *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]             # <<<<<<<<<<<<<<
8389  *
8390  *         radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
8391  */
8392       __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_v1array, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error)
8393       __Pyx_GOTREF(__pyx_t_4);
8394       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
8395       __Pyx_GOTREF(__pyx_t_1);
8396       __pyx_t_10 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 360, __pyx_L1_error)
8397       __Pyx_GOTREF(__pyx_t_10);
8398       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8399       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8400       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_v2array, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
8401       __Pyx_GOTREF(__pyx_t_1);
8402       __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error)
8403       __Pyx_GOTREF(__pyx_t_4);
8404       __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error)
8405       __Pyx_GOTREF(__pyx_t_5);
8406       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8407       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8408       __pyx_t_4 = PyList_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error)
8409       __Pyx_GOTREF(__pyx_t_4);
8410       __Pyx_INCREF(__pyx_v_chrom);
8411       __Pyx_GIVEREF(__pyx_v_chrom);
8412       PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_chrom);
8413       __Pyx_INCREF(__pyx_v_start);
8414       __Pyx_GIVEREF(__pyx_v_start);
8415       PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_start);
8416       __Pyx_INCREF(__pyx_v_end);
8417       __Pyx_GIVEREF(__pyx_v_end);
8418       PyList_SET_ITEM(__pyx_t_4, 2, __pyx_v_end);
8419       __Pyx_GIVEREF(__pyx_t_10);
8420       PyList_SET_ITEM(__pyx_t_4, 3, __pyx_t_10);
8421       __Pyx_GIVEREF(__pyx_t_5);
8422       PyList_SET_ITEM(__pyx_t_4, 4, __pyx_t_5);
8423       __pyx_t_10 = 0;
8424       __pyx_t_5 = 0;
8425       __Pyx_DECREF_SET(__pyx_v_cur_region, ((PyObject*)__pyx_t_4));
8426       __pyx_t_4 = 0;
8427     }
8428     __pyx_L9:;
8429   }
8430 
8431   /* "MACS2/IO/ScoreTrack.pyx":362
8432  *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
8433  *
8434  *         radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))             # <<<<<<<<<<<<<<
8435  *         v1add(cur_region[3]/<float32_t>(l))
8436  *         v2add(cur_region[4]/<float32_t>(l))
8437  */
8438   __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L1_error)
8439   __Pyx_GOTREF(__pyx_t_5);
8440   __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 362, __pyx_L1_error)
8441   __Pyx_GOTREF(__pyx_t_10);
8442   __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
8443   __Pyx_GOTREF(__pyx_t_1);
8444   __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 362, __pyx_L1_error)
8445   __Pyx_GOTREF(__pyx_t_9);
8446   __Pyx_GIVEREF(__pyx_t_5);
8447   PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
8448   __Pyx_GIVEREF(__pyx_t_10);
8449   PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
8450   __Pyx_GIVEREF(__pyx_t_1);
8451   PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1);
8452   __pyx_t_5 = 0;
8453   __pyx_t_10 = 0;
8454   __pyx_t_1 = 0;
8455   __pyx_t_1 = PyNumber_Remainder(__pyx_kp_b_s_d_d, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
8456   __Pyx_GOTREF(__pyx_t_1);
8457   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8458   __Pyx_INCREF(__pyx_v_radd);
8459   __pyx_t_9 = __pyx_v_radd; __pyx_t_10 = NULL;
8460   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
8461     __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
8462     if (likely(__pyx_t_10)) {
8463       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
8464       __Pyx_INCREF(__pyx_t_10);
8465       __Pyx_INCREF(function);
8466       __Pyx_DECREF_SET(__pyx_t_9, function);
8467     }
8468   }
8469   __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_1);
8470   __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
8471   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8472   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L1_error)
8473   __Pyx_GOTREF(__pyx_t_4);
8474   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8475   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8476 
8477   /* "MACS2/IO/ScoreTrack.pyx":363
8478  *
8479  *         radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
8480  *         v1add(cur_region[3]/<float32_t>(l))             # <<<<<<<<<<<<<<
8481  *         v2add(cur_region[4]/<float32_t>(l))
8482  *         return ret
8483  */
8484   __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 363, __pyx_L1_error)
8485   __Pyx_GOTREF(__pyx_t_9);
8486   __pyx_t_1 = PyFloat_FromDouble(((__pyx_t_5numpy_float32_t)__pyx_v_l)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
8487   __Pyx_GOTREF(__pyx_t_1);
8488   __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 363, __pyx_L1_error)
8489   __Pyx_GOTREF(__pyx_t_10);
8490   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8491   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8492   __Pyx_INCREF(__pyx_v_v1add);
8493   __pyx_t_1 = __pyx_v_v1add; __pyx_t_9 = NULL;
8494   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
8495     __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
8496     if (likely(__pyx_t_9)) {
8497       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
8498       __Pyx_INCREF(__pyx_t_9);
8499       __Pyx_INCREF(function);
8500       __Pyx_DECREF_SET(__pyx_t_1, function);
8501     }
8502   }
8503   __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10);
8504   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8505   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8506   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error)
8507   __Pyx_GOTREF(__pyx_t_4);
8508   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8509   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8510 
8511   /* "MACS2/IO/ScoreTrack.pyx":364
8512  *         radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
8513  *         v1add(cur_region[3]/<float32_t>(l))
8514  *         v2add(cur_region[4]/<float32_t>(l))             # <<<<<<<<<<<<<<
8515  *         return ret
8516  *
8517  */
8518   __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 4, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
8519   __Pyx_GOTREF(__pyx_t_1);
8520   __pyx_t_10 = PyFloat_FromDouble(((__pyx_t_5numpy_float32_t)__pyx_v_l)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 364, __pyx_L1_error)
8521   __Pyx_GOTREF(__pyx_t_10);
8522   __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 364, __pyx_L1_error)
8523   __Pyx_GOTREF(__pyx_t_9);
8524   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8525   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8526   __Pyx_INCREF(__pyx_v_v2add);
8527   __pyx_t_10 = __pyx_v_v2add; __pyx_t_1 = NULL;
8528   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
8529     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
8530     if (likely(__pyx_t_1)) {
8531       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
8532       __Pyx_INCREF(__pyx_t_1);
8533       __Pyx_INCREF(function);
8534       __Pyx_DECREF_SET(__pyx_t_10, function);
8535     }
8536   }
8537   __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
8538   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8539   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8540   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error)
8541   __Pyx_GOTREF(__pyx_t_4);
8542   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8543   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8544 
8545   /* "MACS2/IO/ScoreTrack.pyx":365
8546  *         v1add(cur_region[3]/<float32_t>(l))
8547  *         v2add(cur_region[4]/<float32_t>(l))
8548  *         return ret             # <<<<<<<<<<<<<<
8549  *
8550  *     def extract_sum (self, bdgTrack2):
8551  */
8552   __Pyx_XDECREF(__pyx_r);
8553   __Pyx_INCREF(__pyx_v_ret);
8554   __pyx_r = __pyx_v_ret;
8555   goto __pyx_L0;
8556 
8557   /* "MACS2/IO/ScoreTrack.pyx":337
8558  *         return ret
8559  *
8560  *     def extract_average (self, bdgTrack2):             # <<<<<<<<<<<<<<
8561  *         cdef:
8562  *             int32_t i, l
8563  */
8564 
8565   /* function exit code */
8566   __pyx_L1_error:;
8567   __Pyx_XDECREF(__pyx_t_1);
8568   __Pyx_XDECREF(__pyx_t_2);
8569   __Pyx_XDECREF(__pyx_t_3);
8570   __Pyx_XDECREF(__pyx_t_4);
8571   __Pyx_XDECREF(__pyx_t_5);
8572   __Pyx_XDECREF(__pyx_t_6);
8573   __Pyx_XDECREF(__pyx_t_9);
8574   __Pyx_XDECREF(__pyx_t_10);
8575   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.extract_average", __pyx_clineno, __pyx_lineno, __pyx_filename);
8576   __pyx_r = NULL;
8577   __pyx_L0:;
8578   __Pyx_XDECREF(__pyx_v_chrom);
8579   __Pyx_XDECREF(__pyx_v_start);
8580   __Pyx_XDECREF(__pyx_v_end);
8581   __Pyx_XDECREF(__pyx_v_rarray);
8582   __Pyx_XDECREF(__pyx_v_v1array);
8583   __Pyx_XDECREF(__pyx_v_v2array);
8584   __Pyx_XDECREF(__pyx_v_larray);
8585   __Pyx_XDECREF(__pyx_v_ret);
8586   __Pyx_XDECREF(__pyx_v_radd);
8587   __Pyx_XDECREF(__pyx_v_v1add);
8588   __Pyx_XDECREF(__pyx_v_v2add);
8589   __Pyx_XDECREF(__pyx_v_cur_region);
8590   __Pyx_XGIVEREF(__pyx_r);
8591   __Pyx_TraceReturn(__pyx_r, 0);
8592   __Pyx_RefNannyFinishContext();
8593   return __pyx_r;
8594 }
8595 
8596 /* "MACS2/IO/ScoreTrack.pyx":367
8597  *         return ret
8598  *
8599  *     def extract_sum (self, bdgTrack2):             # <<<<<<<<<<<<<<
8600  *         """Get sum values in each region defined in bdgTrack2.
8601  *
8602  */
8603 
8604 /* Python wrapper */
8605 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_21extract_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8606 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_20extract_sum[] = "Get sum values in each region defined in bdgTrack2.\n        \n        ";
8607 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_21extract_sum = {"extract_sum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_21extract_sum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_20extract_sum};
__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_21extract_sum(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8608 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_21extract_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8609   PyObject *__pyx_v_self = 0;
8610   PyObject *__pyx_v_bdgTrack2 = 0;
8611   PyObject *__pyx_r = 0;
8612   __Pyx_RefNannyDeclarations
8613   __Pyx_RefNannySetupContext("extract_sum (wrapper)", 0);
8614   {
8615     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_bdgTrack2,0};
8616     PyObject* values[2] = {0,0};
8617     if (unlikely(__pyx_kwds)) {
8618       Py_ssize_t kw_args;
8619       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8620       switch (pos_args) {
8621         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8622         CYTHON_FALLTHROUGH;
8623         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8624         CYTHON_FALLTHROUGH;
8625         case  0: break;
8626         default: goto __pyx_L5_argtuple_error;
8627       }
8628       kw_args = PyDict_Size(__pyx_kwds);
8629       switch (pos_args) {
8630         case  0:
8631         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
8632         else goto __pyx_L5_argtuple_error;
8633         CYTHON_FALLTHROUGH;
8634         case  1:
8635         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bdgTrack2)) != 0)) kw_args--;
8636         else {
8637           __Pyx_RaiseArgtupleInvalid("extract_sum", 1, 2, 2, 1); __PYX_ERR(0, 367, __pyx_L3_error)
8638         }
8639       }
8640       if (unlikely(kw_args > 0)) {
8641         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract_sum") < 0)) __PYX_ERR(0, 367, __pyx_L3_error)
8642       }
8643     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
8644       goto __pyx_L5_argtuple_error;
8645     } else {
8646       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8647       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8648     }
8649     __pyx_v_self = values[0];
8650     __pyx_v_bdgTrack2 = values[1];
8651   }
8652   goto __pyx_L4_argument_unpacking_done;
8653   __pyx_L5_argtuple_error:;
8654   __Pyx_RaiseArgtupleInvalid("extract_sum", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 367, __pyx_L3_error)
8655   __pyx_L3_error:;
8656   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.extract_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
8657   __Pyx_RefNannyFinishContext();
8658   return NULL;
8659   __pyx_L4_argument_unpacking_done:;
8660   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_20extract_sum(__pyx_self, __pyx_v_self, __pyx_v_bdgTrack2);
8661 
8662   /* function exit code */
8663   __Pyx_RefNannyFinishContext();
8664   return __pyx_r;
8665 }
8666 
__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_20extract_sum(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_bdgTrack2)8667 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_20extract_sum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bdgTrack2) {
8668   __pyx_t_5numpy_int32_t __pyx_v_i;
8669   PyObject *__pyx_v_chrom = 0;
8670   PyObject *__pyx_v_start = 0;
8671   PyObject *__pyx_v_end = 0;
8672   PyObject *__pyx_v_rarray = NULL;
8673   PyObject *__pyx_v_v1array = NULL;
8674   PyObject *__pyx_v_v2array = NULL;
8675   PyObject *__pyx_v_larray = NULL;
8676   PyObject *__pyx_v_ret = NULL;
8677   PyObject *__pyx_v_radd = NULL;
8678   PyObject *__pyx_v_v1add = NULL;
8679   PyObject *__pyx_v_v2add = NULL;
8680   PyObject *__pyx_v_cur_region = NULL;
8681   PyObject *__pyx_r = NULL;
8682   __Pyx_TraceDeclarations
8683   __Pyx_RefNannyDeclarations
8684   PyObject *__pyx_t_1 = NULL;
8685   PyObject *__pyx_t_2 = NULL;
8686   PyObject *__pyx_t_3 = NULL;
8687   PyObject *__pyx_t_4 = NULL;
8688   PyObject *__pyx_t_5 = NULL;
8689   PyObject *__pyx_t_6 = NULL;
8690   PyObject *(*__pyx_t_7)(PyObject *);
8691   int __pyx_t_8;
8692   PyObject *__pyx_t_9 = NULL;
8693   PyObject *__pyx_t_10 = NULL;
8694   Py_ssize_t __pyx_t_11;
8695   Py_ssize_t __pyx_t_12;
8696   __pyx_t_5numpy_int32_t __pyx_t_13;
8697   int __pyx_t_14;
8698   int __pyx_t_15;
8699   Py_ssize_t __pyx_t_16;
8700   __Pyx_TraceFrameInit(__pyx_codeobj__17)
8701   __Pyx_RefNannySetupContext("extract_sum", 0);
8702   __Pyx_TraceCall("extract_sum", __pyx_f[0], 367, 0, __PYX_ERR(0, 367, __pyx_L1_error));
8703 
8704   /* "MACS2/IO/ScoreTrack.pyx":375
8705  *             bytes chrom, start, end
8706  *
8707  *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)             # <<<<<<<<<<<<<<
8708  *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
8709  *         radd = ret[0].append
8710  */
8711   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extract_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error)
8712   __Pyx_GOTREF(__pyx_t_2);
8713   __pyx_t_3 = NULL;
8714   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
8715     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
8716     if (likely(__pyx_t_3)) {
8717       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
8718       __Pyx_INCREF(__pyx_t_3);
8719       __Pyx_INCREF(function);
8720       __Pyx_DECREF_SET(__pyx_t_2, function);
8721     }
8722   }
8723   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_bdgTrack2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_bdgTrack2);
8724   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8725   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
8726   __Pyx_GOTREF(__pyx_t_1);
8727   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8728   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
8729     PyObject* sequence = __pyx_t_1;
8730     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8731     if (unlikely(size != 4)) {
8732       if (size > 4) __Pyx_RaiseTooManyValuesError(4);
8733       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8734       __PYX_ERR(0, 375, __pyx_L1_error)
8735     }
8736     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8737     if (likely(PyTuple_CheckExact(sequence))) {
8738       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
8739       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
8740       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
8741       __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
8742     } else {
8743       __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
8744       __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
8745       __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
8746       __pyx_t_5 = PyList_GET_ITEM(sequence, 3);
8747     }
8748     __Pyx_INCREF(__pyx_t_2);
8749     __Pyx_INCREF(__pyx_t_3);
8750     __Pyx_INCREF(__pyx_t_4);
8751     __Pyx_INCREF(__pyx_t_5);
8752     #else
8753     {
8754       Py_ssize_t i;
8755       PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
8756       for (i=0; i < 4; i++) {
8757         PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 375, __pyx_L1_error)
8758         __Pyx_GOTREF(item);
8759         *(temps[i]) = item;
8760       }
8761     }
8762     #endif
8763     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8764   } else {
8765     Py_ssize_t index = -1;
8766     PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
8767     __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error)
8768     __Pyx_GOTREF(__pyx_t_6);
8769     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8770     __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
8771     for (index=0; index < 4; index++) {
8772       PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
8773       __Pyx_GOTREF(item);
8774       *(temps[index]) = item;
8775     }
8776     if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) __PYX_ERR(0, 375, __pyx_L1_error)
8777     __pyx_t_7 = NULL;
8778     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8779     goto __pyx_L4_unpacking_done;
8780     __pyx_L3_unpacking_failed:;
8781     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8782     __pyx_t_7 = NULL;
8783     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
8784     __PYX_ERR(0, 375, __pyx_L1_error)
8785     __pyx_L4_unpacking_done:;
8786   }
8787   __pyx_v_rarray = __pyx_t_2;
8788   __pyx_t_2 = 0;
8789   __pyx_v_v1array = __pyx_t_3;
8790   __pyx_t_3 = 0;
8791   __pyx_v_v2array = __pyx_t_4;
8792   __pyx_t_4 = 0;
8793   __pyx_v_larray = __pyx_t_5;
8794   __pyx_t_5 = 0;
8795 
8796   /* "MACS2/IO/ScoreTrack.pyx":376
8797  *
8798  *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)
8799  *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1             # <<<<<<<<<<<<<<
8800  *         radd = ret[0].append
8801  *         v1add = ret[1].append
8802  */
8803   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
8804   __Pyx_GOTREF(__pyx_t_1);
8805   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
8806   __Pyx_GOTREF(__pyx_t_4);
8807   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FBYTE4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error)
8808   __Pyx_GOTREF(__pyx_t_3);
8809   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
8810   __Pyx_GOTREF(__pyx_t_2);
8811   __pyx_t_6 = NULL;
8812   __pyx_t_8 = 0;
8813   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8814     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
8815     if (likely(__pyx_t_6)) {
8816       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8817       __Pyx_INCREF(__pyx_t_6);
8818       __Pyx_INCREF(function);
8819       __Pyx_DECREF_SET(__pyx_t_4, function);
8820       __pyx_t_8 = 1;
8821     }
8822   }
8823   #if CYTHON_FAST_PYCALL
8824   if (PyFunction_Check(__pyx_t_4)) {
8825     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_2};
8826     __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
8827     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8828     __Pyx_GOTREF(__pyx_t_5);
8829     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8830     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8831   } else
8832   #endif
8833   #if CYTHON_FAST_PYCCALL
8834   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
8835     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_2};
8836     __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
8837     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8838     __Pyx_GOTREF(__pyx_t_5);
8839     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8840     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8841   } else
8842   #endif
8843   {
8844     __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 376, __pyx_L1_error)
8845     __Pyx_GOTREF(__pyx_t_9);
8846     if (__pyx_t_6) {
8847       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
8848     }
8849     __Pyx_GIVEREF(__pyx_t_3);
8850     PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
8851     __Pyx_GIVEREF(__pyx_t_2);
8852     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_2);
8853     __pyx_t_3 = 0;
8854     __pyx_t_2 = 0;
8855     __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
8856     __Pyx_GOTREF(__pyx_t_5);
8857     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8858   }
8859   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8860   __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 376, __pyx_L1_error)
8861   __Pyx_GOTREF(__pyx_t_9);
8862   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FBYTE4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
8863   __Pyx_GOTREF(__pyx_t_2);
8864   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error)
8865   __Pyx_GOTREF(__pyx_t_3);
8866   __pyx_t_6 = NULL;
8867   __pyx_t_8 = 0;
8868   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
8869     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
8870     if (likely(__pyx_t_6)) {
8871       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
8872       __Pyx_INCREF(__pyx_t_6);
8873       __Pyx_INCREF(function);
8874       __Pyx_DECREF_SET(__pyx_t_9, function);
8875       __pyx_t_8 = 1;
8876     }
8877   }
8878   #if CYTHON_FAST_PYCALL
8879   if (PyFunction_Check(__pyx_t_9)) {
8880     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_t_3};
8881     __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
8882     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8883     __Pyx_GOTREF(__pyx_t_4);
8884     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8885     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8886   } else
8887   #endif
8888   #if CYTHON_FAST_PYCCALL
8889   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
8890     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_t_3};
8891     __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
8892     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8893     __Pyx_GOTREF(__pyx_t_4);
8894     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8895     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8896   } else
8897   #endif
8898   {
8899     __pyx_t_10 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 376, __pyx_L1_error)
8900     __Pyx_GOTREF(__pyx_t_10);
8901     if (__pyx_t_6) {
8902       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
8903     }
8904     __Pyx_GIVEREF(__pyx_t_2);
8905     PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_8, __pyx_t_2);
8906     __Pyx_GIVEREF(__pyx_t_3);
8907     PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, __pyx_t_3);
8908     __pyx_t_2 = 0;
8909     __pyx_t_3 = 0;
8910     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
8911     __Pyx_GOTREF(__pyx_t_4);
8912     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8913   }
8914   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8915   __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 376, __pyx_L1_error)
8916   __Pyx_GOTREF(__pyx_t_9);
8917   __Pyx_GIVEREF(__pyx_t_1);
8918   PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
8919   __Pyx_GIVEREF(__pyx_t_5);
8920   PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_5);
8921   __Pyx_GIVEREF(__pyx_t_4);
8922   PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_4);
8923   __pyx_t_1 = 0;
8924   __pyx_t_5 = 0;
8925   __pyx_t_4 = 0;
8926   __pyx_v_ret = ((PyObject*)__pyx_t_9);
8927   __pyx_t_9 = 0;
8928 
8929   /* "MACS2/IO/ScoreTrack.pyx":377
8930  *         (rarray,v1array,v2array,larray)  = self.extract_value(bdgTrack2)
8931  *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
8932  *         radd = ret[0].append             # <<<<<<<<<<<<<<
8933  *         v1add = ret[1].append
8934  *         v2add = ret[2].append
8935  */
8936   __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 377, __pyx_L1_error)
8937   __Pyx_GOTREF(__pyx_t_9);
8938   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_append); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error)
8939   __Pyx_GOTREF(__pyx_t_4);
8940   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8941   __pyx_v_radd = __pyx_t_4;
8942   __pyx_t_4 = 0;
8943 
8944   /* "MACS2/IO/ScoreTrack.pyx":378
8945  *         ret = [[],array(FBYTE4,[]),array(FBYTE4,[])] # region,V1,V1
8946  *         radd = ret[0].append
8947  *         v1add = ret[1].append             # <<<<<<<<<<<<<<
8948  *         v2add = ret[2].append
8949  *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
8950  */
8951   __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_ret, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error)
8952   __Pyx_GOTREF(__pyx_t_4);
8953   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_append); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 378, __pyx_L1_error)
8954   __Pyx_GOTREF(__pyx_t_9);
8955   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8956   __pyx_v_v1add = __pyx_t_9;
8957   __pyx_t_9 = 0;
8958 
8959   /* "MACS2/IO/ScoreTrack.pyx":379
8960  *         radd = ret[0].append
8961  *         v1add = ret[1].append
8962  *         v2add = ret[2].append             # <<<<<<<<<<<<<<
8963  *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
8964  *         for i in range(len(rarray)):
8965  */
8966   __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_ret, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 379, __pyx_L1_error)
8967   __Pyx_GOTREF(__pyx_t_9);
8968   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_append); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error)
8969   __Pyx_GOTREF(__pyx_t_4);
8970   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8971   __pyx_v_v2add = __pyx_t_4;
8972   __pyx_t_4 = 0;
8973 
8974   /* "MACS2/IO/ScoreTrack.pyx":380
8975  *         v1add = ret[1].append
8976  *         v2add = ret[2].append
8977  *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2             # <<<<<<<<<<<<<<
8978  *         for i in range(len(rarray)):
8979  *             (chrom,start,end) = rarray[i].split(b'.')
8980  */
8981   __pyx_t_4 = PyList_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error)
8982   __Pyx_GOTREF(__pyx_t_4);
8983   __Pyx_INCREF(Py_None);
8984   __Pyx_GIVEREF(Py_None);
8985   PyList_SET_ITEM(__pyx_t_4, 0, Py_None);
8986   __Pyx_INCREF(Py_None);
8987   __Pyx_GIVEREF(Py_None);
8988   PyList_SET_ITEM(__pyx_t_4, 1, Py_None);
8989   __Pyx_INCREF(Py_None);
8990   __Pyx_GIVEREF(Py_None);
8991   PyList_SET_ITEM(__pyx_t_4, 2, Py_None);
8992   __Pyx_INCREF(Py_None);
8993   __Pyx_GIVEREF(Py_None);
8994   PyList_SET_ITEM(__pyx_t_4, 3, Py_None);
8995   __Pyx_INCREF(Py_None);
8996   __Pyx_GIVEREF(Py_None);
8997   PyList_SET_ITEM(__pyx_t_4, 4, Py_None);
8998   __pyx_v_cur_region = ((PyObject*)__pyx_t_4);
8999   __pyx_t_4 = 0;
9000 
9001   /* "MACS2/IO/ScoreTrack.pyx":381
9002  *         v2add = ret[2].append
9003  *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
9004  *         for i in range(len(rarray)):             # <<<<<<<<<<<<<<
9005  *             (chrom,start,end) = rarray[i].split(b'.')
9006  *             if chrom == cur_region[0] and start == cur_region[2]:
9007  */
9008   __pyx_t_11 = PyObject_Length(__pyx_v_rarray); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 381, __pyx_L1_error)
9009   __pyx_t_12 = __pyx_t_11;
9010   for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
9011     __pyx_v_i = __pyx_t_13;
9012 
9013     /* "MACS2/IO/ScoreTrack.pyx":382
9014  *         cur_region = [None,None,None,None,None]      # chrom, start, end, s1, s2
9015  *         for i in range(len(rarray)):
9016  *             (chrom,start,end) = rarray[i].split(b'.')             # <<<<<<<<<<<<<<
9017  *             if chrom == cur_region[0] and start == cur_region[2]:
9018  *                 cur_region[2] =  end
9019  */
9020     __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_rarray, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 382, __pyx_L1_error)
9021     __Pyx_GOTREF(__pyx_t_9);
9022     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error)
9023     __Pyx_GOTREF(__pyx_t_5);
9024     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9025     __pyx_t_9 = NULL;
9026     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
9027       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
9028       if (likely(__pyx_t_9)) {
9029         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9030         __Pyx_INCREF(__pyx_t_9);
9031         __Pyx_INCREF(function);
9032         __Pyx_DECREF_SET(__pyx_t_5, function);
9033       }
9034     }
9035     __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_kp_b__16) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_b__16);
9036     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9037     if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
9038     __Pyx_GOTREF(__pyx_t_4);
9039     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9040     if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
9041       PyObject* sequence = __pyx_t_4;
9042       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9043       if (unlikely(size != 3)) {
9044         if (size > 3) __Pyx_RaiseTooManyValuesError(3);
9045         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9046         __PYX_ERR(0, 382, __pyx_L1_error)
9047       }
9048       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9049       if (likely(PyTuple_CheckExact(sequence))) {
9050         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
9051         __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
9052         __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
9053       } else {
9054         __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
9055         __pyx_t_9 = PyList_GET_ITEM(sequence, 1);
9056         __pyx_t_1 = PyList_GET_ITEM(sequence, 2);
9057       }
9058       __Pyx_INCREF(__pyx_t_5);
9059       __Pyx_INCREF(__pyx_t_9);
9060       __Pyx_INCREF(__pyx_t_1);
9061       #else
9062       __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error)
9063       __Pyx_GOTREF(__pyx_t_5);
9064       __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 382, __pyx_L1_error)
9065       __Pyx_GOTREF(__pyx_t_9);
9066       __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
9067       __Pyx_GOTREF(__pyx_t_1);
9068       #endif
9069       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9070     } else {
9071       Py_ssize_t index = -1;
9072       __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 382, __pyx_L1_error)
9073       __Pyx_GOTREF(__pyx_t_10);
9074       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9075       __pyx_t_7 = Py_TYPE(__pyx_t_10)->tp_iternext;
9076       index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
9077       __Pyx_GOTREF(__pyx_t_5);
9078       index = 1; __pyx_t_9 = __pyx_t_7(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed;
9079       __Pyx_GOTREF(__pyx_t_9);
9080       index = 2; __pyx_t_1 = __pyx_t_7(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
9081       __Pyx_GOTREF(__pyx_t_1);
9082       if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_10), 3) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
9083       __pyx_t_7 = NULL;
9084       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9085       goto __pyx_L8_unpacking_done;
9086       __pyx_L7_unpacking_failed:;
9087       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9088       __pyx_t_7 = NULL;
9089       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
9090       __PYX_ERR(0, 382, __pyx_L1_error)
9091       __pyx_L8_unpacking_done:;
9092     }
9093     if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 382, __pyx_L1_error)
9094     if (!(likely(PyBytes_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_9)->tp_name), 0))) __PYX_ERR(0, 382, __pyx_L1_error)
9095     if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 382, __pyx_L1_error)
9096     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_5));
9097     __pyx_t_5 = 0;
9098     __Pyx_XDECREF_SET(__pyx_v_start, ((PyObject*)__pyx_t_9));
9099     __pyx_t_9 = 0;
9100     __Pyx_XDECREF_SET(__pyx_v_end, ((PyObject*)__pyx_t_1));
9101     __pyx_t_1 = 0;
9102 
9103     /* "MACS2/IO/ScoreTrack.pyx":383
9104  *         for i in range(len(rarray)):
9105  *             (chrom,start,end) = rarray[i].split(b'.')
9106  *             if chrom == cur_region[0] and start == cur_region[2]:             # <<<<<<<<<<<<<<
9107  *                 cur_region[2] =  end
9108  *                 cur_region[3] += v1array[i]*larray[i]
9109  */
9110     __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error)
9111     __Pyx_GOTREF(__pyx_t_4);
9112     __pyx_t_15 = (__Pyx_PyBytes_Equals(__pyx_v_chrom, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
9113     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9114     if (__pyx_t_15) {
9115     } else {
9116       __pyx_t_14 = __pyx_t_15;
9117       goto __pyx_L10_bool_binop_done;
9118     }
9119     __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error)
9120     __Pyx_GOTREF(__pyx_t_4);
9121     __pyx_t_15 = (__Pyx_PyBytes_Equals(__pyx_v_start, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
9122     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9123     __pyx_t_14 = __pyx_t_15;
9124     __pyx_L10_bool_binop_done:;
9125     if (__pyx_t_14) {
9126 
9127       /* "MACS2/IO/ScoreTrack.pyx":384
9128  *             (chrom,start,end) = rarray[i].split(b'.')
9129  *             if chrom == cur_region[0] and start == cur_region[2]:
9130  *                 cur_region[2] =  end             # <<<<<<<<<<<<<<
9131  *                 cur_region[3] += v1array[i]*larray[i]
9132  *                 cur_region[4] += v2array[i]*larray[i]
9133  */
9134       if (unlikely(__Pyx_SetItemInt(__pyx_v_cur_region, 2, __pyx_v_end, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 384, __pyx_L1_error)
9135 
9136       /* "MACS2/IO/ScoreTrack.pyx":385
9137  *             if chrom == cur_region[0] and start == cur_region[2]:
9138  *                 cur_region[2] =  end
9139  *                 cur_region[3] += v1array[i]*larray[i]             # <<<<<<<<<<<<<<
9140  *                 cur_region[4] += v2array[i]*larray[i]
9141  *             else:
9142  */
9143       __pyx_t_16 = 3;
9144       __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_cur_region, __pyx_t_16, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error)
9145       __Pyx_GOTREF(__pyx_t_4);
9146       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_v1array, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
9147       __Pyx_GOTREF(__pyx_t_1);
9148       __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 385, __pyx_L1_error)
9149       __Pyx_GOTREF(__pyx_t_9);
9150       __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 385, __pyx_L1_error)
9151       __Pyx_GOTREF(__pyx_t_5);
9152       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9153       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9154       __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 385, __pyx_L1_error)
9155       __Pyx_GOTREF(__pyx_t_9);
9156       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9157       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9158       if (unlikely(__Pyx_SetItemInt(__pyx_v_cur_region, __pyx_t_16, __pyx_t_9, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) __PYX_ERR(0, 385, __pyx_L1_error)
9159       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9160 
9161       /* "MACS2/IO/ScoreTrack.pyx":386
9162  *                 cur_region[2] =  end
9163  *                 cur_region[3] += v1array[i]*larray[i]
9164  *                 cur_region[4] += v2array[i]*larray[i]             # <<<<<<<<<<<<<<
9165  *             else:
9166  *                 if cur_region[0]:
9167  */
9168       __pyx_t_16 = 4;
9169       __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_cur_region, __pyx_t_16, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 386, __pyx_L1_error)
9170       __Pyx_GOTREF(__pyx_t_9);
9171       __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_v2array, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
9172       __Pyx_GOTREF(__pyx_t_5);
9173       __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
9174       __Pyx_GOTREF(__pyx_t_4);
9175       __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
9176       __Pyx_GOTREF(__pyx_t_1);
9177       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9178       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9179       __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
9180       __Pyx_GOTREF(__pyx_t_4);
9181       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9182       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9183       if (unlikely(__Pyx_SetItemInt(__pyx_v_cur_region, __pyx_t_16, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
9184       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9185 
9186       /* "MACS2/IO/ScoreTrack.pyx":383
9187  *         for i in range(len(rarray)):
9188  *             (chrom,start,end) = rarray[i].split(b'.')
9189  *             if chrom == cur_region[0] and start == cur_region[2]:             # <<<<<<<<<<<<<<
9190  *                 cur_region[2] =  end
9191  *                 cur_region[3] += v1array[i]*larray[i]
9192  */
9193       goto __pyx_L9;
9194     }
9195 
9196     /* "MACS2/IO/ScoreTrack.pyx":388
9197  *                 cur_region[4] += v2array[i]*larray[i]
9198  *             else:
9199  *                 if cur_region[0]:             # <<<<<<<<<<<<<<
9200  *                     radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
9201  *                     v1add(cur_region[3])
9202  */
9203     /*else*/ {
9204       __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error)
9205       __Pyx_GOTREF(__pyx_t_4);
9206       __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 388, __pyx_L1_error)
9207       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9208       if (__pyx_t_14) {
9209 
9210         /* "MACS2/IO/ScoreTrack.pyx":389
9211  *             else:
9212  *                 if cur_region[0]:
9213  *                     radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))             # <<<<<<<<<<<<<<
9214  *                     v1add(cur_region[3])
9215  *                     v2add(cur_region[4])
9216  */
9217         __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
9218         __Pyx_GOTREF(__pyx_t_1);
9219         __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 389, __pyx_L1_error)
9220         __Pyx_GOTREF(__pyx_t_9);
9221         __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L1_error)
9222         __Pyx_GOTREF(__pyx_t_5);
9223         __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 389, __pyx_L1_error)
9224         __Pyx_GOTREF(__pyx_t_10);
9225         __Pyx_GIVEREF(__pyx_t_1);
9226         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
9227         __Pyx_GIVEREF(__pyx_t_9);
9228         PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
9229         __Pyx_GIVEREF(__pyx_t_5);
9230         PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5);
9231         __pyx_t_1 = 0;
9232         __pyx_t_9 = 0;
9233         __pyx_t_5 = 0;
9234         __pyx_t_5 = PyNumber_Remainder(__pyx_kp_b_s_d_d, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L1_error)
9235         __Pyx_GOTREF(__pyx_t_5);
9236         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9237         __Pyx_INCREF(__pyx_v_radd);
9238         __pyx_t_10 = __pyx_v_radd; __pyx_t_9 = NULL;
9239         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
9240           __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
9241           if (likely(__pyx_t_9)) {
9242             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
9243             __Pyx_INCREF(__pyx_t_9);
9244             __Pyx_INCREF(function);
9245             __Pyx_DECREF_SET(__pyx_t_10, function);
9246           }
9247         }
9248         __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5);
9249         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9250         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9251         if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error)
9252         __Pyx_GOTREF(__pyx_t_4);
9253         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9254         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9255 
9256         /* "MACS2/IO/ScoreTrack.pyx":390
9257  *                 if cur_region[0]:
9258  *                     radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
9259  *                     v1add(cur_region[3])             # <<<<<<<<<<<<<<
9260  *                     v2add(cur_region[4])
9261  *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
9262  */
9263         __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 390, __pyx_L1_error)
9264         __Pyx_GOTREF(__pyx_t_10);
9265         __Pyx_INCREF(__pyx_v_v1add);
9266         __pyx_t_5 = __pyx_v_v1add; __pyx_t_9 = NULL;
9267         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
9268           __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
9269           if (likely(__pyx_t_9)) {
9270             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9271             __Pyx_INCREF(__pyx_t_9);
9272             __Pyx_INCREF(function);
9273             __Pyx_DECREF_SET(__pyx_t_5, function);
9274           }
9275         }
9276         __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10);
9277         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9278         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9279         if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 390, __pyx_L1_error)
9280         __Pyx_GOTREF(__pyx_t_4);
9281         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9282         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9283 
9284         /* "MACS2/IO/ScoreTrack.pyx":391
9285  *                     radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
9286  *                     v1add(cur_region[3])
9287  *                     v2add(cur_region[4])             # <<<<<<<<<<<<<<
9288  *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
9289  *
9290  */
9291         __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 4, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error)
9292         __Pyx_GOTREF(__pyx_t_5);
9293         __Pyx_INCREF(__pyx_v_v2add);
9294         __pyx_t_10 = __pyx_v_v2add; __pyx_t_9 = NULL;
9295         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
9296           __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
9297           if (likely(__pyx_t_9)) {
9298             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
9299             __Pyx_INCREF(__pyx_t_9);
9300             __Pyx_INCREF(function);
9301             __Pyx_DECREF_SET(__pyx_t_10, function);
9302           }
9303         }
9304         __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5);
9305         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9306         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9307         if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error)
9308         __Pyx_GOTREF(__pyx_t_4);
9309         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9310         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9311 
9312         /* "MACS2/IO/ScoreTrack.pyx":388
9313  *                 cur_region[4] += v2array[i]*larray[i]
9314  *             else:
9315  *                 if cur_region[0]:             # <<<<<<<<<<<<<<
9316  *                     radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
9317  *                     v1add(cur_region[3])
9318  */
9319       }
9320 
9321       /* "MACS2/IO/ScoreTrack.pyx":392
9322  *                     v1add(cur_region[3])
9323  *                     v2add(cur_region[4])
9324  *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]             # <<<<<<<<<<<<<<
9325  *
9326  *         radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
9327  */
9328       __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_v1array, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error)
9329       __Pyx_GOTREF(__pyx_t_4);
9330       __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 392, __pyx_L1_error)
9331       __Pyx_GOTREF(__pyx_t_10);
9332       __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error)
9333       __Pyx_GOTREF(__pyx_t_5);
9334       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9335       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9336       __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_v2array, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 392, __pyx_L1_error)
9337       __Pyx_GOTREF(__pyx_t_10);
9338       __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_larray, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error)
9339       __Pyx_GOTREF(__pyx_t_4);
9340       __pyx_t_9 = PyNumber_Multiply(__pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 392, __pyx_L1_error)
9341       __Pyx_GOTREF(__pyx_t_9);
9342       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9343       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9344       __pyx_t_4 = PyList_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error)
9345       __Pyx_GOTREF(__pyx_t_4);
9346       __Pyx_INCREF(__pyx_v_chrom);
9347       __Pyx_GIVEREF(__pyx_v_chrom);
9348       PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_chrom);
9349       __Pyx_INCREF(__pyx_v_start);
9350       __Pyx_GIVEREF(__pyx_v_start);
9351       PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_start);
9352       __Pyx_INCREF(__pyx_v_end);
9353       __Pyx_GIVEREF(__pyx_v_end);
9354       PyList_SET_ITEM(__pyx_t_4, 2, __pyx_v_end);
9355       __Pyx_GIVEREF(__pyx_t_5);
9356       PyList_SET_ITEM(__pyx_t_4, 3, __pyx_t_5);
9357       __Pyx_GIVEREF(__pyx_t_9);
9358       PyList_SET_ITEM(__pyx_t_4, 4, __pyx_t_9);
9359       __pyx_t_5 = 0;
9360       __pyx_t_9 = 0;
9361       __Pyx_DECREF_SET(__pyx_v_cur_region, ((PyObject*)__pyx_t_4));
9362       __pyx_t_4 = 0;
9363     }
9364     __pyx_L9:;
9365   }
9366 
9367   /* "MACS2/IO/ScoreTrack.pyx":394
9368  *                 cur_region = [chrom, start, end, v1array[i]*larray[i], v2array[i]*larray[i]]
9369  *
9370  *         radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))             # <<<<<<<<<<<<<<
9371  *         v1add(cur_region[3])
9372  *         v2add(cur_region[4])
9373  */
9374   __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 394, __pyx_L1_error)
9375   __Pyx_GOTREF(__pyx_t_9);
9376   __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error)
9377   __Pyx_GOTREF(__pyx_t_5);
9378   __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 394, __pyx_L1_error)
9379   __Pyx_GOTREF(__pyx_t_10);
9380   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
9381   __Pyx_GOTREF(__pyx_t_1);
9382   __Pyx_GIVEREF(__pyx_t_9);
9383   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
9384   __Pyx_GIVEREF(__pyx_t_5);
9385   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
9386   __Pyx_GIVEREF(__pyx_t_10);
9387   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_10);
9388   __pyx_t_9 = 0;
9389   __pyx_t_5 = 0;
9390   __pyx_t_10 = 0;
9391   __pyx_t_10 = PyNumber_Remainder(__pyx_kp_b_s_d_d, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 394, __pyx_L1_error)
9392   __Pyx_GOTREF(__pyx_t_10);
9393   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9394   __Pyx_INCREF(__pyx_v_radd);
9395   __pyx_t_1 = __pyx_v_radd; __pyx_t_5 = NULL;
9396   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
9397     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
9398     if (likely(__pyx_t_5)) {
9399       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
9400       __Pyx_INCREF(__pyx_t_5);
9401       __Pyx_INCREF(function);
9402       __Pyx_DECREF_SET(__pyx_t_1, function);
9403     }
9404   }
9405   __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10);
9406   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9407   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9408   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error)
9409   __Pyx_GOTREF(__pyx_t_4);
9410   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9411   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9412 
9413   /* "MACS2/IO/ScoreTrack.pyx":395
9414  *
9415  *         radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
9416  *         v1add(cur_region[3])             # <<<<<<<<<<<<<<
9417  *         v2add(cur_region[4])
9418  *         return ret
9419  */
9420   __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
9421   __Pyx_GOTREF(__pyx_t_1);
9422   __Pyx_INCREF(__pyx_v_v1add);
9423   __pyx_t_10 = __pyx_v_v1add; __pyx_t_5 = NULL;
9424   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
9425     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
9426     if (likely(__pyx_t_5)) {
9427       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
9428       __Pyx_INCREF(__pyx_t_5);
9429       __Pyx_INCREF(function);
9430       __Pyx_DECREF_SET(__pyx_t_10, function);
9431     }
9432   }
9433   __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1);
9434   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9435   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9436   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error)
9437   __Pyx_GOTREF(__pyx_t_4);
9438   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9439   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9440 
9441   /* "MACS2/IO/ScoreTrack.pyx":396
9442  *         radd(b"%s\.%d\.%d" % (cur_region[0],cur_region[1],cur_region[2]))
9443  *         v1add(cur_region[3])
9444  *         v2add(cur_region[4])             # <<<<<<<<<<<<<<
9445  *         return ret
9446  *
9447  */
9448   __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_cur_region, 4, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 396, __pyx_L1_error)
9449   __Pyx_GOTREF(__pyx_t_10);
9450   __Pyx_INCREF(__pyx_v_v2add);
9451   __pyx_t_1 = __pyx_v_v2add; __pyx_t_5 = NULL;
9452   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
9453     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
9454     if (likely(__pyx_t_5)) {
9455       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
9456       __Pyx_INCREF(__pyx_t_5);
9457       __Pyx_INCREF(function);
9458       __Pyx_DECREF_SET(__pyx_t_1, function);
9459     }
9460   }
9461   __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10);
9462   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9463   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9464   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
9465   __Pyx_GOTREF(__pyx_t_4);
9466   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9467   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9468 
9469   /* "MACS2/IO/ScoreTrack.pyx":397
9470  *         v1add(cur_region[3])
9471  *         v2add(cur_region[4])
9472  *         return ret             # <<<<<<<<<<<<<<
9473  *
9474  * cdef class scoreTrackII:
9475  */
9476   __Pyx_XDECREF(__pyx_r);
9477   __Pyx_INCREF(__pyx_v_ret);
9478   __pyx_r = __pyx_v_ret;
9479   goto __pyx_L0;
9480 
9481   /* "MACS2/IO/ScoreTrack.pyx":367
9482  *         return ret
9483  *
9484  *     def extract_sum (self, bdgTrack2):             # <<<<<<<<<<<<<<
9485  *         """Get sum values in each region defined in bdgTrack2.
9486  *
9487  */
9488 
9489   /* function exit code */
9490   __pyx_L1_error:;
9491   __Pyx_XDECREF(__pyx_t_1);
9492   __Pyx_XDECREF(__pyx_t_2);
9493   __Pyx_XDECREF(__pyx_t_3);
9494   __Pyx_XDECREF(__pyx_t_4);
9495   __Pyx_XDECREF(__pyx_t_5);
9496   __Pyx_XDECREF(__pyx_t_6);
9497   __Pyx_XDECREF(__pyx_t_9);
9498   __Pyx_XDECREF(__pyx_t_10);
9499   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.CombinedTwoTrack.extract_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
9500   __pyx_r = NULL;
9501   __pyx_L0:;
9502   __Pyx_XDECREF(__pyx_v_chrom);
9503   __Pyx_XDECREF(__pyx_v_start);
9504   __Pyx_XDECREF(__pyx_v_end);
9505   __Pyx_XDECREF(__pyx_v_rarray);
9506   __Pyx_XDECREF(__pyx_v_v1array);
9507   __Pyx_XDECREF(__pyx_v_v2array);
9508   __Pyx_XDECREF(__pyx_v_larray);
9509   __Pyx_XDECREF(__pyx_v_ret);
9510   __Pyx_XDECREF(__pyx_v_radd);
9511   __Pyx_XDECREF(__pyx_v_v1add);
9512   __Pyx_XDECREF(__pyx_v_v2add);
9513   __Pyx_XDECREF(__pyx_v_cur_region);
9514   __Pyx_XGIVEREF(__pyx_r);
9515   __Pyx_TraceReturn(__pyx_r, 0);
9516   __Pyx_RefNannyFinishContext();
9517   return __pyx_r;
9518 }
9519 
9520 /* "MACS2/IO/ScoreTrack.pyx":425
9521  *
9522  *
9523  *     def __init__ (self, float64_t treat_depth, float64_t ctrl_depth, bool stderr_on = False, float64_t pseudocount = 1.0 ):             # <<<<<<<<<<<<<<
9524  *         """Initialize.
9525  *
9526  */
9527 
9528 /* Python wrapper */
9529 static int __pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9530 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII___init__[] = "Initialize.\n\n        treat_depth and ctrl_depth are effective depth in million:\n                                    sequencing depth in million after\n                                    duplicates being filtered. If\n                                    treatment is scaled down to\n                                    control sample size, then this\n                                    should be control sample size in\n                                    million. And vice versa.\n                                    \n        pseudocount: a pseudocount used to calculate logLR, FE or\n                     logFE. Please note this value will not be changed\n                     with normalization method. So if you really want\n                     to set pseudocount 1 per million reads, set it\n                     after you normalize treat and control by million\n                     reads by `change_normalizetion_method(ord('M'))`.\n\n        ";
9531 #if CYTHON_COMPILING_IN_CPYTHON
9532 struct wrapperbase __pyx_wrapperbase_5MACS2_2IO_10ScoreTrack_12scoreTrackII___init__;
9533 #endif
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9534 static int __pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9535   __pyx_t_5numpy_float64_t __pyx_v_treat_depth;
9536   __pyx_t_5numpy_float64_t __pyx_v_ctrl_depth;
9537   CYTHON_UNUSED PyBoolObject *__pyx_v_stderr_on = 0;
9538   __pyx_t_5numpy_float64_t __pyx_v_pseudocount;
9539   int __pyx_r;
9540   __Pyx_RefNannyDeclarations
9541   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9542   {
9543     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_treat_depth,&__pyx_n_s_ctrl_depth,&__pyx_n_s_stderr_on,&__pyx_n_s_pseudocount,0};
9544     PyObject* values[4] = {0,0,0,0};
9545     values[2] = (PyObject *)((PyBoolObject *)Py_False);
9546     if (unlikely(__pyx_kwds)) {
9547       Py_ssize_t kw_args;
9548       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9549       switch (pos_args) {
9550         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9551         CYTHON_FALLTHROUGH;
9552         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9553         CYTHON_FALLTHROUGH;
9554         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9555         CYTHON_FALLTHROUGH;
9556         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9557         CYTHON_FALLTHROUGH;
9558         case  0: break;
9559         default: goto __pyx_L5_argtuple_error;
9560       }
9561       kw_args = PyDict_Size(__pyx_kwds);
9562       switch (pos_args) {
9563         case  0:
9564         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_treat_depth)) != 0)) kw_args--;
9565         else goto __pyx_L5_argtuple_error;
9566         CYTHON_FALLTHROUGH;
9567         case  1:
9568         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ctrl_depth)) != 0)) kw_args--;
9569         else {
9570           __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 425, __pyx_L3_error)
9571         }
9572         CYTHON_FALLTHROUGH;
9573         case  2:
9574         if (kw_args > 0) {
9575           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stderr_on);
9576           if (value) { values[2] = value; kw_args--; }
9577         }
9578         CYTHON_FALLTHROUGH;
9579         case  3:
9580         if (kw_args > 0) {
9581           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pseudocount);
9582           if (value) { values[3] = value; kw_args--; }
9583         }
9584       }
9585       if (unlikely(kw_args > 0)) {
9586         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 425, __pyx_L3_error)
9587       }
9588     } else {
9589       switch (PyTuple_GET_SIZE(__pyx_args)) {
9590         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9591         CYTHON_FALLTHROUGH;
9592         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9593         CYTHON_FALLTHROUGH;
9594         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9595         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9596         break;
9597         default: goto __pyx_L5_argtuple_error;
9598       }
9599     }
9600     __pyx_v_treat_depth = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_treat_depth == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error)
9601     __pyx_v_ctrl_depth = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_ctrl_depth == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error)
9602     __pyx_v_stderr_on = ((PyBoolObject *)values[2]);
9603     if (values[3]) {
9604       __pyx_v_pseudocount = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_pseudocount == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error)
9605     } else {
9606       __pyx_v_pseudocount = ((__pyx_t_5numpy_float64_t)1.0);
9607     }
9608   }
9609   goto __pyx_L4_argument_unpacking_done;
9610   __pyx_L5_argtuple_error:;
9611   __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 425, __pyx_L3_error)
9612   __pyx_L3_error:;
9613   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9614   __Pyx_RefNannyFinishContext();
9615   return -1;
9616   __pyx_L4_argument_unpacking_done:;
9617   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stderr_on), __pyx_ptype_7cpython_4bool_bool, 1, "stderr_on", 0))) __PYX_ERR(0, 425, __pyx_L1_error)
9618   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII___init__(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_treat_depth, __pyx_v_ctrl_depth, __pyx_v_stderr_on, __pyx_v_pseudocount);
9619 
9620   /* function exit code */
9621   goto __pyx_L0;
9622   __pyx_L1_error:;
9623   __pyx_r = -1;
9624   __pyx_L0:;
9625   __Pyx_RefNannyFinishContext();
9626   return __pyx_r;
9627 }
9628 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII___init__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,__pyx_t_5numpy_float64_t __pyx_v_treat_depth,__pyx_t_5numpy_float64_t __pyx_v_ctrl_depth,CYTHON_UNUSED PyBoolObject * __pyx_v_stderr_on,__pyx_t_5numpy_float64_t __pyx_v_pseudocount)9629 static int __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII___init__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_treat_depth, __pyx_t_5numpy_float64_t __pyx_v_ctrl_depth, CYTHON_UNUSED PyBoolObject *__pyx_v_stderr_on, __pyx_t_5numpy_float64_t __pyx_v_pseudocount) {
9630   int __pyx_r;
9631   __Pyx_TraceDeclarations
9632   __Pyx_RefNannyDeclarations
9633   PyObject *__pyx_t_1 = NULL;
9634   __Pyx_RefNannySetupContext("__init__", 0);
9635   __Pyx_TraceCall("__init__", __pyx_f[0], 425, 0, __PYX_ERR(0, 425, __pyx_L1_error));
9636 
9637   /* "MACS2/IO/ScoreTrack.pyx":444
9638  *
9639  *         """
9640  *         self.data = {}           # for each chromosome, there is a l*4             # <<<<<<<<<<<<<<
9641  *                                  # matrix. First column: end position
9642  *                                  # of a region; Second: treatment
9643  */
9644   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
9645   __Pyx_GOTREF(__pyx_t_1);
9646   __Pyx_GIVEREF(__pyx_t_1);
9647   __Pyx_GOTREF(__pyx_v_self->data);
9648   __Pyx_DECREF(__pyx_v_self->data);
9649   __pyx_v_self->data = ((PyObject*)__pyx_t_1);
9650   __pyx_t_1 = 0;
9651 
9652   /* "MACS2/IO/ScoreTrack.pyx":452
9653  *                                  # ratio/fold-enrichment/subtraction
9654  *                                  # depending on -c setting)
9655  *         self.datalength = {}             # <<<<<<<<<<<<<<
9656  *         self.trackline = False
9657  *         self.treat_edm = treat_depth
9658  */
9659   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
9660   __Pyx_GOTREF(__pyx_t_1);
9661   __Pyx_GIVEREF(__pyx_t_1);
9662   __Pyx_GOTREF(__pyx_v_self->datalength);
9663   __Pyx_DECREF(__pyx_v_self->datalength);
9664   __pyx_v_self->datalength = ((PyObject*)__pyx_t_1);
9665   __pyx_t_1 = 0;
9666 
9667   /* "MACS2/IO/ScoreTrack.pyx":453
9668  *                                  # depending on -c setting)
9669  *         self.datalength = {}
9670  *         self.trackline = False             # <<<<<<<<<<<<<<
9671  *         self.treat_edm = treat_depth
9672  *         self.ctrl_edm = ctrl_depth
9673  */
9674   __Pyx_INCREF(Py_False);
9675   __Pyx_GIVEREF(Py_False);
9676   __Pyx_GOTREF(__pyx_v_self->trackline);
9677   __Pyx_DECREF(((PyObject *)__pyx_v_self->trackline));
9678   __pyx_v_self->trackline = ((PyBoolObject *)Py_False);
9679 
9680   /* "MACS2/IO/ScoreTrack.pyx":454
9681  *         self.datalength = {}
9682  *         self.trackline = False
9683  *         self.treat_edm = treat_depth             # <<<<<<<<<<<<<<
9684  *         self.ctrl_edm = ctrl_depth
9685  *         #scoring_method:  p: -log10 pvalue;
9686  */
9687   __pyx_v_self->treat_edm = __pyx_v_treat_depth;
9688 
9689   /* "MACS2/IO/ScoreTrack.pyx":455
9690  *         self.trackline = False
9691  *         self.treat_edm = treat_depth
9692  *         self.ctrl_edm = ctrl_depth             # <<<<<<<<<<<<<<
9693  *         #scoring_method:  p: -log10 pvalue;
9694  *         #                 q: -log10 qvalue;
9695  */
9696   __pyx_v_self->ctrl_edm = __pyx_v_ctrl_depth;
9697 
9698   /* "MACS2/IO/ScoreTrack.pyx":464
9699  *         #                 m: fragment pileup per million reads
9700  *         #                 N: not set
9701  *         self.scoring_method = ord("N")             # <<<<<<<<<<<<<<
9702  *
9703  *         #normalization_method: T: scale to depth of treatment;
9704  */
9705   __pyx_v_self->scoring_method = 78;
9706 
9707   /* "MACS2/IO/ScoreTrack.pyx":470
9708  *         #                      M: scale to depth of 1 million;
9709  *         #                      N: not set/ raw pileup
9710  *         self.normalization_method = ord("N")             # <<<<<<<<<<<<<<
9711  *
9712  *         self.pseudocount = pseudocount
9713  */
9714   __pyx_v_self->normalization_method = 78;
9715 
9716   /* "MACS2/IO/ScoreTrack.pyx":472
9717  *         self.normalization_method = ord("N")
9718  *
9719  *         self.pseudocount = pseudocount             # <<<<<<<<<<<<<<
9720  *         self.pvalue_stat = {}
9721  *
9722  */
9723   __pyx_v_self->pseudocount = __pyx_v_pseudocount;
9724 
9725   /* "MACS2/IO/ScoreTrack.pyx":473
9726  *
9727  *         self.pseudocount = pseudocount
9728  *         self.pvalue_stat = {}             # <<<<<<<<<<<<<<
9729  *
9730  *     cpdef set_pseudocount( self, float64_t pseudocount ):
9731  */
9732   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
9733   __Pyx_GOTREF(__pyx_t_1);
9734   __Pyx_GIVEREF(__pyx_t_1);
9735   __Pyx_GOTREF(__pyx_v_self->pvalue_stat);
9736   __Pyx_DECREF(__pyx_v_self->pvalue_stat);
9737   __pyx_v_self->pvalue_stat = ((PyObject*)__pyx_t_1);
9738   __pyx_t_1 = 0;
9739 
9740   /* "MACS2/IO/ScoreTrack.pyx":425
9741  *
9742  *
9743  *     def __init__ (self, float64_t treat_depth, float64_t ctrl_depth, bool stderr_on = False, float64_t pseudocount = 1.0 ):             # <<<<<<<<<<<<<<
9744  *         """Initialize.
9745  *
9746  */
9747 
9748   /* function exit code */
9749   __pyx_r = 0;
9750   goto __pyx_L0;
9751   __pyx_L1_error:;
9752   __Pyx_XDECREF(__pyx_t_1);
9753   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9754   __pyx_r = -1;
9755   __pyx_L0:;
9756   __Pyx_TraceReturn(Py_None, 0);
9757   __Pyx_RefNannyFinishContext();
9758   return __pyx_r;
9759 }
9760 
9761 /* "MACS2/IO/ScoreTrack.pyx":475
9762  *         self.pvalue_stat = {}
9763  *
9764  *     cpdef set_pseudocount( self, float64_t pseudocount ):             # <<<<<<<<<<<<<<
9765  *         self.pseudocount = pseudocount
9766  *
9767  */
9768 
9769 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,__pyx_t_5numpy_float64_t __pyx_v_pseudocount,int __pyx_skip_dispatch)9770 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_pseudocount, int __pyx_skip_dispatch) {
9771   PyObject *__pyx_r = NULL;
9772   __Pyx_TraceDeclarations
9773   __Pyx_RefNannyDeclarations
9774   PyObject *__pyx_t_1 = NULL;
9775   PyObject *__pyx_t_2 = NULL;
9776   PyObject *__pyx_t_3 = NULL;
9777   PyObject *__pyx_t_4 = NULL;
9778   PyObject *__pyx_t_5 = NULL;
9779   __Pyx_RefNannySetupContext("set_pseudocount", 0);
9780   __Pyx_TraceCall("set_pseudocount", __pyx_f[0], 475, 0, __PYX_ERR(0, 475, __pyx_L1_error));
9781   /* Check if called by wrapper */
9782   if (unlikely(__pyx_skip_dispatch)) ;
9783   /* Check if overridden in Python */
9784   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
9785     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9786     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
9787     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
9788       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
9789       #endif
9790       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_pseudocount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
9791       __Pyx_GOTREF(__pyx_t_1);
9792       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_3set_pseudocount)) {
9793         __Pyx_XDECREF(__pyx_r);
9794         __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error)
9795         __Pyx_GOTREF(__pyx_t_3);
9796         __Pyx_INCREF(__pyx_t_1);
9797         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
9798         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
9799           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
9800           if (likely(__pyx_t_5)) {
9801             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
9802             __Pyx_INCREF(__pyx_t_5);
9803             __Pyx_INCREF(function);
9804             __Pyx_DECREF_SET(__pyx_t_4, function);
9805           }
9806         }
9807         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
9808         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9809         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9810         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
9811         __Pyx_GOTREF(__pyx_t_2);
9812         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9813         __pyx_r = __pyx_t_2;
9814         __pyx_t_2 = 0;
9815         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9816         goto __pyx_L0;
9817       }
9818       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9819       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
9820       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
9821       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
9822         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
9823       }
9824       #endif
9825       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9826       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9827     }
9828     #endif
9829   }
9830 
9831   /* "MACS2/IO/ScoreTrack.pyx":476
9832  *
9833  *     cpdef set_pseudocount( self, float64_t pseudocount ):
9834  *         self.pseudocount = pseudocount             # <<<<<<<<<<<<<<
9835  *
9836  *     cpdef enable_trackline( self ):
9837  */
9838   __pyx_v_self->pseudocount = __pyx_v_pseudocount;
9839 
9840   /* "MACS2/IO/ScoreTrack.pyx":475
9841  *         self.pvalue_stat = {}
9842  *
9843  *     cpdef set_pseudocount( self, float64_t pseudocount ):             # <<<<<<<<<<<<<<
9844  *         self.pseudocount = pseudocount
9845  *
9846  */
9847 
9848   /* function exit code */
9849   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9850   goto __pyx_L0;
9851   __pyx_L1_error:;
9852   __Pyx_XDECREF(__pyx_t_1);
9853   __Pyx_XDECREF(__pyx_t_2);
9854   __Pyx_XDECREF(__pyx_t_3);
9855   __Pyx_XDECREF(__pyx_t_4);
9856   __Pyx_XDECREF(__pyx_t_5);
9857   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
9858   __pyx_r = 0;
9859   __pyx_L0:;
9860   __Pyx_XGIVEREF(__pyx_r);
9861   __Pyx_TraceReturn(__pyx_r, 0);
9862   __Pyx_RefNannyFinishContext();
9863   return __pyx_r;
9864 }
9865 
9866 /* Python wrapper */
9867 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount); /*proto*/
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_3set_pseudocount(PyObject * __pyx_v_self,PyObject * __pyx_arg_pseudocount)9868 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount) {
9869   __pyx_t_5numpy_float64_t __pyx_v_pseudocount;
9870   PyObject *__pyx_r = 0;
9871   __Pyx_RefNannyDeclarations
9872   __Pyx_RefNannySetupContext("set_pseudocount (wrapper)", 0);
9873   assert(__pyx_arg_pseudocount); {
9874     __pyx_v_pseudocount = __pyx_PyFloat_AsDouble(__pyx_arg_pseudocount); if (unlikely((__pyx_v_pseudocount == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L3_error)
9875   }
9876   goto __pyx_L4_argument_unpacking_done;
9877   __pyx_L3_error:;
9878   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
9879   __Pyx_RefNannyFinishContext();
9880   return NULL;
9881   __pyx_L4_argument_unpacking_done:;
9882   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_2set_pseudocount(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_pseudocount));
9883 
9884   /* function exit code */
9885   __Pyx_RefNannyFinishContext();
9886   return __pyx_r;
9887 }
9888 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,__pyx_t_5numpy_float64_t __pyx_v_pseudocount)9889 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_pseudocount) {
9890   PyObject *__pyx_r = NULL;
9891   __Pyx_TraceDeclarations
9892   __Pyx_RefNannyDeclarations
9893   PyObject *__pyx_t_1 = NULL;
9894   __Pyx_RefNannySetupContext("set_pseudocount", 0);
9895   __Pyx_TraceCall("set_pseudocount (wrapper)", __pyx_f[0], 475, 0, __PYX_ERR(0, 475, __pyx_L1_error));
9896   __Pyx_XDECREF(__pyx_r);
9897   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_set_pseudocount(__pyx_v_self, __pyx_v_pseudocount, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
9898   __Pyx_GOTREF(__pyx_t_1);
9899   __pyx_r = __pyx_t_1;
9900   __pyx_t_1 = 0;
9901   goto __pyx_L0;
9902 
9903   /* function exit code */
9904   __pyx_L1_error:;
9905   __Pyx_XDECREF(__pyx_t_1);
9906   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
9907   __pyx_r = NULL;
9908   __pyx_L0:;
9909   __Pyx_XGIVEREF(__pyx_r);
9910   __Pyx_TraceReturn(__pyx_r, 0);
9911   __Pyx_RefNannyFinishContext();
9912   return __pyx_r;
9913 }
9914 
9915 /* "MACS2/IO/ScoreTrack.pyx":478
9916  *         self.pseudocount = pseudocount
9917  *
9918  *     cpdef enable_trackline( self ):             # <<<<<<<<<<<<<<
9919  *         """Turn on trackline with bedgraph output
9920  *         """
9921  */
9922 
9923 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_5enable_trackline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_enable_trackline(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,int __pyx_skip_dispatch)9924 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_enable_trackline(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch) {
9925   PyObject *__pyx_r = NULL;
9926   __Pyx_TraceDeclarations
9927   __Pyx_RefNannyDeclarations
9928   PyObject *__pyx_t_1 = NULL;
9929   PyObject *__pyx_t_2 = NULL;
9930   PyObject *__pyx_t_3 = NULL;
9931   PyObject *__pyx_t_4 = NULL;
9932   __Pyx_RefNannySetupContext("enable_trackline", 0);
9933   __Pyx_TraceCall("enable_trackline", __pyx_f[0], 478, 0, __PYX_ERR(0, 478, __pyx_L1_error));
9934   /* Check if called by wrapper */
9935   if (unlikely(__pyx_skip_dispatch)) ;
9936   /* Check if overridden in Python */
9937   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
9938     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9939     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
9940     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
9941       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
9942       #endif
9943       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enable_trackline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
9944       __Pyx_GOTREF(__pyx_t_1);
9945       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_5enable_trackline)) {
9946         __Pyx_XDECREF(__pyx_r);
9947         __Pyx_INCREF(__pyx_t_1);
9948         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
9949         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
9950           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
9951           if (likely(__pyx_t_4)) {
9952             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
9953             __Pyx_INCREF(__pyx_t_4);
9954             __Pyx_INCREF(function);
9955             __Pyx_DECREF_SET(__pyx_t_3, function);
9956           }
9957         }
9958         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
9959         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9960         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
9961         __Pyx_GOTREF(__pyx_t_2);
9962         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9963         __pyx_r = __pyx_t_2;
9964         __pyx_t_2 = 0;
9965         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9966         goto __pyx_L0;
9967       }
9968       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9969       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
9970       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
9971       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
9972         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
9973       }
9974       #endif
9975       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9976       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9977     }
9978     #endif
9979   }
9980 
9981   /* "MACS2/IO/ScoreTrack.pyx":481
9982  *         """Turn on trackline with bedgraph output
9983  *         """
9984  *         self.trackline = True             # <<<<<<<<<<<<<<
9985  *
9986  *     cpdef add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):
9987  */
9988   __Pyx_INCREF(Py_True);
9989   __Pyx_GIVEREF(Py_True);
9990   __Pyx_GOTREF(__pyx_v_self->trackline);
9991   __Pyx_DECREF(((PyObject *)__pyx_v_self->trackline));
9992   __pyx_v_self->trackline = ((PyBoolObject *)Py_True);
9993 
9994   /* "MACS2/IO/ScoreTrack.pyx":478
9995  *         self.pseudocount = pseudocount
9996  *
9997  *     cpdef enable_trackline( self ):             # <<<<<<<<<<<<<<
9998  *         """Turn on trackline with bedgraph output
9999  *         """
10000  */
10001 
10002   /* function exit code */
10003   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10004   goto __pyx_L0;
10005   __pyx_L1_error:;
10006   __Pyx_XDECREF(__pyx_t_1);
10007   __Pyx_XDECREF(__pyx_t_2);
10008   __Pyx_XDECREF(__pyx_t_3);
10009   __Pyx_XDECREF(__pyx_t_4);
10010   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.enable_trackline", __pyx_clineno, __pyx_lineno, __pyx_filename);
10011   __pyx_r = 0;
10012   __pyx_L0:;
10013   __Pyx_XGIVEREF(__pyx_r);
10014   __Pyx_TraceReturn(__pyx_r, 0);
10015   __Pyx_RefNannyFinishContext();
10016   return __pyx_r;
10017 }
10018 
10019 /* Python wrapper */
10020 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_5enable_trackline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10021 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_4enable_trackline[] = "Turn on trackline with bedgraph output\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_5enable_trackline(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)10022 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_5enable_trackline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10023   PyObject *__pyx_r = 0;
10024   __Pyx_RefNannyDeclarations
10025   __Pyx_RefNannySetupContext("enable_trackline (wrapper)", 0);
10026   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_4enable_trackline(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self));
10027 
10028   /* function exit code */
10029   __Pyx_RefNannyFinishContext();
10030   return __pyx_r;
10031 }
10032 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_4enable_trackline(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)10033 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_4enable_trackline(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
10034   PyObject *__pyx_r = NULL;
10035   __Pyx_TraceDeclarations
10036   __Pyx_RefNannyDeclarations
10037   PyObject *__pyx_t_1 = NULL;
10038   __Pyx_RefNannySetupContext("enable_trackline", 0);
10039   __Pyx_TraceCall("enable_trackline (wrapper)", __pyx_f[0], 478, 0, __PYX_ERR(0, 478, __pyx_L1_error));
10040   __Pyx_XDECREF(__pyx_r);
10041   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_enable_trackline(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
10042   __Pyx_GOTREF(__pyx_t_1);
10043   __pyx_r = __pyx_t_1;
10044   __pyx_t_1 = 0;
10045   goto __pyx_L0;
10046 
10047   /* function exit code */
10048   __pyx_L1_error:;
10049   __Pyx_XDECREF(__pyx_t_1);
10050   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.enable_trackline", __pyx_clineno, __pyx_lineno, __pyx_filename);
10051   __pyx_r = NULL;
10052   __pyx_L0:;
10053   __Pyx_XGIVEREF(__pyx_r);
10054   __Pyx_TraceReturn(__pyx_r, 0);
10055   __Pyx_RefNannyFinishContext();
10056   return __pyx_r;
10057 }
10058 
10059 /* "MACS2/IO/ScoreTrack.pyx":483
10060  *         self.trackline = True
10061  *
10062  *     cpdef add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):             # <<<<<<<<<<<<<<
10063  *         """
10064  *         chrom: chromosome name
10065  */
10066 
10067 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_7add_chromosome(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_add_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v_chrom,__pyx_t_5numpy_int32_t __pyx_v_chrom_max_len,int __pyx_skip_dispatch)10068 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_add_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_5numpy_int32_t __pyx_v_chrom_max_len, int __pyx_skip_dispatch) {
10069   PyObject *__pyx_r = NULL;
10070   __Pyx_TraceDeclarations
10071   __Pyx_RefNannyDeclarations
10072   PyObject *__pyx_t_1 = NULL;
10073   PyObject *__pyx_t_2 = NULL;
10074   PyObject *__pyx_t_3 = NULL;
10075   PyObject *__pyx_t_4 = NULL;
10076   PyObject *__pyx_t_5 = NULL;
10077   int __pyx_t_6;
10078   PyObject *__pyx_t_7 = NULL;
10079   int __pyx_t_8;
10080   int __pyx_t_9;
10081   PyObject *__pyx_t_10 = NULL;
10082   __Pyx_RefNannySetupContext("add_chromosome", 0);
10083   __Pyx_TraceCall("add_chromosome", __pyx_f[0], 483, 0, __PYX_ERR(0, 483, __pyx_L1_error));
10084   /* Check if called by wrapper */
10085   if (unlikely(__pyx_skip_dispatch)) ;
10086   /* Check if overridden in Python */
10087   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
10088     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10089     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10090     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
10091       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10092       #endif
10093       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_chromosome); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
10094       __Pyx_GOTREF(__pyx_t_1);
10095       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_7add_chromosome)) {
10096         __Pyx_XDECREF(__pyx_r);
10097         __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
10098         __Pyx_GOTREF(__pyx_t_3);
10099         __Pyx_INCREF(__pyx_t_1);
10100         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
10101         __pyx_t_6 = 0;
10102         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
10103           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10104           if (likely(__pyx_t_5)) {
10105             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10106             __Pyx_INCREF(__pyx_t_5);
10107             __Pyx_INCREF(function);
10108             __Pyx_DECREF_SET(__pyx_t_4, function);
10109             __pyx_t_6 = 1;
10110           }
10111         }
10112         #if CYTHON_FAST_PYCALL
10113         if (PyFunction_Check(__pyx_t_4)) {
10114           PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_chrom, __pyx_t_3};
10115           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
10116           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10117           __Pyx_GOTREF(__pyx_t_2);
10118           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10119         } else
10120         #endif
10121         #if CYTHON_FAST_PYCCALL
10122         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10123           PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_chrom, __pyx_t_3};
10124           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
10125           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10126           __Pyx_GOTREF(__pyx_t_2);
10127           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10128         } else
10129         #endif
10130         {
10131           __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error)
10132           __Pyx_GOTREF(__pyx_t_7);
10133           if (__pyx_t_5) {
10134             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
10135           }
10136           __Pyx_INCREF(__pyx_v_chrom);
10137           __Pyx_GIVEREF(__pyx_v_chrom);
10138           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_chrom);
10139           __Pyx_GIVEREF(__pyx_t_3);
10140           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
10141           __pyx_t_3 = 0;
10142           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
10143           __Pyx_GOTREF(__pyx_t_2);
10144           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10145         }
10146         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10147         __pyx_r = __pyx_t_2;
10148         __pyx_t_2 = 0;
10149         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10150         goto __pyx_L0;
10151       }
10152       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10153       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10154       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
10155       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
10156         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10157       }
10158       #endif
10159       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10160       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10161     }
10162     #endif
10163   }
10164 
10165   /* "MACS2/IO/ScoreTrack.pyx":489
10166  *
10167  *         """
10168  *         if chrom not in self.data:             # <<<<<<<<<<<<<<
10169  *             #self.data[chrom] = np.zeros( ( chrom_max_len, 4 ), dtype="int32" ) # remember col #2-4 is actual value * 100, I use integer here.
10170  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
10171  */
10172   if (unlikely(__pyx_v_self->data == Py_None)) {
10173     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
10174     __PYX_ERR(0, 489, __pyx_L1_error)
10175   }
10176   __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_v_chrom, __pyx_v_self->data, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 489, __pyx_L1_error)
10177   __pyx_t_9 = (__pyx_t_8 != 0);
10178   if (__pyx_t_9) {
10179 
10180     /* "MACS2/IO/ScoreTrack.pyx":491
10181  *         if chrom not in self.data:
10182  *             #self.data[chrom] = np.zeros( ( chrom_max_len, 4 ), dtype="int32" ) # remember col #2-4 is actual value * 100, I use integer here.
10183  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos             # <<<<<<<<<<<<<<
10184  *                                  np.zeros( chrom_max_len, dtype="float32" ), # pileup at each interval, in float32 format
10185  *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float32 format
10186  */
10187     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
10188     __Pyx_GOTREF(__pyx_t_1);
10189     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error)
10190     __Pyx_GOTREF(__pyx_t_2);
10191     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10192     __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
10193     __Pyx_GOTREF(__pyx_t_1);
10194     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
10195     __Pyx_GOTREF(__pyx_t_4);
10196     __Pyx_GIVEREF(__pyx_t_1);
10197     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10198     __pyx_t_1 = 0;
10199     __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
10200     __Pyx_GOTREF(__pyx_t_1);
10201     if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_u_int32) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
10202     __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 491, __pyx_L1_error)
10203     __Pyx_GOTREF(__pyx_t_7);
10204     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10205     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10206     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10207 
10208     /* "MACS2/IO/ScoreTrack.pyx":492
10209  *             #self.data[chrom] = np.zeros( ( chrom_max_len, 4 ), dtype="int32" ) # remember col #2-4 is actual value * 100, I use integer here.
10210  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
10211  *                                  np.zeros( chrom_max_len, dtype="float32" ), # pileup at each interval, in float32 format             # <<<<<<<<<<<<<<
10212  *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float32 format
10213  *                                  np.zeros( chrom_max_len, dtype="float32" ) ] # score at each interval, in float32 format
10214  */
10215     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
10216     __Pyx_GOTREF(__pyx_t_1);
10217     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 492, __pyx_L1_error)
10218     __Pyx_GOTREF(__pyx_t_4);
10219     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10220     __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
10221     __Pyx_GOTREF(__pyx_t_1);
10222     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error)
10223     __Pyx_GOTREF(__pyx_t_2);
10224     __Pyx_GIVEREF(__pyx_t_1);
10225     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
10226     __pyx_t_1 = 0;
10227     __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
10228     __Pyx_GOTREF(__pyx_t_1);
10229     if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 492, __pyx_L1_error)
10230     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error)
10231     __Pyx_GOTREF(__pyx_t_3);
10232     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10233     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10234     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10235 
10236     /* "MACS2/IO/ScoreTrack.pyx":493
10237  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
10238  *                                  np.zeros( chrom_max_len, dtype="float32" ), # pileup at each interval, in float32 format
10239  *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float32 format             # <<<<<<<<<<<<<<
10240  *                                  np.zeros( chrom_max_len, dtype="float32" ) ] # score at each interval, in float32 format
10241  *             self.datalength[chrom] = 0
10242  */
10243     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
10244     __Pyx_GOTREF(__pyx_t_1);
10245     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
10246     __Pyx_GOTREF(__pyx_t_2);
10247     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10248     __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
10249     __Pyx_GOTREF(__pyx_t_1);
10250     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error)
10251     __Pyx_GOTREF(__pyx_t_4);
10252     __Pyx_GIVEREF(__pyx_t_1);
10253     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10254     __pyx_t_1 = 0;
10255     __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
10256     __Pyx_GOTREF(__pyx_t_1);
10257     if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 493, __pyx_L1_error)
10258     __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error)
10259     __Pyx_GOTREF(__pyx_t_5);
10260     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10261     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10262     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10263 
10264     /* "MACS2/IO/ScoreTrack.pyx":494
10265  *                                  np.zeros( chrom_max_len, dtype="float32" ), # pileup at each interval, in float32 format
10266  *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float32 format
10267  *                                  np.zeros( chrom_max_len, dtype="float32" ) ] # score at each interval, in float32 format             # <<<<<<<<<<<<<<
10268  *             self.datalength[chrom] = 0
10269  *
10270  */
10271     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
10272     __Pyx_GOTREF(__pyx_t_1);
10273     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
10274     __Pyx_GOTREF(__pyx_t_4);
10275     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10276     __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
10277     __Pyx_GOTREF(__pyx_t_1);
10278     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
10279     __Pyx_GOTREF(__pyx_t_2);
10280     __Pyx_GIVEREF(__pyx_t_1);
10281     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
10282     __pyx_t_1 = 0;
10283     __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
10284     __Pyx_GOTREF(__pyx_t_1);
10285     if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 494, __pyx_L1_error)
10286     __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 494, __pyx_L1_error)
10287     __Pyx_GOTREF(__pyx_t_10);
10288     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10289     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10290     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10291 
10292     /* "MACS2/IO/ScoreTrack.pyx":491
10293  *         if chrom not in self.data:
10294  *             #self.data[chrom] = np.zeros( ( chrom_max_len, 4 ), dtype="int32" ) # remember col #2-4 is actual value * 100, I use integer here.
10295  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos             # <<<<<<<<<<<<<<
10296  *                                  np.zeros( chrom_max_len, dtype="float32" ), # pileup at each interval, in float32 format
10297  *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float32 format
10298  */
10299     __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
10300     __Pyx_GOTREF(__pyx_t_1);
10301     __Pyx_GIVEREF(__pyx_t_7);
10302     PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
10303     __Pyx_GIVEREF(__pyx_t_3);
10304     PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
10305     __Pyx_GIVEREF(__pyx_t_5);
10306     PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
10307     __Pyx_GIVEREF(__pyx_t_10);
10308     PyList_SET_ITEM(__pyx_t_1, 3, __pyx_t_10);
10309     __pyx_t_7 = 0;
10310     __pyx_t_3 = 0;
10311     __pyx_t_5 = 0;
10312     __pyx_t_10 = 0;
10313     if (unlikely(__pyx_v_self->data == Py_None)) {
10314       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10315       __PYX_ERR(0, 491, __pyx_L1_error)
10316     }
10317     if (unlikely(PyDict_SetItem(__pyx_v_self->data, __pyx_v_chrom, __pyx_t_1) < 0)) __PYX_ERR(0, 491, __pyx_L1_error)
10318     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10319 
10320     /* "MACS2/IO/ScoreTrack.pyx":495
10321  *                                  np.zeros( chrom_max_len, dtype="float32" ), # control at each interval, in float32 format
10322  *                                  np.zeros( chrom_max_len, dtype="float32" ) ] # score at each interval, in float32 format
10323  *             self.datalength[chrom] = 0             # <<<<<<<<<<<<<<
10324  *
10325  *     cpdef add (self, bytes chromosome, int32_t endpos, float64_t chip, float64_t control):
10326  */
10327     if (unlikely(__pyx_v_self->datalength == Py_None)) {
10328       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10329       __PYX_ERR(0, 495, __pyx_L1_error)
10330     }
10331     if (unlikely(PyDict_SetItem(__pyx_v_self->datalength, __pyx_v_chrom, __pyx_int_0) < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
10332 
10333     /* "MACS2/IO/ScoreTrack.pyx":489
10334  *
10335  *         """
10336  *         if chrom not in self.data:             # <<<<<<<<<<<<<<
10337  *             #self.data[chrom] = np.zeros( ( chrom_max_len, 4 ), dtype="int32" ) # remember col #2-4 is actual value * 100, I use integer here.
10338  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
10339  */
10340   }
10341 
10342   /* "MACS2/IO/ScoreTrack.pyx":483
10343  *         self.trackline = True
10344  *
10345  *     cpdef add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):             # <<<<<<<<<<<<<<
10346  *         """
10347  *         chrom: chromosome name
10348  */
10349 
10350   /* function exit code */
10351   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10352   goto __pyx_L0;
10353   __pyx_L1_error:;
10354   __Pyx_XDECREF(__pyx_t_1);
10355   __Pyx_XDECREF(__pyx_t_2);
10356   __Pyx_XDECREF(__pyx_t_3);
10357   __Pyx_XDECREF(__pyx_t_4);
10358   __Pyx_XDECREF(__pyx_t_5);
10359   __Pyx_XDECREF(__pyx_t_7);
10360   __Pyx_XDECREF(__pyx_t_10);
10361   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
10362   __pyx_r = 0;
10363   __pyx_L0:;
10364   __Pyx_XGIVEREF(__pyx_r);
10365   __Pyx_TraceReturn(__pyx_r, 0);
10366   __Pyx_RefNannyFinishContext();
10367   return __pyx_r;
10368 }
10369 
10370 /* Python wrapper */
10371 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_7add_chromosome(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10372 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_6add_chromosome[] = "\n        chrom: chromosome name\n        chrom_max_len: maximum number of data points in this chromosome\n        \n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_7add_chromosome(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)10373 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_7add_chromosome(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10374   PyObject *__pyx_v_chrom = 0;
10375   __pyx_t_5numpy_int32_t __pyx_v_chrom_max_len;
10376   PyObject *__pyx_r = 0;
10377   __Pyx_RefNannyDeclarations
10378   __Pyx_RefNannySetupContext("add_chromosome (wrapper)", 0);
10379   {
10380     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_chrom_max_len,0};
10381     PyObject* values[2] = {0,0};
10382     if (unlikely(__pyx_kwds)) {
10383       Py_ssize_t kw_args;
10384       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10385       switch (pos_args) {
10386         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10387         CYTHON_FALLTHROUGH;
10388         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10389         CYTHON_FALLTHROUGH;
10390         case  0: break;
10391         default: goto __pyx_L5_argtuple_error;
10392       }
10393       kw_args = PyDict_Size(__pyx_kwds);
10394       switch (pos_args) {
10395         case  0:
10396         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
10397         else goto __pyx_L5_argtuple_error;
10398         CYTHON_FALLTHROUGH;
10399         case  1:
10400         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom_max_len)) != 0)) kw_args--;
10401         else {
10402           __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 2, 2, 1); __PYX_ERR(0, 483, __pyx_L3_error)
10403         }
10404       }
10405       if (unlikely(kw_args > 0)) {
10406         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_chromosome") < 0)) __PYX_ERR(0, 483, __pyx_L3_error)
10407       }
10408     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
10409       goto __pyx_L5_argtuple_error;
10410     } else {
10411       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10412       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10413     }
10414     __pyx_v_chrom = ((PyObject*)values[0]);
10415     __pyx_v_chrom_max_len = __Pyx_PyInt_As_npy_int32(values[1]); if (unlikely((__pyx_v_chrom_max_len == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L3_error)
10416   }
10417   goto __pyx_L4_argument_unpacking_done;
10418   __pyx_L5_argtuple_error:;
10419   __Pyx_RaiseArgtupleInvalid("add_chromosome", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 483, __pyx_L3_error)
10420   __pyx_L3_error:;
10421   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
10422   __Pyx_RefNannyFinishContext();
10423   return NULL;
10424   __pyx_L4_argument_unpacking_done:;
10425   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyBytes_Type), 1, "chrom", 1))) __PYX_ERR(0, 483, __pyx_L1_error)
10426   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_6add_chromosome(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_chrom, __pyx_v_chrom_max_len);
10427 
10428   /* function exit code */
10429   goto __pyx_L0;
10430   __pyx_L1_error:;
10431   __pyx_r = NULL;
10432   __pyx_L0:;
10433   __Pyx_RefNannyFinishContext();
10434   return __pyx_r;
10435 }
10436 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_6add_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v_chrom,__pyx_t_5numpy_int32_t __pyx_v_chrom_max_len)10437 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_6add_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_5numpy_int32_t __pyx_v_chrom_max_len) {
10438   PyObject *__pyx_r = NULL;
10439   __Pyx_TraceDeclarations
10440   __Pyx_RefNannyDeclarations
10441   PyObject *__pyx_t_1 = NULL;
10442   __Pyx_RefNannySetupContext("add_chromosome", 0);
10443   __Pyx_TraceCall("add_chromosome (wrapper)", __pyx_f[0], 483, 0, __PYX_ERR(0, 483, __pyx_L1_error));
10444   __Pyx_XDECREF(__pyx_r);
10445   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_add_chromosome(__pyx_v_self, __pyx_v_chrom, __pyx_v_chrom_max_len, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
10446   __Pyx_GOTREF(__pyx_t_1);
10447   __pyx_r = __pyx_t_1;
10448   __pyx_t_1 = 0;
10449   goto __pyx_L0;
10450 
10451   /* function exit code */
10452   __pyx_L1_error:;
10453   __Pyx_XDECREF(__pyx_t_1);
10454   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
10455   __pyx_r = NULL;
10456   __pyx_L0:;
10457   __Pyx_XGIVEREF(__pyx_r);
10458   __Pyx_TraceReturn(__pyx_r, 0);
10459   __Pyx_RefNannyFinishContext();
10460   return __pyx_r;
10461 }
10462 
10463 /* "MACS2/IO/ScoreTrack.pyx":497
10464  *             self.datalength[chrom] = 0
10465  *
10466  *     cpdef add (self, bytes chromosome, int32_t endpos, float64_t chip, float64_t control):             # <<<<<<<<<<<<<<
10467  *         """Add a chr-endpos-sample-control block into data
10468  *         dictionary.
10469  */
10470 
10471 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_9add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_add(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v_chromosome,__pyx_t_5numpy_int32_t __pyx_v_endpos,__pyx_t_5numpy_float64_t __pyx_v_chip,__pyx_t_5numpy_float64_t __pyx_v_control,int __pyx_skip_dispatch)10472 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_add(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome, __pyx_t_5numpy_int32_t __pyx_v_endpos, __pyx_t_5numpy_float64_t __pyx_v_chip, __pyx_t_5numpy_float64_t __pyx_v_control, int __pyx_skip_dispatch) {
10473   __pyx_t_5numpy_int32_t __pyx_v_i;
10474   PyObject *__pyx_v_c = NULL;
10475   PyObject *__pyx_r = NULL;
10476   __Pyx_TraceDeclarations
10477   __Pyx_RefNannyDeclarations
10478   PyObject *__pyx_t_1 = NULL;
10479   PyObject *__pyx_t_2 = NULL;
10480   PyObject *__pyx_t_3 = NULL;
10481   PyObject *__pyx_t_4 = NULL;
10482   PyObject *__pyx_t_5 = NULL;
10483   PyObject *__pyx_t_6 = NULL;
10484   PyObject *__pyx_t_7 = NULL;
10485   int __pyx_t_8;
10486   PyObject *__pyx_t_9 = NULL;
10487   __pyx_t_5numpy_int32_t __pyx_t_10;
10488   PyObject *__pyx_t_11 = NULL;
10489   PyObject *__pyx_t_12 = NULL;
10490   __Pyx_RefNannySetupContext("add", 0);
10491   __Pyx_TraceCall("add", __pyx_f[0], 497, 0, __PYX_ERR(0, 497, __pyx_L1_error));
10492   /* Check if called by wrapper */
10493   if (unlikely(__pyx_skip_dispatch)) ;
10494   /* Check if overridden in Python */
10495   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
10496     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10497     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10498     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
10499       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10500       #endif
10501       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error)
10502       __Pyx_GOTREF(__pyx_t_1);
10503       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_9add)) {
10504         __Pyx_XDECREF(__pyx_r);
10505         __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_endpos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error)
10506         __Pyx_GOTREF(__pyx_t_3);
10507         __pyx_t_4 = PyFloat_FromDouble(__pyx_v_chip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error)
10508         __Pyx_GOTREF(__pyx_t_4);
10509         __pyx_t_5 = PyFloat_FromDouble(__pyx_v_control); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 497, __pyx_L1_error)
10510         __Pyx_GOTREF(__pyx_t_5);
10511         __Pyx_INCREF(__pyx_t_1);
10512         __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
10513         __pyx_t_8 = 0;
10514         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
10515           __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
10516           if (likely(__pyx_t_7)) {
10517             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10518             __Pyx_INCREF(__pyx_t_7);
10519             __Pyx_INCREF(function);
10520             __Pyx_DECREF_SET(__pyx_t_6, function);
10521             __pyx_t_8 = 1;
10522           }
10523         }
10524         #if CYTHON_FAST_PYCALL
10525         if (PyFunction_Check(__pyx_t_6)) {
10526           PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_chromosome, __pyx_t_3, __pyx_t_4, __pyx_t_5};
10527           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
10528           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10529           __Pyx_GOTREF(__pyx_t_2);
10530           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10531           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10532           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10533         } else
10534         #endif
10535         #if CYTHON_FAST_PYCCALL
10536         if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
10537           PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_chromosome, __pyx_t_3, __pyx_t_4, __pyx_t_5};
10538           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
10539           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10540           __Pyx_GOTREF(__pyx_t_2);
10541           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10542           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10543           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10544         } else
10545         #endif
10546         {
10547           __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 497, __pyx_L1_error)
10548           __Pyx_GOTREF(__pyx_t_9);
10549           if (__pyx_t_7) {
10550             __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
10551           }
10552           __Pyx_INCREF(__pyx_v_chromosome);
10553           __Pyx_GIVEREF(__pyx_v_chromosome);
10554           PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_chromosome);
10555           __Pyx_GIVEREF(__pyx_t_3);
10556           PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_3);
10557           __Pyx_GIVEREF(__pyx_t_4);
10558           PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_4);
10559           __Pyx_GIVEREF(__pyx_t_5);
10560           PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_5);
10561           __pyx_t_3 = 0;
10562           __pyx_t_4 = 0;
10563           __pyx_t_5 = 0;
10564           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
10565           __Pyx_GOTREF(__pyx_t_2);
10566           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10567         }
10568         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10569         __pyx_r = __pyx_t_2;
10570         __pyx_t_2 = 0;
10571         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10572         goto __pyx_L0;
10573       }
10574       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10575       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10576       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
10577       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
10578         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10579       }
10580       #endif
10581       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10582       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10583     }
10584     #endif
10585   }
10586 
10587   /* "MACS2/IO/ScoreTrack.pyx":509
10588  *         """
10589  *         cdef int32_t i
10590  *         i = self.datalength[chromosome]             # <<<<<<<<<<<<<<
10591  *         c = self.data[chromosome]
10592  *         c[0][ i ] = endpos
10593  */
10594   if (unlikely(__pyx_v_self->datalength == Py_None)) {
10595     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10596     __PYX_ERR(0, 509, __pyx_L1_error)
10597   }
10598   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chromosome); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
10599   __Pyx_GOTREF(__pyx_t_1);
10600   __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L1_error)
10601   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10602   __pyx_v_i = __pyx_t_10;
10603 
10604   /* "MACS2/IO/ScoreTrack.pyx":510
10605  *         cdef int32_t i
10606  *         i = self.datalength[chromosome]
10607  *         c = self.data[chromosome]             # <<<<<<<<<<<<<<
10608  *         c[0][ i ] = endpos
10609  *         c[1][ i ] = chip
10610  */
10611   if (unlikely(__pyx_v_self->data == Py_None)) {
10612     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10613     __PYX_ERR(0, 510, __pyx_L1_error)
10614   }
10615   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chromosome); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
10616   __Pyx_GOTREF(__pyx_t_1);
10617   __pyx_v_c = __pyx_t_1;
10618   __pyx_t_1 = 0;
10619 
10620   /* "MACS2/IO/ScoreTrack.pyx":511
10621  *         i = self.datalength[chromosome]
10622  *         c = self.data[chromosome]
10623  *         c[0][ i ] = endpos             # <<<<<<<<<<<<<<
10624  *         c[1][ i ] = chip
10625  *         c[2][ i ] = control
10626  */
10627   __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_endpos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
10628   __Pyx_GOTREF(__pyx_t_1);
10629   __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
10630   __Pyx_GOTREF(__pyx_t_2);
10631   if (unlikely(__Pyx_SetItemInt(__pyx_t_2, __pyx_v_i, __pyx_t_1, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1) < 0)) __PYX_ERR(0, 511, __pyx_L1_error)
10632   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10633   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10634 
10635   /* "MACS2/IO/ScoreTrack.pyx":512
10636  *         c = self.data[chromosome]
10637  *         c[0][ i ] = endpos
10638  *         c[1][ i ] = chip             # <<<<<<<<<<<<<<
10639  *         c[2][ i ] = control
10640  *         self.datalength[chromosome] += 1
10641  */
10642   __pyx_t_1 = PyFloat_FromDouble(__pyx_v_chip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
10643   __Pyx_GOTREF(__pyx_t_1);
10644   __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error)
10645   __Pyx_GOTREF(__pyx_t_2);
10646   if (unlikely(__Pyx_SetItemInt(__pyx_t_2, __pyx_v_i, __pyx_t_1, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1) < 0)) __PYX_ERR(0, 512, __pyx_L1_error)
10647   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10648   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10649 
10650   /* "MACS2/IO/ScoreTrack.pyx":513
10651  *         c[0][ i ] = endpos
10652  *         c[1][ i ] = chip
10653  *         c[2][ i ] = control             # <<<<<<<<<<<<<<
10654  *         self.datalength[chromosome] += 1
10655  *
10656  */
10657   __pyx_t_1 = PyFloat_FromDouble(__pyx_v_control); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
10658   __Pyx_GOTREF(__pyx_t_1);
10659   __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_c, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
10660   __Pyx_GOTREF(__pyx_t_2);
10661   if (unlikely(__Pyx_SetItemInt(__pyx_t_2, __pyx_v_i, __pyx_t_1, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1) < 0)) __PYX_ERR(0, 513, __pyx_L1_error)
10662   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10663   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10664 
10665   /* "MACS2/IO/ScoreTrack.pyx":514
10666  *         c[1][ i ] = chip
10667  *         c[2][ i ] = control
10668  *         self.datalength[chromosome] += 1             # <<<<<<<<<<<<<<
10669  *
10670  *     cpdef finalize ( self ):
10671  */
10672   if (unlikely(__pyx_v_self->datalength == Py_None)) {
10673     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10674     __PYX_ERR(0, 514, __pyx_L1_error)
10675   }
10676   __Pyx_INCREF(__pyx_v_self->datalength);
10677   __pyx_t_11 = __pyx_v_self->datalength;
10678   __Pyx_INCREF(__pyx_v_chromosome);
10679   __pyx_t_12 = __pyx_v_chromosome;
10680   if (unlikely(__pyx_t_11 == Py_None)) {
10681     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10682     __PYX_ERR(0, 514, __pyx_L1_error)
10683   }
10684   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
10685   __Pyx_GOTREF(__pyx_t_1);
10686   __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
10687   __Pyx_GOTREF(__pyx_t_2);
10688   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10689   if (unlikely(__pyx_t_11 == Py_None)) {
10690     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10691     __PYX_ERR(0, 514, __pyx_L1_error)
10692   }
10693   if (unlikely(PyDict_SetItem(__pyx_t_11, __pyx_t_12, __pyx_t_2) < 0)) __PYX_ERR(0, 514, __pyx_L1_error)
10694   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10695   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10696   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
10697 
10698   /* "MACS2/IO/ScoreTrack.pyx":497
10699  *             self.datalength[chrom] = 0
10700  *
10701  *     cpdef add (self, bytes chromosome, int32_t endpos, float64_t chip, float64_t control):             # <<<<<<<<<<<<<<
10702  *         """Add a chr-endpos-sample-control block into data
10703  *         dictionary.
10704  */
10705 
10706   /* function exit code */
10707   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10708   goto __pyx_L0;
10709   __pyx_L1_error:;
10710   __Pyx_XDECREF(__pyx_t_1);
10711   __Pyx_XDECREF(__pyx_t_2);
10712   __Pyx_XDECREF(__pyx_t_3);
10713   __Pyx_XDECREF(__pyx_t_4);
10714   __Pyx_XDECREF(__pyx_t_5);
10715   __Pyx_XDECREF(__pyx_t_6);
10716   __Pyx_XDECREF(__pyx_t_7);
10717   __Pyx_XDECREF(__pyx_t_9);
10718   __Pyx_XDECREF(__pyx_t_11);
10719   __Pyx_XDECREF(__pyx_t_12);
10720   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
10721   __pyx_r = 0;
10722   __pyx_L0:;
10723   __Pyx_XDECREF(__pyx_v_c);
10724   __Pyx_XGIVEREF(__pyx_r);
10725   __Pyx_TraceReturn(__pyx_r, 0);
10726   __Pyx_RefNannyFinishContext();
10727   return __pyx_r;
10728 }
10729 
10730 /* Python wrapper */
10731 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_9add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10732 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_8add[] = "Add a chr-endpos-sample-control block into data\n        dictionary.\n\n        chromosome: chromosome name in string\n        endpos    : end position of each interval in integer\n        chip      : ChIP pileup value of each interval in float\n        control   : Control pileup value of each interval in float\n\n        *Warning* Need to add regions continuously.\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_9add(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)10733 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_9add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10734   PyObject *__pyx_v_chromosome = 0;
10735   __pyx_t_5numpy_int32_t __pyx_v_endpos;
10736   __pyx_t_5numpy_float64_t __pyx_v_chip;
10737   __pyx_t_5numpy_float64_t __pyx_v_control;
10738   PyObject *__pyx_r = 0;
10739   __Pyx_RefNannyDeclarations
10740   __Pyx_RefNannySetupContext("add (wrapper)", 0);
10741   {
10742     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chromosome,&__pyx_n_s_endpos,&__pyx_n_s_chip,&__pyx_n_s_control,0};
10743     PyObject* values[4] = {0,0,0,0};
10744     if (unlikely(__pyx_kwds)) {
10745       Py_ssize_t kw_args;
10746       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10747       switch (pos_args) {
10748         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10749         CYTHON_FALLTHROUGH;
10750         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10751         CYTHON_FALLTHROUGH;
10752         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10753         CYTHON_FALLTHROUGH;
10754         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10755         CYTHON_FALLTHROUGH;
10756         case  0: break;
10757         default: goto __pyx_L5_argtuple_error;
10758       }
10759       kw_args = PyDict_Size(__pyx_kwds);
10760       switch (pos_args) {
10761         case  0:
10762         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chromosome)) != 0)) kw_args--;
10763         else goto __pyx_L5_argtuple_error;
10764         CYTHON_FALLTHROUGH;
10765         case  1:
10766         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_endpos)) != 0)) kw_args--;
10767         else {
10768           __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 1); __PYX_ERR(0, 497, __pyx_L3_error)
10769         }
10770         CYTHON_FALLTHROUGH;
10771         case  2:
10772         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chip)) != 0)) kw_args--;
10773         else {
10774           __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 2); __PYX_ERR(0, 497, __pyx_L3_error)
10775         }
10776         CYTHON_FALLTHROUGH;
10777         case  3:
10778         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_control)) != 0)) kw_args--;
10779         else {
10780           __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 3); __PYX_ERR(0, 497, __pyx_L3_error)
10781         }
10782       }
10783       if (unlikely(kw_args > 0)) {
10784         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 497, __pyx_L3_error)
10785       }
10786     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
10787       goto __pyx_L5_argtuple_error;
10788     } else {
10789       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10790       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10791       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10792       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10793     }
10794     __pyx_v_chromosome = ((PyObject*)values[0]);
10795     __pyx_v_endpos = __Pyx_PyInt_As_npy_int32(values[1]); if (unlikely((__pyx_v_endpos == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L3_error)
10796     __pyx_v_chip = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_chip == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L3_error)
10797     __pyx_v_control = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_control == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L3_error)
10798   }
10799   goto __pyx_L4_argument_unpacking_done;
10800   __pyx_L5_argtuple_error:;
10801   __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 497, __pyx_L3_error)
10802   __pyx_L3_error:;
10803   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
10804   __Pyx_RefNannyFinishContext();
10805   return NULL;
10806   __pyx_L4_argument_unpacking_done:;
10807   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chromosome), (&PyBytes_Type), 1, "chromosome", 1))) __PYX_ERR(0, 497, __pyx_L1_error)
10808   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_8add(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_chromosome, __pyx_v_endpos, __pyx_v_chip, __pyx_v_control);
10809 
10810   /* function exit code */
10811   goto __pyx_L0;
10812   __pyx_L1_error:;
10813   __pyx_r = NULL;
10814   __pyx_L0:;
10815   __Pyx_RefNannyFinishContext();
10816   return __pyx_r;
10817 }
10818 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_8add(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v_chromosome,__pyx_t_5numpy_int32_t __pyx_v_endpos,__pyx_t_5numpy_float64_t __pyx_v_chip,__pyx_t_5numpy_float64_t __pyx_v_control)10819 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_8add(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome, __pyx_t_5numpy_int32_t __pyx_v_endpos, __pyx_t_5numpy_float64_t __pyx_v_chip, __pyx_t_5numpy_float64_t __pyx_v_control) {
10820   PyObject *__pyx_r = NULL;
10821   __Pyx_TraceDeclarations
10822   __Pyx_RefNannyDeclarations
10823   PyObject *__pyx_t_1 = NULL;
10824   __Pyx_RefNannySetupContext("add", 0);
10825   __Pyx_TraceCall("add (wrapper)", __pyx_f[0], 497, 0, __PYX_ERR(0, 497, __pyx_L1_error));
10826   __Pyx_XDECREF(__pyx_r);
10827   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_add(__pyx_v_self, __pyx_v_chromosome, __pyx_v_endpos, __pyx_v_chip, __pyx_v_control, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error)
10828   __Pyx_GOTREF(__pyx_t_1);
10829   __pyx_r = __pyx_t_1;
10830   __pyx_t_1 = 0;
10831   goto __pyx_L0;
10832 
10833   /* function exit code */
10834   __pyx_L1_error:;
10835   __Pyx_XDECREF(__pyx_t_1);
10836   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
10837   __pyx_r = NULL;
10838   __pyx_L0:;
10839   __Pyx_XGIVEREF(__pyx_r);
10840   __Pyx_TraceReturn(__pyx_r, 0);
10841   __Pyx_RefNannyFinishContext();
10842   return __pyx_r;
10843 }
10844 
10845 /* "MACS2/IO/ScoreTrack.pyx":516
10846  *         self.datalength[chromosome] += 1
10847  *
10848  *     cpdef finalize ( self ):             # <<<<<<<<<<<<<<
10849  *         """
10850  *         Adjust array size of each chromosome.
10851  */
10852 
10853 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_11finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,int __pyx_skip_dispatch)10854 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch) {
10855   PyObject *__pyx_v_chrom = 0;
10856   __pyx_t_5numpy_int32_t __pyx_v_l;
10857   PyObject *__pyx_v_d = NULL;
10858   PyObject *__pyx_r = NULL;
10859   __Pyx_TraceDeclarations
10860   __Pyx_RefNannyDeclarations
10861   PyObject *__pyx_t_1 = NULL;
10862   PyObject *__pyx_t_2 = NULL;
10863   PyObject *__pyx_t_3 = NULL;
10864   PyObject *__pyx_t_4 = NULL;
10865   Py_ssize_t __pyx_t_5;
10866   Py_ssize_t __pyx_t_6;
10867   int __pyx_t_7;
10868   int __pyx_t_8;
10869   __pyx_t_5numpy_int32_t __pyx_t_9;
10870   PyObject *__pyx_t_10 = NULL;
10871   __Pyx_RefNannySetupContext("finalize", 0);
10872   __Pyx_TraceCall("finalize", __pyx_f[0], 516, 0, __PYX_ERR(0, 516, __pyx_L1_error));
10873   /* Check if called by wrapper */
10874   if (unlikely(__pyx_skip_dispatch)) ;
10875   /* Check if overridden in Python */
10876   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
10877     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10878     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10879     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
10880       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10881       #endif
10882       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_finalize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
10883       __Pyx_GOTREF(__pyx_t_1);
10884       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_11finalize)) {
10885         __Pyx_XDECREF(__pyx_r);
10886         __Pyx_INCREF(__pyx_t_1);
10887         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
10888         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
10889           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
10890           if (likely(__pyx_t_4)) {
10891             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10892             __Pyx_INCREF(__pyx_t_4);
10893             __Pyx_INCREF(function);
10894             __Pyx_DECREF_SET(__pyx_t_3, function);
10895           }
10896         }
10897         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
10898         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10899         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
10900         __Pyx_GOTREF(__pyx_t_2);
10901         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10902         __pyx_r = __pyx_t_2;
10903         __pyx_t_2 = 0;
10904         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10905         goto __pyx_L0;
10906       }
10907       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10908       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10909       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
10910       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
10911         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10912       }
10913       #endif
10914       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10915       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10916     }
10917     #endif
10918   }
10919 
10920   /* "MACS2/IO/ScoreTrack.pyx":525
10921  *             int32_t l
10922  *
10923  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
10924  *             d = self.data[chrom]
10925  *             l = self.datalength[chrom]
10926  */
10927   __pyx_t_5 = 0;
10928   if (unlikely(__pyx_v_self->data == Py_None)) {
10929     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
10930     __PYX_ERR(0, 525, __pyx_L1_error)
10931   }
10932   __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
10933   __Pyx_GOTREF(__pyx_t_2);
10934   __Pyx_XDECREF(__pyx_t_1);
10935   __pyx_t_1 = __pyx_t_2;
10936   __pyx_t_2 = 0;
10937   while (1) {
10938     __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_2, NULL, NULL, __pyx_t_7);
10939     if (unlikely(__pyx_t_8 == 0)) break;
10940     if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 525, __pyx_L1_error)
10941     __Pyx_GOTREF(__pyx_t_2);
10942     if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 525, __pyx_L1_error)
10943     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_2));
10944     __pyx_t_2 = 0;
10945 
10946     /* "MACS2/IO/ScoreTrack.pyx":526
10947  *
10948  *         for chrom in self.data.keys():
10949  *             d = self.data[chrom]             # <<<<<<<<<<<<<<
10950  *             l = self.datalength[chrom]
10951  *             d[0].resize( l, refcheck = False )
10952  */
10953     if (unlikely(__pyx_v_self->data == Py_None)) {
10954       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10955       __PYX_ERR(0, 526, __pyx_L1_error)
10956     }
10957     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
10958     __Pyx_GOTREF(__pyx_t_2);
10959     __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_2);
10960     __pyx_t_2 = 0;
10961 
10962     /* "MACS2/IO/ScoreTrack.pyx":527
10963  *         for chrom in self.data.keys():
10964  *             d = self.data[chrom]
10965  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
10966  *             d[0].resize( l, refcheck = False )
10967  *             d[1].resize( l, refcheck = False )
10968  */
10969     if (unlikely(__pyx_v_self->datalength == Py_None)) {
10970       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10971       __PYX_ERR(0, 527, __pyx_L1_error)
10972     }
10973     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error)
10974     __Pyx_GOTREF(__pyx_t_2);
10975     __pyx_t_9 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_9 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 527, __pyx_L1_error)
10976     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10977     __pyx_v_l = __pyx_t_9;
10978 
10979     /* "MACS2/IO/ScoreTrack.pyx":528
10980  *             d = self.data[chrom]
10981  *             l = self.datalength[chrom]
10982  *             d[0].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
10983  *             d[1].resize( l, refcheck = False )
10984  *             d[2].resize( l, refcheck = False )
10985  */
10986     __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
10987     __Pyx_GOTREF(__pyx_t_2);
10988     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_resize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error)
10989     __Pyx_GOTREF(__pyx_t_3);
10990     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10991     __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
10992     __Pyx_GOTREF(__pyx_t_2);
10993     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error)
10994     __Pyx_GOTREF(__pyx_t_4);
10995     __Pyx_GIVEREF(__pyx_t_2);
10996     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
10997     __pyx_t_2 = 0;
10998     __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
10999     __Pyx_GOTREF(__pyx_t_2);
11000     if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 528, __pyx_L1_error)
11001     __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 528, __pyx_L1_error)
11002     __Pyx_GOTREF(__pyx_t_10);
11003     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11004     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11005     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11006     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11007 
11008     /* "MACS2/IO/ScoreTrack.pyx":529
11009  *             l = self.datalength[chrom]
11010  *             d[0].resize( l, refcheck = False )
11011  *             d[1].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
11012  *             d[2].resize( l, refcheck = False )
11013  *             d[3].resize( l, refcheck = False )
11014  */
11015     __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_d, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 529, __pyx_L1_error)
11016     __Pyx_GOTREF(__pyx_t_10);
11017     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error)
11018     __Pyx_GOTREF(__pyx_t_2);
11019     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11020     __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_l); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 529, __pyx_L1_error)
11021     __Pyx_GOTREF(__pyx_t_10);
11022     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error)
11023     __Pyx_GOTREF(__pyx_t_4);
11024     __Pyx_GIVEREF(__pyx_t_10);
11025     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10);
11026     __pyx_t_10 = 0;
11027     __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 529, __pyx_L1_error)
11028     __Pyx_GOTREF(__pyx_t_10);
11029     if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 529, __pyx_L1_error)
11030     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
11031     __Pyx_GOTREF(__pyx_t_3);
11032     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11033     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11034     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11035     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11036 
11037     /* "MACS2/IO/ScoreTrack.pyx":530
11038  *             d[0].resize( l, refcheck = False )
11039  *             d[1].resize( l, refcheck = False )
11040  *             d[2].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
11041  *             d[3].resize( l, refcheck = False )
11042  *         return
11043  */
11044     __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_d, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error)
11045     __Pyx_GOTREF(__pyx_t_3);
11046     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_resize); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 530, __pyx_L1_error)
11047     __Pyx_GOTREF(__pyx_t_10);
11048     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11049     __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_l); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error)
11050     __Pyx_GOTREF(__pyx_t_3);
11051     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
11052     __Pyx_GOTREF(__pyx_t_4);
11053     __Pyx_GIVEREF(__pyx_t_3);
11054     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
11055     __pyx_t_3 = 0;
11056     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error)
11057     __Pyx_GOTREF(__pyx_t_3);
11058     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
11059     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
11060     __Pyx_GOTREF(__pyx_t_2);
11061     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11062     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11063     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11064     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11065 
11066     /* "MACS2/IO/ScoreTrack.pyx":531
11067  *             d[1].resize( l, refcheck = False )
11068  *             d[2].resize( l, refcheck = False )
11069  *             d[3].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
11070  *         return
11071  *
11072  */
11073     __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_d, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
11074     __Pyx_GOTREF(__pyx_t_2);
11075     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_resize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error)
11076     __Pyx_GOTREF(__pyx_t_3);
11077     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11078     __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
11079     __Pyx_GOTREF(__pyx_t_2);
11080     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error)
11081     __Pyx_GOTREF(__pyx_t_4);
11082     __Pyx_GIVEREF(__pyx_t_2);
11083     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
11084     __pyx_t_2 = 0;
11085     __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
11086     __Pyx_GOTREF(__pyx_t_2);
11087     if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 531, __pyx_L1_error)
11088     __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 531, __pyx_L1_error)
11089     __Pyx_GOTREF(__pyx_t_10);
11090     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11091     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11092     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11093     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11094   }
11095   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11096 
11097   /* "MACS2/IO/ScoreTrack.pyx":532
11098  *             d[2].resize( l, refcheck = False )
11099  *             d[3].resize( l, refcheck = False )
11100  *         return             # <<<<<<<<<<<<<<
11101  *
11102  *     # cpdef sort ( self, int32_t column = 1 ):
11103  */
11104   __Pyx_XDECREF(__pyx_r);
11105   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11106   goto __pyx_L0;
11107 
11108   /* "MACS2/IO/ScoreTrack.pyx":516
11109  *         self.datalength[chromosome] += 1
11110  *
11111  *     cpdef finalize ( self ):             # <<<<<<<<<<<<<<
11112  *         """
11113  *         Adjust array size of each chromosome.
11114  */
11115 
11116   /* function exit code */
11117   __pyx_L1_error:;
11118   __Pyx_XDECREF(__pyx_t_1);
11119   __Pyx_XDECREF(__pyx_t_2);
11120   __Pyx_XDECREF(__pyx_t_3);
11121   __Pyx_XDECREF(__pyx_t_4);
11122   __Pyx_XDECREF(__pyx_t_10);
11123   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
11124   __pyx_r = 0;
11125   __pyx_L0:;
11126   __Pyx_XDECREF(__pyx_v_chrom);
11127   __Pyx_XDECREF(__pyx_v_d);
11128   __Pyx_XGIVEREF(__pyx_r);
11129   __Pyx_TraceReturn(__pyx_r, 0);
11130   __Pyx_RefNannyFinishContext();
11131   return __pyx_r;
11132 }
11133 
11134 /* Python wrapper */
11135 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_11finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11136 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_10finalize[] = "\n        Adjust array size of each chromosome.\n\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_11finalize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)11137 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_11finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11138   PyObject *__pyx_r = 0;
11139   __Pyx_RefNannyDeclarations
11140   __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
11141   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_10finalize(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self));
11142 
11143   /* function exit code */
11144   __Pyx_RefNannyFinishContext();
11145   return __pyx_r;
11146 }
11147 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_10finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)11148 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_10finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
11149   PyObject *__pyx_r = NULL;
11150   __Pyx_TraceDeclarations
11151   __Pyx_RefNannyDeclarations
11152   PyObject *__pyx_t_1 = NULL;
11153   __Pyx_RefNannySetupContext("finalize", 0);
11154   __Pyx_TraceCall("finalize (wrapper)", __pyx_f[0], 516, 0, __PYX_ERR(0, 516, __pyx_L1_error));
11155   __Pyx_XDECREF(__pyx_r);
11156   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_finalize(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
11157   __Pyx_GOTREF(__pyx_t_1);
11158   __pyx_r = __pyx_t_1;
11159   __pyx_t_1 = 0;
11160   goto __pyx_L0;
11161 
11162   /* function exit code */
11163   __pyx_L1_error:;
11164   __Pyx_XDECREF(__pyx_t_1);
11165   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
11166   __pyx_r = NULL;
11167   __pyx_L0:;
11168   __Pyx_XGIVEREF(__pyx_r);
11169   __Pyx_TraceReturn(__pyx_r, 0);
11170   __Pyx_RefNannyFinishContext();
11171   return __pyx_r;
11172 }
11173 
11174 /* "MACS2/IO/ScoreTrack.pyx":550
11175  *     #     return
11176  *
11177  *     cpdef get_data_by_chr (self, bytes chromosome):             # <<<<<<<<<<<<<<
11178  *         """Return array of counts by chromosome.
11179  *
11180  */
11181 
11182 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_13get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v_chromosome,int __pyx_skip_dispatch)11183 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_skip_dispatch) {
11184   PyObject *__pyx_r = NULL;
11185   __Pyx_TraceDeclarations
11186   __Pyx_RefNannyDeclarations
11187   PyObject *__pyx_t_1 = NULL;
11188   PyObject *__pyx_t_2 = NULL;
11189   PyObject *__pyx_t_3 = NULL;
11190   PyObject *__pyx_t_4 = NULL;
11191   int __pyx_t_5;
11192   int __pyx_t_6;
11193   __Pyx_RefNannySetupContext("get_data_by_chr", 0);
11194   __Pyx_TraceCall("get_data_by_chr", __pyx_f[0], 550, 0, __PYX_ERR(0, 550, __pyx_L1_error));
11195   /* Check if called by wrapper */
11196   if (unlikely(__pyx_skip_dispatch)) ;
11197   /* Check if overridden in Python */
11198   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
11199     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11200     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
11201     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
11202       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
11203       #endif
11204       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_data_by_chr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
11205       __Pyx_GOTREF(__pyx_t_1);
11206       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_13get_data_by_chr)) {
11207         __Pyx_XDECREF(__pyx_r);
11208         __Pyx_INCREF(__pyx_t_1);
11209         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
11210         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11211           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11212           if (likely(__pyx_t_4)) {
11213             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11214             __Pyx_INCREF(__pyx_t_4);
11215             __Pyx_INCREF(function);
11216             __Pyx_DECREF_SET(__pyx_t_3, function);
11217           }
11218         }
11219         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_chromosome) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_chromosome);
11220         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11221         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error)
11222         __Pyx_GOTREF(__pyx_t_2);
11223         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11224         __pyx_r = __pyx_t_2;
11225         __pyx_t_2 = 0;
11226         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11227         goto __pyx_L0;
11228       }
11229       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11230       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
11231       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
11232       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
11233         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
11234       }
11235       #endif
11236       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11237       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11238     }
11239     #endif
11240   }
11241 
11242   /* "MACS2/IO/ScoreTrack.pyx":556
11243  *         ([end pos],[value])
11244  *         """
11245  *         if chromosome in self.data:             # <<<<<<<<<<<<<<
11246  *             return self.data[chromosome]
11247  *         else:
11248  */
11249   if (unlikely(__pyx_v_self->data == Py_None)) {
11250     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
11251     __PYX_ERR(0, 556, __pyx_L1_error)
11252   }
11253   __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_chromosome, __pyx_v_self->data, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 556, __pyx_L1_error)
11254   __pyx_t_6 = (__pyx_t_5 != 0);
11255   if (__pyx_t_6) {
11256 
11257     /* "MACS2/IO/ScoreTrack.pyx":557
11258  *         """
11259  *         if chromosome in self.data:
11260  *             return self.data[chromosome]             # <<<<<<<<<<<<<<
11261  *         else:
11262  *             return None
11263  */
11264     __Pyx_XDECREF(__pyx_r);
11265     if (unlikely(__pyx_v_self->data == Py_None)) {
11266       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
11267       __PYX_ERR(0, 557, __pyx_L1_error)
11268     }
11269     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chromosome); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
11270     __Pyx_GOTREF(__pyx_t_1);
11271     __pyx_r = __pyx_t_1;
11272     __pyx_t_1 = 0;
11273     goto __pyx_L0;
11274 
11275     /* "MACS2/IO/ScoreTrack.pyx":556
11276  *         ([end pos],[value])
11277  *         """
11278  *         if chromosome in self.data:             # <<<<<<<<<<<<<<
11279  *             return self.data[chromosome]
11280  *         else:
11281  */
11282   }
11283 
11284   /* "MACS2/IO/ScoreTrack.pyx":559
11285  *             return self.data[chromosome]
11286  *         else:
11287  *             return None             # <<<<<<<<<<<<<<
11288  *
11289  *     cpdef get_chr_names (self):
11290  */
11291   /*else*/ {
11292     __Pyx_XDECREF(__pyx_r);
11293     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11294     goto __pyx_L0;
11295   }
11296 
11297   /* "MACS2/IO/ScoreTrack.pyx":550
11298  *     #     return
11299  *
11300  *     cpdef get_data_by_chr (self, bytes chromosome):             # <<<<<<<<<<<<<<
11301  *         """Return array of counts by chromosome.
11302  *
11303  */
11304 
11305   /* function exit code */
11306   __pyx_L1_error:;
11307   __Pyx_XDECREF(__pyx_t_1);
11308   __Pyx_XDECREF(__pyx_t_2);
11309   __Pyx_XDECREF(__pyx_t_3);
11310   __Pyx_XDECREF(__pyx_t_4);
11311   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
11312   __pyx_r = 0;
11313   __pyx_L0:;
11314   __Pyx_XGIVEREF(__pyx_r);
11315   __Pyx_TraceReturn(__pyx_r, 0);
11316   __Pyx_RefNannyFinishContext();
11317   return __pyx_r;
11318 }
11319 
11320 /* Python wrapper */
11321 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_13get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /*proto*/
11322 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_12get_data_by_chr[] = "Return array of counts by chromosome.\n\n        The return value is a tuple:\n        ([end pos],[value])\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_13get_data_by_chr(PyObject * __pyx_v_self,PyObject * __pyx_v_chromosome)11323 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_13get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome) {
11324   PyObject *__pyx_r = 0;
11325   __Pyx_RefNannyDeclarations
11326   __Pyx_RefNannySetupContext("get_data_by_chr (wrapper)", 0);
11327   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chromosome), (&PyBytes_Type), 1, "chromosome", 1))) __PYX_ERR(0, 550, __pyx_L1_error)
11328   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_12get_data_by_chr(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), ((PyObject*)__pyx_v_chromosome));
11329 
11330   /* function exit code */
11331   goto __pyx_L0;
11332   __pyx_L1_error:;
11333   __pyx_r = NULL;
11334   __pyx_L0:;
11335   __Pyx_RefNannyFinishContext();
11336   return __pyx_r;
11337 }
11338 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_12get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v_chromosome)11339 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_12get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_chromosome) {
11340   PyObject *__pyx_r = NULL;
11341   __Pyx_TraceDeclarations
11342   __Pyx_RefNannyDeclarations
11343   PyObject *__pyx_t_1 = NULL;
11344   __Pyx_RefNannySetupContext("get_data_by_chr", 0);
11345   __Pyx_TraceCall("get_data_by_chr (wrapper)", __pyx_f[0], 550, 0, __PYX_ERR(0, 550, __pyx_L1_error));
11346   __Pyx_XDECREF(__pyx_r);
11347   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_get_data_by_chr(__pyx_v_self, __pyx_v_chromosome, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
11348   __Pyx_GOTREF(__pyx_t_1);
11349   __pyx_r = __pyx_t_1;
11350   __pyx_t_1 = 0;
11351   goto __pyx_L0;
11352 
11353   /* function exit code */
11354   __pyx_L1_error:;
11355   __Pyx_XDECREF(__pyx_t_1);
11356   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
11357   __pyx_r = NULL;
11358   __pyx_L0:;
11359   __Pyx_XGIVEREF(__pyx_r);
11360   __Pyx_TraceReturn(__pyx_r, 0);
11361   __Pyx_RefNannyFinishContext();
11362   return __pyx_r;
11363 }
11364 
11365 /* "MACS2/IO/ScoreTrack.pyx":561
11366  *             return None
11367  *
11368  *     cpdef get_chr_names (self):             # <<<<<<<<<<<<<<
11369  *         """Return all the chromosome names stored.
11370  *
11371  */
11372 
11373 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_15get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,int __pyx_skip_dispatch)11374 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch) {
11375   PyObject *__pyx_v_l = NULL;
11376   PyObject *__pyx_r = NULL;
11377   __Pyx_TraceDeclarations
11378   __Pyx_RefNannyDeclarations
11379   PyObject *__pyx_t_1 = NULL;
11380   PyObject *__pyx_t_2 = NULL;
11381   PyObject *__pyx_t_3 = NULL;
11382   PyObject *__pyx_t_4 = NULL;
11383   __Pyx_RefNannySetupContext("get_chr_names", 0);
11384   __Pyx_TraceCall("get_chr_names", __pyx_f[0], 561, 0, __PYX_ERR(0, 561, __pyx_L1_error));
11385   /* Check if called by wrapper */
11386   if (unlikely(__pyx_skip_dispatch)) ;
11387   /* Check if overridden in Python */
11388   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
11389     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11390     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
11391     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
11392       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
11393       #endif
11394       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_chr_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
11395       __Pyx_GOTREF(__pyx_t_1);
11396       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_15get_chr_names)) {
11397         __Pyx_XDECREF(__pyx_r);
11398         __Pyx_INCREF(__pyx_t_1);
11399         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
11400         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11401           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11402           if (likely(__pyx_t_4)) {
11403             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11404             __Pyx_INCREF(__pyx_t_4);
11405             __Pyx_INCREF(function);
11406             __Pyx_DECREF_SET(__pyx_t_3, function);
11407           }
11408         }
11409         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11410         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11411         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
11412         __Pyx_GOTREF(__pyx_t_2);
11413         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11414         __pyx_r = __pyx_t_2;
11415         __pyx_t_2 = 0;
11416         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11417         goto __pyx_L0;
11418       }
11419       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11420       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
11421       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
11422       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
11423         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
11424       }
11425       #endif
11426       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11427       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11428     }
11429     #endif
11430   }
11431 
11432   /* "MACS2/IO/ScoreTrack.pyx":565
11433  *
11434  *         """
11435  *         l = set(self.data.keys())             # <<<<<<<<<<<<<<
11436  *         return l
11437  *
11438  */
11439   if (unlikely(__pyx_v_self->data == Py_None)) {
11440     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
11441     __PYX_ERR(0, 565, __pyx_L1_error)
11442   }
11443   __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
11444   __Pyx_GOTREF(__pyx_t_1);
11445   __pyx_t_2 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error)
11446   __Pyx_GOTREF(__pyx_t_2);
11447   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11448   __pyx_v_l = ((PyObject*)__pyx_t_2);
11449   __pyx_t_2 = 0;
11450 
11451   /* "MACS2/IO/ScoreTrack.pyx":566
11452  *         """
11453  *         l = set(self.data.keys())
11454  *         return l             # <<<<<<<<<<<<<<
11455  *
11456  *     cpdef change_normalization_method ( self, char normalization_method ):
11457  */
11458   __Pyx_XDECREF(__pyx_r);
11459   __Pyx_INCREF(__pyx_v_l);
11460   __pyx_r = __pyx_v_l;
11461   goto __pyx_L0;
11462 
11463   /* "MACS2/IO/ScoreTrack.pyx":561
11464  *             return None
11465  *
11466  *     cpdef get_chr_names (self):             # <<<<<<<<<<<<<<
11467  *         """Return all the chromosome names stored.
11468  *
11469  */
11470 
11471   /* function exit code */
11472   __pyx_L1_error:;
11473   __Pyx_XDECREF(__pyx_t_1);
11474   __Pyx_XDECREF(__pyx_t_2);
11475   __Pyx_XDECREF(__pyx_t_3);
11476   __Pyx_XDECREF(__pyx_t_4);
11477   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
11478   __pyx_r = 0;
11479   __pyx_L0:;
11480   __Pyx_XDECREF(__pyx_v_l);
11481   __Pyx_XGIVEREF(__pyx_r);
11482   __Pyx_TraceReturn(__pyx_r, 0);
11483   __Pyx_RefNannyFinishContext();
11484   return __pyx_r;
11485 }
11486 
11487 /* Python wrapper */
11488 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_15get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11489 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_14get_chr_names[] = "Return all the chromosome names stored.\n        \n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_15get_chr_names(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)11490 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_15get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11491   PyObject *__pyx_r = 0;
11492   __Pyx_RefNannyDeclarations
11493   __Pyx_RefNannySetupContext("get_chr_names (wrapper)", 0);
11494   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_14get_chr_names(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self));
11495 
11496   /* function exit code */
11497   __Pyx_RefNannyFinishContext();
11498   return __pyx_r;
11499 }
11500 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_14get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)11501 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_14get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
11502   PyObject *__pyx_r = NULL;
11503   __Pyx_TraceDeclarations
11504   __Pyx_RefNannyDeclarations
11505   PyObject *__pyx_t_1 = NULL;
11506   __Pyx_RefNannySetupContext("get_chr_names", 0);
11507   __Pyx_TraceCall("get_chr_names (wrapper)", __pyx_f[0], 561, 0, __PYX_ERR(0, 561, __pyx_L1_error));
11508   __Pyx_XDECREF(__pyx_r);
11509   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_get_chr_names(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
11510   __Pyx_GOTREF(__pyx_t_1);
11511   __pyx_r = __pyx_t_1;
11512   __pyx_t_1 = 0;
11513   goto __pyx_L0;
11514 
11515   /* function exit code */
11516   __pyx_L1_error:;
11517   __Pyx_XDECREF(__pyx_t_1);
11518   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
11519   __pyx_r = NULL;
11520   __pyx_L0:;
11521   __Pyx_XGIVEREF(__pyx_r);
11522   __Pyx_TraceReturn(__pyx_r, 0);
11523   __Pyx_RefNannyFinishContext();
11524   return __pyx_r;
11525 }
11526 
11527 /* "MACS2/IO/ScoreTrack.pyx":568
11528  *         return l
11529  *
11530  *     cpdef change_normalization_method ( self, char normalization_method ):             # <<<<<<<<<<<<<<
11531  *         """Change/set normalization method. However, I do not
11532  *         recommend change this back and forward, since some precision
11533  */
11534 
11535 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_17change_normalization_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_normalization_method); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_change_normalization_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,char __pyx_v_normalization_method,int __pyx_skip_dispatch)11536 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_change_normalization_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_normalization_method, int __pyx_skip_dispatch) {
11537   PyObject *__pyx_r = NULL;
11538   __Pyx_TraceDeclarations
11539   __Pyx_RefNannyDeclarations
11540   PyObject *__pyx_t_1 = NULL;
11541   PyObject *__pyx_t_2 = NULL;
11542   PyObject *__pyx_t_3 = NULL;
11543   PyObject *__pyx_t_4 = NULL;
11544   PyObject *__pyx_t_5 = NULL;
11545   __Pyx_RefNannySetupContext("change_normalization_method", 0);
11546   __Pyx_TraceCall("change_normalization_method", __pyx_f[0], 568, 0, __PYX_ERR(0, 568, __pyx_L1_error));
11547   /* Check if called by wrapper */
11548   if (unlikely(__pyx_skip_dispatch)) ;
11549   /* Check if overridden in Python */
11550   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
11551     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11552     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
11553     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
11554       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
11555       #endif
11556       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_change_normalization_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
11557       __Pyx_GOTREF(__pyx_t_1);
11558       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_17change_normalization_method)) {
11559         __Pyx_XDECREF(__pyx_r);
11560         __pyx_t_3 = __Pyx_PyInt_From_char(__pyx_v_normalization_method); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
11561         __Pyx_GOTREF(__pyx_t_3);
11562         __Pyx_INCREF(__pyx_t_1);
11563         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
11564         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11565           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
11566           if (likely(__pyx_t_5)) {
11567             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11568             __Pyx_INCREF(__pyx_t_5);
11569             __Pyx_INCREF(function);
11570             __Pyx_DECREF_SET(__pyx_t_4, function);
11571           }
11572         }
11573         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
11574         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11575         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11576         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
11577         __Pyx_GOTREF(__pyx_t_2);
11578         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11579         __pyx_r = __pyx_t_2;
11580         __pyx_t_2 = 0;
11581         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11582         goto __pyx_L0;
11583       }
11584       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11585       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
11586       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
11587       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
11588         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
11589       }
11590       #endif
11591       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11592       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11593     }
11594     #endif
11595   }
11596 
11597   /* "MACS2/IO/ScoreTrack.pyx":578
11598  *                               N: not set/ raw pileup
11599  *         """
11600  *         if normalization_method == ord('T'):             # <<<<<<<<<<<<<<
11601  *             if self.normalization_method == ord('T'): # do nothing
11602  *                 pass
11603  */
11604   switch (__pyx_v_normalization_method) {
11605     case 84:
11606 
11607     /* "MACS2/IO/ScoreTrack.pyx":579
11608  *         """
11609  *         if normalization_method == ord('T'):
11610  *             if self.normalization_method == ord('T'): # do nothing             # <<<<<<<<<<<<<<
11611  *                 pass
11612  *             elif self.normalization_method == ord('C'):
11613  */
11614     switch (__pyx_v_self->normalization_method) {
11615       case 84:
11616       break;
11617       case 67:
11618 
11619       /* "MACS2/IO/ScoreTrack.pyx":582
11620  *                 pass
11621  *             elif self.normalization_method == ord('C'):
11622  *                 self.normalize( self.treat_edm/self.ctrl_edm, self.treat_edm/self.ctrl_edm )             # <<<<<<<<<<<<<<
11623  *             elif  self.normalization_method == ord('M'):
11624  *                 self.normalize( self.treat_edm, self.treat_edm )
11625  */
11626       if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
11627         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11628         __PYX_ERR(0, 582, __pyx_L1_error)
11629       }
11630       if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
11631         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11632         __PYX_ERR(0, 582, __pyx_L1_error)
11633       }
11634       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (__pyx_v_self->treat_edm / __pyx_v_self->ctrl_edm), (__pyx_v_self->treat_edm / __pyx_v_self->ctrl_edm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
11635       __Pyx_GOTREF(__pyx_t_1);
11636       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11637 
11638       /* "MACS2/IO/ScoreTrack.pyx":581
11639  *             if self.normalization_method == ord('T'): # do nothing
11640  *                 pass
11641  *             elif self.normalization_method == ord('C'):             # <<<<<<<<<<<<<<
11642  *                 self.normalize( self.treat_edm/self.ctrl_edm, self.treat_edm/self.ctrl_edm )
11643  *             elif  self.normalization_method == ord('M'):
11644  */
11645       break;
11646       case 77:
11647 
11648       /* "MACS2/IO/ScoreTrack.pyx":584
11649  *                 self.normalize( self.treat_edm/self.ctrl_edm, self.treat_edm/self.ctrl_edm )
11650  *             elif  self.normalization_method == ord('M'):
11651  *                 self.normalize( self.treat_edm, self.treat_edm )             # <<<<<<<<<<<<<<
11652  *             elif self.normalization_method == ord('N'):
11653  *                 self.normalize( 1, self.treat_edm/self.ctrl_edm )
11654  */
11655       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, __pyx_v_self->treat_edm, __pyx_v_self->treat_edm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
11656       __Pyx_GOTREF(__pyx_t_1);
11657       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11658 
11659       /* "MACS2/IO/ScoreTrack.pyx":583
11660  *             elif self.normalization_method == ord('C'):
11661  *                 self.normalize( self.treat_edm/self.ctrl_edm, self.treat_edm/self.ctrl_edm )
11662  *             elif  self.normalization_method == ord('M'):             # <<<<<<<<<<<<<<
11663  *                 self.normalize( self.treat_edm, self.treat_edm )
11664  *             elif self.normalization_method == ord('N'):
11665  */
11666       break;
11667       case 78:
11668 
11669       /* "MACS2/IO/ScoreTrack.pyx":586
11670  *                 self.normalize( self.treat_edm, self.treat_edm )
11671  *             elif self.normalization_method == ord('N'):
11672  *                 self.normalize( 1, self.treat_edm/self.ctrl_edm )             # <<<<<<<<<<<<<<
11673  *             else:
11674  *                 raise NotImplemented
11675  */
11676       if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
11677         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11678         __PYX_ERR(0, 586, __pyx_L1_error)
11679       }
11680       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, 1.0, (__pyx_v_self->treat_edm / __pyx_v_self->ctrl_edm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error)
11681       __Pyx_GOTREF(__pyx_t_1);
11682       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11683 
11684       /* "MACS2/IO/ScoreTrack.pyx":585
11685  *             elif  self.normalization_method == ord('M'):
11686  *                 self.normalize( self.treat_edm, self.treat_edm )
11687  *             elif self.normalization_method == ord('N'):             # <<<<<<<<<<<<<<
11688  *                 self.normalize( 1, self.treat_edm/self.ctrl_edm )
11689  *             else:
11690  */
11691       break;
11692       default:
11693 
11694       /* "MACS2/IO/ScoreTrack.pyx":588
11695  *                 self.normalize( 1, self.treat_edm/self.ctrl_edm )
11696  *             else:
11697  *                 raise NotImplemented             # <<<<<<<<<<<<<<
11698  *             self.normalization_method = ord('T')
11699  *         elif normalization_method == ord('C'):
11700  */
11701       __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
11702       __PYX_ERR(0, 588, __pyx_L1_error)
11703       break;
11704     }
11705 
11706     /* "MACS2/IO/ScoreTrack.pyx":589
11707  *             else:
11708  *                 raise NotImplemented
11709  *             self.normalization_method = ord('T')             # <<<<<<<<<<<<<<
11710  *         elif normalization_method == ord('C'):
11711  *             if self.normalization_method == ord('T'):
11712  */
11713     __pyx_v_self->normalization_method = 84;
11714 
11715     /* "MACS2/IO/ScoreTrack.pyx":578
11716  *                               N: not set/ raw pileup
11717  *         """
11718  *         if normalization_method == ord('T'):             # <<<<<<<<<<<<<<
11719  *             if self.normalization_method == ord('T'): # do nothing
11720  *                 pass
11721  */
11722     break;
11723     case 67:
11724 
11725     /* "MACS2/IO/ScoreTrack.pyx":591
11726  *             self.normalization_method = ord('T')
11727  *         elif normalization_method == ord('C'):
11728  *             if self.normalization_method == ord('T'):             # <<<<<<<<<<<<<<
11729  *                 self.normalize( self.ctrl_edm/self.treat_edm, self.ctrl_edm/self.treat_edm )
11730  *             elif self.normalization_method == ord('C'): # do nothing
11731  */
11732     switch (__pyx_v_self->normalization_method) {
11733       case 84:
11734 
11735       /* "MACS2/IO/ScoreTrack.pyx":592
11736  *         elif normalization_method == ord('C'):
11737  *             if self.normalization_method == ord('T'):
11738  *                 self.normalize( self.ctrl_edm/self.treat_edm, self.ctrl_edm/self.treat_edm )             # <<<<<<<<<<<<<<
11739  *             elif self.normalization_method == ord('C'): # do nothing
11740  *                 pass
11741  */
11742       if (unlikely(__pyx_v_self->treat_edm == 0)) {
11743         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11744         __PYX_ERR(0, 592, __pyx_L1_error)
11745       }
11746       if (unlikely(__pyx_v_self->treat_edm == 0)) {
11747         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11748         __PYX_ERR(0, 592, __pyx_L1_error)
11749       }
11750       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (__pyx_v_self->ctrl_edm / __pyx_v_self->treat_edm), (__pyx_v_self->ctrl_edm / __pyx_v_self->treat_edm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
11751       __Pyx_GOTREF(__pyx_t_1);
11752       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11753 
11754       /* "MACS2/IO/ScoreTrack.pyx":591
11755  *             self.normalization_method = ord('T')
11756  *         elif normalization_method == ord('C'):
11757  *             if self.normalization_method == ord('T'):             # <<<<<<<<<<<<<<
11758  *                 self.normalize( self.ctrl_edm/self.treat_edm, self.ctrl_edm/self.treat_edm )
11759  *             elif self.normalization_method == ord('C'): # do nothing
11760  */
11761       break;
11762       case 67:
11763 
11764       /* "MACS2/IO/ScoreTrack.pyx":593
11765  *             if self.normalization_method == ord('T'):
11766  *                 self.normalize( self.ctrl_edm/self.treat_edm, self.ctrl_edm/self.treat_edm )
11767  *             elif self.normalization_method == ord('C'): # do nothing             # <<<<<<<<<<<<<<
11768  *                 pass
11769  *             elif  self.normalization_method == ord('M'):
11770  */
11771       break;
11772       case 77:
11773 
11774       /* "MACS2/IO/ScoreTrack.pyx":596
11775  *                 pass
11776  *             elif  self.normalization_method == ord('M'):
11777  *                 self.normalize( self.ctrl_edm, self.ctrl_edm )             # <<<<<<<<<<<<<<
11778  *             elif self.normalization_method == ord('N'):
11779  *                 self.normalize( self.ctrl_edm/self.treat_edm, 1 )
11780  */
11781       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, __pyx_v_self->ctrl_edm, __pyx_v_self->ctrl_edm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error)
11782       __Pyx_GOTREF(__pyx_t_1);
11783       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11784 
11785       /* "MACS2/IO/ScoreTrack.pyx":595
11786  *             elif self.normalization_method == ord('C'): # do nothing
11787  *                 pass
11788  *             elif  self.normalization_method == ord('M'):             # <<<<<<<<<<<<<<
11789  *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
11790  *             elif self.normalization_method == ord('N'):
11791  */
11792       break;
11793       case 78:
11794 
11795       /* "MACS2/IO/ScoreTrack.pyx":598
11796  *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
11797  *             elif self.normalization_method == ord('N'):
11798  *                 self.normalize( self.ctrl_edm/self.treat_edm, 1 )             # <<<<<<<<<<<<<<
11799  *             else:
11800  *                 raise NotImplemented
11801  */
11802       if (unlikely(__pyx_v_self->treat_edm == 0)) {
11803         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11804         __PYX_ERR(0, 598, __pyx_L1_error)
11805       }
11806       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (__pyx_v_self->ctrl_edm / __pyx_v_self->treat_edm), 1.0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
11807       __Pyx_GOTREF(__pyx_t_1);
11808       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11809 
11810       /* "MACS2/IO/ScoreTrack.pyx":597
11811  *             elif  self.normalization_method == ord('M'):
11812  *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
11813  *             elif self.normalization_method == ord('N'):             # <<<<<<<<<<<<<<
11814  *                 self.normalize( self.ctrl_edm/self.treat_edm, 1 )
11815  *             else:
11816  */
11817       break;
11818       default:
11819 
11820       /* "MACS2/IO/ScoreTrack.pyx":600
11821  *                 self.normalize( self.ctrl_edm/self.treat_edm, 1 )
11822  *             else:
11823  *                 raise NotImplemented             # <<<<<<<<<<<<<<
11824  *             self.normalization_method = ord('C')
11825  *         elif normalization_method == ord('M'):
11826  */
11827       __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
11828       __PYX_ERR(0, 600, __pyx_L1_error)
11829       break;
11830     }
11831 
11832     /* "MACS2/IO/ScoreTrack.pyx":601
11833  *             else:
11834  *                 raise NotImplemented
11835  *             self.normalization_method = ord('C')             # <<<<<<<<<<<<<<
11836  *         elif normalization_method == ord('M'):
11837  *             if self.normalization_method == ord('T'):
11838  */
11839     __pyx_v_self->normalization_method = 67;
11840 
11841     /* "MACS2/IO/ScoreTrack.pyx":590
11842  *                 raise NotImplemented
11843  *             self.normalization_method = ord('T')
11844  *         elif normalization_method == ord('C'):             # <<<<<<<<<<<<<<
11845  *             if self.normalization_method == ord('T'):
11846  *                 self.normalize( self.ctrl_edm/self.treat_edm, self.ctrl_edm/self.treat_edm )
11847  */
11848     break;
11849     case 77:
11850 
11851     /* "MACS2/IO/ScoreTrack.pyx":603
11852  *             self.normalization_method = ord('C')
11853  *         elif normalization_method == ord('M'):
11854  *             if self.normalization_method == ord('T'):             # <<<<<<<<<<<<<<
11855  *                 self.normalize( 1/self.treat_edm, 1/self.treat_edm )
11856  *             elif self.normalization_method == ord('C'):
11857  */
11858     switch (__pyx_v_self->normalization_method) {
11859       case 84:
11860 
11861       /* "MACS2/IO/ScoreTrack.pyx":604
11862  *         elif normalization_method == ord('M'):
11863  *             if self.normalization_method == ord('T'):
11864  *                 self.normalize( 1/self.treat_edm, 1/self.treat_edm )             # <<<<<<<<<<<<<<
11865  *             elif self.normalization_method == ord('C'):
11866  *                 self.normalize( 1/self.ctrl_edm, 1/self.ctrl_edm )
11867  */
11868       if (unlikely(__pyx_v_self->treat_edm == 0)) {
11869         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11870         __PYX_ERR(0, 604, __pyx_L1_error)
11871       }
11872       if (unlikely(__pyx_v_self->treat_edm == 0)) {
11873         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11874         __PYX_ERR(0, 604, __pyx_L1_error)
11875       }
11876       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (1.0 / __pyx_v_self->treat_edm), (1.0 / __pyx_v_self->treat_edm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
11877       __Pyx_GOTREF(__pyx_t_1);
11878       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11879 
11880       /* "MACS2/IO/ScoreTrack.pyx":603
11881  *             self.normalization_method = ord('C')
11882  *         elif normalization_method == ord('M'):
11883  *             if self.normalization_method == ord('T'):             # <<<<<<<<<<<<<<
11884  *                 self.normalize( 1/self.treat_edm, 1/self.treat_edm )
11885  *             elif self.normalization_method == ord('C'):
11886  */
11887       break;
11888       case 67:
11889 
11890       /* "MACS2/IO/ScoreTrack.pyx":606
11891  *                 self.normalize( 1/self.treat_edm, 1/self.treat_edm )
11892  *             elif self.normalization_method == ord('C'):
11893  *                 self.normalize( 1/self.ctrl_edm, 1/self.ctrl_edm )             # <<<<<<<<<<<<<<
11894  *             elif  self.normalization_method == ord('M'): # do nothing
11895  *                 pass
11896  */
11897       if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
11898         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11899         __PYX_ERR(0, 606, __pyx_L1_error)
11900       }
11901       if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
11902         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11903         __PYX_ERR(0, 606, __pyx_L1_error)
11904       }
11905       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (1.0 / __pyx_v_self->ctrl_edm), (1.0 / __pyx_v_self->ctrl_edm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
11906       __Pyx_GOTREF(__pyx_t_1);
11907       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11908 
11909       /* "MACS2/IO/ScoreTrack.pyx":605
11910  *             if self.normalization_method == ord('T'):
11911  *                 self.normalize( 1/self.treat_edm, 1/self.treat_edm )
11912  *             elif self.normalization_method == ord('C'):             # <<<<<<<<<<<<<<
11913  *                 self.normalize( 1/self.ctrl_edm, 1/self.ctrl_edm )
11914  *             elif  self.normalization_method == ord('M'): # do nothing
11915  */
11916       break;
11917       case 77:
11918 
11919       /* "MACS2/IO/ScoreTrack.pyx":607
11920  *             elif self.normalization_method == ord('C'):
11921  *                 self.normalize( 1/self.ctrl_edm, 1/self.ctrl_edm )
11922  *             elif  self.normalization_method == ord('M'): # do nothing             # <<<<<<<<<<<<<<
11923  *                 pass
11924  *             elif self.normalization_method == ord('N'):
11925  */
11926       break;
11927       case 78:
11928 
11929       /* "MACS2/IO/ScoreTrack.pyx":610
11930  *                 pass
11931  *             elif self.normalization_method == ord('N'):
11932  *                 self.normalize( 1/self.treat_edm, 1/self.ctrl_edm )             # <<<<<<<<<<<<<<
11933  *             else:
11934  *                 raise NotImplemented
11935  */
11936       if (unlikely(__pyx_v_self->treat_edm == 0)) {
11937         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11938         __PYX_ERR(0, 610, __pyx_L1_error)
11939       }
11940       if (unlikely(__pyx_v_self->ctrl_edm == 0)) {
11941         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11942         __PYX_ERR(0, 610, __pyx_L1_error)
11943       }
11944       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, (1.0 / __pyx_v_self->treat_edm), (1.0 / __pyx_v_self->ctrl_edm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error)
11945       __Pyx_GOTREF(__pyx_t_1);
11946       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11947 
11948       /* "MACS2/IO/ScoreTrack.pyx":609
11949  *             elif  self.normalization_method == ord('M'): # do nothing
11950  *                 pass
11951  *             elif self.normalization_method == ord('N'):             # <<<<<<<<<<<<<<
11952  *                 self.normalize( 1/self.treat_edm, 1/self.ctrl_edm )
11953  *             else:
11954  */
11955       break;
11956       default:
11957 
11958       /* "MACS2/IO/ScoreTrack.pyx":612
11959  *                 self.normalize( 1/self.treat_edm, 1/self.ctrl_edm )
11960  *             else:
11961  *                 raise NotImplemented             # <<<<<<<<<<<<<<
11962  *             self.normalization_method = ord('M')
11963  *         elif normalization_method == ord('N'):
11964  */
11965       __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
11966       __PYX_ERR(0, 612, __pyx_L1_error)
11967       break;
11968     }
11969 
11970     /* "MACS2/IO/ScoreTrack.pyx":613
11971  *             else:
11972  *                 raise NotImplemented
11973  *             self.normalization_method = ord('M')             # <<<<<<<<<<<<<<
11974  *         elif normalization_method == ord('N'):
11975  *             if self.normalization_method == ord('T'):
11976  */
11977     __pyx_v_self->normalization_method = 77;
11978 
11979     /* "MACS2/IO/ScoreTrack.pyx":602
11980  *                 raise NotImplemented
11981  *             self.normalization_method = ord('C')
11982  *         elif normalization_method == ord('M'):             # <<<<<<<<<<<<<<
11983  *             if self.normalization_method == ord('T'):
11984  *                 self.normalize( 1/self.treat_edm, 1/self.treat_edm )
11985  */
11986     break;
11987     case 78:
11988 
11989     /* "MACS2/IO/ScoreTrack.pyx":615
11990  *             self.normalization_method = ord('M')
11991  *         elif normalization_method == ord('N'):
11992  *             if self.normalization_method == ord('T'):             # <<<<<<<<<<<<<<
11993  *                 self.normalize( self.treat_edm, self.treat_edm )
11994  *             elif self.normalization_method == ord('C'):
11995  */
11996     switch (__pyx_v_self->normalization_method) {
11997       case 84:
11998 
11999       /* "MACS2/IO/ScoreTrack.pyx":616
12000  *         elif normalization_method == ord('N'):
12001  *             if self.normalization_method == ord('T'):
12002  *                 self.normalize( self.treat_edm, self.treat_edm )             # <<<<<<<<<<<<<<
12003  *             elif self.normalization_method == ord('C'):
12004  *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
12005  */
12006       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, __pyx_v_self->treat_edm, __pyx_v_self->treat_edm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
12007       __Pyx_GOTREF(__pyx_t_1);
12008       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12009 
12010       /* "MACS2/IO/ScoreTrack.pyx":615
12011  *             self.normalization_method = ord('M')
12012  *         elif normalization_method == ord('N'):
12013  *             if self.normalization_method == ord('T'):             # <<<<<<<<<<<<<<
12014  *                 self.normalize( self.treat_edm, self.treat_edm )
12015  *             elif self.normalization_method == ord('C'):
12016  */
12017       break;
12018       case 67:
12019 
12020       /* "MACS2/IO/ScoreTrack.pyx":618
12021  *                 self.normalize( self.treat_edm, self.treat_edm )
12022  *             elif self.normalization_method == ord('C'):
12023  *                 self.normalize( self.ctrl_edm, self.ctrl_edm )             # <<<<<<<<<<<<<<
12024  *             elif  self.normalization_method == ord('M'):
12025  *                 self.normalize( self.treat_edm, self.ctrl_edm )
12026  */
12027       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, __pyx_v_self->ctrl_edm, __pyx_v_self->ctrl_edm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
12028       __Pyx_GOTREF(__pyx_t_1);
12029       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12030 
12031       /* "MACS2/IO/ScoreTrack.pyx":617
12032  *             if self.normalization_method == ord('T'):
12033  *                 self.normalize( self.treat_edm, self.treat_edm )
12034  *             elif self.normalization_method == ord('C'):             # <<<<<<<<<<<<<<
12035  *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
12036  *             elif  self.normalization_method == ord('M'):
12037  */
12038       break;
12039       case 77:
12040 
12041       /* "MACS2/IO/ScoreTrack.pyx":620
12042  *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
12043  *             elif  self.normalization_method == ord('M'):
12044  *                 self.normalize( self.treat_edm, self.ctrl_edm )             # <<<<<<<<<<<<<<
12045  *             elif self.normalization_method == ord('N'): # do nothing
12046  *                 pass
12047  */
12048       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->normalize(__pyx_v_self, __pyx_v_self->treat_edm, __pyx_v_self->ctrl_edm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
12049       __Pyx_GOTREF(__pyx_t_1);
12050       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12051 
12052       /* "MACS2/IO/ScoreTrack.pyx":619
12053  *             elif self.normalization_method == ord('C'):
12054  *                 self.normalize( self.ctrl_edm, self.ctrl_edm )
12055  *             elif  self.normalization_method == ord('M'):             # <<<<<<<<<<<<<<
12056  *                 self.normalize( self.treat_edm, self.ctrl_edm )
12057  *             elif self.normalization_method == ord('N'): # do nothing
12058  */
12059       break;
12060       case 78:
12061 
12062       /* "MACS2/IO/ScoreTrack.pyx":621
12063  *             elif  self.normalization_method == ord('M'):
12064  *                 self.normalize( self.treat_edm, self.ctrl_edm )
12065  *             elif self.normalization_method == ord('N'): # do nothing             # <<<<<<<<<<<<<<
12066  *                 pass
12067  *             else:
12068  */
12069       break;
12070       default:
12071 
12072       /* "MACS2/IO/ScoreTrack.pyx":624
12073  *                 pass
12074  *             else:
12075  *                 raise NotImplemented             # <<<<<<<<<<<<<<
12076  *             self.normalization_method = ord('N')
12077  *
12078  */
12079       __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
12080       __PYX_ERR(0, 624, __pyx_L1_error)
12081       break;
12082     }
12083 
12084     /* "MACS2/IO/ScoreTrack.pyx":625
12085  *             else:
12086  *                 raise NotImplemented
12087  *             self.normalization_method = ord('N')             # <<<<<<<<<<<<<<
12088  *
12089  *     cdef normalize ( self, float64_t treat_scale, float64_t control_scale ):
12090  */
12091     __pyx_v_self->normalization_method = 78;
12092 
12093     /* "MACS2/IO/ScoreTrack.pyx":614
12094  *                 raise NotImplemented
12095  *             self.normalization_method = ord('M')
12096  *         elif normalization_method == ord('N'):             # <<<<<<<<<<<<<<
12097  *             if self.normalization_method == ord('T'):
12098  *                 self.normalize( self.treat_edm, self.treat_edm )
12099  */
12100     break;
12101     default: break;
12102   }
12103 
12104   /* "MACS2/IO/ScoreTrack.pyx":568
12105  *         return l
12106  *
12107  *     cpdef change_normalization_method ( self, char normalization_method ):             # <<<<<<<<<<<<<<
12108  *         """Change/set normalization method. However, I do not
12109  *         recommend change this back and forward, since some precision
12110  */
12111 
12112   /* function exit code */
12113   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12114   goto __pyx_L0;
12115   __pyx_L1_error:;
12116   __Pyx_XDECREF(__pyx_t_1);
12117   __Pyx_XDECREF(__pyx_t_2);
12118   __Pyx_XDECREF(__pyx_t_3);
12119   __Pyx_XDECREF(__pyx_t_4);
12120   __Pyx_XDECREF(__pyx_t_5);
12121   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.change_normalization_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
12122   __pyx_r = 0;
12123   __pyx_L0:;
12124   __Pyx_XGIVEREF(__pyx_r);
12125   __Pyx_TraceReturn(__pyx_r, 0);
12126   __Pyx_RefNannyFinishContext();
12127   return __pyx_r;
12128 }
12129 
12130 /* Python wrapper */
12131 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_17change_normalization_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_normalization_method); /*proto*/
12132 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_16change_normalization_method[] = "Change/set normalization method. However, I do not\n        recommend change this back and forward, since some precision\n        issue will happen -- I only keep two digits.\n        \n        normalization_method: T: scale to depth of treatment;\n                              C: scale to depth of control;\n                              M: scale to depth of 1 million;\n                              N: not set/ raw pileup        \n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_17change_normalization_method(PyObject * __pyx_v_self,PyObject * __pyx_arg_normalization_method)12133 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_17change_normalization_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_normalization_method) {
12134   char __pyx_v_normalization_method;
12135   PyObject *__pyx_r = 0;
12136   __Pyx_RefNannyDeclarations
12137   __Pyx_RefNannySetupContext("change_normalization_method (wrapper)", 0);
12138   assert(__pyx_arg_normalization_method); {
12139     __pyx_v_normalization_method = __Pyx_PyInt_As_char(__pyx_arg_normalization_method); if (unlikely((__pyx_v_normalization_method == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error)
12140   }
12141   goto __pyx_L4_argument_unpacking_done;
12142   __pyx_L3_error:;
12143   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.change_normalization_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
12144   __Pyx_RefNannyFinishContext();
12145   return NULL;
12146   __pyx_L4_argument_unpacking_done:;
12147   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_16change_normalization_method(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), ((char)__pyx_v_normalization_method));
12148 
12149   /* function exit code */
12150   __Pyx_RefNannyFinishContext();
12151   return __pyx_r;
12152 }
12153 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_16change_normalization_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,char __pyx_v_normalization_method)12154 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_16change_normalization_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_normalization_method) {
12155   PyObject *__pyx_r = NULL;
12156   __Pyx_TraceDeclarations
12157   __Pyx_RefNannyDeclarations
12158   PyObject *__pyx_t_1 = NULL;
12159   __Pyx_RefNannySetupContext("change_normalization_method", 0);
12160   __Pyx_TraceCall("change_normalization_method (wrapper)", __pyx_f[0], 568, 0, __PYX_ERR(0, 568, __pyx_L1_error));
12161   __Pyx_XDECREF(__pyx_r);
12162   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_change_normalization_method(__pyx_v_self, __pyx_v_normalization_method, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
12163   __Pyx_GOTREF(__pyx_t_1);
12164   __pyx_r = __pyx_t_1;
12165   __pyx_t_1 = 0;
12166   goto __pyx_L0;
12167 
12168   /* function exit code */
12169   __pyx_L1_error:;
12170   __Pyx_XDECREF(__pyx_t_1);
12171   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.change_normalization_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
12172   __pyx_r = NULL;
12173   __pyx_L0:;
12174   __Pyx_XGIVEREF(__pyx_r);
12175   __Pyx_TraceReturn(__pyx_r, 0);
12176   __Pyx_RefNannyFinishContext();
12177   return __pyx_r;
12178 }
12179 
12180 /* "MACS2/IO/ScoreTrack.pyx":627
12181  *             self.normalization_method = ord('N')
12182  *
12183  *     cdef normalize ( self, float64_t treat_scale, float64_t control_scale ):             # <<<<<<<<<<<<<<
12184  *         cdef:
12185  *             np.ndarray p, c
12186  */
12187 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_normalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,__pyx_t_5numpy_float64_t __pyx_v_treat_scale,__pyx_t_5numpy_float64_t __pyx_v_control_scale)12188 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_normalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_treat_scale, __pyx_t_5numpy_float64_t __pyx_v_control_scale) {
12189   PyArrayObject *__pyx_v_p = 0;
12190   PyArrayObject *__pyx_v_c = 0;
12191   __pyx_t_5numpy_int64_t __pyx_v_l;
12192   __pyx_t_5numpy_int64_t __pyx_v_i;
12193   PyObject *__pyx_v_chrom = NULL;
12194   PyObject *__pyx_r = NULL;
12195   __Pyx_TraceDeclarations
12196   __Pyx_RefNannyDeclarations
12197   PyObject *__pyx_t_1 = NULL;
12198   Py_ssize_t __pyx_t_2;
12199   Py_ssize_t __pyx_t_3;
12200   int __pyx_t_4;
12201   PyObject *__pyx_t_5 = NULL;
12202   int __pyx_t_6;
12203   PyObject *__pyx_t_7 = NULL;
12204   __pyx_t_5numpy_int64_t __pyx_t_8;
12205   __pyx_t_5numpy_int64_t __pyx_t_9;
12206   __pyx_t_5numpy_int64_t __pyx_t_10;
12207   __pyx_t_5numpy_int64_t __pyx_t_11;
12208   PyObject *__pyx_t_12 = NULL;
12209   __Pyx_RefNannySetupContext("normalize", 0);
12210   __Pyx_TraceCall("normalize", __pyx_f[0], 627, 0, __PYX_ERR(0, 627, __pyx_L1_error));
12211 
12212   /* "MACS2/IO/ScoreTrack.pyx":632
12213  *             int64_t l, i
12214  *
12215  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
12216  *             p = self.data[chrom][1]
12217  *             c = self.data[chrom][2]
12218  */
12219   __pyx_t_2 = 0;
12220   if (unlikely(__pyx_v_self->data == Py_None)) {
12221     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
12222     __PYX_ERR(0, 632, __pyx_L1_error)
12223   }
12224   __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 632, __pyx_L1_error)
12225   __Pyx_GOTREF(__pyx_t_5);
12226   __Pyx_XDECREF(__pyx_t_1);
12227   __pyx_t_1 = __pyx_t_5;
12228   __pyx_t_5 = 0;
12229   while (1) {
12230     __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, NULL, NULL, __pyx_t_4);
12231     if (unlikely(__pyx_t_6 == 0)) break;
12232     if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 632, __pyx_L1_error)
12233     __Pyx_GOTREF(__pyx_t_5);
12234     __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_5);
12235     __pyx_t_5 = 0;
12236 
12237     /* "MACS2/IO/ScoreTrack.pyx":633
12238  *
12239  *         for chrom in self.data.keys():
12240  *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
12241  *             c = self.data[chrom][2]
12242  *             l = self.datalength[chrom]
12243  */
12244     if (unlikely(__pyx_v_self->data == Py_None)) {
12245       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12246       __PYX_ERR(0, 633, __pyx_L1_error)
12247     }
12248     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L1_error)
12249     __Pyx_GOTREF(__pyx_t_5);
12250     __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 633, __pyx_L1_error)
12251     __Pyx_GOTREF(__pyx_t_7);
12252     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12253     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 633, __pyx_L1_error)
12254     __Pyx_XDECREF_SET(__pyx_v_p, ((PyArrayObject *)__pyx_t_7));
12255     __pyx_t_7 = 0;
12256 
12257     /* "MACS2/IO/ScoreTrack.pyx":634
12258  *         for chrom in self.data.keys():
12259  *             p = self.data[chrom][1]
12260  *             c = self.data[chrom][2]             # <<<<<<<<<<<<<<
12261  *             l = self.datalength[chrom]
12262  *             for i in range(l):
12263  */
12264     if (unlikely(__pyx_v_self->data == Py_None)) {
12265       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12266       __PYX_ERR(0, 634, __pyx_L1_error)
12267     }
12268     __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error)
12269     __Pyx_GOTREF(__pyx_t_7);
12270     __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error)
12271     __Pyx_GOTREF(__pyx_t_5);
12272     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12273     if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 634, __pyx_L1_error)
12274     __Pyx_XDECREF_SET(__pyx_v_c, ((PyArrayObject *)__pyx_t_5));
12275     __pyx_t_5 = 0;
12276 
12277     /* "MACS2/IO/ScoreTrack.pyx":635
12278  *             p = self.data[chrom][1]
12279  *             c = self.data[chrom][2]
12280  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
12281  *             for i in range(l):
12282  *                 p[ i ] *= treat_scale
12283  */
12284     if (unlikely(__pyx_v_self->datalength == Py_None)) {
12285       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12286       __PYX_ERR(0, 635, __pyx_L1_error)
12287     }
12288     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error)
12289     __Pyx_GOTREF(__pyx_t_5);
12290     __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 635, __pyx_L1_error)
12291     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12292     __pyx_v_l = __pyx_t_8;
12293 
12294     /* "MACS2/IO/ScoreTrack.pyx":636
12295  *             c = self.data[chrom][2]
12296  *             l = self.datalength[chrom]
12297  *             for i in range(l):             # <<<<<<<<<<<<<<
12298  *                 p[ i ] *= treat_scale
12299  *                 c[ i ] *= control_scale
12300  */
12301     __pyx_t_8 = __pyx_v_l;
12302     __pyx_t_9 = __pyx_t_8;
12303     for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
12304       __pyx_v_i = __pyx_t_10;
12305 
12306       /* "MACS2/IO/ScoreTrack.pyx":637
12307  *             l = self.datalength[chrom]
12308  *             for i in range(l):
12309  *                 p[ i ] *= treat_scale             # <<<<<<<<<<<<<<
12310  *                 c[ i ] *= control_scale
12311  *         return
12312  */
12313       __pyx_t_11 = __pyx_v_i;
12314       __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_p), __pyx_t_11, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
12315       __Pyx_GOTREF(__pyx_t_5);
12316       __pyx_t_7 = PyFloat_FromDouble(__pyx_v_treat_scale); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 637, __pyx_L1_error)
12317       __Pyx_GOTREF(__pyx_t_7);
12318       __pyx_t_12 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 637, __pyx_L1_error)
12319       __Pyx_GOTREF(__pyx_t_12);
12320       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12321       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12322       if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_p), __pyx_t_11, __pyx_t_12, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1) < 0)) __PYX_ERR(0, 637, __pyx_L1_error)
12323       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12324 
12325       /* "MACS2/IO/ScoreTrack.pyx":638
12326  *             for i in range(l):
12327  *                 p[ i ] *= treat_scale
12328  *                 c[ i ] *= control_scale             # <<<<<<<<<<<<<<
12329  *         return
12330  *
12331  */
12332       __pyx_t_11 = __pyx_v_i;
12333       __pyx_t_12 = __Pyx_GetItemInt(((PyObject *)__pyx_v_c), __pyx_t_11, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 638, __pyx_L1_error)
12334       __Pyx_GOTREF(__pyx_t_12);
12335       __pyx_t_7 = PyFloat_FromDouble(__pyx_v_control_scale); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L1_error)
12336       __Pyx_GOTREF(__pyx_t_7);
12337       __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error)
12338       __Pyx_GOTREF(__pyx_t_5);
12339       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12340       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12341       if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_c), __pyx_t_11, __pyx_t_5, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1) < 0)) __PYX_ERR(0, 638, __pyx_L1_error)
12342       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12343     }
12344   }
12345   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12346 
12347   /* "MACS2/IO/ScoreTrack.pyx":639
12348  *                 p[ i ] *= treat_scale
12349  *                 c[ i ] *= control_scale
12350  *         return             # <<<<<<<<<<<<<<
12351  *
12352  *     cpdef change_score_method (self, char scoring_method):
12353  */
12354   __Pyx_XDECREF(__pyx_r);
12355   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12356   goto __pyx_L0;
12357 
12358   /* "MACS2/IO/ScoreTrack.pyx":627
12359  *             self.normalization_method = ord('N')
12360  *
12361  *     cdef normalize ( self, float64_t treat_scale, float64_t control_scale ):             # <<<<<<<<<<<<<<
12362  *         cdef:
12363  *             np.ndarray p, c
12364  */
12365 
12366   /* function exit code */
12367   __pyx_L1_error:;
12368   __Pyx_XDECREF(__pyx_t_1);
12369   __Pyx_XDECREF(__pyx_t_5);
12370   __Pyx_XDECREF(__pyx_t_7);
12371   __Pyx_XDECREF(__pyx_t_12);
12372   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.normalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
12373   __pyx_r = 0;
12374   __pyx_L0:;
12375   __Pyx_XDECREF((PyObject *)__pyx_v_p);
12376   __Pyx_XDECREF((PyObject *)__pyx_v_c);
12377   __Pyx_XDECREF(__pyx_v_chrom);
12378   __Pyx_XGIVEREF(__pyx_r);
12379   __Pyx_TraceReturn(__pyx_r, 0);
12380   __Pyx_RefNannyFinishContext();
12381   return __pyx_r;
12382 }
12383 
12384 /* "MACS2/IO/ScoreTrack.pyx":641
12385  *         return
12386  *
12387  *     cpdef change_score_method (self, char scoring_method):             # <<<<<<<<<<<<<<
12388  *         """
12389  *         scoring_method:  p: -log10 pvalue;
12390  */
12391 
12392 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_19change_score_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_scoring_method); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_change_score_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,char __pyx_v_scoring_method,int __pyx_skip_dispatch)12393 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_change_score_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_scoring_method, int __pyx_skip_dispatch) {
12394   PyObject *__pyx_r = NULL;
12395   __Pyx_TraceDeclarations
12396   __Pyx_RefNannyDeclarations
12397   PyObject *__pyx_t_1 = NULL;
12398   PyObject *__pyx_t_2 = NULL;
12399   PyObject *__pyx_t_3 = NULL;
12400   PyObject *__pyx_t_4 = NULL;
12401   PyObject *__pyx_t_5 = NULL;
12402   int __pyx_t_6;
12403   __Pyx_RefNannySetupContext("change_score_method", 0);
12404   __Pyx_TraceCall("change_score_method", __pyx_f[0], 641, 0, __PYX_ERR(0, 641, __pyx_L1_error));
12405   /* Check if called by wrapper */
12406   if (unlikely(__pyx_skip_dispatch)) ;
12407   /* Check if overridden in Python */
12408   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
12409     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
12410     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
12411     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
12412       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
12413       #endif
12414       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_change_score_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
12415       __Pyx_GOTREF(__pyx_t_1);
12416       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_19change_score_method)) {
12417         __Pyx_XDECREF(__pyx_r);
12418         __pyx_t_3 = __Pyx_PyInt_From_char(__pyx_v_scoring_method); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error)
12419         __Pyx_GOTREF(__pyx_t_3);
12420         __Pyx_INCREF(__pyx_t_1);
12421         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
12422         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
12423           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
12424           if (likely(__pyx_t_5)) {
12425             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12426             __Pyx_INCREF(__pyx_t_5);
12427             __Pyx_INCREF(function);
12428             __Pyx_DECREF_SET(__pyx_t_4, function);
12429           }
12430         }
12431         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
12432         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12433         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12434         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
12435         __Pyx_GOTREF(__pyx_t_2);
12436         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12437         __pyx_r = __pyx_t_2;
12438         __pyx_t_2 = 0;
12439         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12440         goto __pyx_L0;
12441       }
12442       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
12443       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
12444       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
12445       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
12446         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
12447       }
12448       #endif
12449       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12450       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
12451     }
12452     #endif
12453   }
12454 
12455   /* "MACS2/IO/ScoreTrack.pyx":653
12456  *                          m: fragment pileup per million reads
12457  *         """
12458  *         if scoring_method == ord('p'):             # <<<<<<<<<<<<<<
12459  *             self.compute_pvalue()
12460  *         elif scoring_method == ord('q'):
12461  */
12462   switch (__pyx_v_scoring_method) {
12463     case 0x70:
12464 
12465     /* "MACS2/IO/ScoreTrack.pyx":654
12466  *         """
12467  *         if scoring_method == ord('p'):
12468  *             self.compute_pvalue()             # <<<<<<<<<<<<<<
12469  *         elif scoring_method == ord('q'):
12470  *             #if not already calculated p, compute pvalue first
12471  */
12472     __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_pvalue(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
12473     __Pyx_GOTREF(__pyx_t_1);
12474     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12475 
12476     /* "MACS2/IO/ScoreTrack.pyx":653
12477  *                          m: fragment pileup per million reads
12478  *         """
12479  *         if scoring_method == ord('p'):             # <<<<<<<<<<<<<<
12480  *             self.compute_pvalue()
12481  *         elif scoring_method == ord('q'):
12482  */
12483     break;
12484     case 0x71:
12485 
12486     /* "MACS2/IO/ScoreTrack.pyx":657
12487  *         elif scoring_method == ord('q'):
12488  *             #if not already calculated p, compute pvalue first
12489  *             if self.scoring_method != ord('p'):             # <<<<<<<<<<<<<<
12490  *                 self.compute_pvalue()
12491  *             self.compute_qvalue()
12492  */
12493     __pyx_t_6 = ((__pyx_v_self->scoring_method != 0x70) != 0);
12494     if (__pyx_t_6) {
12495 
12496       /* "MACS2/IO/ScoreTrack.pyx":658
12497  *             #if not already calculated p, compute pvalue first
12498  *             if self.scoring_method != ord('p'):
12499  *                 self.compute_pvalue()             # <<<<<<<<<<<<<<
12500  *             self.compute_qvalue()
12501  *         elif scoring_method == ord('l'):
12502  */
12503       __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_pvalue(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
12504       __Pyx_GOTREF(__pyx_t_1);
12505       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12506 
12507       /* "MACS2/IO/ScoreTrack.pyx":657
12508  *         elif scoring_method == ord('q'):
12509  *             #if not already calculated p, compute pvalue first
12510  *             if self.scoring_method != ord('p'):             # <<<<<<<<<<<<<<
12511  *                 self.compute_pvalue()
12512  *             self.compute_qvalue()
12513  */
12514     }
12515 
12516     /* "MACS2/IO/ScoreTrack.pyx":659
12517  *             if self.scoring_method != ord('p'):
12518  *                 self.compute_pvalue()
12519  *             self.compute_qvalue()             # <<<<<<<<<<<<<<
12520  *         elif scoring_method == ord('l'):
12521  *             self.compute_likelihood()
12522  */
12523     __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_qvalue(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
12524     __Pyx_GOTREF(__pyx_t_1);
12525     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12526 
12527     /* "MACS2/IO/ScoreTrack.pyx":655
12528  *         if scoring_method == ord('p'):
12529  *             self.compute_pvalue()
12530  *         elif scoring_method == ord('q'):             # <<<<<<<<<<<<<<
12531  *             #if not already calculated p, compute pvalue first
12532  *             if self.scoring_method != ord('p'):
12533  */
12534     break;
12535     case 0x6C:
12536 
12537     /* "MACS2/IO/ScoreTrack.pyx":661
12538  *             self.compute_qvalue()
12539  *         elif scoring_method == ord('l'):
12540  *             self.compute_likelihood()             # <<<<<<<<<<<<<<
12541  *         elif scoring_method == ord('s'):
12542  *             self.compute_sym_likelihood()
12543  */
12544     __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_likelihood(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
12545     __Pyx_GOTREF(__pyx_t_1);
12546     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12547 
12548     /* "MACS2/IO/ScoreTrack.pyx":660
12549  *                 self.compute_pvalue()
12550  *             self.compute_qvalue()
12551  *         elif scoring_method == ord('l'):             # <<<<<<<<<<<<<<
12552  *             self.compute_likelihood()
12553  *         elif scoring_method == ord('s'):
12554  */
12555     break;
12556     case 0x73:
12557 
12558     /* "MACS2/IO/ScoreTrack.pyx":663
12559  *             self.compute_likelihood()
12560  *         elif scoring_method == ord('s'):
12561  *             self.compute_sym_likelihood()             # <<<<<<<<<<<<<<
12562  *         elif scoring_method == ord('f'):
12563  *             self.compute_logFE()
12564  */
12565     __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_sym_likelihood(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error)
12566     __Pyx_GOTREF(__pyx_t_1);
12567     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12568 
12569     /* "MACS2/IO/ScoreTrack.pyx":662
12570  *         elif scoring_method == ord('l'):
12571  *             self.compute_likelihood()
12572  *         elif scoring_method == ord('s'):             # <<<<<<<<<<<<<<
12573  *             self.compute_sym_likelihood()
12574  *         elif scoring_method == ord('f'):
12575  */
12576     break;
12577     case 0x66:
12578 
12579     /* "MACS2/IO/ScoreTrack.pyx":665
12580  *             self.compute_sym_likelihood()
12581  *         elif scoring_method == ord('f'):
12582  *             self.compute_logFE()             # <<<<<<<<<<<<<<
12583  *         elif scoring_method == ord('F'):
12584  *             self.compute_foldenrichment()
12585  */
12586     __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_logFE(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
12587     __Pyx_GOTREF(__pyx_t_1);
12588     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12589 
12590     /* "MACS2/IO/ScoreTrack.pyx":664
12591  *         elif scoring_method == ord('s'):
12592  *             self.compute_sym_likelihood()
12593  *         elif scoring_method == ord('f'):             # <<<<<<<<<<<<<<
12594  *             self.compute_logFE()
12595  *         elif scoring_method == ord('F'):
12596  */
12597     break;
12598     case 70:
12599 
12600     /* "MACS2/IO/ScoreTrack.pyx":667
12601  *             self.compute_logFE()
12602  *         elif scoring_method == ord('F'):
12603  *             self.compute_foldenrichment()             # <<<<<<<<<<<<<<
12604  *         elif scoring_method == ord('d'):
12605  *             self.compute_subtraction()
12606  */
12607     __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_foldenrichment(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
12608     __Pyx_GOTREF(__pyx_t_1);
12609     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12610 
12611     /* "MACS2/IO/ScoreTrack.pyx":666
12612  *         elif scoring_method == ord('f'):
12613  *             self.compute_logFE()
12614  *         elif scoring_method == ord('F'):             # <<<<<<<<<<<<<<
12615  *             self.compute_foldenrichment()
12616  *         elif scoring_method == ord('d'):
12617  */
12618     break;
12619     case 0x64:
12620 
12621     /* "MACS2/IO/ScoreTrack.pyx":669
12622  *             self.compute_foldenrichment()
12623  *         elif scoring_method == ord('d'):
12624  *             self.compute_subtraction()             # <<<<<<<<<<<<<<
12625  *         elif scoring_method == ord('m'):
12626  *             self.compute_SPMR()
12627  */
12628     __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_subtraction(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
12629     __Pyx_GOTREF(__pyx_t_1);
12630     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12631 
12632     /* "MACS2/IO/ScoreTrack.pyx":668
12633  *         elif scoring_method == ord('F'):
12634  *             self.compute_foldenrichment()
12635  *         elif scoring_method == ord('d'):             # <<<<<<<<<<<<<<
12636  *             self.compute_subtraction()
12637  *         elif scoring_method == ord('m'):
12638  */
12639     break;
12640     case 0x6D:
12641 
12642     /* "MACS2/IO/ScoreTrack.pyx":671
12643  *             self.compute_subtraction()
12644  *         elif scoring_method == ord('m'):
12645  *             self.compute_SPMR()             # <<<<<<<<<<<<<<
12646  *         elif scoring_method == ord('M'):
12647  *             self.compute_max()
12648  */
12649     __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_SPMR(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
12650     __Pyx_GOTREF(__pyx_t_1);
12651     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12652 
12653     /* "MACS2/IO/ScoreTrack.pyx":670
12654  *         elif scoring_method == ord('d'):
12655  *             self.compute_subtraction()
12656  *         elif scoring_method == ord('m'):             # <<<<<<<<<<<<<<
12657  *             self.compute_SPMR()
12658  *         elif scoring_method == ord('M'):
12659  */
12660     break;
12661     case 77:
12662 
12663     /* "MACS2/IO/ScoreTrack.pyx":673
12664  *             self.compute_SPMR()
12665  *         elif scoring_method == ord('M'):
12666  *             self.compute_max()             # <<<<<<<<<<<<<<
12667  *         else:
12668  *             raise NotImplemented
12669  */
12670     __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->compute_max(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
12671     __Pyx_GOTREF(__pyx_t_1);
12672     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12673 
12674     /* "MACS2/IO/ScoreTrack.pyx":672
12675  *         elif scoring_method == ord('m'):
12676  *             self.compute_SPMR()
12677  *         elif scoring_method == ord('M'):             # <<<<<<<<<<<<<<
12678  *             self.compute_max()
12679  *         else:
12680  */
12681     break;
12682     default:
12683 
12684     /* "MACS2/IO/ScoreTrack.pyx":675
12685  *             self.compute_max()
12686  *         else:
12687  *             raise NotImplemented             # <<<<<<<<<<<<<<
12688  *
12689  *     cdef compute_pvalue ( self ):
12690  */
12691     __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
12692     __PYX_ERR(0, 675, __pyx_L1_error)
12693     break;
12694   }
12695 
12696   /* "MACS2/IO/ScoreTrack.pyx":641
12697  *         return
12698  *
12699  *     cpdef change_score_method (self, char scoring_method):             # <<<<<<<<<<<<<<
12700  *         """
12701  *         scoring_method:  p: -log10 pvalue;
12702  */
12703 
12704   /* function exit code */
12705   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12706   goto __pyx_L0;
12707   __pyx_L1_error:;
12708   __Pyx_XDECREF(__pyx_t_1);
12709   __Pyx_XDECREF(__pyx_t_2);
12710   __Pyx_XDECREF(__pyx_t_3);
12711   __Pyx_XDECREF(__pyx_t_4);
12712   __Pyx_XDECREF(__pyx_t_5);
12713   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.change_score_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
12714   __pyx_r = 0;
12715   __pyx_L0:;
12716   __Pyx_XGIVEREF(__pyx_r);
12717   __Pyx_TraceReturn(__pyx_r, 0);
12718   __Pyx_RefNannyFinishContext();
12719   return __pyx_r;
12720 }
12721 
12722 /* Python wrapper */
12723 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_19change_score_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_scoring_method); /*proto*/
12724 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_18change_score_method[] = "\n        scoring_method:  p: -log10 pvalue;\n                         q: -log10 qvalue;\n                         l: log10 likelihood ratio ( minus for depletion )\n\t\t\t s: symmetric log10 likelihood ratio ( for comparing two ChIPs )\n                         f: log10 fold enrichment\n                         F: linear fold enrichment\n                         d: subtraction\n                         M: maximum\n                         m: fragment pileup per million reads\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_19change_score_method(PyObject * __pyx_v_self,PyObject * __pyx_arg_scoring_method)12725 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_19change_score_method(PyObject *__pyx_v_self, PyObject *__pyx_arg_scoring_method) {
12726   char __pyx_v_scoring_method;
12727   PyObject *__pyx_r = 0;
12728   __Pyx_RefNannyDeclarations
12729   __Pyx_RefNannySetupContext("change_score_method (wrapper)", 0);
12730   assert(__pyx_arg_scoring_method); {
12731     __pyx_v_scoring_method = __Pyx_PyInt_As_char(__pyx_arg_scoring_method); if (unlikely((__pyx_v_scoring_method == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error)
12732   }
12733   goto __pyx_L4_argument_unpacking_done;
12734   __pyx_L3_error:;
12735   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.change_score_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
12736   __Pyx_RefNannyFinishContext();
12737   return NULL;
12738   __pyx_L4_argument_unpacking_done:;
12739   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_18change_score_method(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), ((char)__pyx_v_scoring_method));
12740 
12741   /* function exit code */
12742   __Pyx_RefNannyFinishContext();
12743   return __pyx_r;
12744 }
12745 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_18change_score_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,char __pyx_v_scoring_method)12746 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_18change_score_method(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, char __pyx_v_scoring_method) {
12747   PyObject *__pyx_r = NULL;
12748   __Pyx_TraceDeclarations
12749   __Pyx_RefNannyDeclarations
12750   PyObject *__pyx_t_1 = NULL;
12751   __Pyx_RefNannySetupContext("change_score_method", 0);
12752   __Pyx_TraceCall("change_score_method (wrapper)", __pyx_f[0], 641, 0, __PYX_ERR(0, 641, __pyx_L1_error));
12753   __Pyx_XDECREF(__pyx_r);
12754   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_change_score_method(__pyx_v_self, __pyx_v_scoring_method, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
12755   __Pyx_GOTREF(__pyx_t_1);
12756   __pyx_r = __pyx_t_1;
12757   __pyx_t_1 = 0;
12758   goto __pyx_L0;
12759 
12760   /* function exit code */
12761   __pyx_L1_error:;
12762   __Pyx_XDECREF(__pyx_t_1);
12763   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.change_score_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
12764   __pyx_r = NULL;
12765   __pyx_L0:;
12766   __Pyx_XGIVEREF(__pyx_r);
12767   __Pyx_TraceReturn(__pyx_r, 0);
12768   __Pyx_RefNannyFinishContext();
12769   return __pyx_r;
12770 }
12771 
12772 /* "MACS2/IO/ScoreTrack.pyx":677
12773  *             raise NotImplemented
12774  *
12775  *     cdef compute_pvalue ( self ):             # <<<<<<<<<<<<<<
12776  *         """Compute -log_{10}(pvalue)
12777  *         """
12778  */
12779 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_pvalue(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)12780 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_pvalue(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
12781   PyArrayObject *__pyx_v_p = 0;
12782   PyArrayObject *__pyx_v_c = 0;
12783   PyArrayObject *__pyx_v_v = 0;
12784   PyArrayObject *__pyx_v_pos = 0;
12785   __pyx_t_5numpy_int64_t __pyx_v_l;
12786   __pyx_t_5numpy_int64_t __pyx_v_i;
12787   __pyx_t_5numpy_int64_t __pyx_v_prev_pos;
12788   PyObject *__pyx_v_chrom = 0;
12789   __Pyx_LocalBuf_ND __pyx_pybuffernd_c;
12790   __Pyx_Buffer __pyx_pybuffer_c;
12791   __Pyx_LocalBuf_ND __pyx_pybuffernd_p;
12792   __Pyx_Buffer __pyx_pybuffer_p;
12793   __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
12794   __Pyx_Buffer __pyx_pybuffer_pos;
12795   __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
12796   __Pyx_Buffer __pyx_pybuffer_v;
12797   PyObject *__pyx_r = NULL;
12798   __Pyx_TraceDeclarations
12799   __Pyx_RefNannyDeclarations
12800   PyObject *__pyx_t_1 = NULL;
12801   Py_ssize_t __pyx_t_2;
12802   Py_ssize_t __pyx_t_3;
12803   int __pyx_t_4;
12804   PyObject *__pyx_t_5 = NULL;
12805   int __pyx_t_6;
12806   PyObject *__pyx_t_7 = NULL;
12807   PyArrayObject *__pyx_t_8 = NULL;
12808   PyObject *__pyx_t_9 = NULL;
12809   PyObject *__pyx_t_10 = NULL;
12810   PyObject *__pyx_t_11 = NULL;
12811   PyArrayObject *__pyx_t_12 = NULL;
12812   __pyx_t_5numpy_int64_t __pyx_t_13;
12813   __pyx_t_5numpy_int64_t __pyx_t_14;
12814   __pyx_t_5numpy_int64_t __pyx_t_15;
12815   __pyx_t_5numpy_int64_t __pyx_t_16;
12816   __pyx_t_5numpy_int64_t __pyx_t_17;
12817   __pyx_t_5numpy_int64_t __pyx_t_18;
12818   PyObject *__pyx_t_19 = NULL;
12819   __pyx_t_5numpy_int64_t __pyx_t_20;
12820   __pyx_t_5numpy_int64_t __pyx_t_21;
12821   PyObject *__pyx_t_22 = NULL;
12822   PyObject *__pyx_t_23 = NULL;
12823   __pyx_t_5numpy_int64_t __pyx_t_24;
12824   __pyx_t_5numpy_int64_t __pyx_t_25;
12825   PyObject *__pyx_t_26 = NULL;
12826   __pyx_t_5numpy_int64_t __pyx_t_27;
12827   __Pyx_RefNannySetupContext("compute_pvalue", 0);
12828   __Pyx_TraceCall("compute_pvalue", __pyx_f[0], 677, 0, __PYX_ERR(0, 677, __pyx_L1_error));
12829   __pyx_pybuffer_p.pybuffer.buf = NULL;
12830   __pyx_pybuffer_p.refcount = 0;
12831   __pyx_pybuffernd_p.data = NULL;
12832   __pyx_pybuffernd_p.rcbuffer = &__pyx_pybuffer_p;
12833   __pyx_pybuffer_c.pybuffer.buf = NULL;
12834   __pyx_pybuffer_c.refcount = 0;
12835   __pyx_pybuffernd_c.data = NULL;
12836   __pyx_pybuffernd_c.rcbuffer = &__pyx_pybuffer_c;
12837   __pyx_pybuffer_v.pybuffer.buf = NULL;
12838   __pyx_pybuffer_v.refcount = 0;
12839   __pyx_pybuffernd_v.data = NULL;
12840   __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
12841   __pyx_pybuffer_pos.pybuffer.buf = NULL;
12842   __pyx_pybuffer_pos.refcount = 0;
12843   __pyx_pybuffernd_pos.data = NULL;
12844   __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
12845 
12846   /* "MACS2/IO/ScoreTrack.pyx":686
12847  *             bytes chrom
12848  *
12849  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
12850  *             prev_pos = 0
12851  *             pos = self.data[chrom][0]
12852  */
12853   __pyx_t_2 = 0;
12854   if (unlikely(__pyx_v_self->data == Py_None)) {
12855     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
12856     __PYX_ERR(0, 686, __pyx_L1_error)
12857   }
12858   __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __pyx_L1_error)
12859   __Pyx_GOTREF(__pyx_t_5);
12860   __Pyx_XDECREF(__pyx_t_1);
12861   __pyx_t_1 = __pyx_t_5;
12862   __pyx_t_5 = 0;
12863   while (1) {
12864     __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, NULL, NULL, __pyx_t_4);
12865     if (unlikely(__pyx_t_6 == 0)) break;
12866     if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 686, __pyx_L1_error)
12867     __Pyx_GOTREF(__pyx_t_5);
12868     if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 686, __pyx_L1_error)
12869     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_5));
12870     __pyx_t_5 = 0;
12871 
12872     /* "MACS2/IO/ScoreTrack.pyx":687
12873  *
12874  *         for chrom in self.data.keys():
12875  *             prev_pos = 0             # <<<<<<<<<<<<<<
12876  *             pos = self.data[chrom][0]
12877  *             p = self.data[chrom][1]
12878  */
12879     __pyx_v_prev_pos = 0;
12880 
12881     /* "MACS2/IO/ScoreTrack.pyx":688
12882  *         for chrom in self.data.keys():
12883  *             prev_pos = 0
12884  *             pos = self.data[chrom][0]             # <<<<<<<<<<<<<<
12885  *             p = self.data[chrom][1]
12886  *             c = self.data[chrom][2]
12887  */
12888     if (unlikely(__pyx_v_self->data == Py_None)) {
12889       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12890       __PYX_ERR(0, 688, __pyx_L1_error)
12891     }
12892     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L1_error)
12893     __Pyx_GOTREF(__pyx_t_5);
12894     __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error)
12895     __Pyx_GOTREF(__pyx_t_7);
12896     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12897     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 688, __pyx_L1_error)
12898     __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
12899     {
12900       __Pyx_BufFmt_StackElem __pyx_stack[1];
12901       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
12902       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
12903       if (unlikely(__pyx_t_6 < 0)) {
12904         PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
12905         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
12906           Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
12907           __Pyx_RaiseBufferFallbackError();
12908         } else {
12909           PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
12910         }
12911         __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
12912       }
12913       __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0];
12914       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 688, __pyx_L1_error)
12915     }
12916     __pyx_t_8 = 0;
12917     __Pyx_XDECREF_SET(__pyx_v_pos, ((PyArrayObject *)__pyx_t_7));
12918     __pyx_t_7 = 0;
12919 
12920     /* "MACS2/IO/ScoreTrack.pyx":689
12921  *             prev_pos = 0
12922  *             pos = self.data[chrom][0]
12923  *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
12924  *             c = self.data[chrom][2]
12925  *             v = self.data[chrom][3]
12926  */
12927     if (unlikely(__pyx_v_self->data == Py_None)) {
12928       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12929       __PYX_ERR(0, 689, __pyx_L1_error)
12930     }
12931     __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error)
12932     __Pyx_GOTREF(__pyx_t_7);
12933     __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 689, __pyx_L1_error)
12934     __Pyx_GOTREF(__pyx_t_5);
12935     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12936     if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 689, __pyx_L1_error)
12937     __pyx_t_12 = ((PyArrayObject *)__pyx_t_5);
12938     {
12939       __Pyx_BufFmt_StackElem __pyx_stack[1];
12940       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
12941       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
12942       if (unlikely(__pyx_t_6 < 0)) {
12943         PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
12944         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_v_p, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
12945           Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
12946           __Pyx_RaiseBufferFallbackError();
12947         } else {
12948           PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
12949         }
12950         __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
12951       }
12952       __pyx_pybuffernd_p.diminfo[0].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p.diminfo[0].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[0];
12953       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 689, __pyx_L1_error)
12954     }
12955     __pyx_t_12 = 0;
12956     __Pyx_XDECREF_SET(__pyx_v_p, ((PyArrayObject *)__pyx_t_5));
12957     __pyx_t_5 = 0;
12958 
12959     /* "MACS2/IO/ScoreTrack.pyx":690
12960  *             pos = self.data[chrom][0]
12961  *             p = self.data[chrom][1]
12962  *             c = self.data[chrom][2]             # <<<<<<<<<<<<<<
12963  *             v = self.data[chrom][3]
12964  *             l = self.datalength[chrom]
12965  */
12966     if (unlikely(__pyx_v_self->data == Py_None)) {
12967       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
12968       __PYX_ERR(0, 690, __pyx_L1_error)
12969     }
12970     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 690, __pyx_L1_error)
12971     __Pyx_GOTREF(__pyx_t_5);
12972     __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 690, __pyx_L1_error)
12973     __Pyx_GOTREF(__pyx_t_7);
12974     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12975     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 690, __pyx_L1_error)
12976     __pyx_t_12 = ((PyArrayObject *)__pyx_t_7);
12977     {
12978       __Pyx_BufFmt_StackElem __pyx_stack[1];
12979       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
12980       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
12981       if (unlikely(__pyx_t_6 < 0)) {
12982         PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
12983         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c.rcbuffer->pybuffer, (PyObject*)__pyx_v_c, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
12984           Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
12985           __Pyx_RaiseBufferFallbackError();
12986         } else {
12987           PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
12988         }
12989         __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
12990       }
12991       __pyx_pybuffernd_c.diminfo[0].strides = __pyx_pybuffernd_c.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c.diminfo[0].shape = __pyx_pybuffernd_c.rcbuffer->pybuffer.shape[0];
12992       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 690, __pyx_L1_error)
12993     }
12994     __pyx_t_12 = 0;
12995     __Pyx_XDECREF_SET(__pyx_v_c, ((PyArrayObject *)__pyx_t_7));
12996     __pyx_t_7 = 0;
12997 
12998     /* "MACS2/IO/ScoreTrack.pyx":691
12999  *             p = self.data[chrom][1]
13000  *             c = self.data[chrom][2]
13001  *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
13002  *             l = self.datalength[chrom]
13003  *             for i in range(l):
13004  */
13005     if (unlikely(__pyx_v_self->data == Py_None)) {
13006       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13007       __PYX_ERR(0, 691, __pyx_L1_error)
13008     }
13009     __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 691, __pyx_L1_error)
13010     __Pyx_GOTREF(__pyx_t_7);
13011     __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error)
13012     __Pyx_GOTREF(__pyx_t_5);
13013     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13014     if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 691, __pyx_L1_error)
13015     __pyx_t_12 = ((PyArrayObject *)__pyx_t_5);
13016     {
13017       __Pyx_BufFmt_StackElem __pyx_stack[1];
13018       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
13019       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
13020       if (unlikely(__pyx_t_6 < 0)) {
13021         PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
13022         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
13023           Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
13024           __Pyx_RaiseBufferFallbackError();
13025         } else {
13026           PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
13027         }
13028         __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
13029       }
13030       __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
13031       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 691, __pyx_L1_error)
13032     }
13033     __pyx_t_12 = 0;
13034     __Pyx_XDECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_5));
13035     __pyx_t_5 = 0;
13036 
13037     /* "MACS2/IO/ScoreTrack.pyx":692
13038  *             c = self.data[chrom][2]
13039  *             v = self.data[chrom][3]
13040  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
13041  *             for i in range(l):
13042  *                 v[ i ] =  get_pscore( <int32_t>(p[ i ]  + self.pseudocount) , c[ i ]  + self.pseudocount )
13043  */
13044     if (unlikely(__pyx_v_self->datalength == Py_None)) {
13045       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13046       __PYX_ERR(0, 692, __pyx_L1_error)
13047     }
13048     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error)
13049     __Pyx_GOTREF(__pyx_t_5);
13050     __pyx_t_13 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_13 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error)
13051     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13052     __pyx_v_l = __pyx_t_13;
13053 
13054     /* "MACS2/IO/ScoreTrack.pyx":693
13055  *             v = self.data[chrom][3]
13056  *             l = self.datalength[chrom]
13057  *             for i in range(l):             # <<<<<<<<<<<<<<
13058  *                 v[ i ] =  get_pscore( <int32_t>(p[ i ]  + self.pseudocount) , c[ i ]  + self.pseudocount )
13059  *                 try:
13060  */
13061     __pyx_t_13 = __pyx_v_l;
13062     __pyx_t_14 = __pyx_t_13;
13063     for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
13064       __pyx_v_i = __pyx_t_15;
13065 
13066       /* "MACS2/IO/ScoreTrack.pyx":694
13067  *             l = self.datalength[chrom]
13068  *             for i in range(l):
13069  *                 v[ i ] =  get_pscore( <int32_t>(p[ i ]  + self.pseudocount) , c[ i ]  + self.pseudocount )             # <<<<<<<<<<<<<<
13070  *                 try:
13071  *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos
13072  */
13073       __pyx_t_16 = __pyx_v_i;
13074       __pyx_t_6 = -1;
13075       if (__pyx_t_16 < 0) {
13076         __pyx_t_16 += __pyx_pybuffernd_p.diminfo[0].shape;
13077         if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0;
13078       } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_p.diminfo[0].shape)) __pyx_t_6 = 0;
13079       if (unlikely(__pyx_t_6 != -1)) {
13080         __Pyx_RaiseBufferIndexError(__pyx_t_6);
13081         __PYX_ERR(0, 694, __pyx_L1_error)
13082       }
13083       __pyx_t_17 = __pyx_v_i;
13084       __pyx_t_6 = -1;
13085       if (__pyx_t_17 < 0) {
13086         __pyx_t_17 += __pyx_pybuffernd_c.diminfo[0].shape;
13087         if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0;
13088       } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_c.diminfo[0].shape)) __pyx_t_6 = 0;
13089       if (unlikely(__pyx_t_6 != -1)) {
13090         __Pyx_RaiseBufferIndexError(__pyx_t_6);
13091         __PYX_ERR(0, 694, __pyx_L1_error)
13092       }
13093       __pyx_t_18 = __pyx_v_i;
13094       __pyx_t_6 = -1;
13095       if (__pyx_t_18 < 0) {
13096         __pyx_t_18 += __pyx_pybuffernd_v.diminfo[0].shape;
13097         if (unlikely(__pyx_t_18 < 0)) __pyx_t_6 = 0;
13098       } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_6 = 0;
13099       if (unlikely(__pyx_t_6 != -1)) {
13100         __Pyx_RaiseBufferIndexError(__pyx_t_6);
13101         __PYX_ERR(0, 694, __pyx_L1_error)
13102       }
13103       *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_f_5MACS2_2IO_10ScoreTrack_get_pscore(((__pyx_t_5numpy_int32_t)((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_p.diminfo[0].strides)) + __pyx_v_self->pseudocount)), ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_c.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_c.diminfo[0].strides)) + __pyx_v_self->pseudocount));
13104 
13105       /* "MACS2/IO/ScoreTrack.pyx":695
13106  *             for i in range(l):
13107  *                 v[ i ] =  get_pscore( <int32_t>(p[ i ]  + self.pseudocount) , c[ i ]  + self.pseudocount )
13108  *                 try:             # <<<<<<<<<<<<<<
13109  *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos
13110  *                 except:
13111  */
13112       {
13113         __Pyx_PyThreadState_declare
13114         __Pyx_PyThreadState_assign
13115         __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
13116         __Pyx_XGOTREF(__pyx_t_9);
13117         __Pyx_XGOTREF(__pyx_t_10);
13118         __Pyx_XGOTREF(__pyx_t_11);
13119         /*try:*/ {
13120 
13121           /* "MACS2/IO/ScoreTrack.pyx":696
13122  *                 v[ i ] =  get_pscore( <int32_t>(p[ i ]  + self.pseudocount) , c[ i ]  + self.pseudocount )
13123  *                 try:
13124  *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
13125  *                 except:
13126  *                     self.pvalue_stat[v[ i ]] = pos[ i ] - prev_pos
13127  */
13128           if (unlikely(__pyx_v_self->pvalue_stat == Py_None)) {
13129             PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13130             __PYX_ERR(0, 696, __pyx_L7_error)
13131           }
13132           __Pyx_INCREF(__pyx_v_self->pvalue_stat);
13133           __pyx_t_19 = __pyx_v_self->pvalue_stat;
13134           __pyx_t_20 = __pyx_v_i;
13135           __pyx_t_6 = -1;
13136           if (__pyx_t_20 < 0) {
13137             __pyx_t_20 += __pyx_pybuffernd_v.diminfo[0].shape;
13138             if (unlikely(__pyx_t_20 < 0)) __pyx_t_6 = 0;
13139           } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_6 = 0;
13140           if (unlikely(__pyx_t_6 != -1)) {
13141             __Pyx_RaiseBufferIndexError(__pyx_t_6);
13142             __PYX_ERR(0, 696, __pyx_L7_error)
13143           }
13144           __pyx_t_5 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_v.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L7_error)
13145           __Pyx_GOTREF(__pyx_t_5);
13146           if (unlikely(__pyx_t_19 == Py_None)) {
13147             PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13148             __PYX_ERR(0, 696, __pyx_L7_error)
13149           }
13150           __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_t_19, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 696, __pyx_L7_error)
13151           __Pyx_GOTREF(__pyx_t_7);
13152           __pyx_t_21 = __pyx_v_i;
13153           __pyx_t_6 = -1;
13154           if (__pyx_t_21 < 0) {
13155             __pyx_t_21 += __pyx_pybuffernd_pos.diminfo[0].shape;
13156             if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 0;
13157           } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_6 = 0;
13158           if (unlikely(__pyx_t_6 != -1)) {
13159             __Pyx_RaiseBufferIndexError(__pyx_t_6);
13160             __PYX_ERR(0, 696, __pyx_L7_error)
13161           }
13162           __pyx_t_22 = __Pyx_PyInt_From_npy_int64(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 696, __pyx_L7_error)
13163           __Pyx_GOTREF(__pyx_t_22);
13164           __pyx_t_23 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_t_22); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 696, __pyx_L7_error)
13165           __Pyx_GOTREF(__pyx_t_23);
13166           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13167           __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
13168           if (unlikely(__pyx_t_19 == Py_None)) {
13169             PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13170             __PYX_ERR(0, 696, __pyx_L7_error)
13171           }
13172           if (unlikely(PyDict_SetItem(__pyx_t_19, __pyx_t_5, __pyx_t_23) < 0)) __PYX_ERR(0, 696, __pyx_L7_error)
13173           __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
13174           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13175           __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
13176 
13177           /* "MACS2/IO/ScoreTrack.pyx":695
13178  *             for i in range(l):
13179  *                 v[ i ] =  get_pscore( <int32_t>(p[ i ]  + self.pseudocount) , c[ i ]  + self.pseudocount )
13180  *                 try:             # <<<<<<<<<<<<<<
13181  *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos
13182  *                 except:
13183  */
13184         }
13185         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13186         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13187         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
13188         goto __pyx_L14_try_end;
13189         __pyx_L7_error:;
13190         __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
13191         __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
13192         __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
13193         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13194         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13195 
13196         /* "MACS2/IO/ScoreTrack.pyx":697
13197  *                 try:
13198  *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos
13199  *                 except:             # <<<<<<<<<<<<<<
13200  *                     self.pvalue_stat[v[ i ]] = pos[ i ] - prev_pos
13201  *                 prev_pos = pos[ i ]
13202  */
13203         /*except:*/ {
13204           __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.compute_pvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
13205           if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_23, &__pyx_t_22) < 0) __PYX_ERR(0, 697, __pyx_L9_except_error)
13206           __Pyx_GOTREF(__pyx_t_5);
13207           __Pyx_GOTREF(__pyx_t_23);
13208           __Pyx_GOTREF(__pyx_t_22);
13209 
13210           /* "MACS2/IO/ScoreTrack.pyx":698
13211  *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos
13212  *                 except:
13213  *                     self.pvalue_stat[v[ i ]] = pos[ i ] - prev_pos             # <<<<<<<<<<<<<<
13214  *                 prev_pos = pos[ i ]
13215  *
13216  */
13217           __pyx_t_24 = __pyx_v_i;
13218           __pyx_t_6 = -1;
13219           if (__pyx_t_24 < 0) {
13220             __pyx_t_24 += __pyx_pybuffernd_pos.diminfo[0].shape;
13221             if (unlikely(__pyx_t_24 < 0)) __pyx_t_6 = 0;
13222           } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_6 = 0;
13223           if (unlikely(__pyx_t_6 != -1)) {
13224             __Pyx_RaiseBufferIndexError(__pyx_t_6);
13225             __PYX_ERR(0, 698, __pyx_L9_except_error)
13226           }
13227           __pyx_t_7 = __Pyx_PyInt_From_npy_int64(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_pos.diminfo[0].strides)) - __pyx_v_prev_pos)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 698, __pyx_L9_except_error)
13228           __Pyx_GOTREF(__pyx_t_7);
13229           if (unlikely(__pyx_v_self->pvalue_stat == Py_None)) {
13230             PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13231             __PYX_ERR(0, 698, __pyx_L9_except_error)
13232           }
13233           __pyx_t_25 = __pyx_v_i;
13234           __pyx_t_6 = -1;
13235           if (__pyx_t_25 < 0) {
13236             __pyx_t_25 += __pyx_pybuffernd_v.diminfo[0].shape;
13237             if (unlikely(__pyx_t_25 < 0)) __pyx_t_6 = 0;
13238           } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_6 = 0;
13239           if (unlikely(__pyx_t_6 != -1)) {
13240             __Pyx_RaiseBufferIndexError(__pyx_t_6);
13241             __PYX_ERR(0, 698, __pyx_L9_except_error)
13242           }
13243           __pyx_t_26 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_v.diminfo[0].strides))); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 698, __pyx_L9_except_error)
13244           __Pyx_GOTREF(__pyx_t_26);
13245           if (unlikely(PyDict_SetItem(__pyx_v_self->pvalue_stat, __pyx_t_26, __pyx_t_7) < 0)) __PYX_ERR(0, 698, __pyx_L9_except_error)
13246           __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
13247           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13248           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13249           __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
13250           __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
13251           goto __pyx_L8_exception_handled;
13252         }
13253         __pyx_L9_except_error:;
13254 
13255         /* "MACS2/IO/ScoreTrack.pyx":695
13256  *             for i in range(l):
13257  *                 v[ i ] =  get_pscore( <int32_t>(p[ i ]  + self.pseudocount) , c[ i ]  + self.pseudocount )
13258  *                 try:             # <<<<<<<<<<<<<<
13259  *                     self.pvalue_stat[v[ i ]] += pos[ i ] - prev_pos
13260  *                 except:
13261  */
13262         __Pyx_XGIVEREF(__pyx_t_9);
13263         __Pyx_XGIVEREF(__pyx_t_10);
13264         __Pyx_XGIVEREF(__pyx_t_11);
13265         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
13266         goto __pyx_L1_error;
13267         __pyx_L8_exception_handled:;
13268         __Pyx_XGIVEREF(__pyx_t_9);
13269         __Pyx_XGIVEREF(__pyx_t_10);
13270         __Pyx_XGIVEREF(__pyx_t_11);
13271         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
13272         __pyx_L14_try_end:;
13273       }
13274 
13275       /* "MACS2/IO/ScoreTrack.pyx":699
13276  *                 except:
13277  *                     self.pvalue_stat[v[ i ]] = pos[ i ] - prev_pos
13278  *                 prev_pos = pos[ i ]             # <<<<<<<<<<<<<<
13279  *
13280  *         self.scoring_method = ord('p')
13281  */
13282       __pyx_t_27 = __pyx_v_i;
13283       __pyx_t_6 = -1;
13284       if (__pyx_t_27 < 0) {
13285         __pyx_t_27 += __pyx_pybuffernd_pos.diminfo[0].shape;
13286         if (unlikely(__pyx_t_27 < 0)) __pyx_t_6 = 0;
13287       } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_pos.diminfo[0].shape)) __pyx_t_6 = 0;
13288       if (unlikely(__pyx_t_6 != -1)) {
13289         __Pyx_RaiseBufferIndexError(__pyx_t_6);
13290         __PYX_ERR(0, 699, __pyx_L1_error)
13291       }
13292       __pyx_v_prev_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_pos.diminfo[0].strides));
13293     }
13294   }
13295   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13296 
13297   /* "MACS2/IO/ScoreTrack.pyx":701
13298  *                 prev_pos = pos[ i ]
13299  *
13300  *         self.scoring_method = ord('p')             # <<<<<<<<<<<<<<
13301  *         return
13302  *
13303  */
13304   __pyx_v_self->scoring_method = 0x70;
13305 
13306   /* "MACS2/IO/ScoreTrack.pyx":702
13307  *
13308  *         self.scoring_method = ord('p')
13309  *         return             # <<<<<<<<<<<<<<
13310  *
13311  *     cdef compute_qvalue ( self ):
13312  */
13313   __Pyx_XDECREF(__pyx_r);
13314   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13315   goto __pyx_L0;
13316 
13317   /* "MACS2/IO/ScoreTrack.pyx":677
13318  *             raise NotImplemented
13319  *
13320  *     cdef compute_pvalue ( self ):             # <<<<<<<<<<<<<<
13321  *         """Compute -log_{10}(pvalue)
13322  *         """
13323  */
13324 
13325   /* function exit code */
13326   __pyx_L1_error:;
13327   __Pyx_XDECREF(__pyx_t_1);
13328   __Pyx_XDECREF(__pyx_t_5);
13329   __Pyx_XDECREF(__pyx_t_7);
13330   __Pyx_XDECREF(__pyx_t_19);
13331   __Pyx_XDECREF(__pyx_t_22);
13332   __Pyx_XDECREF(__pyx_t_23);
13333   __Pyx_XDECREF(__pyx_t_26);
13334   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13335     __Pyx_PyThreadState_declare
13336     __Pyx_PyThreadState_assign
13337     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13338     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
13339     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
13340     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
13341     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
13342   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13343   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.compute_pvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
13344   __pyx_r = 0;
13345   goto __pyx_L2;
13346   __pyx_L0:;
13347   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
13348   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
13349   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
13350   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
13351   __pyx_L2:;
13352   __Pyx_XDECREF((PyObject *)__pyx_v_p);
13353   __Pyx_XDECREF((PyObject *)__pyx_v_c);
13354   __Pyx_XDECREF((PyObject *)__pyx_v_v);
13355   __Pyx_XDECREF((PyObject *)__pyx_v_pos);
13356   __Pyx_XDECREF(__pyx_v_chrom);
13357   __Pyx_XGIVEREF(__pyx_r);
13358   __Pyx_TraceReturn(__pyx_r, 0);
13359   __Pyx_RefNannyFinishContext();
13360   return __pyx_r;
13361 }
13362 
13363 /* "MACS2/IO/ScoreTrack.pyx":704
13364  *         return
13365  *
13366  *     cdef compute_qvalue ( self ):             # <<<<<<<<<<<<<<
13367  *         """Compute -log_{10}(qvalue)
13368  *         """
13369  */
13370 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_qvalue(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)13371 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_qvalue(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
13372   PyObject *__pyx_v_pqtable = 0;
13373   __pyx_t_5numpy_int64_t __pyx_v_i;
13374   __pyx_t_5numpy_int64_t __pyx_v_l;
13375   PyObject *__pyx_v_chrom = 0;
13376   PyArrayObject *__pyx_v_v = 0;
13377   PyObject *__pyx_r = NULL;
13378   __Pyx_TraceDeclarations
13379   __Pyx_RefNannyDeclarations
13380   PyObject *__pyx_t_1 = NULL;
13381   Py_ssize_t __pyx_t_2;
13382   Py_ssize_t __pyx_t_3;
13383   int __pyx_t_4;
13384   PyObject *__pyx_t_5 = NULL;
13385   int __pyx_t_6;
13386   PyObject *__pyx_t_7 = NULL;
13387   __pyx_t_5numpy_int64_t __pyx_t_8;
13388   __pyx_t_5numpy_int64_t __pyx_t_9;
13389   __pyx_t_5numpy_int64_t __pyx_t_10;
13390   __Pyx_RefNannySetupContext("compute_qvalue", 0);
13391   __Pyx_TraceCall("compute_qvalue", __pyx_f[0], 704, 0, __PYX_ERR(0, 704, __pyx_L1_error));
13392 
13393   /* "MACS2/IO/ScoreTrack.pyx":715
13394  *
13395  *         # pvalue should be computed first!
13396  *         assert self.scoring_method == ord('p')             # <<<<<<<<<<<<<<
13397  *         # make pqtable
13398  *         pqtable = self.make_pq_table()
13399  */
13400   #ifndef CYTHON_WITHOUT_ASSERTIONS
13401   if (unlikely(!Py_OptimizeFlag)) {
13402     if (unlikely(!((__pyx_v_self->scoring_method == 0x70) != 0))) {
13403       PyErr_SetNone(PyExc_AssertionError);
13404       __PYX_ERR(0, 715, __pyx_L1_error)
13405     }
13406   }
13407   #endif
13408 
13409   /* "MACS2/IO/ScoreTrack.pyx":717
13410  *         assert self.scoring_method == ord('p')
13411  *         # make pqtable
13412  *         pqtable = self.make_pq_table()             # <<<<<<<<<<<<<<
13413  *
13414  *         # convert p to q
13415  */
13416   __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->make_pq_table(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
13417   __Pyx_GOTREF(__pyx_t_1);
13418   __pyx_v_pqtable = ((PyObject*)__pyx_t_1);
13419   __pyx_t_1 = 0;
13420 
13421   /* "MACS2/IO/ScoreTrack.pyx":720
13422  *
13423  *         # convert p to q
13424  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
13425  *             v = self.data[chrom][3]
13426  *             l = self.datalength[chrom]
13427  */
13428   __pyx_t_2 = 0;
13429   if (unlikely(__pyx_v_self->data == Py_None)) {
13430     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
13431     __PYX_ERR(0, 720, __pyx_L1_error)
13432   }
13433   __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 720, __pyx_L1_error)
13434   __Pyx_GOTREF(__pyx_t_5);
13435   __Pyx_XDECREF(__pyx_t_1);
13436   __pyx_t_1 = __pyx_t_5;
13437   __pyx_t_5 = 0;
13438   while (1) {
13439     __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, NULL, NULL, __pyx_t_4);
13440     if (unlikely(__pyx_t_6 == 0)) break;
13441     if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 720, __pyx_L1_error)
13442     __Pyx_GOTREF(__pyx_t_5);
13443     if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 720, __pyx_L1_error)
13444     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_5));
13445     __pyx_t_5 = 0;
13446 
13447     /* "MACS2/IO/ScoreTrack.pyx":721
13448  *         # convert p to q
13449  *         for chrom in self.data.keys():
13450  *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
13451  *             l = self.datalength[chrom]
13452  *             for i in range(l):
13453  */
13454     if (unlikely(__pyx_v_self->data == Py_None)) {
13455       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13456       __PYX_ERR(0, 721, __pyx_L1_error)
13457     }
13458     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error)
13459     __Pyx_GOTREF(__pyx_t_5);
13460     __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 721, __pyx_L1_error)
13461     __Pyx_GOTREF(__pyx_t_7);
13462     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13463     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 721, __pyx_L1_error)
13464     __Pyx_XDECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_7));
13465     __pyx_t_7 = 0;
13466 
13467     /* "MACS2/IO/ScoreTrack.pyx":722
13468  *         for chrom in self.data.keys():
13469  *             v = self.data[chrom][3]
13470  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
13471  *             for i in range(l):
13472  *                 v[ i ] = pqtable[ v[ i ] ]
13473  */
13474     if (unlikely(__pyx_v_self->datalength == Py_None)) {
13475       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13476       __PYX_ERR(0, 722, __pyx_L1_error)
13477     }
13478     __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L1_error)
13479     __Pyx_GOTREF(__pyx_t_7);
13480     __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 722, __pyx_L1_error)
13481     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13482     __pyx_v_l = __pyx_t_8;
13483 
13484     /* "MACS2/IO/ScoreTrack.pyx":723
13485  *             v = self.data[chrom][3]
13486  *             l = self.datalength[chrom]
13487  *             for i in range(l):             # <<<<<<<<<<<<<<
13488  *                 v[ i ] = pqtable[ v[ i ] ]
13489  *                 #v [ i ] =  g( v[ i ])
13490  */
13491     __pyx_t_8 = __pyx_v_l;
13492     __pyx_t_9 = __pyx_t_8;
13493     for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
13494       __pyx_v_i = __pyx_t_10;
13495 
13496       /* "MACS2/IO/ScoreTrack.pyx":724
13497  *             l = self.datalength[chrom]
13498  *             for i in range(l):
13499  *                 v[ i ] = pqtable[ v[ i ] ]             # <<<<<<<<<<<<<<
13500  *                 #v [ i ] =  g( v[ i ])
13501  *
13502  */
13503       if (unlikely(__pyx_v_pqtable == Py_None)) {
13504         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13505         __PYX_ERR(0, 724, __pyx_L1_error)
13506       }
13507       __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 724, __pyx_L1_error)
13508       __Pyx_GOTREF(__pyx_t_7);
13509       __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_pqtable, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error)
13510       __Pyx_GOTREF(__pyx_t_5);
13511       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13512       if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_5, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1) < 0)) __PYX_ERR(0, 724, __pyx_L1_error)
13513       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13514     }
13515   }
13516   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13517 
13518   /* "MACS2/IO/ScoreTrack.pyx":727
13519  *                 #v [ i ] =  g( v[ i ])
13520  *
13521  *         self.scoring_method = ord('q')             # <<<<<<<<<<<<<<
13522  *         return
13523  *
13524  */
13525   __pyx_v_self->scoring_method = 0x71;
13526 
13527   /* "MACS2/IO/ScoreTrack.pyx":728
13528  *
13529  *         self.scoring_method = ord('q')
13530  *         return             # <<<<<<<<<<<<<<
13531  *
13532  *     cpdef dict make_pq_table ( self ):
13533  */
13534   __Pyx_XDECREF(__pyx_r);
13535   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13536   goto __pyx_L0;
13537 
13538   /* "MACS2/IO/ScoreTrack.pyx":704
13539  *         return
13540  *
13541  *     cdef compute_qvalue ( self ):             # <<<<<<<<<<<<<<
13542  *         """Compute -log_{10}(qvalue)
13543  *         """
13544  */
13545 
13546   /* function exit code */
13547   __pyx_L1_error:;
13548   __Pyx_XDECREF(__pyx_t_1);
13549   __Pyx_XDECREF(__pyx_t_5);
13550   __Pyx_XDECREF(__pyx_t_7);
13551   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.compute_qvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
13552   __pyx_r = 0;
13553   __pyx_L0:;
13554   __Pyx_XDECREF(__pyx_v_pqtable);
13555   __Pyx_XDECREF(__pyx_v_chrom);
13556   __Pyx_XDECREF((PyObject *)__pyx_v_v);
13557   __Pyx_XGIVEREF(__pyx_r);
13558   __Pyx_TraceReturn(__pyx_r, 0);
13559   __Pyx_RefNannyFinishContext();
13560   return __pyx_r;
13561 }
13562 
13563 /* "MACS2/IO/ScoreTrack.pyx":730
13564  *         return
13565  *
13566  *     cpdef dict make_pq_table ( self ):             # <<<<<<<<<<<<<<
13567  *         """Make pvalue-qvalue table.
13568  *
13569  */
13570 
13571 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_21make_pq_table(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_make_pq_table(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,int __pyx_skip_dispatch)13572 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_make_pq_table(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch) {
13573   CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_pre_l;
13574   __pyx_t_5numpy_int64_t __pyx_v_l;
13575   __pyx_t_5numpy_int64_t __pyx_v_i;
13576   CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_pre_v;
13577   __pyx_t_5numpy_float64_t __pyx_v_v;
13578   __pyx_t_5numpy_float64_t __pyx_v_q;
13579   __pyx_t_5numpy_float64_t __pyx_v_pre_q;
13580   __pyx_t_5numpy_int64_t __pyx_v_N;
13581   __pyx_t_5numpy_int64_t __pyx_v_k;
13582   __pyx_t_5numpy_float64_t __pyx_v_f;
13583   PyObject *__pyx_v_pvalue2qvalue = 0;
13584   PyObject *__pyx_v_value_dict = 0;
13585   PyObject *__pyx_v_unique_values = 0;
13586   PyObject *__pyx_r = NULL;
13587   __Pyx_TraceDeclarations
13588   __Pyx_RefNannyDeclarations
13589   PyObject *__pyx_t_1 = NULL;
13590   PyObject *__pyx_t_2 = NULL;
13591   PyObject *__pyx_t_3 = NULL;
13592   PyObject *__pyx_t_4 = NULL;
13593   __pyx_t_5numpy_int64_t __pyx_t_5;
13594   Py_ssize_t __pyx_t_6;
13595   Py_ssize_t __pyx_t_7;
13596   __pyx_t_5numpy_float64_t __pyx_t_8;
13597   __pyx_t_5numpy_int64_t __pyx_t_9;
13598   __pyx_t_5numpy_float64_t __pyx_t_10;
13599   __pyx_t_5numpy_float64_t __pyx_t_11;
13600   long __pyx_t_12;
13601   __Pyx_RefNannySetupContext("make_pq_table", 0);
13602   __Pyx_TraceCall("make_pq_table", __pyx_f[0], 730, 0, __PYX_ERR(0, 730, __pyx_L1_error));
13603   /* Check if called by wrapper */
13604   if (unlikely(__pyx_skip_dispatch)) ;
13605   /* Check if overridden in Python */
13606   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
13607     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
13608     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
13609     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
13610       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
13611       #endif
13612       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_make_pq_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
13613       __Pyx_GOTREF(__pyx_t_1);
13614       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_21make_pq_table)) {
13615         __Pyx_XDECREF(__pyx_r);
13616         __Pyx_INCREF(__pyx_t_1);
13617         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
13618         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
13619           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
13620           if (likely(__pyx_t_4)) {
13621             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13622             __Pyx_INCREF(__pyx_t_4);
13623             __Pyx_INCREF(function);
13624             __Pyx_DECREF_SET(__pyx_t_3, function);
13625           }
13626         }
13627         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
13628         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13629         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
13630         __Pyx_GOTREF(__pyx_t_2);
13631         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13632         if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 730, __pyx_L1_error)
13633         __pyx_r = ((PyObject*)__pyx_t_2);
13634         __pyx_t_2 = 0;
13635         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13636         goto __pyx_L0;
13637       }
13638       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
13639       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
13640       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
13641       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
13642         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
13643       }
13644       #endif
13645       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13646       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
13647     }
13648     #endif
13649   }
13650 
13651   /* "MACS2/IO/ScoreTrack.pyx":750
13652  *             list unique_values
13653  *
13654  *         assert self.scoring_method == ord('p')             # <<<<<<<<<<<<<<
13655  *
13656  *         value_dict = self.pvalue_stat
13657  */
13658   #ifndef CYTHON_WITHOUT_ASSERTIONS
13659   if (unlikely(!Py_OptimizeFlag)) {
13660     if (unlikely(!((__pyx_v_self->scoring_method == 0x70) != 0))) {
13661       PyErr_SetNone(PyExc_AssertionError);
13662       __PYX_ERR(0, 750, __pyx_L1_error)
13663     }
13664   }
13665   #endif
13666 
13667   /* "MACS2/IO/ScoreTrack.pyx":752
13668  *         assert self.scoring_method == ord('p')
13669  *
13670  *         value_dict = self.pvalue_stat             # <<<<<<<<<<<<<<
13671  *
13672  *         #for p in sorted(self.pvalue_stat.keys()):
13673  */
13674   __pyx_t_1 = __pyx_v_self->pvalue_stat;
13675   __Pyx_INCREF(__pyx_t_1);
13676   __pyx_v_value_dict = ((PyObject*)__pyx_t_1);
13677   __pyx_t_1 = 0;
13678 
13679   /* "MACS2/IO/ScoreTrack.pyx":758
13680  *
13681  *         #logging.info("####test#### 2")
13682  *         N = sum(value_dict.values())             # <<<<<<<<<<<<<<
13683  *         #for i in range(len(unique_values)):
13684  *             #N += value_dict.get_item(unique_values[i])
13685  */
13686   if (unlikely(__pyx_v_value_dict == Py_None)) {
13687     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
13688     __PYX_ERR(0, 758, __pyx_L1_error)
13689   }
13690   __pyx_t_1 = __Pyx_PyDict_Values(__pyx_v_value_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error)
13691   __Pyx_GOTREF(__pyx_t_1);
13692   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 758, __pyx_L1_error)
13693   __Pyx_GOTREF(__pyx_t_2);
13694   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13695   __pyx_t_5 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_5 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L1_error)
13696   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13697   __pyx_v_N = __pyx_t_5;
13698 
13699   /* "MACS2/IO/ScoreTrack.pyx":761
13700  *         #for i in range(len(unique_values)):
13701  *             #N += value_dict.get_item(unique_values[i])
13702  *         k = 1                           # rank             # <<<<<<<<<<<<<<
13703  *         f = -log10(N)
13704  *         pre_v = -2147483647
13705  */
13706   __pyx_v_k = 1;
13707 
13708   /* "MACS2/IO/ScoreTrack.pyx":762
13709  *             #N += value_dict.get_item(unique_values[i])
13710  *         k = 1                           # rank
13711  *         f = -log10(N)             # <<<<<<<<<<<<<<
13712  *         pre_v = -2147483647
13713  *         pre_l = 0
13714  */
13715   __pyx_v_f = (-log10(__pyx_v_N));
13716 
13717   /* "MACS2/IO/ScoreTrack.pyx":763
13718  *         k = 1                           # rank
13719  *         f = -log10(N)
13720  *         pre_v = -2147483647             # <<<<<<<<<<<<<<
13721  *         pre_l = 0
13722  *         pre_q = 2147483647              # save the previous q-value
13723  */
13724   __pyx_v_pre_v = -2147483647.0;
13725 
13726   /* "MACS2/IO/ScoreTrack.pyx":764
13727  *         f = -log10(N)
13728  *         pre_v = -2147483647
13729  *         pre_l = 0             # <<<<<<<<<<<<<<
13730  *         pre_q = 2147483647              # save the previous q-value
13731  *
13732  */
13733   __pyx_v_pre_l = 0;
13734 
13735   /* "MACS2/IO/ScoreTrack.pyx":765
13736  *         pre_v = -2147483647
13737  *         pre_l = 0
13738  *         pre_q = 2147483647              # save the previous q-value             # <<<<<<<<<<<<<<
13739  *
13740  *         pvalue2qvalue = {}#Float64HashTable()
13741  */
13742   __pyx_v_pre_q = 2147483647.0;
13743 
13744   /* "MACS2/IO/ScoreTrack.pyx":767
13745  *         pre_q = 2147483647              # save the previous q-value
13746  *
13747  *         pvalue2qvalue = {}#Float64HashTable()             # <<<<<<<<<<<<<<
13748  *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
13749  *         for i in range(len(unique_values)):
13750  */
13751   __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
13752   __Pyx_GOTREF(__pyx_t_2);
13753   __pyx_v_pvalue2qvalue = ((PyObject*)__pyx_t_2);
13754   __pyx_t_2 = 0;
13755 
13756   /* "MACS2/IO/ScoreTrack.pyx":768
13757  *
13758  *         pvalue2qvalue = {}#Float64HashTable()
13759  *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)             # <<<<<<<<<<<<<<
13760  *         for i in range(len(unique_values)):
13761  *             v = unique_values[i]
13762  */
13763   if (unlikely(__pyx_v_value_dict == Py_None)) {
13764     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
13765     __PYX_ERR(0, 768, __pyx_L1_error)
13766   }
13767   __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_value_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
13768   __Pyx_GOTREF(__pyx_t_2);
13769   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error)
13770   __Pyx_GOTREF(__pyx_t_1);
13771   __Pyx_GIVEREF(__pyx_t_2);
13772   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
13773   __pyx_t_2 = 0;
13774   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
13775   __Pyx_GOTREF(__pyx_t_2);
13776   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_reverse, Py_True) < 0) __PYX_ERR(0, 768, __pyx_L1_error)
13777   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error)
13778   __Pyx_GOTREF(__pyx_t_3);
13779   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13780   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13781   if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 768, __pyx_L1_error)
13782   __pyx_v_unique_values = ((PyObject*)__pyx_t_3);
13783   __pyx_t_3 = 0;
13784 
13785   /* "MACS2/IO/ScoreTrack.pyx":769
13786  *         pvalue2qvalue = {}#Float64HashTable()
13787  *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
13788  *         for i in range(len(unique_values)):             # <<<<<<<<<<<<<<
13789  *             v = unique_values[i]
13790  *
13791  */
13792   if (unlikely(__pyx_v_unique_values == Py_None)) {
13793     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
13794     __PYX_ERR(0, 769, __pyx_L1_error)
13795   }
13796   __pyx_t_6 = PyList_GET_SIZE(__pyx_v_unique_values); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 769, __pyx_L1_error)
13797   __pyx_t_7 = __pyx_t_6;
13798   for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
13799     __pyx_v_i = __pyx_t_5;
13800 
13801     /* "MACS2/IO/ScoreTrack.pyx":770
13802  *         unique_values = sorted(value_dict.keys(), reverse=True) #sorted(unique_values,reverse=True)
13803  *         for i in range(len(unique_values)):
13804  *             v = unique_values[i]             # <<<<<<<<<<<<<<
13805  *
13806  *             l = value_dict[v]
13807  */
13808     if (unlikely(__pyx_v_unique_values == Py_None)) {
13809       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13810       __PYX_ERR(0, 770, __pyx_L1_error)
13811     }
13812     __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_unique_values, __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error)
13813     __Pyx_GOTREF(__pyx_t_3);
13814     __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L1_error)
13815     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13816     __pyx_v_v = __pyx_t_8;
13817 
13818     /* "MACS2/IO/ScoreTrack.pyx":772
13819  *             v = unique_values[i]
13820  *
13821  *             l = value_dict[v]             # <<<<<<<<<<<<<<
13822  *             q = v + (log10(k) + f)
13823  *             q = max(0,min(pre_q,q))           # make q-score monotonic
13824  */
13825     if (unlikely(__pyx_v_value_dict == Py_None)) {
13826       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13827       __PYX_ERR(0, 772, __pyx_L1_error)
13828     }
13829     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error)
13830     __Pyx_GOTREF(__pyx_t_3);
13831     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_value_dict, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error)
13832     __Pyx_GOTREF(__pyx_t_2);
13833     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13834     __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 772, __pyx_L1_error)
13835     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13836     __pyx_v_l = __pyx_t_9;
13837 
13838     /* "MACS2/IO/ScoreTrack.pyx":773
13839  *
13840  *             l = value_dict[v]
13841  *             q = v + (log10(k) + f)             # <<<<<<<<<<<<<<
13842  *             q = max(0,min(pre_q,q))           # make q-score monotonic
13843  *
13844  */
13845     __pyx_v_q = (__pyx_v_v + (log10(__pyx_v_k) + __pyx_v_f));
13846 
13847     /* "MACS2/IO/ScoreTrack.pyx":774
13848  *             l = value_dict[v]
13849  *             q = v + (log10(k) + f)
13850  *             q = max(0,min(pre_q,q))           # make q-score monotonic             # <<<<<<<<<<<<<<
13851  *
13852  *             pvalue2qvalue[ v ] = q
13853  */
13854     __pyx_t_8 = __pyx_v_q;
13855     __pyx_t_10 = __pyx_v_pre_q;
13856     if (((__pyx_t_8 < __pyx_t_10) != 0)) {
13857       __pyx_t_11 = __pyx_t_8;
13858     } else {
13859       __pyx_t_11 = __pyx_t_10;
13860     }
13861     __pyx_t_8 = __pyx_t_11;
13862     __pyx_t_12 = 0;
13863     if (((__pyx_t_8 > __pyx_t_12) != 0)) {
13864       __pyx_t_11 = __pyx_t_8;
13865     } else {
13866       __pyx_t_11 = __pyx_t_12;
13867     }
13868     __pyx_v_q = __pyx_t_11;
13869 
13870     /* "MACS2/IO/ScoreTrack.pyx":776
13871  *             q = max(0,min(pre_q,q))           # make q-score monotonic
13872  *
13873  *             pvalue2qvalue[ v ] = q             # <<<<<<<<<<<<<<
13874  *
13875  *             pre_v = v
13876  */
13877     __pyx_t_2 = PyFloat_FromDouble(__pyx_v_q); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
13878     __Pyx_GOTREF(__pyx_t_2);
13879     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error)
13880     __Pyx_GOTREF(__pyx_t_3);
13881     if (unlikely(PyDict_SetItem(__pyx_v_pvalue2qvalue, __pyx_t_3, __pyx_t_2) < 0)) __PYX_ERR(0, 776, __pyx_L1_error)
13882     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13883     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13884 
13885     /* "MACS2/IO/ScoreTrack.pyx":778
13886  *             pvalue2qvalue[ v ] = q
13887  *
13888  *             pre_v = v             # <<<<<<<<<<<<<<
13889  *             pre_q = q
13890  *             k+=l
13891  */
13892     __pyx_v_pre_v = __pyx_v_v;
13893 
13894     /* "MACS2/IO/ScoreTrack.pyx":779
13895  *
13896  *             pre_v = v
13897  *             pre_q = q             # <<<<<<<<<<<<<<
13898  *             k+=l
13899  *         return pvalue2qvalue
13900  */
13901     __pyx_v_pre_q = __pyx_v_q;
13902 
13903     /* "MACS2/IO/ScoreTrack.pyx":780
13904  *             pre_v = v
13905  *             pre_q = q
13906  *             k+=l             # <<<<<<<<<<<<<<
13907  *         return pvalue2qvalue
13908  *
13909  */
13910     __pyx_v_k = (__pyx_v_k + __pyx_v_l);
13911   }
13912 
13913   /* "MACS2/IO/ScoreTrack.pyx":781
13914  *             pre_q = q
13915  *             k+=l
13916  *         return pvalue2qvalue             # <<<<<<<<<<<<<<
13917  *
13918  *     cdef compute_likelihood ( self ):
13919  */
13920   __Pyx_XDECREF(__pyx_r);
13921   __Pyx_INCREF(__pyx_v_pvalue2qvalue);
13922   __pyx_r = __pyx_v_pvalue2qvalue;
13923   goto __pyx_L0;
13924 
13925   /* "MACS2/IO/ScoreTrack.pyx":730
13926  *         return
13927  *
13928  *     cpdef dict make_pq_table ( self ):             # <<<<<<<<<<<<<<
13929  *         """Make pvalue-qvalue table.
13930  *
13931  */
13932 
13933   /* function exit code */
13934   __pyx_L1_error:;
13935   __Pyx_XDECREF(__pyx_t_1);
13936   __Pyx_XDECREF(__pyx_t_2);
13937   __Pyx_XDECREF(__pyx_t_3);
13938   __Pyx_XDECREF(__pyx_t_4);
13939   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.make_pq_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
13940   __pyx_r = 0;
13941   __pyx_L0:;
13942   __Pyx_XDECREF(__pyx_v_pvalue2qvalue);
13943   __Pyx_XDECREF(__pyx_v_value_dict);
13944   __Pyx_XDECREF(__pyx_v_unique_values);
13945   __Pyx_XGIVEREF(__pyx_r);
13946   __Pyx_TraceReturn(__pyx_r, 0);
13947   __Pyx_RefNannyFinishContext();
13948   return __pyx_r;
13949 }
13950 
13951 /* Python wrapper */
13952 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_21make_pq_table(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13953 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_20make_pq_table[] = "Make pvalue-qvalue table.\n\n        Step1: get all pvalue and length of block with this pvalue\n        Step2: Sort them\n        Step3: Apply AFDR method to adjust pvalue and get qvalue for each pvalue\n\n        Return a dictionary of {-log10pvalue:(-log10qvalue,rank,basepairs)} relationships.\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_21make_pq_table(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)13954 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_21make_pq_table(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13955   PyObject *__pyx_r = 0;
13956   __Pyx_RefNannyDeclarations
13957   __Pyx_RefNannySetupContext("make_pq_table (wrapper)", 0);
13958   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_20make_pq_table(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self));
13959 
13960   /* function exit code */
13961   __Pyx_RefNannyFinishContext();
13962   return __pyx_r;
13963 }
13964 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_20make_pq_table(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)13965 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_20make_pq_table(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
13966   PyObject *__pyx_r = NULL;
13967   __Pyx_TraceDeclarations
13968   __Pyx_RefNannyDeclarations
13969   PyObject *__pyx_t_1 = NULL;
13970   __Pyx_RefNannySetupContext("make_pq_table", 0);
13971   __Pyx_TraceCall("make_pq_table (wrapper)", __pyx_f[0], 730, 0, __PYX_ERR(0, 730, __pyx_L1_error));
13972   __Pyx_XDECREF(__pyx_r);
13973   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_make_pq_table(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
13974   __Pyx_GOTREF(__pyx_t_1);
13975   __pyx_r = __pyx_t_1;
13976   __pyx_t_1 = 0;
13977   goto __pyx_L0;
13978 
13979   /* function exit code */
13980   __pyx_L1_error:;
13981   __Pyx_XDECREF(__pyx_t_1);
13982   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.make_pq_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
13983   __pyx_r = NULL;
13984   __pyx_L0:;
13985   __Pyx_XGIVEREF(__pyx_r);
13986   __Pyx_TraceReturn(__pyx_r, 0);
13987   __Pyx_RefNannyFinishContext();
13988   return __pyx_r;
13989 }
13990 
13991 /* "MACS2/IO/ScoreTrack.pyx":783
13992  *         return pvalue2qvalue
13993  *
13994  *     cdef compute_likelihood ( self ):             # <<<<<<<<<<<<<<
13995  *         """Calculate log10 likelihood.
13996  *
13997  */
13998 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_likelihood(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)13999 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_likelihood(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
14000   __pyx_t_5numpy_int64_t __pyx_v_l;
14001   __pyx_t_5numpy_int64_t __pyx_v_i;
14002   PyObject *__pyx_v_chrom = 0;
14003   __pyx_t_5numpy_float64_t __pyx_v_v1;
14004   __pyx_t_5numpy_float64_t __pyx_v_v2;
14005   __pyx_t_5numpy_float64_t __pyx_v_pseudocount;
14006   PyObject *__pyx_v_p = NULL;
14007   PyObject *__pyx_v_c = NULL;
14008   PyObject *__pyx_v_v = NULL;
14009   PyObject *__pyx_r = NULL;
14010   __Pyx_TraceDeclarations
14011   __Pyx_RefNannyDeclarations
14012   __pyx_t_5numpy_float64_t __pyx_t_1;
14013   PyObject *__pyx_t_2 = NULL;
14014   Py_ssize_t __pyx_t_3;
14015   Py_ssize_t __pyx_t_4;
14016   int __pyx_t_5;
14017   PyObject *__pyx_t_6 = NULL;
14018   int __pyx_t_7;
14019   PyObject *__pyx_t_8 = NULL;
14020   __pyx_t_5numpy_int64_t __pyx_t_9;
14021   __pyx_t_5numpy_int64_t __pyx_t_10;
14022   __pyx_t_5numpy_int64_t __pyx_t_11;
14023   PyObject *__pyx_t_12 = NULL;
14024   __Pyx_RefNannySetupContext("compute_likelihood", 0);
14025   __Pyx_TraceCall("compute_likelihood", __pyx_f[0], 783, 0, __PYX_ERR(0, 783, __pyx_L1_error));
14026 
14027   /* "MACS2/IO/ScoreTrack.pyx":794
14028  *             float64_t pseudocount
14029  *
14030  *         pseudocount = self.pseudocount             # <<<<<<<<<<<<<<
14031  *
14032  *         for chrom in self.data.keys():
14033  */
14034   __pyx_t_1 = __pyx_v_self->pseudocount;
14035   __pyx_v_pseudocount = __pyx_t_1;
14036 
14037   /* "MACS2/IO/ScoreTrack.pyx":796
14038  *         pseudocount = self.pseudocount
14039  *
14040  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
14041  *             p = self.data[chrom][ 1 ].flat.__next__
14042  *             c = self.data[chrom][ 2 ].flat.__next__
14043  */
14044   __pyx_t_3 = 0;
14045   if (unlikely(__pyx_v_self->data == Py_None)) {
14046     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
14047     __PYX_ERR(0, 796, __pyx_L1_error)
14048   }
14049   __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 796, __pyx_L1_error)
14050   __Pyx_GOTREF(__pyx_t_6);
14051   __Pyx_XDECREF(__pyx_t_2);
14052   __pyx_t_2 = __pyx_t_6;
14053   __pyx_t_6 = 0;
14054   while (1) {
14055     __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, NULL, NULL, __pyx_t_5);
14056     if (unlikely(__pyx_t_7 == 0)) break;
14057     if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 796, __pyx_L1_error)
14058     __Pyx_GOTREF(__pyx_t_6);
14059     if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 796, __pyx_L1_error)
14060     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_6));
14061     __pyx_t_6 = 0;
14062 
14063     /* "MACS2/IO/ScoreTrack.pyx":797
14064  *
14065  *         for chrom in self.data.keys():
14066  *             p = self.data[chrom][ 1 ].flat.__next__             # <<<<<<<<<<<<<<
14067  *             c = self.data[chrom][ 2 ].flat.__next__
14068  *             v = self.data[chrom][ 3 ]
14069  */
14070     if (unlikely(__pyx_v_self->data == Py_None)) {
14071       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14072       __PYX_ERR(0, 797, __pyx_L1_error)
14073     }
14074     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 797, __pyx_L1_error)
14075     __Pyx_GOTREF(__pyx_t_6);
14076     __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 797, __pyx_L1_error)
14077     __Pyx_GOTREF(__pyx_t_8);
14078     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14079     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flat); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 797, __pyx_L1_error)
14080     __Pyx_GOTREF(__pyx_t_6);
14081     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14082     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_next); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 797, __pyx_L1_error)
14083     __Pyx_GOTREF(__pyx_t_8);
14084     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14085     __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_8);
14086     __pyx_t_8 = 0;
14087 
14088     /* "MACS2/IO/ScoreTrack.pyx":798
14089  *         for chrom in self.data.keys():
14090  *             p = self.data[chrom][ 1 ].flat.__next__
14091  *             c = self.data[chrom][ 2 ].flat.__next__             # <<<<<<<<<<<<<<
14092  *             v = self.data[chrom][ 3 ]
14093  *             l = self.datalength[chrom]
14094  */
14095     if (unlikely(__pyx_v_self->data == Py_None)) {
14096       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14097       __PYX_ERR(0, 798, __pyx_L1_error)
14098     }
14099     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 798, __pyx_L1_error)
14100     __Pyx_GOTREF(__pyx_t_8);
14101     __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 798, __pyx_L1_error)
14102     __Pyx_GOTREF(__pyx_t_6);
14103     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14104     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 798, __pyx_L1_error)
14105     __Pyx_GOTREF(__pyx_t_8);
14106     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14107     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_next); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 798, __pyx_L1_error)
14108     __Pyx_GOTREF(__pyx_t_6);
14109     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14110     __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_6);
14111     __pyx_t_6 = 0;
14112 
14113     /* "MACS2/IO/ScoreTrack.pyx":799
14114  *             p = self.data[chrom][ 1 ].flat.__next__
14115  *             c = self.data[chrom][ 2 ].flat.__next__
14116  *             v = self.data[chrom][ 3 ]             # <<<<<<<<<<<<<<
14117  *             l = self.datalength[chrom]
14118  *             v1 = 2
14119  */
14120     if (unlikely(__pyx_v_self->data == Py_None)) {
14121       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14122       __PYX_ERR(0, 799, __pyx_L1_error)
14123     }
14124     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 799, __pyx_L1_error)
14125     __Pyx_GOTREF(__pyx_t_6);
14126     __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_6, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 799, __pyx_L1_error)
14127     __Pyx_GOTREF(__pyx_t_8);
14128     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14129     __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8);
14130     __pyx_t_8 = 0;
14131 
14132     /* "MACS2/IO/ScoreTrack.pyx":800
14133  *             c = self.data[chrom][ 2 ].flat.__next__
14134  *             v = self.data[chrom][ 3 ]
14135  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
14136  *             v1 = 2
14137  *             v2 = 1
14138  */
14139     if (unlikely(__pyx_v_self->datalength == Py_None)) {
14140       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14141       __PYX_ERR(0, 800, __pyx_L1_error)
14142     }
14143     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 800, __pyx_L1_error)
14144     __Pyx_GOTREF(__pyx_t_8);
14145     __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 800, __pyx_L1_error)
14146     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14147     __pyx_v_l = __pyx_t_9;
14148 
14149     /* "MACS2/IO/ScoreTrack.pyx":801
14150  *             v = self.data[chrom][ 3 ]
14151  *             l = self.datalength[chrom]
14152  *             v1 = 2             # <<<<<<<<<<<<<<
14153  *             v2 = 1
14154  *             for i in range(l):
14155  */
14156     __pyx_v_v1 = 2.0;
14157 
14158     /* "MACS2/IO/ScoreTrack.pyx":802
14159  *             l = self.datalength[chrom]
14160  *             v1 = 2
14161  *             v2 = 1             # <<<<<<<<<<<<<<
14162  *             for i in range(l):
14163  *                 v1 = p()
14164  */
14165     __pyx_v_v2 = 1.0;
14166 
14167     /* "MACS2/IO/ScoreTrack.pyx":803
14168  *             v1 = 2
14169  *             v2 = 1
14170  *             for i in range(l):             # <<<<<<<<<<<<<<
14171  *                 v1 = p()
14172  *                 v2 = c()
14173  */
14174     __pyx_t_9 = __pyx_v_l;
14175     __pyx_t_10 = __pyx_t_9;
14176     for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
14177       __pyx_v_i = __pyx_t_11;
14178 
14179       /* "MACS2/IO/ScoreTrack.pyx":804
14180  *             v2 = 1
14181  *             for i in range(l):
14182  *                 v1 = p()             # <<<<<<<<<<<<<<
14183  *                 v2 = c()
14184  *                 v[ i ] =  logLR_asym( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )
14185  */
14186       __Pyx_INCREF(__pyx_v_p);
14187       __pyx_t_6 = __pyx_v_p; __pyx_t_12 = NULL;
14188       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
14189         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
14190         if (likely(__pyx_t_12)) {
14191           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
14192           __Pyx_INCREF(__pyx_t_12);
14193           __Pyx_INCREF(function);
14194           __Pyx_DECREF_SET(__pyx_t_6, function);
14195         }
14196       }
14197       __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
14198       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
14199       if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 804, __pyx_L1_error)
14200       __Pyx_GOTREF(__pyx_t_8);
14201       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14202       __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 804, __pyx_L1_error)
14203       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14204       __pyx_v_v1 = __pyx_t_1;
14205 
14206       /* "MACS2/IO/ScoreTrack.pyx":805
14207  *             for i in range(l):
14208  *                 v1 = p()
14209  *                 v2 = c()             # <<<<<<<<<<<<<<
14210  *                 v[ i ] =  logLR_asym( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )
14211  *                 #print v1, v2, v[i]
14212  */
14213       __Pyx_INCREF(__pyx_v_c);
14214       __pyx_t_6 = __pyx_v_c; __pyx_t_12 = NULL;
14215       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
14216         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
14217         if (likely(__pyx_t_12)) {
14218           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
14219           __Pyx_INCREF(__pyx_t_12);
14220           __Pyx_INCREF(function);
14221           __Pyx_DECREF_SET(__pyx_t_6, function);
14222         }
14223       }
14224       __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
14225       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
14226       if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 805, __pyx_L1_error)
14227       __Pyx_GOTREF(__pyx_t_8);
14228       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14229       __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 805, __pyx_L1_error)
14230       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14231       __pyx_v_v2 = __pyx_t_1;
14232 
14233       /* "MACS2/IO/ScoreTrack.pyx":806
14234  *                 v1 = p()
14235  *                 v2 = c()
14236  *                 v[ i ] =  logLR_asym( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )             # <<<<<<<<<<<<<<
14237  *                 #print v1, v2, v[i]
14238  *         self.scoring_method = ord('l')
14239  */
14240       __pyx_t_8 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_10ScoreTrack_logLR_asym((__pyx_v_v1 + __pyx_v_pseudocount), (__pyx_v_v2 + __pyx_v_pseudocount))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 806, __pyx_L1_error)
14241       __Pyx_GOTREF(__pyx_t_8);
14242       if (unlikely(__Pyx_SetItemInt(__pyx_v_v, __pyx_v_i, __pyx_t_8, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1) < 0)) __PYX_ERR(0, 806, __pyx_L1_error)
14243       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14244     }
14245   }
14246   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14247 
14248   /* "MACS2/IO/ScoreTrack.pyx":808
14249  *                 v[ i ] =  logLR_asym( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )
14250  *                 #print v1, v2, v[i]
14251  *         self.scoring_method = ord('l')             # <<<<<<<<<<<<<<
14252  *         return
14253  *
14254  */
14255   __pyx_v_self->scoring_method = 0x6C;
14256 
14257   /* "MACS2/IO/ScoreTrack.pyx":809
14258  *                 #print v1, v2, v[i]
14259  *         self.scoring_method = ord('l')
14260  *         return             # <<<<<<<<<<<<<<
14261  *
14262  *     cdef compute_sym_likelihood ( self ):
14263  */
14264   __Pyx_XDECREF(__pyx_r);
14265   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14266   goto __pyx_L0;
14267 
14268   /* "MACS2/IO/ScoreTrack.pyx":783
14269  *         return pvalue2qvalue
14270  *
14271  *     cdef compute_likelihood ( self ):             # <<<<<<<<<<<<<<
14272  *         """Calculate log10 likelihood.
14273  *
14274  */
14275 
14276   /* function exit code */
14277   __pyx_L1_error:;
14278   __Pyx_XDECREF(__pyx_t_2);
14279   __Pyx_XDECREF(__pyx_t_6);
14280   __Pyx_XDECREF(__pyx_t_8);
14281   __Pyx_XDECREF(__pyx_t_12);
14282   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.compute_likelihood", __pyx_clineno, __pyx_lineno, __pyx_filename);
14283   __pyx_r = 0;
14284   __pyx_L0:;
14285   __Pyx_XDECREF(__pyx_v_chrom);
14286   __Pyx_XDECREF(__pyx_v_p);
14287   __Pyx_XDECREF(__pyx_v_c);
14288   __Pyx_XDECREF(__pyx_v_v);
14289   __Pyx_XGIVEREF(__pyx_r);
14290   __Pyx_TraceReturn(__pyx_r, 0);
14291   __Pyx_RefNannyFinishContext();
14292   return __pyx_r;
14293 }
14294 
14295 /* "MACS2/IO/ScoreTrack.pyx":811
14296  *         return
14297  *
14298  *     cdef compute_sym_likelihood ( self ):             # <<<<<<<<<<<<<<
14299  *         """Calculate symmetric log10 likelihood.
14300  *
14301  */
14302 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_sym_likelihood(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)14303 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_sym_likelihood(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
14304   __pyx_t_5numpy_int64_t __pyx_v_l;
14305   __pyx_t_5numpy_int64_t __pyx_v_i;
14306   PyObject *__pyx_v_chrom = 0;
14307   __pyx_t_5numpy_float64_t __pyx_v_v1;
14308   __pyx_t_5numpy_float64_t __pyx_v_v2;
14309   __pyx_t_5numpy_float64_t __pyx_v_pseudocount;
14310   PyObject *__pyx_v_p = NULL;
14311   PyObject *__pyx_v_c = NULL;
14312   PyObject *__pyx_v_v = NULL;
14313   PyObject *__pyx_r = NULL;
14314   __Pyx_TraceDeclarations
14315   __Pyx_RefNannyDeclarations
14316   __pyx_t_5numpy_float64_t __pyx_t_1;
14317   PyObject *__pyx_t_2 = NULL;
14318   Py_ssize_t __pyx_t_3;
14319   Py_ssize_t __pyx_t_4;
14320   int __pyx_t_5;
14321   PyObject *__pyx_t_6 = NULL;
14322   int __pyx_t_7;
14323   PyObject *__pyx_t_8 = NULL;
14324   __pyx_t_5numpy_int64_t __pyx_t_9;
14325   __pyx_t_5numpy_int64_t __pyx_t_10;
14326   __pyx_t_5numpy_int64_t __pyx_t_11;
14327   PyObject *__pyx_t_12 = NULL;
14328   __Pyx_RefNannySetupContext("compute_sym_likelihood", 0);
14329   __Pyx_TraceCall("compute_sym_likelihood", __pyx_f[0], 811, 0, __PYX_ERR(0, 811, __pyx_L1_error));
14330 
14331   /* "MACS2/IO/ScoreTrack.pyx":822
14332  *             float64_t pseudocount
14333  *
14334  *         pseudocount = self.pseudocount             # <<<<<<<<<<<<<<
14335  *
14336  *         for chrom in self.data.keys():
14337  */
14338   __pyx_t_1 = __pyx_v_self->pseudocount;
14339   __pyx_v_pseudocount = __pyx_t_1;
14340 
14341   /* "MACS2/IO/ScoreTrack.pyx":824
14342  *         pseudocount = self.pseudocount
14343  *
14344  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
14345  *             p = self.data[chrom][ 1 ].flat.__next__
14346  *             c = self.data[chrom][ 2 ].flat.__next__
14347  */
14348   __pyx_t_3 = 0;
14349   if (unlikely(__pyx_v_self->data == Py_None)) {
14350     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
14351     __PYX_ERR(0, 824, __pyx_L1_error)
14352   }
14353   __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 824, __pyx_L1_error)
14354   __Pyx_GOTREF(__pyx_t_6);
14355   __Pyx_XDECREF(__pyx_t_2);
14356   __pyx_t_2 = __pyx_t_6;
14357   __pyx_t_6 = 0;
14358   while (1) {
14359     __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, NULL, NULL, __pyx_t_5);
14360     if (unlikely(__pyx_t_7 == 0)) break;
14361     if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 824, __pyx_L1_error)
14362     __Pyx_GOTREF(__pyx_t_6);
14363     if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 824, __pyx_L1_error)
14364     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_6));
14365     __pyx_t_6 = 0;
14366 
14367     /* "MACS2/IO/ScoreTrack.pyx":825
14368  *
14369  *         for chrom in self.data.keys():
14370  *             p = self.data[chrom][ 1 ].flat.__next__             # <<<<<<<<<<<<<<
14371  *             c = self.data[chrom][ 2 ].flat.__next__
14372  *             v = self.data[chrom][ 3 ]
14373  */
14374     if (unlikely(__pyx_v_self->data == Py_None)) {
14375       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14376       __PYX_ERR(0, 825, __pyx_L1_error)
14377     }
14378     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error)
14379     __Pyx_GOTREF(__pyx_t_6);
14380     __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 825, __pyx_L1_error)
14381     __Pyx_GOTREF(__pyx_t_8);
14382     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14383     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flat); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error)
14384     __Pyx_GOTREF(__pyx_t_6);
14385     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14386     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_next); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 825, __pyx_L1_error)
14387     __Pyx_GOTREF(__pyx_t_8);
14388     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14389     __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_8);
14390     __pyx_t_8 = 0;
14391 
14392     /* "MACS2/IO/ScoreTrack.pyx":826
14393  *         for chrom in self.data.keys():
14394  *             p = self.data[chrom][ 1 ].flat.__next__
14395  *             c = self.data[chrom][ 2 ].flat.__next__             # <<<<<<<<<<<<<<
14396  *             v = self.data[chrom][ 3 ]
14397  *             l = self.datalength[chrom]
14398  */
14399     if (unlikely(__pyx_v_self->data == Py_None)) {
14400       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14401       __PYX_ERR(0, 826, __pyx_L1_error)
14402     }
14403     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 826, __pyx_L1_error)
14404     __Pyx_GOTREF(__pyx_t_8);
14405     __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 826, __pyx_L1_error)
14406     __Pyx_GOTREF(__pyx_t_6);
14407     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14408     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 826, __pyx_L1_error)
14409     __Pyx_GOTREF(__pyx_t_8);
14410     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14411     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_next); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 826, __pyx_L1_error)
14412     __Pyx_GOTREF(__pyx_t_6);
14413     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14414     __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_6);
14415     __pyx_t_6 = 0;
14416 
14417     /* "MACS2/IO/ScoreTrack.pyx":827
14418  *             p = self.data[chrom][ 1 ].flat.__next__
14419  *             c = self.data[chrom][ 2 ].flat.__next__
14420  *             v = self.data[chrom][ 3 ]             # <<<<<<<<<<<<<<
14421  *             l = self.datalength[chrom]
14422  *             v1 = 2
14423  */
14424     if (unlikely(__pyx_v_self->data == Py_None)) {
14425       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14426       __PYX_ERR(0, 827, __pyx_L1_error)
14427     }
14428     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 827, __pyx_L1_error)
14429     __Pyx_GOTREF(__pyx_t_6);
14430     __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_6, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 827, __pyx_L1_error)
14431     __Pyx_GOTREF(__pyx_t_8);
14432     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14433     __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8);
14434     __pyx_t_8 = 0;
14435 
14436     /* "MACS2/IO/ScoreTrack.pyx":828
14437  *             c = self.data[chrom][ 2 ].flat.__next__
14438  *             v = self.data[chrom][ 3 ]
14439  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
14440  *             v1 = 2
14441  *             v2 = 1
14442  */
14443     if (unlikely(__pyx_v_self->datalength == Py_None)) {
14444       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14445       __PYX_ERR(0, 828, __pyx_L1_error)
14446     }
14447     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 828, __pyx_L1_error)
14448     __Pyx_GOTREF(__pyx_t_8);
14449     __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 828, __pyx_L1_error)
14450     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14451     __pyx_v_l = __pyx_t_9;
14452 
14453     /* "MACS2/IO/ScoreTrack.pyx":829
14454  *             v = self.data[chrom][ 3 ]
14455  *             l = self.datalength[chrom]
14456  *             v1 = 2             # <<<<<<<<<<<<<<
14457  *             v2 = 1
14458  *             for i in range(l):
14459  */
14460     __pyx_v_v1 = 2.0;
14461 
14462     /* "MACS2/IO/ScoreTrack.pyx":830
14463  *             l = self.datalength[chrom]
14464  *             v1 = 2
14465  *             v2 = 1             # <<<<<<<<<<<<<<
14466  *             for i in range(l):
14467  *                 v1 = p()
14468  */
14469     __pyx_v_v2 = 1.0;
14470 
14471     /* "MACS2/IO/ScoreTrack.pyx":831
14472  *             v1 = 2
14473  *             v2 = 1
14474  *             for i in range(l):             # <<<<<<<<<<<<<<
14475  *                 v1 = p()
14476  *                 v2 = c()
14477  */
14478     __pyx_t_9 = __pyx_v_l;
14479     __pyx_t_10 = __pyx_t_9;
14480     for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
14481       __pyx_v_i = __pyx_t_11;
14482 
14483       /* "MACS2/IO/ScoreTrack.pyx":832
14484  *             v2 = 1
14485  *             for i in range(l):
14486  *                 v1 = p()             # <<<<<<<<<<<<<<
14487  *                 v2 = c()
14488  *                 v[ i ] =  logLR_sym( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )
14489  */
14490       __Pyx_INCREF(__pyx_v_p);
14491       __pyx_t_6 = __pyx_v_p; __pyx_t_12 = NULL;
14492       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
14493         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
14494         if (likely(__pyx_t_12)) {
14495           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
14496           __Pyx_INCREF(__pyx_t_12);
14497           __Pyx_INCREF(function);
14498           __Pyx_DECREF_SET(__pyx_t_6, function);
14499         }
14500       }
14501       __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
14502       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
14503       if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
14504       __Pyx_GOTREF(__pyx_t_8);
14505       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14506       __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
14507       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14508       __pyx_v_v1 = __pyx_t_1;
14509 
14510       /* "MACS2/IO/ScoreTrack.pyx":833
14511  *             for i in range(l):
14512  *                 v1 = p()
14513  *                 v2 = c()             # <<<<<<<<<<<<<<
14514  *                 v[ i ] =  logLR_sym( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )
14515  *         self.scoring_method = ord('s')
14516  */
14517       __Pyx_INCREF(__pyx_v_c);
14518       __pyx_t_6 = __pyx_v_c; __pyx_t_12 = NULL;
14519       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
14520         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
14521         if (likely(__pyx_t_12)) {
14522           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
14523           __Pyx_INCREF(__pyx_t_12);
14524           __Pyx_INCREF(function);
14525           __Pyx_DECREF_SET(__pyx_t_6, function);
14526         }
14527       }
14528       __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
14529       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
14530       if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 833, __pyx_L1_error)
14531       __Pyx_GOTREF(__pyx_t_8);
14532       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14533       __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 833, __pyx_L1_error)
14534       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14535       __pyx_v_v2 = __pyx_t_1;
14536 
14537       /* "MACS2/IO/ScoreTrack.pyx":834
14538  *                 v1 = p()
14539  *                 v2 = c()
14540  *                 v[ i ] =  logLR_sym( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )             # <<<<<<<<<<<<<<
14541  *         self.scoring_method = ord('s')
14542  *         return
14543  */
14544       __pyx_t_8 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_10ScoreTrack_logLR_sym((__pyx_v_v1 + __pyx_v_pseudocount), (__pyx_v_v2 + __pyx_v_pseudocount))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 834, __pyx_L1_error)
14545       __Pyx_GOTREF(__pyx_t_8);
14546       if (unlikely(__Pyx_SetItemInt(__pyx_v_v, __pyx_v_i, __pyx_t_8, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1) < 0)) __PYX_ERR(0, 834, __pyx_L1_error)
14547       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14548     }
14549   }
14550   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14551 
14552   /* "MACS2/IO/ScoreTrack.pyx":835
14553  *                 v2 = c()
14554  *                 v[ i ] =  logLR_sym( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )
14555  *         self.scoring_method = ord('s')             # <<<<<<<<<<<<<<
14556  *         return
14557  *
14558  */
14559   __pyx_v_self->scoring_method = 0x73;
14560 
14561   /* "MACS2/IO/ScoreTrack.pyx":836
14562  *                 v[ i ] =  logLR_sym( v1 + pseudocount, v2 + pseudocount )  #logLR( d[ i, 1]/100.0, d[ i, 2]/100.0 )
14563  *         self.scoring_method = ord('s')
14564  *         return             # <<<<<<<<<<<<<<
14565  *
14566  *     cdef compute_logFE ( self ):
14567  */
14568   __Pyx_XDECREF(__pyx_r);
14569   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14570   goto __pyx_L0;
14571 
14572   /* "MACS2/IO/ScoreTrack.pyx":811
14573  *         return
14574  *
14575  *     cdef compute_sym_likelihood ( self ):             # <<<<<<<<<<<<<<
14576  *         """Calculate symmetric log10 likelihood.
14577  *
14578  */
14579 
14580   /* function exit code */
14581   __pyx_L1_error:;
14582   __Pyx_XDECREF(__pyx_t_2);
14583   __Pyx_XDECREF(__pyx_t_6);
14584   __Pyx_XDECREF(__pyx_t_8);
14585   __Pyx_XDECREF(__pyx_t_12);
14586   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.compute_sym_likelihood", __pyx_clineno, __pyx_lineno, __pyx_filename);
14587   __pyx_r = 0;
14588   __pyx_L0:;
14589   __Pyx_XDECREF(__pyx_v_chrom);
14590   __Pyx_XDECREF(__pyx_v_p);
14591   __Pyx_XDECREF(__pyx_v_c);
14592   __Pyx_XDECREF(__pyx_v_v);
14593   __Pyx_XGIVEREF(__pyx_r);
14594   __Pyx_TraceReturn(__pyx_r, 0);
14595   __Pyx_RefNannyFinishContext();
14596   return __pyx_r;
14597 }
14598 
14599 /* "MACS2/IO/ScoreTrack.pyx":838
14600  *         return
14601  *
14602  *     cdef compute_logFE ( self ):             # <<<<<<<<<<<<<<
14603  *         """Calculate log10 fold enrichment ( with 1 pseudocount ).
14604  *
14605  */
14606 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_logFE(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)14607 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_logFE(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
14608   PyArrayObject *__pyx_v_p = 0;
14609   PyArrayObject *__pyx_v_c = 0;
14610   PyArrayObject *__pyx_v_v = 0;
14611   __pyx_t_5numpy_int64_t __pyx_v_l;
14612   __pyx_t_5numpy_int64_t __pyx_v_i;
14613   __pyx_t_5numpy_float64_t __pyx_v_pseudocount;
14614   PyObject *__pyx_v_chrom = NULL;
14615   PyObject *__pyx_r = NULL;
14616   __Pyx_TraceDeclarations
14617   __Pyx_RefNannyDeclarations
14618   __pyx_t_5numpy_float64_t __pyx_t_1;
14619   PyObject *__pyx_t_2 = NULL;
14620   Py_ssize_t __pyx_t_3;
14621   Py_ssize_t __pyx_t_4;
14622   int __pyx_t_5;
14623   PyObject *__pyx_t_6 = NULL;
14624   int __pyx_t_7;
14625   PyObject *__pyx_t_8 = NULL;
14626   __pyx_t_5numpy_int64_t __pyx_t_9;
14627   __pyx_t_5numpy_int64_t __pyx_t_10;
14628   __pyx_t_5numpy_int64_t __pyx_t_11;
14629   PyObject *__pyx_t_12 = NULL;
14630   __pyx_t_5numpy_float64_t __pyx_t_13;
14631   __Pyx_RefNannySetupContext("compute_logFE", 0);
14632   __Pyx_TraceCall("compute_logFE", __pyx_f[0], 838, 0, __PYX_ERR(0, 838, __pyx_L1_error));
14633 
14634   /* "MACS2/IO/ScoreTrack.pyx":847
14635  *             float64_t pseudocount
14636  *
14637  *         pseudocount = self.pseudocount             # <<<<<<<<<<<<<<
14638  *
14639  *         for chrom in self.data.keys():
14640  */
14641   __pyx_t_1 = __pyx_v_self->pseudocount;
14642   __pyx_v_pseudocount = __pyx_t_1;
14643 
14644   /* "MACS2/IO/ScoreTrack.pyx":849
14645  *         pseudocount = self.pseudocount
14646  *
14647  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
14648  *             p = self.data[chrom][1]
14649  *             c = self.data[chrom][2]
14650  */
14651   __pyx_t_3 = 0;
14652   if (unlikely(__pyx_v_self->data == Py_None)) {
14653     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
14654     __PYX_ERR(0, 849, __pyx_L1_error)
14655   }
14656   __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 849, __pyx_L1_error)
14657   __Pyx_GOTREF(__pyx_t_6);
14658   __Pyx_XDECREF(__pyx_t_2);
14659   __pyx_t_2 = __pyx_t_6;
14660   __pyx_t_6 = 0;
14661   while (1) {
14662     __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, NULL, NULL, __pyx_t_5);
14663     if (unlikely(__pyx_t_7 == 0)) break;
14664     if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 849, __pyx_L1_error)
14665     __Pyx_GOTREF(__pyx_t_6);
14666     __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_6);
14667     __pyx_t_6 = 0;
14668 
14669     /* "MACS2/IO/ScoreTrack.pyx":850
14670  *
14671  *         for chrom in self.data.keys():
14672  *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
14673  *             c = self.data[chrom][2]
14674  *             v = self.data[chrom][3]
14675  */
14676     if (unlikely(__pyx_v_self->data == Py_None)) {
14677       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14678       __PYX_ERR(0, 850, __pyx_L1_error)
14679     }
14680     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 850, __pyx_L1_error)
14681     __Pyx_GOTREF(__pyx_t_6);
14682     __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 850, __pyx_L1_error)
14683     __Pyx_GOTREF(__pyx_t_8);
14684     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14685     if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 850, __pyx_L1_error)
14686     __Pyx_XDECREF_SET(__pyx_v_p, ((PyArrayObject *)__pyx_t_8));
14687     __pyx_t_8 = 0;
14688 
14689     /* "MACS2/IO/ScoreTrack.pyx":851
14690  *         for chrom in self.data.keys():
14691  *             p = self.data[chrom][1]
14692  *             c = self.data[chrom][2]             # <<<<<<<<<<<<<<
14693  *             v = self.data[chrom][3]
14694  *             l = self.datalength[chrom]
14695  */
14696     if (unlikely(__pyx_v_self->data == Py_None)) {
14697       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14698       __PYX_ERR(0, 851, __pyx_L1_error)
14699     }
14700     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 851, __pyx_L1_error)
14701     __Pyx_GOTREF(__pyx_t_8);
14702     __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 851, __pyx_L1_error)
14703     __Pyx_GOTREF(__pyx_t_6);
14704     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14705     if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 851, __pyx_L1_error)
14706     __Pyx_XDECREF_SET(__pyx_v_c, ((PyArrayObject *)__pyx_t_6));
14707     __pyx_t_6 = 0;
14708 
14709     /* "MACS2/IO/ScoreTrack.pyx":852
14710  *             p = self.data[chrom][1]
14711  *             c = self.data[chrom][2]
14712  *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
14713  *             l = self.datalength[chrom]
14714  *             for i in range(l):
14715  */
14716     if (unlikely(__pyx_v_self->data == Py_None)) {
14717       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14718       __PYX_ERR(0, 852, __pyx_L1_error)
14719     }
14720     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 852, __pyx_L1_error)
14721     __Pyx_GOTREF(__pyx_t_6);
14722     __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_6, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 852, __pyx_L1_error)
14723     __Pyx_GOTREF(__pyx_t_8);
14724     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14725     if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 852, __pyx_L1_error)
14726     __Pyx_XDECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_8));
14727     __pyx_t_8 = 0;
14728 
14729     /* "MACS2/IO/ScoreTrack.pyx":853
14730  *             c = self.data[chrom][2]
14731  *             v = self.data[chrom][3]
14732  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
14733  *             for i in range(l):
14734  *                 v[ i ] = get_logFE ( p[ i ] + pseudocount, c[ i ] + pseudocount)
14735  */
14736     if (unlikely(__pyx_v_self->datalength == Py_None)) {
14737       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14738       __PYX_ERR(0, 853, __pyx_L1_error)
14739     }
14740     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 853, __pyx_L1_error)
14741     __Pyx_GOTREF(__pyx_t_8);
14742     __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 853, __pyx_L1_error)
14743     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14744     __pyx_v_l = __pyx_t_9;
14745 
14746     /* "MACS2/IO/ScoreTrack.pyx":854
14747  *             v = self.data[chrom][3]
14748  *             l = self.datalength[chrom]
14749  *             for i in range(l):             # <<<<<<<<<<<<<<
14750  *                 v[ i ] = get_logFE ( p[ i ] + pseudocount, c[ i ] + pseudocount)
14751  *         self.scoring_method = ord('f')
14752  */
14753     __pyx_t_9 = __pyx_v_l;
14754     __pyx_t_10 = __pyx_t_9;
14755     for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
14756       __pyx_v_i = __pyx_t_11;
14757 
14758       /* "MACS2/IO/ScoreTrack.pyx":855
14759  *             l = self.datalength[chrom]
14760  *             for i in range(l):
14761  *                 v[ i ] = get_logFE ( p[ i ] + pseudocount, c[ i ] + pseudocount)             # <<<<<<<<<<<<<<
14762  *         self.scoring_method = ord('f')
14763  *         return
14764  */
14765       __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_v_p), __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 855, __pyx_L1_error)
14766       __Pyx_GOTREF(__pyx_t_8);
14767       __pyx_t_6 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 855, __pyx_L1_error)
14768       __Pyx_GOTREF(__pyx_t_6);
14769       __pyx_t_12 = PyNumber_Add(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 855, __pyx_L1_error)
14770       __Pyx_GOTREF(__pyx_t_12);
14771       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14772       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14773       __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error)
14774       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14775       __pyx_t_12 = __Pyx_GetItemInt(((PyObject *)__pyx_v_c), __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 855, __pyx_L1_error)
14776       __Pyx_GOTREF(__pyx_t_12);
14777       __pyx_t_6 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 855, __pyx_L1_error)
14778       __Pyx_GOTREF(__pyx_t_6);
14779       __pyx_t_8 = PyNumber_Add(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 855, __pyx_L1_error)
14780       __Pyx_GOTREF(__pyx_t_8);
14781       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14782       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14783       __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_13 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error)
14784       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14785       __pyx_t_8 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_10ScoreTrack_get_logFE(__pyx_t_1, __pyx_t_13)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 855, __pyx_L1_error)
14786       __Pyx_GOTREF(__pyx_t_8);
14787       if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_8, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1) < 0)) __PYX_ERR(0, 855, __pyx_L1_error)
14788       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14789     }
14790   }
14791   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14792 
14793   /* "MACS2/IO/ScoreTrack.pyx":856
14794  *             for i in range(l):
14795  *                 v[ i ] = get_logFE ( p[ i ] + pseudocount, c[ i ] + pseudocount)
14796  *         self.scoring_method = ord('f')             # <<<<<<<<<<<<<<
14797  *         return
14798  *
14799  */
14800   __pyx_v_self->scoring_method = 0x66;
14801 
14802   /* "MACS2/IO/ScoreTrack.pyx":857
14803  *                 v[ i ] = get_logFE ( p[ i ] + pseudocount, c[ i ] + pseudocount)
14804  *         self.scoring_method = ord('f')
14805  *         return             # <<<<<<<<<<<<<<
14806  *
14807  *     cdef compute_foldenrichment ( self ):
14808  */
14809   __Pyx_XDECREF(__pyx_r);
14810   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14811   goto __pyx_L0;
14812 
14813   /* "MACS2/IO/ScoreTrack.pyx":838
14814  *         return
14815  *
14816  *     cdef compute_logFE ( self ):             # <<<<<<<<<<<<<<
14817  *         """Calculate log10 fold enrichment ( with 1 pseudocount ).
14818  *
14819  */
14820 
14821   /* function exit code */
14822   __pyx_L1_error:;
14823   __Pyx_XDECREF(__pyx_t_2);
14824   __Pyx_XDECREF(__pyx_t_6);
14825   __Pyx_XDECREF(__pyx_t_8);
14826   __Pyx_XDECREF(__pyx_t_12);
14827   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.compute_logFE", __pyx_clineno, __pyx_lineno, __pyx_filename);
14828   __pyx_r = 0;
14829   __pyx_L0:;
14830   __Pyx_XDECREF((PyObject *)__pyx_v_p);
14831   __Pyx_XDECREF((PyObject *)__pyx_v_c);
14832   __Pyx_XDECREF((PyObject *)__pyx_v_v);
14833   __Pyx_XDECREF(__pyx_v_chrom);
14834   __Pyx_XGIVEREF(__pyx_r);
14835   __Pyx_TraceReturn(__pyx_r, 0);
14836   __Pyx_RefNannyFinishContext();
14837   return __pyx_r;
14838 }
14839 
14840 /* "MACS2/IO/ScoreTrack.pyx":859
14841  *         return
14842  *
14843  *     cdef compute_foldenrichment ( self ):             # <<<<<<<<<<<<<<
14844  *         """Calculate linear scale fold enrichment ( with 1 pseudocount ).
14845  *
14846  */
14847 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_foldenrichment(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)14848 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_foldenrichment(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
14849   PyArrayObject *__pyx_v_p = 0;
14850   PyArrayObject *__pyx_v_c = 0;
14851   PyArrayObject *__pyx_v_v = 0;
14852   __pyx_t_5numpy_int64_t __pyx_v_l;
14853   __pyx_t_5numpy_int64_t __pyx_v_i;
14854   __pyx_t_5numpy_float64_t __pyx_v_pseudocount;
14855   PyObject *__pyx_v_chrom = NULL;
14856   PyObject *__pyx_r = NULL;
14857   __Pyx_TraceDeclarations
14858   __Pyx_RefNannyDeclarations
14859   __pyx_t_5numpy_float64_t __pyx_t_1;
14860   PyObject *__pyx_t_2 = NULL;
14861   Py_ssize_t __pyx_t_3;
14862   Py_ssize_t __pyx_t_4;
14863   int __pyx_t_5;
14864   PyObject *__pyx_t_6 = NULL;
14865   int __pyx_t_7;
14866   PyObject *__pyx_t_8 = NULL;
14867   __pyx_t_5numpy_int64_t __pyx_t_9;
14868   __pyx_t_5numpy_int64_t __pyx_t_10;
14869   __pyx_t_5numpy_int64_t __pyx_t_11;
14870   PyObject *__pyx_t_12 = NULL;
14871   PyObject *__pyx_t_13 = NULL;
14872   __Pyx_RefNannySetupContext("compute_foldenrichment", 0);
14873   __Pyx_TraceCall("compute_foldenrichment", __pyx_f[0], 859, 0, __PYX_ERR(0, 859, __pyx_L1_error));
14874 
14875   /* "MACS2/IO/ScoreTrack.pyx":868
14876  *             float64_t pseudocount
14877  *
14878  *         pseudocount = self.pseudocount             # <<<<<<<<<<<<<<
14879  *
14880  *         for chrom in self.data.keys():
14881  */
14882   __pyx_t_1 = __pyx_v_self->pseudocount;
14883   __pyx_v_pseudocount = __pyx_t_1;
14884 
14885   /* "MACS2/IO/ScoreTrack.pyx":870
14886  *         pseudocount = self.pseudocount
14887  *
14888  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
14889  *             p = self.data[chrom][1]
14890  *             c = self.data[chrom][2]
14891  */
14892   __pyx_t_3 = 0;
14893   if (unlikely(__pyx_v_self->data == Py_None)) {
14894     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
14895     __PYX_ERR(0, 870, __pyx_L1_error)
14896   }
14897   __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 870, __pyx_L1_error)
14898   __Pyx_GOTREF(__pyx_t_6);
14899   __Pyx_XDECREF(__pyx_t_2);
14900   __pyx_t_2 = __pyx_t_6;
14901   __pyx_t_6 = 0;
14902   while (1) {
14903     __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, NULL, NULL, __pyx_t_5);
14904     if (unlikely(__pyx_t_7 == 0)) break;
14905     if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 870, __pyx_L1_error)
14906     __Pyx_GOTREF(__pyx_t_6);
14907     __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_6);
14908     __pyx_t_6 = 0;
14909 
14910     /* "MACS2/IO/ScoreTrack.pyx":871
14911  *
14912  *         for chrom in self.data.keys():
14913  *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
14914  *             c = self.data[chrom][2]
14915  *             v = self.data[chrom][3]
14916  */
14917     if (unlikely(__pyx_v_self->data == Py_None)) {
14918       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14919       __PYX_ERR(0, 871, __pyx_L1_error)
14920     }
14921     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 871, __pyx_L1_error)
14922     __Pyx_GOTREF(__pyx_t_6);
14923     __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 871, __pyx_L1_error)
14924     __Pyx_GOTREF(__pyx_t_8);
14925     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14926     if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 871, __pyx_L1_error)
14927     __Pyx_XDECREF_SET(__pyx_v_p, ((PyArrayObject *)__pyx_t_8));
14928     __pyx_t_8 = 0;
14929 
14930     /* "MACS2/IO/ScoreTrack.pyx":872
14931  *         for chrom in self.data.keys():
14932  *             p = self.data[chrom][1]
14933  *             c = self.data[chrom][2]             # <<<<<<<<<<<<<<
14934  *             v = self.data[chrom][3]
14935  *             l = self.datalength[chrom]
14936  */
14937     if (unlikely(__pyx_v_self->data == Py_None)) {
14938       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14939       __PYX_ERR(0, 872, __pyx_L1_error)
14940     }
14941     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 872, __pyx_L1_error)
14942     __Pyx_GOTREF(__pyx_t_8);
14943     __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 872, __pyx_L1_error)
14944     __Pyx_GOTREF(__pyx_t_6);
14945     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14946     if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 872, __pyx_L1_error)
14947     __Pyx_XDECREF_SET(__pyx_v_c, ((PyArrayObject *)__pyx_t_6));
14948     __pyx_t_6 = 0;
14949 
14950     /* "MACS2/IO/ScoreTrack.pyx":873
14951  *             p = self.data[chrom][1]
14952  *             c = self.data[chrom][2]
14953  *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
14954  *             l = self.datalength[chrom]
14955  *             for i in range(l):
14956  */
14957     if (unlikely(__pyx_v_self->data == Py_None)) {
14958       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14959       __PYX_ERR(0, 873, __pyx_L1_error)
14960     }
14961     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 873, __pyx_L1_error)
14962     __Pyx_GOTREF(__pyx_t_6);
14963     __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_6, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 873, __pyx_L1_error)
14964     __Pyx_GOTREF(__pyx_t_8);
14965     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14966     if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 873, __pyx_L1_error)
14967     __Pyx_XDECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_8));
14968     __pyx_t_8 = 0;
14969 
14970     /* "MACS2/IO/ScoreTrack.pyx":874
14971  *             c = self.data[chrom][2]
14972  *             v = self.data[chrom][3]
14973  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
14974  *             for i in range(l):
14975  *                 v[ i ] =  ( p[ i ] + pseudocount )/( c[ i ] + pseudocount )
14976  */
14977     if (unlikely(__pyx_v_self->datalength == Py_None)) {
14978       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14979       __PYX_ERR(0, 874, __pyx_L1_error)
14980     }
14981     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 874, __pyx_L1_error)
14982     __Pyx_GOTREF(__pyx_t_8);
14983     __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 874, __pyx_L1_error)
14984     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14985     __pyx_v_l = __pyx_t_9;
14986 
14987     /* "MACS2/IO/ScoreTrack.pyx":875
14988  *             v = self.data[chrom][3]
14989  *             l = self.datalength[chrom]
14990  *             for i in range(l):             # <<<<<<<<<<<<<<
14991  *                 v[ i ] =  ( p[ i ] + pseudocount )/( c[ i ] + pseudocount )
14992  *         self.scoring_method = ord('F')
14993  */
14994     __pyx_t_9 = __pyx_v_l;
14995     __pyx_t_10 = __pyx_t_9;
14996     for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
14997       __pyx_v_i = __pyx_t_11;
14998 
14999       /* "MACS2/IO/ScoreTrack.pyx":876
15000  *             l = self.datalength[chrom]
15001  *             for i in range(l):
15002  *                 v[ i ] =  ( p[ i ] + pseudocount )/( c[ i ] + pseudocount )             # <<<<<<<<<<<<<<
15003  *         self.scoring_method = ord('F')
15004  *         return
15005  */
15006       __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_v_p), __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 876, __pyx_L1_error)
15007       __Pyx_GOTREF(__pyx_t_8);
15008       __pyx_t_6 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 876, __pyx_L1_error)
15009       __Pyx_GOTREF(__pyx_t_6);
15010       __pyx_t_12 = PyNumber_Add(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 876, __pyx_L1_error)
15011       __Pyx_GOTREF(__pyx_t_12);
15012       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15013       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15014       __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_c), __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 876, __pyx_L1_error)
15015       __Pyx_GOTREF(__pyx_t_6);
15016       __pyx_t_8 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 876, __pyx_L1_error)
15017       __Pyx_GOTREF(__pyx_t_8);
15018       __pyx_t_13 = PyNumber_Add(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 876, __pyx_L1_error)
15019       __Pyx_GOTREF(__pyx_t_13);
15020       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15021       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15022       __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 876, __pyx_L1_error)
15023       __Pyx_GOTREF(__pyx_t_8);
15024       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15025       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
15026       if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_8, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1) < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
15027       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15028     }
15029   }
15030   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15031 
15032   /* "MACS2/IO/ScoreTrack.pyx":877
15033  *             for i in range(l):
15034  *                 v[ i ] =  ( p[ i ] + pseudocount )/( c[ i ] + pseudocount )
15035  *         self.scoring_method = ord('F')             # <<<<<<<<<<<<<<
15036  *         return
15037  *
15038  */
15039   __pyx_v_self->scoring_method = 70;
15040 
15041   /* "MACS2/IO/ScoreTrack.pyx":878
15042  *                 v[ i ] =  ( p[ i ] + pseudocount )/( c[ i ] + pseudocount )
15043  *         self.scoring_method = ord('F')
15044  *         return             # <<<<<<<<<<<<<<
15045  *
15046  *     cdef compute_subtraction ( self ):
15047  */
15048   __Pyx_XDECREF(__pyx_r);
15049   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15050   goto __pyx_L0;
15051 
15052   /* "MACS2/IO/ScoreTrack.pyx":859
15053  *         return
15054  *
15055  *     cdef compute_foldenrichment ( self ):             # <<<<<<<<<<<<<<
15056  *         """Calculate linear scale fold enrichment ( with 1 pseudocount ).
15057  *
15058  */
15059 
15060   /* function exit code */
15061   __pyx_L1_error:;
15062   __Pyx_XDECREF(__pyx_t_2);
15063   __Pyx_XDECREF(__pyx_t_6);
15064   __Pyx_XDECREF(__pyx_t_8);
15065   __Pyx_XDECREF(__pyx_t_12);
15066   __Pyx_XDECREF(__pyx_t_13);
15067   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.compute_foldenrichment", __pyx_clineno, __pyx_lineno, __pyx_filename);
15068   __pyx_r = 0;
15069   __pyx_L0:;
15070   __Pyx_XDECREF((PyObject *)__pyx_v_p);
15071   __Pyx_XDECREF((PyObject *)__pyx_v_c);
15072   __Pyx_XDECREF((PyObject *)__pyx_v_v);
15073   __Pyx_XDECREF(__pyx_v_chrom);
15074   __Pyx_XGIVEREF(__pyx_r);
15075   __Pyx_TraceReturn(__pyx_r, 0);
15076   __Pyx_RefNannyFinishContext();
15077   return __pyx_r;
15078 }
15079 
15080 /* "MACS2/IO/ScoreTrack.pyx":880
15081  *         return
15082  *
15083  *     cdef compute_subtraction ( self ):             # <<<<<<<<<<<<<<
15084  *         cdef:
15085  *             np.ndarray p, c, v
15086  */
15087 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_subtraction(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)15088 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_subtraction(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
15089   PyArrayObject *__pyx_v_p = 0;
15090   PyArrayObject *__pyx_v_c = 0;
15091   PyArrayObject *__pyx_v_v = 0;
15092   __pyx_t_5numpy_int64_t __pyx_v_l;
15093   __pyx_t_5numpy_int64_t __pyx_v_i;
15094   PyObject *__pyx_v_chrom = NULL;
15095   PyObject *__pyx_r = NULL;
15096   __Pyx_TraceDeclarations
15097   __Pyx_RefNannyDeclarations
15098   PyObject *__pyx_t_1 = NULL;
15099   Py_ssize_t __pyx_t_2;
15100   Py_ssize_t __pyx_t_3;
15101   int __pyx_t_4;
15102   PyObject *__pyx_t_5 = NULL;
15103   int __pyx_t_6;
15104   PyObject *__pyx_t_7 = NULL;
15105   __pyx_t_5numpy_int64_t __pyx_t_8;
15106   __pyx_t_5numpy_int64_t __pyx_t_9;
15107   __pyx_t_5numpy_int64_t __pyx_t_10;
15108   PyObject *__pyx_t_11 = NULL;
15109   __Pyx_RefNannySetupContext("compute_subtraction", 0);
15110   __Pyx_TraceCall("compute_subtraction", __pyx_f[0], 880, 0, __PYX_ERR(0, 880, __pyx_L1_error));
15111 
15112   /* "MACS2/IO/ScoreTrack.pyx":885
15113  *             int64_t l, i
15114  *
15115  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
15116  *             p = self.data[chrom][1]
15117  *             c = self.data[chrom][2]
15118  */
15119   __pyx_t_2 = 0;
15120   if (unlikely(__pyx_v_self->data == Py_None)) {
15121     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
15122     __PYX_ERR(0, 885, __pyx_L1_error)
15123   }
15124   __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 885, __pyx_L1_error)
15125   __Pyx_GOTREF(__pyx_t_5);
15126   __Pyx_XDECREF(__pyx_t_1);
15127   __pyx_t_1 = __pyx_t_5;
15128   __pyx_t_5 = 0;
15129   while (1) {
15130     __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, NULL, NULL, __pyx_t_4);
15131     if (unlikely(__pyx_t_6 == 0)) break;
15132     if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 885, __pyx_L1_error)
15133     __Pyx_GOTREF(__pyx_t_5);
15134     __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_5);
15135     __pyx_t_5 = 0;
15136 
15137     /* "MACS2/IO/ScoreTrack.pyx":886
15138  *
15139  *         for chrom in self.data.keys():
15140  *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
15141  *             c = self.data[chrom][2]
15142  *             v = self.data[chrom][3]
15143  */
15144     if (unlikely(__pyx_v_self->data == Py_None)) {
15145       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15146       __PYX_ERR(0, 886, __pyx_L1_error)
15147     }
15148     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 886, __pyx_L1_error)
15149     __Pyx_GOTREF(__pyx_t_5);
15150     __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 886, __pyx_L1_error)
15151     __Pyx_GOTREF(__pyx_t_7);
15152     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15153     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 886, __pyx_L1_error)
15154     __Pyx_XDECREF_SET(__pyx_v_p, ((PyArrayObject *)__pyx_t_7));
15155     __pyx_t_7 = 0;
15156 
15157     /* "MACS2/IO/ScoreTrack.pyx":887
15158  *         for chrom in self.data.keys():
15159  *             p = self.data[chrom][1]
15160  *             c = self.data[chrom][2]             # <<<<<<<<<<<<<<
15161  *             v = self.data[chrom][3]
15162  *             l = self.datalength[chrom]
15163  */
15164     if (unlikely(__pyx_v_self->data == Py_None)) {
15165       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15166       __PYX_ERR(0, 887, __pyx_L1_error)
15167     }
15168     __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 887, __pyx_L1_error)
15169     __Pyx_GOTREF(__pyx_t_7);
15170     __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 887, __pyx_L1_error)
15171     __Pyx_GOTREF(__pyx_t_5);
15172     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15173     if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 887, __pyx_L1_error)
15174     __Pyx_XDECREF_SET(__pyx_v_c, ((PyArrayObject *)__pyx_t_5));
15175     __pyx_t_5 = 0;
15176 
15177     /* "MACS2/IO/ScoreTrack.pyx":888
15178  *             p = self.data[chrom][1]
15179  *             c = self.data[chrom][2]
15180  *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
15181  *             l = self.datalength[chrom]
15182  *             for i in range(l):
15183  */
15184     if (unlikely(__pyx_v_self->data == Py_None)) {
15185       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15186       __PYX_ERR(0, 888, __pyx_L1_error)
15187     }
15188     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 888, __pyx_L1_error)
15189     __Pyx_GOTREF(__pyx_t_5);
15190     __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 888, __pyx_L1_error)
15191     __Pyx_GOTREF(__pyx_t_7);
15192     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15193     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 888, __pyx_L1_error)
15194     __Pyx_XDECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_7));
15195     __pyx_t_7 = 0;
15196 
15197     /* "MACS2/IO/ScoreTrack.pyx":889
15198  *             c = self.data[chrom][2]
15199  *             v = self.data[chrom][3]
15200  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
15201  *             for i in range(l):
15202  *                 v[ i ] = p[ i ] - c[ i ]
15203  */
15204     if (unlikely(__pyx_v_self->datalength == Py_None)) {
15205       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15206       __PYX_ERR(0, 889, __pyx_L1_error)
15207     }
15208     __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 889, __pyx_L1_error)
15209     __Pyx_GOTREF(__pyx_t_7);
15210     __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
15211     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15212     __pyx_v_l = __pyx_t_8;
15213 
15214     /* "MACS2/IO/ScoreTrack.pyx":890
15215  *             v = self.data[chrom][3]
15216  *             l = self.datalength[chrom]
15217  *             for i in range(l):             # <<<<<<<<<<<<<<
15218  *                 v[ i ] = p[ i ] - c[ i ]
15219  *         self.scoring_method = ord('d')
15220  */
15221     __pyx_t_8 = __pyx_v_l;
15222     __pyx_t_9 = __pyx_t_8;
15223     for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
15224       __pyx_v_i = __pyx_t_10;
15225 
15226       /* "MACS2/IO/ScoreTrack.pyx":891
15227  *             l = self.datalength[chrom]
15228  *             for i in range(l):
15229  *                 v[ i ] = p[ i ] - c[ i ]             # <<<<<<<<<<<<<<
15230  *         self.scoring_method = ord('d')
15231  *         return
15232  */
15233       __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_p), __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 891, __pyx_L1_error)
15234       __Pyx_GOTREF(__pyx_t_7);
15235       __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_c), __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 891, __pyx_L1_error)
15236       __Pyx_GOTREF(__pyx_t_5);
15237       __pyx_t_11 = PyNumber_Subtract(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 891, __pyx_L1_error)
15238       __Pyx_GOTREF(__pyx_t_11);
15239       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15240       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15241       if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_11, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1) < 0)) __PYX_ERR(0, 891, __pyx_L1_error)
15242       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15243     }
15244   }
15245   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15246 
15247   /* "MACS2/IO/ScoreTrack.pyx":892
15248  *             for i in range(l):
15249  *                 v[ i ] = p[ i ] - c[ i ]
15250  *         self.scoring_method = ord('d')             # <<<<<<<<<<<<<<
15251  *         return
15252  *
15253  */
15254   __pyx_v_self->scoring_method = 0x64;
15255 
15256   /* "MACS2/IO/ScoreTrack.pyx":893
15257  *                 v[ i ] = p[ i ] - c[ i ]
15258  *         self.scoring_method = ord('d')
15259  *         return             # <<<<<<<<<<<<<<
15260  *
15261  *     cdef compute_SPMR ( self ):
15262  */
15263   __Pyx_XDECREF(__pyx_r);
15264   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15265   goto __pyx_L0;
15266 
15267   /* "MACS2/IO/ScoreTrack.pyx":880
15268  *         return
15269  *
15270  *     cdef compute_subtraction ( self ):             # <<<<<<<<<<<<<<
15271  *         cdef:
15272  *             np.ndarray p, c, v
15273  */
15274 
15275   /* function exit code */
15276   __pyx_L1_error:;
15277   __Pyx_XDECREF(__pyx_t_1);
15278   __Pyx_XDECREF(__pyx_t_5);
15279   __Pyx_XDECREF(__pyx_t_7);
15280   __Pyx_XDECREF(__pyx_t_11);
15281   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.compute_subtraction", __pyx_clineno, __pyx_lineno, __pyx_filename);
15282   __pyx_r = 0;
15283   __pyx_L0:;
15284   __Pyx_XDECREF((PyObject *)__pyx_v_p);
15285   __Pyx_XDECREF((PyObject *)__pyx_v_c);
15286   __Pyx_XDECREF((PyObject *)__pyx_v_v);
15287   __Pyx_XDECREF(__pyx_v_chrom);
15288   __Pyx_XGIVEREF(__pyx_r);
15289   __Pyx_TraceReturn(__pyx_r, 0);
15290   __Pyx_RefNannyFinishContext();
15291   return __pyx_r;
15292 }
15293 
15294 /* "MACS2/IO/ScoreTrack.pyx":895
15295  *         return
15296  *
15297  *     cdef compute_SPMR ( self ):             # <<<<<<<<<<<<<<
15298  *         cdef:
15299  *             np.ndarray p, v
15300  */
15301 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_SPMR(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)15302 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_SPMR(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
15303   PyArrayObject *__pyx_v_p = 0;
15304   PyArrayObject *__pyx_v_v = 0;
15305   __pyx_t_5numpy_int64_t __pyx_v_l;
15306   __pyx_t_5numpy_int64_t __pyx_v_i;
15307   __pyx_t_5numpy_float64_t __pyx_v_scale;
15308   PyObject *__pyx_v_chrom = NULL;
15309   PyObject *__pyx_r = NULL;
15310   __Pyx_TraceDeclarations
15311   __Pyx_RefNannyDeclarations
15312   __pyx_t_5numpy_float64_t __pyx_t_1;
15313   PyObject *__pyx_t_2 = NULL;
15314   Py_ssize_t __pyx_t_3;
15315   Py_ssize_t __pyx_t_4;
15316   int __pyx_t_5;
15317   PyObject *__pyx_t_6 = NULL;
15318   int __pyx_t_7;
15319   PyObject *__pyx_t_8 = NULL;
15320   __pyx_t_5numpy_int64_t __pyx_t_9;
15321   __pyx_t_5numpy_int64_t __pyx_t_10;
15322   __pyx_t_5numpy_int64_t __pyx_t_11;
15323   PyObject *__pyx_t_12 = NULL;
15324   __Pyx_RefNannySetupContext("compute_SPMR", 0);
15325   __Pyx_TraceCall("compute_SPMR", __pyx_f[0], 895, 0, __PYX_ERR(0, 895, __pyx_L1_error));
15326 
15327   /* "MACS2/IO/ScoreTrack.pyx":900
15328  *             int64_t l, i
15329  *             float64_t scale
15330  *         if self.normalization_method == ord('T') or self.normalization_method == ord('N'):             # <<<<<<<<<<<<<<
15331  *             scale = self.treat_edm
15332  *         elif self.normalization_method == ord('C'):
15333  */
15334   switch (__pyx_v_self->normalization_method) {
15335     case 84:
15336     case 78:
15337 
15338     /* "MACS2/IO/ScoreTrack.pyx":901
15339  *             float64_t scale
15340  *         if self.normalization_method == ord('T') or self.normalization_method == ord('N'):
15341  *             scale = self.treat_edm             # <<<<<<<<<<<<<<
15342  *         elif self.normalization_method == ord('C'):
15343  *             scale = self.ctrl_edm
15344  */
15345     __pyx_t_1 = __pyx_v_self->treat_edm;
15346     __pyx_v_scale = __pyx_t_1;
15347 
15348     /* "MACS2/IO/ScoreTrack.pyx":900
15349  *             int64_t l, i
15350  *             float64_t scale
15351  *         if self.normalization_method == ord('T') or self.normalization_method == ord('N'):             # <<<<<<<<<<<<<<
15352  *             scale = self.treat_edm
15353  *         elif self.normalization_method == ord('C'):
15354  */
15355     break;
15356     case 67:
15357 
15358     /* "MACS2/IO/ScoreTrack.pyx":903
15359  *             scale = self.treat_edm
15360  *         elif self.normalization_method == ord('C'):
15361  *             scale = self.ctrl_edm             # <<<<<<<<<<<<<<
15362  *         elif self.normalization_method == ord('M'):
15363  *             scale = 1
15364  */
15365     __pyx_t_1 = __pyx_v_self->ctrl_edm;
15366     __pyx_v_scale = __pyx_t_1;
15367 
15368     /* "MACS2/IO/ScoreTrack.pyx":902
15369  *         if self.normalization_method == ord('T') or self.normalization_method == ord('N'):
15370  *             scale = self.treat_edm
15371  *         elif self.normalization_method == ord('C'):             # <<<<<<<<<<<<<<
15372  *             scale = self.ctrl_edm
15373  *         elif self.normalization_method == ord('M'):
15374  */
15375     break;
15376     case 77:
15377 
15378     /* "MACS2/IO/ScoreTrack.pyx":905
15379  *             scale = self.ctrl_edm
15380  *         elif self.normalization_method == ord('M'):
15381  *             scale = 1             # <<<<<<<<<<<<<<
15382  *
15383  *         for chrom in self.data.keys():
15384  */
15385     __pyx_v_scale = 1.0;
15386 
15387     /* "MACS2/IO/ScoreTrack.pyx":904
15388  *         elif self.normalization_method == ord('C'):
15389  *             scale = self.ctrl_edm
15390  *         elif self.normalization_method == ord('M'):             # <<<<<<<<<<<<<<
15391  *             scale = 1
15392  *
15393  */
15394     break;
15395     default: break;
15396   }
15397 
15398   /* "MACS2/IO/ScoreTrack.pyx":907
15399  *             scale = 1
15400  *
15401  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
15402  *             p = self.data[chrom][1]
15403  *             v = self.data[chrom][3]
15404  */
15405   __pyx_t_3 = 0;
15406   if (unlikely(__pyx_v_self->data == Py_None)) {
15407     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
15408     __PYX_ERR(0, 907, __pyx_L1_error)
15409   }
15410   __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 907, __pyx_L1_error)
15411   __Pyx_GOTREF(__pyx_t_6);
15412   __Pyx_XDECREF(__pyx_t_2);
15413   __pyx_t_2 = __pyx_t_6;
15414   __pyx_t_6 = 0;
15415   while (1) {
15416     __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, NULL, NULL, __pyx_t_5);
15417     if (unlikely(__pyx_t_7 == 0)) break;
15418     if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 907, __pyx_L1_error)
15419     __Pyx_GOTREF(__pyx_t_6);
15420     __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_6);
15421     __pyx_t_6 = 0;
15422 
15423     /* "MACS2/IO/ScoreTrack.pyx":908
15424  *
15425  *         for chrom in self.data.keys():
15426  *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
15427  *             v = self.data[chrom][3]
15428  *             l = self.datalength[chrom]
15429  */
15430     if (unlikely(__pyx_v_self->data == Py_None)) {
15431       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15432       __PYX_ERR(0, 908, __pyx_L1_error)
15433     }
15434     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 908, __pyx_L1_error)
15435     __Pyx_GOTREF(__pyx_t_6);
15436     __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error)
15437     __Pyx_GOTREF(__pyx_t_8);
15438     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15439     if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 908, __pyx_L1_error)
15440     __Pyx_XDECREF_SET(__pyx_v_p, ((PyArrayObject *)__pyx_t_8));
15441     __pyx_t_8 = 0;
15442 
15443     /* "MACS2/IO/ScoreTrack.pyx":909
15444  *         for chrom in self.data.keys():
15445  *             p = self.data[chrom][1]
15446  *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
15447  *             l = self.datalength[chrom]
15448  *             for i in range(l):
15449  */
15450     if (unlikely(__pyx_v_self->data == Py_None)) {
15451       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15452       __PYX_ERR(0, 909, __pyx_L1_error)
15453     }
15454     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 909, __pyx_L1_error)
15455     __Pyx_GOTREF(__pyx_t_8);
15456     __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_8, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 909, __pyx_L1_error)
15457     __Pyx_GOTREF(__pyx_t_6);
15458     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15459     if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 909, __pyx_L1_error)
15460     __Pyx_XDECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_6));
15461     __pyx_t_6 = 0;
15462 
15463     /* "MACS2/IO/ScoreTrack.pyx":910
15464  *             p = self.data[chrom][1]
15465  *             v = self.data[chrom][3]
15466  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
15467  *             for i in range(l):
15468  *                 v[ i ] =  p[ i ] / scale # two digit precision may not be enough...
15469  */
15470     if (unlikely(__pyx_v_self->datalength == Py_None)) {
15471       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15472       __PYX_ERR(0, 910, __pyx_L1_error)
15473     }
15474     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L1_error)
15475     __Pyx_GOTREF(__pyx_t_6);
15476     __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 910, __pyx_L1_error)
15477     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15478     __pyx_v_l = __pyx_t_9;
15479 
15480     /* "MACS2/IO/ScoreTrack.pyx":911
15481  *             v = self.data[chrom][3]
15482  *             l = self.datalength[chrom]
15483  *             for i in range(l):             # <<<<<<<<<<<<<<
15484  *                 v[ i ] =  p[ i ] / scale # two digit precision may not be enough...
15485  *         self.scoring_method = ord('m')
15486  */
15487     __pyx_t_9 = __pyx_v_l;
15488     __pyx_t_10 = __pyx_t_9;
15489     for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
15490       __pyx_v_i = __pyx_t_11;
15491 
15492       /* "MACS2/IO/ScoreTrack.pyx":912
15493  *             l = self.datalength[chrom]
15494  *             for i in range(l):
15495  *                 v[ i ] =  p[ i ] / scale # two digit precision may not be enough...             # <<<<<<<<<<<<<<
15496  *         self.scoring_method = ord('m')
15497  *         return
15498  */
15499       __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_p), __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 912, __pyx_L1_error)
15500       __Pyx_GOTREF(__pyx_t_6);
15501       __pyx_t_8 = PyFloat_FromDouble(__pyx_v_scale); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 912, __pyx_L1_error)
15502       __Pyx_GOTREF(__pyx_t_8);
15503       __pyx_t_12 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 912, __pyx_L1_error)
15504       __Pyx_GOTREF(__pyx_t_12);
15505       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15506       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15507       if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_12, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1) < 0)) __PYX_ERR(0, 912, __pyx_L1_error)
15508       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15509     }
15510   }
15511   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15512 
15513   /* "MACS2/IO/ScoreTrack.pyx":913
15514  *             for i in range(l):
15515  *                 v[ i ] =  p[ i ] / scale # two digit precision may not be enough...
15516  *         self.scoring_method = ord('m')             # <<<<<<<<<<<<<<
15517  *         return
15518  *
15519  */
15520   __pyx_v_self->scoring_method = 0x6D;
15521 
15522   /* "MACS2/IO/ScoreTrack.pyx":914
15523  *                 v[ i ] =  p[ i ] / scale # two digit precision may not be enough...
15524  *         self.scoring_method = ord('m')
15525  *         return             # <<<<<<<<<<<<<<
15526  *
15527  *     cdef compute_max ( self ):
15528  */
15529   __Pyx_XDECREF(__pyx_r);
15530   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15531   goto __pyx_L0;
15532 
15533   /* "MACS2/IO/ScoreTrack.pyx":895
15534  *         return
15535  *
15536  *     cdef compute_SPMR ( self ):             # <<<<<<<<<<<<<<
15537  *         cdef:
15538  *             np.ndarray p, v
15539  */
15540 
15541   /* function exit code */
15542   __pyx_L1_error:;
15543   __Pyx_XDECREF(__pyx_t_2);
15544   __Pyx_XDECREF(__pyx_t_6);
15545   __Pyx_XDECREF(__pyx_t_8);
15546   __Pyx_XDECREF(__pyx_t_12);
15547   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.compute_SPMR", __pyx_clineno, __pyx_lineno, __pyx_filename);
15548   __pyx_r = 0;
15549   __pyx_L0:;
15550   __Pyx_XDECREF((PyObject *)__pyx_v_p);
15551   __Pyx_XDECREF((PyObject *)__pyx_v_v);
15552   __Pyx_XDECREF(__pyx_v_chrom);
15553   __Pyx_XGIVEREF(__pyx_r);
15554   __Pyx_TraceReturn(__pyx_r, 0);
15555   __Pyx_RefNannyFinishContext();
15556   return __pyx_r;
15557 }
15558 
15559 /* "MACS2/IO/ScoreTrack.pyx":916
15560  *         return
15561  *
15562  *     cdef compute_max ( self ):             # <<<<<<<<<<<<<<
15563  *         cdef:
15564  *             np.ndarray p, c, v
15565  */
15566 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_max(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)15567 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_max(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
15568   PyArrayObject *__pyx_v_p = 0;
15569   PyArrayObject *__pyx_v_c = 0;
15570   PyArrayObject *__pyx_v_v = 0;
15571   __pyx_t_5numpy_int64_t __pyx_v_l;
15572   __pyx_t_5numpy_int64_t __pyx_v_i;
15573   PyObject *__pyx_v_chrom = NULL;
15574   PyObject *__pyx_r = NULL;
15575   __Pyx_TraceDeclarations
15576   __Pyx_RefNannyDeclarations
15577   PyObject *__pyx_t_1 = NULL;
15578   Py_ssize_t __pyx_t_2;
15579   Py_ssize_t __pyx_t_3;
15580   int __pyx_t_4;
15581   PyObject *__pyx_t_5 = NULL;
15582   int __pyx_t_6;
15583   PyObject *__pyx_t_7 = NULL;
15584   __pyx_t_5numpy_int64_t __pyx_t_8;
15585   __pyx_t_5numpy_int64_t __pyx_t_9;
15586   __pyx_t_5numpy_int64_t __pyx_t_10;
15587   PyObject *__pyx_t_11 = NULL;
15588   PyObject *__pyx_t_12 = NULL;
15589   int __pyx_t_13;
15590   __Pyx_RefNannySetupContext("compute_max", 0);
15591   __Pyx_TraceCall("compute_max", __pyx_f[0], 916, 0, __PYX_ERR(0, 916, __pyx_L1_error));
15592 
15593   /* "MACS2/IO/ScoreTrack.pyx":921
15594  *             int64_t l, i
15595  *
15596  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
15597  *             p = self.data[chrom][1]
15598  *             c = self.data[chrom][2]
15599  */
15600   __pyx_t_2 = 0;
15601   if (unlikely(__pyx_v_self->data == Py_None)) {
15602     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
15603     __PYX_ERR(0, 921, __pyx_L1_error)
15604   }
15605   __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 921, __pyx_L1_error)
15606   __Pyx_GOTREF(__pyx_t_5);
15607   __Pyx_XDECREF(__pyx_t_1);
15608   __pyx_t_1 = __pyx_t_5;
15609   __pyx_t_5 = 0;
15610   while (1) {
15611     __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, NULL, NULL, __pyx_t_4);
15612     if (unlikely(__pyx_t_6 == 0)) break;
15613     if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 921, __pyx_L1_error)
15614     __Pyx_GOTREF(__pyx_t_5);
15615     __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_5);
15616     __pyx_t_5 = 0;
15617 
15618     /* "MACS2/IO/ScoreTrack.pyx":922
15619  *
15620  *         for chrom in self.data.keys():
15621  *             p = self.data[chrom][1]             # <<<<<<<<<<<<<<
15622  *             c = self.data[chrom][2]
15623  *             v = self.data[chrom][3]
15624  */
15625     if (unlikely(__pyx_v_self->data == Py_None)) {
15626       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15627       __PYX_ERR(0, 922, __pyx_L1_error)
15628     }
15629     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 922, __pyx_L1_error)
15630     __Pyx_GOTREF(__pyx_t_5);
15631     __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 922, __pyx_L1_error)
15632     __Pyx_GOTREF(__pyx_t_7);
15633     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15634     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 922, __pyx_L1_error)
15635     __Pyx_XDECREF_SET(__pyx_v_p, ((PyArrayObject *)__pyx_t_7));
15636     __pyx_t_7 = 0;
15637 
15638     /* "MACS2/IO/ScoreTrack.pyx":923
15639  *         for chrom in self.data.keys():
15640  *             p = self.data[chrom][1]
15641  *             c = self.data[chrom][2]             # <<<<<<<<<<<<<<
15642  *             v = self.data[chrom][3]
15643  *             l = self.datalength[chrom]
15644  */
15645     if (unlikely(__pyx_v_self->data == Py_None)) {
15646       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15647       __PYX_ERR(0, 923, __pyx_L1_error)
15648     }
15649     __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 923, __pyx_L1_error)
15650     __Pyx_GOTREF(__pyx_t_7);
15651     __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
15652     __Pyx_GOTREF(__pyx_t_5);
15653     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15654     if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 923, __pyx_L1_error)
15655     __Pyx_XDECREF_SET(__pyx_v_c, ((PyArrayObject *)__pyx_t_5));
15656     __pyx_t_5 = 0;
15657 
15658     /* "MACS2/IO/ScoreTrack.pyx":924
15659  *             p = self.data[chrom][1]
15660  *             c = self.data[chrom][2]
15661  *             v = self.data[chrom][3]             # <<<<<<<<<<<<<<
15662  *             l = self.datalength[chrom]
15663  *             for i in range(l):
15664  */
15665     if (unlikely(__pyx_v_self->data == Py_None)) {
15666       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15667       __PYX_ERR(0, 924, __pyx_L1_error)
15668     }
15669     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 924, __pyx_L1_error)
15670     __Pyx_GOTREF(__pyx_t_5);
15671     __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 924, __pyx_L1_error)
15672     __Pyx_GOTREF(__pyx_t_7);
15673     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15674     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 924, __pyx_L1_error)
15675     __Pyx_XDECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_7));
15676     __pyx_t_7 = 0;
15677 
15678     /* "MACS2/IO/ScoreTrack.pyx":925
15679  *             c = self.data[chrom][2]
15680  *             v = self.data[chrom][3]
15681  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
15682  *             for i in range(l):
15683  *                 v[ i ] = max(p[ i ],c[ i ])
15684  */
15685     if (unlikely(__pyx_v_self->datalength == Py_None)) {
15686       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15687       __PYX_ERR(0, 925, __pyx_L1_error)
15688     }
15689     __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 925, __pyx_L1_error)
15690     __Pyx_GOTREF(__pyx_t_7);
15691     __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_7); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 925, __pyx_L1_error)
15692     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15693     __pyx_v_l = __pyx_t_8;
15694 
15695     /* "MACS2/IO/ScoreTrack.pyx":926
15696  *             v = self.data[chrom][3]
15697  *             l = self.datalength[chrom]
15698  *             for i in range(l):             # <<<<<<<<<<<<<<
15699  *                 v[ i ] = max(p[ i ],c[ i ])
15700  *         self.scoring_method = ord('M')
15701  */
15702     __pyx_t_8 = __pyx_v_l;
15703     __pyx_t_9 = __pyx_t_8;
15704     for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
15705       __pyx_v_i = __pyx_t_10;
15706 
15707       /* "MACS2/IO/ScoreTrack.pyx":927
15708  *             l = self.datalength[chrom]
15709  *             for i in range(l):
15710  *                 v[ i ] = max(p[ i ],c[ i ])             # <<<<<<<<<<<<<<
15711  *         self.scoring_method = ord('M')
15712  *         return
15713  */
15714       __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_c), __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 927, __pyx_L1_error)
15715       __Pyx_GOTREF(__pyx_t_7);
15716       __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_p), __pyx_v_i, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 927, __pyx_L1_error)
15717       __Pyx_GOTREF(__pyx_t_5);
15718       __pyx_t_12 = PyObject_RichCompare(__pyx_t_7, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 927, __pyx_L1_error)
15719       __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 927, __pyx_L1_error)
15720       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15721       if (__pyx_t_13) {
15722         __Pyx_INCREF(__pyx_t_7);
15723         __pyx_t_11 = __pyx_t_7;
15724       } else {
15725         __Pyx_INCREF(__pyx_t_5);
15726         __pyx_t_11 = __pyx_t_5;
15727       }
15728       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15729       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15730       __pyx_t_7 = __pyx_t_11;
15731       __Pyx_INCREF(__pyx_t_7);
15732       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15733       if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_7, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 1, 1) < 0)) __PYX_ERR(0, 927, __pyx_L1_error)
15734       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15735     }
15736   }
15737   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15738 
15739   /* "MACS2/IO/ScoreTrack.pyx":928
15740  *             for i in range(l):
15741  *                 v[ i ] = max(p[ i ],c[ i ])
15742  *         self.scoring_method = ord('M')             # <<<<<<<<<<<<<<
15743  *         return
15744  *
15745  */
15746   __pyx_v_self->scoring_method = 77;
15747 
15748   /* "MACS2/IO/ScoreTrack.pyx":929
15749  *                 v[ i ] = max(p[ i ],c[ i ])
15750  *         self.scoring_method = ord('M')
15751  *         return             # <<<<<<<<<<<<<<
15752  *
15753  *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):
15754  */
15755   __Pyx_XDECREF(__pyx_r);
15756   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15757   goto __pyx_L0;
15758 
15759   /* "MACS2/IO/ScoreTrack.pyx":916
15760  *         return
15761  *
15762  *     cdef compute_max ( self ):             # <<<<<<<<<<<<<<
15763  *         cdef:
15764  *             np.ndarray p, c, v
15765  */
15766 
15767   /* function exit code */
15768   __pyx_L1_error:;
15769   __Pyx_XDECREF(__pyx_t_1);
15770   __Pyx_XDECREF(__pyx_t_5);
15771   __Pyx_XDECREF(__pyx_t_7);
15772   __Pyx_XDECREF(__pyx_t_11);
15773   __Pyx_XDECREF(__pyx_t_12);
15774   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.compute_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
15775   __pyx_r = 0;
15776   __pyx_L0:;
15777   __Pyx_XDECREF((PyObject *)__pyx_v_p);
15778   __Pyx_XDECREF((PyObject *)__pyx_v_c);
15779   __Pyx_XDECREF((PyObject *)__pyx_v_v);
15780   __Pyx_XDECREF(__pyx_v_chrom);
15781   __Pyx_XGIVEREF(__pyx_r);
15782   __Pyx_TraceReturn(__pyx_r, 0);
15783   __Pyx_RefNannyFinishContext();
15784   return __pyx_r;
15785 }
15786 
15787 /* "MACS2/IO/ScoreTrack.pyx":931
15788  *         return
15789  *
15790  *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
15791  *         """Write all data to fhd in bedGraph Format.
15792  *
15793  */
15794 
15795 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_23write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v_fhd,PyObject * __pyx_v_name,PyObject * __pyx_v_description,int __pyx_skip_dispatch,struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph * __pyx_optional_args)15796 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph *__pyx_optional_args) {
15797   short __pyx_v_column = ((short)3);
15798   PyObject *__pyx_v_chrom = 0;
15799   __pyx_t_5numpy_int32_t __pyx_v_l;
15800   __pyx_t_5numpy_int32_t __pyx_v_pre;
15801   __pyx_t_5numpy_int32_t __pyx_v_i;
15802   __pyx_t_5numpy_int32_t __pyx_v_p;
15803   __pyx_t_5numpy_float64_t __pyx_v_pre_v;
15804   __pyx_t_5numpy_float64_t __pyx_v_v;
15805   PyObject *__pyx_v_chrs = 0;
15806   PyArrayObject *__pyx_v_pos = 0;
15807   PyArrayObject *__pyx_v_value = 0;
15808   PyObject *__pyx_v_write = NULL;
15809   PyObject *__pyx_r = NULL;
15810   __Pyx_TraceDeclarations
15811   __Pyx_RefNannyDeclarations
15812   PyObject *__pyx_t_1 = NULL;
15813   PyObject *__pyx_t_2 = NULL;
15814   PyObject *__pyx_t_3 = NULL;
15815   PyObject *__pyx_t_4 = NULL;
15816   PyObject *__pyx_t_5 = NULL;
15817   int __pyx_t_6;
15818   PyObject *__pyx_t_7 = NULL;
15819   int __pyx_t_8;
15820   Py_ssize_t __pyx_t_9;
15821   Py_UCS4 __pyx_t_10;
15822   Py_ssize_t __pyx_t_11;
15823   int __pyx_t_12;
15824   __pyx_t_5numpy_int32_t __pyx_t_13;
15825   __pyx_t_5numpy_float64_t __pyx_t_14;
15826   __pyx_t_5numpy_int32_t __pyx_t_15;
15827   __pyx_t_5numpy_int32_t __pyx_t_16;
15828   long __pyx_t_17;
15829   __pyx_t_5numpy_int32_t __pyx_t_18;
15830   Py_ssize_t __pyx_t_19;
15831   __Pyx_RefNannySetupContext("write_bedGraph", 0);
15832   __Pyx_TraceCall("write_bedGraph", __pyx_f[0], 931, 0, __PYX_ERR(0, 931, __pyx_L1_error));
15833   if (__pyx_optional_args) {
15834     if (__pyx_optional_args->__pyx_n > 0) {
15835       __pyx_v_column = __pyx_optional_args->column;
15836     }
15837   }
15838   /* Check if called by wrapper */
15839   if (unlikely(__pyx_skip_dispatch)) ;
15840   /* Check if overridden in Python */
15841   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
15842     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15843     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
15844     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
15845       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
15846       #endif
15847       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_bedGraph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error)
15848       __Pyx_GOTREF(__pyx_t_1);
15849       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_23write_bedGraph)) {
15850         __Pyx_XDECREF(__pyx_r);
15851         __pyx_t_3 = __Pyx_PyInt_From_short(__pyx_v_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error)
15852         __Pyx_GOTREF(__pyx_t_3);
15853         __Pyx_INCREF(__pyx_t_1);
15854         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
15855         __pyx_t_6 = 0;
15856         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
15857           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
15858           if (likely(__pyx_t_5)) {
15859             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
15860             __Pyx_INCREF(__pyx_t_5);
15861             __Pyx_INCREF(function);
15862             __Pyx_DECREF_SET(__pyx_t_4, function);
15863             __pyx_t_6 = 1;
15864           }
15865         }
15866         #if CYTHON_FAST_PYCALL
15867         if (PyFunction_Check(__pyx_t_4)) {
15868           PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_t_3};
15869           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error)
15870           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15871           __Pyx_GOTREF(__pyx_t_2);
15872           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15873         } else
15874         #endif
15875         #if CYTHON_FAST_PYCCALL
15876         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
15877           PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_t_3};
15878           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error)
15879           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15880           __Pyx_GOTREF(__pyx_t_2);
15881           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15882         } else
15883         #endif
15884         {
15885           __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 931, __pyx_L1_error)
15886           __Pyx_GOTREF(__pyx_t_7);
15887           if (__pyx_t_5) {
15888             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
15889           }
15890           __Pyx_INCREF(__pyx_v_fhd);
15891           __Pyx_GIVEREF(__pyx_v_fhd);
15892           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_fhd);
15893           __Pyx_INCREF(__pyx_v_name);
15894           __Pyx_GIVEREF(__pyx_v_name);
15895           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name);
15896           __Pyx_INCREF(__pyx_v_description);
15897           __Pyx_GIVEREF(__pyx_v_description);
15898           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_description);
15899           __Pyx_GIVEREF(__pyx_t_3);
15900           PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_t_3);
15901           __pyx_t_3 = 0;
15902           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error)
15903           __Pyx_GOTREF(__pyx_t_2);
15904           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15905         }
15906         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15907         __pyx_r = __pyx_t_2;
15908         __pyx_t_2 = 0;
15909         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15910         goto __pyx_L0;
15911       }
15912       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15913       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
15914       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
15915       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
15916         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
15917       }
15918       #endif
15919       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15920       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15921     }
15922     #endif
15923   }
15924 
15925   /* "MACS2/IO/ScoreTrack.pyx":948
15926  *             np.ndarray pos, value
15927  *
15928  *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."             # <<<<<<<<<<<<<<
15929  *
15930  *         write = fhd.write
15931  */
15932   #ifndef CYTHON_WITHOUT_ASSERTIONS
15933   if (unlikely(!Py_OptimizeFlag)) {
15934     __pyx_t_1 = __Pyx_PyInt_From_short(__pyx_v_column); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
15935     __Pyx_GOTREF(__pyx_t_1);
15936     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error)
15937     __Pyx_GOTREF(__pyx_t_2);
15938     __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 948, __pyx_L1_error)
15939     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15940     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15941     if (unlikely(!(__pyx_t_8 != 0))) {
15942       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_column_should_be_between_1_2_or);
15943       __PYX_ERR(0, 948, __pyx_L1_error)
15944     }
15945   }
15946   #endif
15947 
15948   /* "MACS2/IO/ScoreTrack.pyx":950
15949  *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."
15950  *
15951  *         write = fhd.write             # <<<<<<<<<<<<<<
15952  *
15953  *         if self.trackline:
15954  */
15955   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fhd, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error)
15956   __Pyx_GOTREF(__pyx_t_2);
15957   __pyx_v_write = __pyx_t_2;
15958   __pyx_t_2 = 0;
15959 
15960   /* "MACS2/IO/ScoreTrack.pyx":952
15961  *         write = fhd.write
15962  *
15963  *         if self.trackline:             # <<<<<<<<<<<<<<
15964  *             # this line is REQUIRED by the wiggle format for UCSC browser
15965  *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name.decode(), description ) )
15966  */
15967   __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->trackline)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 952, __pyx_L1_error)
15968   if (__pyx_t_8) {
15969 
15970     /* "MACS2/IO/ScoreTrack.pyx":954
15971  *         if self.trackline:
15972  *             # this line is REQUIRED by the wiggle format for UCSC browser
15973  *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name.decode(), description ) )             # <<<<<<<<<<<<<<
15974  *
15975  *         chrs = self.get_chr_names()
15976  */
15977     __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
15978     __Pyx_GOTREF(__pyx_t_1);
15979     __pyx_t_9 = 0;
15980     __pyx_t_10 = 127;
15981     __Pyx_INCREF(__pyx_kp_u_track_type_bedGraph_name);
15982     __pyx_t_9 += 26;
15983     __Pyx_GIVEREF(__pyx_kp_u_track_type_bedGraph_name);
15984     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_track_type_bedGraph_name);
15985     __pyx_t_4 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyUnicode_Type_decode, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error)
15986     __Pyx_GOTREF(__pyx_t_4);
15987     __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 954, __pyx_L1_error)
15988     __Pyx_GOTREF(__pyx_t_7);
15989     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15990     __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_10;
15991     __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
15992     __Pyx_GIVEREF(__pyx_t_7);
15993     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
15994     __pyx_t_7 = 0;
15995     __Pyx_INCREF(__pyx_kp_u_description_2);
15996     __pyx_t_9 += 15;
15997     __Pyx_GIVEREF(__pyx_kp_u_description_2);
15998     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_description_2);
15999     __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_description); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 954, __pyx_L1_error)
16000     __Pyx_GOTREF(__pyx_t_7);
16001     __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_10;
16002     __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
16003     __Pyx_GIVEREF(__pyx_t_7);
16004     PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
16005     __pyx_t_7 = 0;
16006     __Pyx_INCREF(__pyx_kp_u__19);
16007     __pyx_t_9 += 2;
16008     __Pyx_GIVEREF(__pyx_kp_u__19);
16009     PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__19);
16010     __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 954, __pyx_L1_error)
16011     __Pyx_GOTREF(__pyx_t_7);
16012     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16013     __Pyx_INCREF(__pyx_v_write);
16014     __pyx_t_1 = __pyx_v_write; __pyx_t_4 = NULL;
16015     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
16016       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
16017       if (likely(__pyx_t_4)) {
16018         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
16019         __Pyx_INCREF(__pyx_t_4);
16020         __Pyx_INCREF(function);
16021         __Pyx_DECREF_SET(__pyx_t_1, function);
16022       }
16023     }
16024     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7);
16025     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16026     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16027     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error)
16028     __Pyx_GOTREF(__pyx_t_2);
16029     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16030     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16031 
16032     /* "MACS2/IO/ScoreTrack.pyx":952
16033  *         write = fhd.write
16034  *
16035  *         if self.trackline:             # <<<<<<<<<<<<<<
16036  *             # this line is REQUIRED by the wiggle format for UCSC browser
16037  *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name.decode(), description ) )
16038  */
16039   }
16040 
16041   /* "MACS2/IO/ScoreTrack.pyx":956
16042  *             write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name.decode(), description ) )
16043  *
16044  *         chrs = self.get_chr_names()             # <<<<<<<<<<<<<<
16045  *         for chrom in chrs:
16046  *             pos = self.data[ chrom ][ 0 ]
16047  */
16048   __pyx_t_2 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 956, __pyx_L1_error)
16049   __Pyx_GOTREF(__pyx_t_2);
16050   if (!(likely(PySet_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 956, __pyx_L1_error)
16051   __pyx_v_chrs = ((PyObject*)__pyx_t_2);
16052   __pyx_t_2 = 0;
16053 
16054   /* "MACS2/IO/ScoreTrack.pyx":957
16055  *
16056  *         chrs = self.get_chr_names()
16057  *         for chrom in chrs:             # <<<<<<<<<<<<<<
16058  *             pos = self.data[ chrom ][ 0 ]
16059  *             value = self.data[ chrom ][ column ]
16060  */
16061   __pyx_t_9 = 0;
16062   __pyx_t_1 = __Pyx_set_iterator(__pyx_v_chrs, 1, (&__pyx_t_11), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error)
16063   __Pyx_GOTREF(__pyx_t_1);
16064   __Pyx_XDECREF(__pyx_t_2);
16065   __pyx_t_2 = __pyx_t_1;
16066   __pyx_t_1 = 0;
16067   while (1) {
16068     __pyx_t_12 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_11, &__pyx_t_9, &__pyx_t_1, __pyx_t_6);
16069     if (unlikely(__pyx_t_12 == 0)) break;
16070     if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 957, __pyx_L1_error)
16071     __Pyx_GOTREF(__pyx_t_1);
16072     if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 957, __pyx_L1_error)
16073     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_1));
16074     __pyx_t_1 = 0;
16075 
16076     /* "MACS2/IO/ScoreTrack.pyx":958
16077  *         chrs = self.get_chr_names()
16078  *         for chrom in chrs:
16079  *             pos = self.data[ chrom ][ 0 ]             # <<<<<<<<<<<<<<
16080  *             value = self.data[ chrom ][ column ]
16081  *             l = self.datalength[ chrom ]
16082  */
16083     if (unlikely(__pyx_v_self->data == Py_None)) {
16084       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16085       __PYX_ERR(0, 958, __pyx_L1_error)
16086     }
16087     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error)
16088     __Pyx_GOTREF(__pyx_t_1);
16089     __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 958, __pyx_L1_error)
16090     __Pyx_GOTREF(__pyx_t_7);
16091     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16092     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 958, __pyx_L1_error)
16093     __Pyx_XDECREF_SET(__pyx_v_pos, ((PyArrayObject *)__pyx_t_7));
16094     __pyx_t_7 = 0;
16095 
16096     /* "MACS2/IO/ScoreTrack.pyx":959
16097  *         for chrom in chrs:
16098  *             pos = self.data[ chrom ][ 0 ]
16099  *             value = self.data[ chrom ][ column ]             # <<<<<<<<<<<<<<
16100  *             l = self.datalength[ chrom ]
16101  *             pre = 0
16102  */
16103     if (unlikely(__pyx_v_self->data == Py_None)) {
16104       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16105       __PYX_ERR(0, 959, __pyx_L1_error)
16106     }
16107     __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 959, __pyx_L1_error)
16108     __Pyx_GOTREF(__pyx_t_7);
16109     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, __pyx_v_column, short, 1, __Pyx_PyInt_From_short, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
16110     __Pyx_GOTREF(__pyx_t_1);
16111     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16112     if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 959, __pyx_L1_error)
16113     __Pyx_XDECREF_SET(__pyx_v_value, ((PyArrayObject *)__pyx_t_1));
16114     __pyx_t_1 = 0;
16115 
16116     /* "MACS2/IO/ScoreTrack.pyx":960
16117  *             pos = self.data[ chrom ][ 0 ]
16118  *             value = self.data[ chrom ][ column ]
16119  *             l = self.datalength[ chrom ]             # <<<<<<<<<<<<<<
16120  *             pre = 0
16121  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
16122  */
16123     if (unlikely(__pyx_v_self->datalength == Py_None)) {
16124       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16125       __PYX_ERR(0, 960, __pyx_L1_error)
16126     }
16127     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error)
16128     __Pyx_GOTREF(__pyx_t_1);
16129     __pyx_t_13 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_13 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 960, __pyx_L1_error)
16130     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16131     __pyx_v_l = __pyx_t_13;
16132 
16133     /* "MACS2/IO/ScoreTrack.pyx":961
16134  *             value = self.data[ chrom ][ column ]
16135  *             l = self.datalength[ chrom ]
16136  *             pre = 0             # <<<<<<<<<<<<<<
16137  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
16138  *             pre_v = value[ 0 ]
16139  */
16140     __pyx_v_pre = 0;
16141 
16142     /* "MACS2/IO/ScoreTrack.pyx":962
16143  *             l = self.datalength[ chrom ]
16144  *             pre = 0
16145  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data             # <<<<<<<<<<<<<<
16146  *             pre_v = value[ 0 ]
16147  *             for i in range( 1, l ):
16148  */
16149     __pyx_t_8 = (((__pyx_v_pos->dimensions[0]) == 0) != 0);
16150     if (__pyx_t_8) {
16151       goto __pyx_L4_continue;
16152     }
16153 
16154     /* "MACS2/IO/ScoreTrack.pyx":963
16155  *             pre = 0
16156  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
16157  *             pre_v = value[ 0 ]             # <<<<<<<<<<<<<<
16158  *             for i in range( 1, l ):
16159  *                 v = value[ i ]
16160  */
16161     __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
16162     __Pyx_GOTREF(__pyx_t_1);
16163     __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L1_error)
16164     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16165     __pyx_v_pre_v = __pyx_t_14;
16166 
16167     /* "MACS2/IO/ScoreTrack.pyx":964
16168  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
16169  *             pre_v = value[ 0 ]
16170  *             for i in range( 1, l ):             # <<<<<<<<<<<<<<
16171  *                 v = value[ i ]
16172  *                 p = pos[ i-1 ]
16173  */
16174     __pyx_t_13 = __pyx_v_l;
16175     __pyx_t_15 = __pyx_t_13;
16176     for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
16177       __pyx_v_i = __pyx_t_16;
16178 
16179       /* "MACS2/IO/ScoreTrack.pyx":965
16180  *             pre_v = value[ 0 ]
16181  *             for i in range( 1, l ):
16182  *                 v = value[ i ]             # <<<<<<<<<<<<<<
16183  *                 p = pos[ i-1 ]
16184  *                 #if ('%.5f' % pre_v) != ('%.5f' % v):
16185  */
16186       __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
16187       __Pyx_GOTREF(__pyx_t_1);
16188       __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L1_error)
16189       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16190       __pyx_v_v = __pyx_t_14;
16191 
16192       /* "MACS2/IO/ScoreTrack.pyx":966
16193  *             for i in range( 1, l ):
16194  *                 v = value[ i ]
16195  *                 p = pos[ i-1 ]             # <<<<<<<<<<<<<<
16196  *                 #if ('%.5f' % pre_v) != ('%.5f' % v):
16197  *                 if abs(pre_v - v) > 1e-5: # precision is 5 digits
16198  */
16199       __pyx_t_17 = (__pyx_v_i - 1);
16200       __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), __pyx_t_17, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
16201       __Pyx_GOTREF(__pyx_t_1);
16202       __pyx_t_18 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_18 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 966, __pyx_L1_error)
16203       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16204       __pyx_v_p = __pyx_t_18;
16205 
16206       /* "MACS2/IO/ScoreTrack.pyx":968
16207  *                 p = pos[ i-1 ]
16208  *                 #if ('%.5f' % pre_v) != ('%.5f' % v):
16209  *                 if abs(pre_v - v) > 1e-5: # precision is 5 digits             # <<<<<<<<<<<<<<
16210  *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
16211  *                     pre_v = v
16212  */
16213       __pyx_t_8 = ((fabs((__pyx_v_pre_v - __pyx_v_v)) > 1e-5) != 0);
16214       if (__pyx_t_8) {
16215 
16216         /* "MACS2/IO/ScoreTrack.pyx":969
16217  *                 #if ('%.5f' % pre_v) != ('%.5f' % v):
16218  *                 if abs(pre_v - v) > 1e-5: # precision is 5 digits
16219  *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )             # <<<<<<<<<<<<<<
16220  *                     pre_v = v
16221  *                     pre = p
16222  */
16223         __pyx_t_7 = PyTuple_New(8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 969, __pyx_L1_error)
16224         __Pyx_GOTREF(__pyx_t_7);
16225         __pyx_t_19 = 0;
16226         __pyx_t_10 = 127;
16227         if (unlikely(__pyx_v_chrom == Py_None)) {
16228           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
16229           __PYX_ERR(0, 969, __pyx_L1_error)
16230         }
16231         __pyx_t_4 = __Pyx_decode_bytes(__pyx_v_chrom, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L1_error)
16232         __Pyx_GOTREF(__pyx_t_4);
16233         __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_10;
16234         __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16235         __Pyx_GIVEREF(__pyx_t_4);
16236         PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
16237         __pyx_t_4 = 0;
16238         __Pyx_INCREF(__pyx_kp_u__11);
16239         __pyx_t_19 += 1;
16240         __Pyx_GIVEREF(__pyx_kp_u__11);
16241         PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_kp_u__11);
16242         __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_pre); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L1_error)
16243         __Pyx_GOTREF(__pyx_t_4);
16244         __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 969, __pyx_L1_error)
16245         __Pyx_GOTREF(__pyx_t_3);
16246         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16247         __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_10;
16248         __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
16249         __Pyx_GIVEREF(__pyx_t_3);
16250         PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
16251         __pyx_t_3 = 0;
16252         __Pyx_INCREF(__pyx_kp_u__11);
16253         __pyx_t_19 += 1;
16254         __Pyx_GIVEREF(__pyx_kp_u__11);
16255         PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_kp_u__11);
16256         __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 969, __pyx_L1_error)
16257         __Pyx_GOTREF(__pyx_t_3);
16258         __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L1_error)
16259         __Pyx_GOTREF(__pyx_t_4);
16260         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16261         __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_10;
16262         __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16263         __Pyx_GIVEREF(__pyx_t_4);
16264         PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_4);
16265         __pyx_t_4 = 0;
16266         __Pyx_INCREF(__pyx_kp_u__11);
16267         __pyx_t_19 += 1;
16268         __Pyx_GIVEREF(__pyx_kp_u__11);
16269         PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_kp_u__11);
16270         __pyx_t_4 = PyFloat_FromDouble(__pyx_v_pre_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L1_error)
16271         __Pyx_GOTREF(__pyx_t_4);
16272         __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_kp_u_5f); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 969, __pyx_L1_error)
16273         __Pyx_GOTREF(__pyx_t_3);
16274         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16275         __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_10;
16276         __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
16277         __Pyx_GIVEREF(__pyx_t_3);
16278         PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_3);
16279         __pyx_t_3 = 0;
16280         __Pyx_INCREF(__pyx_kp_u__12);
16281         __pyx_t_19 += 1;
16282         __Pyx_GIVEREF(__pyx_kp_u__12);
16283         PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_kp_u__12);
16284         __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_7, 8, __pyx_t_19, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 969, __pyx_L1_error)
16285         __Pyx_GOTREF(__pyx_t_3);
16286         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16287         __Pyx_INCREF(__pyx_v_write);
16288         __pyx_t_7 = __pyx_v_write; __pyx_t_4 = NULL;
16289         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
16290           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
16291           if (likely(__pyx_t_4)) {
16292             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
16293             __Pyx_INCREF(__pyx_t_4);
16294             __Pyx_INCREF(function);
16295             __Pyx_DECREF_SET(__pyx_t_7, function);
16296           }
16297         }
16298         __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3);
16299         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16300         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16301         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error)
16302         __Pyx_GOTREF(__pyx_t_1);
16303         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16304         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16305 
16306         /* "MACS2/IO/ScoreTrack.pyx":970
16307  *                 if abs(pre_v - v) > 1e-5: # precision is 5 digits
16308  *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
16309  *                     pre_v = v             # <<<<<<<<<<<<<<
16310  *                     pre = p
16311  *             p = pos[ -1 ]
16312  */
16313         __pyx_v_pre_v = __pyx_v_v;
16314 
16315         /* "MACS2/IO/ScoreTrack.pyx":971
16316  *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
16317  *                     pre_v = v
16318  *                     pre = p             # <<<<<<<<<<<<<<
16319  *             p = pos[ -1 ]
16320  *             # last one
16321  */
16322         __pyx_v_pre = __pyx_v_p;
16323 
16324         /* "MACS2/IO/ScoreTrack.pyx":968
16325  *                 p = pos[ i-1 ]
16326  *                 #if ('%.5f' % pre_v) != ('%.5f' % v):
16327  *                 if abs(pre_v - v) > 1e-5: # precision is 5 digits             # <<<<<<<<<<<<<<
16328  *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
16329  *                     pre_v = v
16330  */
16331       }
16332     }
16333 
16334     /* "MACS2/IO/ScoreTrack.pyx":972
16335  *                     pre_v = v
16336  *                     pre = p
16337  *             p = pos[ -1 ]             # <<<<<<<<<<<<<<
16338  *             # last one
16339  *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
16340  */
16341     __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error)
16342     __Pyx_GOTREF(__pyx_t_1);
16343     __pyx_t_13 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_13 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L1_error)
16344     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16345     __pyx_v_p = __pyx_t_13;
16346 
16347     /* "MACS2/IO/ScoreTrack.pyx":974
16348  *             p = pos[ -1 ]
16349  *             # last one
16350  *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )             # <<<<<<<<<<<<<<
16351  *
16352  *         return True
16353  */
16354     __pyx_t_7 = PyTuple_New(8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 974, __pyx_L1_error)
16355     __Pyx_GOTREF(__pyx_t_7);
16356     __pyx_t_19 = 0;
16357     __pyx_t_10 = 127;
16358     if (unlikely(__pyx_v_chrom == Py_None)) {
16359       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
16360       __PYX_ERR(0, 974, __pyx_L1_error)
16361     }
16362     __pyx_t_3 = __Pyx_decode_bytes(__pyx_v_chrom, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error)
16363     __Pyx_GOTREF(__pyx_t_3);
16364     __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_10;
16365     __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
16366     __Pyx_GIVEREF(__pyx_t_3);
16367     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
16368     __pyx_t_3 = 0;
16369     __Pyx_INCREF(__pyx_kp_u__11);
16370     __pyx_t_19 += 1;
16371     __Pyx_GIVEREF(__pyx_kp_u__11);
16372     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_kp_u__11);
16373     __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_pre); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error)
16374     __Pyx_GOTREF(__pyx_t_3);
16375     __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L1_error)
16376     __Pyx_GOTREF(__pyx_t_4);
16377     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16378     __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_10;
16379     __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16380     __Pyx_GIVEREF(__pyx_t_4);
16381     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4);
16382     __pyx_t_4 = 0;
16383     __Pyx_INCREF(__pyx_kp_u__11);
16384     __pyx_t_19 += 1;
16385     __Pyx_GIVEREF(__pyx_kp_u__11);
16386     PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_kp_u__11);
16387     __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L1_error)
16388     __Pyx_GOTREF(__pyx_t_4);
16389     __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error)
16390     __Pyx_GOTREF(__pyx_t_3);
16391     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16392     __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_10;
16393     __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
16394     __Pyx_GIVEREF(__pyx_t_3);
16395     PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_3);
16396     __pyx_t_3 = 0;
16397     __Pyx_INCREF(__pyx_kp_u__11);
16398     __pyx_t_19 += 1;
16399     __Pyx_GIVEREF(__pyx_kp_u__11);
16400     PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_kp_u__11);
16401     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pre_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error)
16402     __Pyx_GOTREF(__pyx_t_3);
16403     __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_kp_u_5f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L1_error)
16404     __Pyx_GOTREF(__pyx_t_4);
16405     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16406     __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_10;
16407     __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16408     __Pyx_GIVEREF(__pyx_t_4);
16409     PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_4);
16410     __pyx_t_4 = 0;
16411     __Pyx_INCREF(__pyx_kp_u__12);
16412     __pyx_t_19 += 1;
16413     __Pyx_GIVEREF(__pyx_kp_u__12);
16414     PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_kp_u__12);
16415     __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_7, 8, __pyx_t_19, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L1_error)
16416     __Pyx_GOTREF(__pyx_t_4);
16417     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16418     __Pyx_INCREF(__pyx_v_write);
16419     __pyx_t_7 = __pyx_v_write; __pyx_t_3 = NULL;
16420     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
16421       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
16422       if (likely(__pyx_t_3)) {
16423         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
16424         __Pyx_INCREF(__pyx_t_3);
16425         __Pyx_INCREF(function);
16426         __Pyx_DECREF_SET(__pyx_t_7, function);
16427       }
16428     }
16429     __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4);
16430     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16431     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16432     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
16433     __Pyx_GOTREF(__pyx_t_1);
16434     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16435     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16436     __pyx_L4_continue:;
16437   }
16438   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16439 
16440   /* "MACS2/IO/ScoreTrack.pyx":976
16441  *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
16442  *
16443  *         return True             # <<<<<<<<<<<<<<
16444  *
16445  *     cpdef call_peaks (self, float64_t cutoff=5.0, int32_t min_length=200, int32_t max_gap=50, bool call_summits=False):
16446  */
16447   __Pyx_XDECREF(__pyx_r);
16448   __Pyx_INCREF(Py_True);
16449   __pyx_r = Py_True;
16450   goto __pyx_L0;
16451 
16452   /* "MACS2/IO/ScoreTrack.pyx":931
16453  *         return
16454  *
16455  *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
16456  *         """Write all data to fhd in bedGraph Format.
16457  *
16458  */
16459 
16460   /* function exit code */
16461   __pyx_L1_error:;
16462   __Pyx_XDECREF(__pyx_t_1);
16463   __Pyx_XDECREF(__pyx_t_2);
16464   __Pyx_XDECREF(__pyx_t_3);
16465   __Pyx_XDECREF(__pyx_t_4);
16466   __Pyx_XDECREF(__pyx_t_5);
16467   __Pyx_XDECREF(__pyx_t_7);
16468   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
16469   __pyx_r = 0;
16470   __pyx_L0:;
16471   __Pyx_XDECREF(__pyx_v_chrom);
16472   __Pyx_XDECREF(__pyx_v_chrs);
16473   __Pyx_XDECREF((PyObject *)__pyx_v_pos);
16474   __Pyx_XDECREF((PyObject *)__pyx_v_value);
16475   __Pyx_XDECREF(__pyx_v_write);
16476   __Pyx_XGIVEREF(__pyx_r);
16477   __Pyx_TraceReturn(__pyx_r, 0);
16478   __Pyx_RefNannyFinishContext();
16479   return __pyx_r;
16480 }
16481 
16482 /* Python wrapper */
16483 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_23write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
16484 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_22write_bedGraph[] = "Write all data to fhd in bedGraph Format.\n\n        fhd: a filehandler to save bedGraph.\n\n        name/description: the name and description in track line.\n\n        colname: can be 1: chip, 2: control, 3: score\n\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_23write_bedGraph(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)16485 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_23write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16486   PyObject *__pyx_v_fhd = 0;
16487   PyObject *__pyx_v_name = 0;
16488   PyObject *__pyx_v_description = 0;
16489   short __pyx_v_column;
16490   PyObject *__pyx_r = 0;
16491   __Pyx_RefNannyDeclarations
16492   __Pyx_RefNannySetupContext("write_bedGraph (wrapper)", 0);
16493   {
16494     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fhd,&__pyx_n_s_name,&__pyx_n_s_description,&__pyx_n_s_column,0};
16495     PyObject* values[4] = {0,0,0,0};
16496     if (unlikely(__pyx_kwds)) {
16497       Py_ssize_t kw_args;
16498       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16499       switch (pos_args) {
16500         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16501         CYTHON_FALLTHROUGH;
16502         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16503         CYTHON_FALLTHROUGH;
16504         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16505         CYTHON_FALLTHROUGH;
16506         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16507         CYTHON_FALLTHROUGH;
16508         case  0: break;
16509         default: goto __pyx_L5_argtuple_error;
16510       }
16511       kw_args = PyDict_Size(__pyx_kwds);
16512       switch (pos_args) {
16513         case  0:
16514         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fhd)) != 0)) kw_args--;
16515         else goto __pyx_L5_argtuple_error;
16516         CYTHON_FALLTHROUGH;
16517         case  1:
16518         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
16519         else {
16520           __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, 1); __PYX_ERR(0, 931, __pyx_L3_error)
16521         }
16522         CYTHON_FALLTHROUGH;
16523         case  2:
16524         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_description)) != 0)) kw_args--;
16525         else {
16526           __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, 2); __PYX_ERR(0, 931, __pyx_L3_error)
16527         }
16528         CYTHON_FALLTHROUGH;
16529         case  3:
16530         if (kw_args > 0) {
16531           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column);
16532           if (value) { values[3] = value; kw_args--; }
16533         }
16534       }
16535       if (unlikely(kw_args > 0)) {
16536         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bedGraph") < 0)) __PYX_ERR(0, 931, __pyx_L3_error)
16537       }
16538     } else {
16539       switch (PyTuple_GET_SIZE(__pyx_args)) {
16540         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16541         CYTHON_FALLTHROUGH;
16542         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16543         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16544         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16545         break;
16546         default: goto __pyx_L5_argtuple_error;
16547       }
16548     }
16549     __pyx_v_fhd = values[0];
16550     __pyx_v_name = ((PyObject*)values[1]);
16551     __pyx_v_description = ((PyObject*)values[2]);
16552     if (values[3]) {
16553       __pyx_v_column = __Pyx_PyInt_As_short(values[3]); if (unlikely((__pyx_v_column == (short)-1) && PyErr_Occurred())) __PYX_ERR(0, 931, __pyx_L3_error)
16554     } else {
16555       __pyx_v_column = ((short)3);
16556     }
16557   }
16558   goto __pyx_L4_argument_unpacking_done;
16559   __pyx_L5_argtuple_error:;
16560   __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 931, __pyx_L3_error)
16561   __pyx_L3_error:;
16562   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
16563   __Pyx_RefNannyFinishContext();
16564   return NULL;
16565   __pyx_L4_argument_unpacking_done:;
16566   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 931, __pyx_L1_error)
16567   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_description), (&PyUnicode_Type), 1, "description", 1))) __PYX_ERR(0, 931, __pyx_L1_error)
16568   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_22write_bedGraph(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_v_column);
16569 
16570   /* function exit code */
16571   goto __pyx_L0;
16572   __pyx_L1_error:;
16573   __pyx_r = NULL;
16574   __pyx_L0:;
16575   __Pyx_RefNannyFinishContext();
16576   return __pyx_r;
16577 }
16578 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_22write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v_fhd,PyObject * __pyx_v_name,PyObject * __pyx_v_description,short __pyx_v_column)16579 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_22write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column) {
16580   PyObject *__pyx_r = NULL;
16581   __Pyx_TraceDeclarations
16582   __Pyx_RefNannyDeclarations
16583   PyObject *__pyx_t_1 = NULL;
16584   struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph __pyx_t_2;
16585   __Pyx_RefNannySetupContext("write_bedGraph", 0);
16586   __Pyx_TraceCall("write_bedGraph (wrapper)", __pyx_f[0], 931, 0, __PYX_ERR(0, 931, __pyx_L1_error));
16587   __Pyx_XDECREF(__pyx_r);
16588   __pyx_t_2.__pyx_n = 1;
16589   __pyx_t_2.column = __pyx_v_column;
16590   __pyx_t_1 = __pyx_vtabptr_5MACS2_2IO_10ScoreTrack_scoreTrackII->write_bedGraph(__pyx_v_self, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error)
16591   __Pyx_GOTREF(__pyx_t_1);
16592   __pyx_r = __pyx_t_1;
16593   __pyx_t_1 = 0;
16594   goto __pyx_L0;
16595 
16596   /* function exit code */
16597   __pyx_L1_error:;
16598   __Pyx_XDECREF(__pyx_t_1);
16599   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
16600   __pyx_r = NULL;
16601   __pyx_L0:;
16602   __Pyx_XGIVEREF(__pyx_r);
16603   __Pyx_TraceReturn(__pyx_r, 0);
16604   __Pyx_RefNannyFinishContext();
16605   return __pyx_r;
16606 }
16607 
16608 /* "MACS2/IO/ScoreTrack.pyx":978
16609  *         return True
16610  *
16611  *     cpdef call_peaks (self, float64_t cutoff=5.0, int32_t min_length=200, int32_t max_gap=50, bool call_summits=False):             # <<<<<<<<<<<<<<
16612  *         """This function try to find regions within which, scores
16613  *         are continuously higher than a given cutoff.
16614  */
16615 
16616 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_25call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,int __pyx_skip_dispatch,struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks * __pyx_optional_args)16617 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks *__pyx_optional_args) {
16618   __pyx_t_5numpy_float64_t __pyx_v_cutoff = ((__pyx_t_5numpy_float64_t)5.0);
16619   __pyx_t_5numpy_int32_t __pyx_v_min_length = ((__pyx_t_5numpy_int32_t)0xC8);
16620   __pyx_t_5numpy_int32_t __pyx_v_max_gap = ((__pyx_t_5numpy_int32_t)50);
16621   PyBoolObject *__pyx_v_call_summits = ((PyBoolObject *)Py_False);
16622   __pyx_t_5numpy_int32_t __pyx_v_i;
16623   PyObject *__pyx_v_chrom = 0;
16624   PyArrayObject *__pyx_v_pos = 0;
16625   PyArrayObject *__pyx_v_sample = 0;
16626   CYTHON_UNUSED PyArrayObject *__pyx_v_control = 0;
16627   PyArrayObject *__pyx_v_value = 0;
16628   PyArrayObject *__pyx_v_above_cutoff = 0;
16629   PyArrayObject *__pyx_v_above_cutoff_v = 0;
16630   PyArrayObject *__pyx_v_above_cutoff_endpos = 0;
16631   PyArrayObject *__pyx_v_above_cutoff_startpos = 0;
16632   PyArrayObject *__pyx_v_above_cutoff_sv = 0;
16633   PyObject *__pyx_v_peak_content = 0;
16634   PyObject *__pyx_v_chrs = NULL;
16635   PyObject *__pyx_v_peaks = NULL;
16636   PyObject *__pyx_r = NULL;
16637   __Pyx_TraceDeclarations
16638   __Pyx_RefNannyDeclarations
16639   PyObject *__pyx_t_1 = NULL;
16640   PyObject *__pyx_t_2 = NULL;
16641   PyObject *__pyx_t_3 = NULL;
16642   PyObject *__pyx_t_4 = NULL;
16643   PyObject *__pyx_t_5 = NULL;
16644   PyObject *__pyx_t_6 = NULL;
16645   PyObject *__pyx_t_7 = NULL;
16646   int __pyx_t_8;
16647   PyObject *__pyx_t_9 = NULL;
16648   Py_ssize_t __pyx_t_10;
16649   PyObject *(*__pyx_t_11)(PyObject *);
16650   int __pyx_t_12;
16651   int __pyx_t_13;
16652   long __pyx_t_14;
16653   long __pyx_t_15;
16654   __pyx_t_5numpy_int32_t __pyx_t_16;
16655   struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2 __pyx_t_17;
16656   struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak __pyx_t_18;
16657   int __pyx_t_19;
16658   __Pyx_RefNannySetupContext("call_peaks", 0);
16659   __Pyx_TraceCall("call_peaks", __pyx_f[0], 978, 0, __PYX_ERR(0, 978, __pyx_L1_error));
16660   if (__pyx_optional_args) {
16661     if (__pyx_optional_args->__pyx_n > 0) {
16662       __pyx_v_cutoff = __pyx_optional_args->cutoff;
16663       if (__pyx_optional_args->__pyx_n > 1) {
16664         __pyx_v_min_length = __pyx_optional_args->min_length;
16665         if (__pyx_optional_args->__pyx_n > 2) {
16666           __pyx_v_max_gap = __pyx_optional_args->max_gap;
16667           if (__pyx_optional_args->__pyx_n > 3) {
16668             __pyx_v_call_summits = __pyx_optional_args->call_summits;
16669           }
16670         }
16671       }
16672     }
16673   }
16674   /* Check if called by wrapper */
16675   if (unlikely(__pyx_skip_dispatch)) ;
16676   /* Check if overridden in Python */
16677   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
16678     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
16679     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
16680     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
16681       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
16682       #endif
16683       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_call_peaks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
16684       __Pyx_GOTREF(__pyx_t_1);
16685       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_25call_peaks)) {
16686         __Pyx_XDECREF(__pyx_r);
16687         __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error)
16688         __Pyx_GOTREF(__pyx_t_3);
16689         __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_min_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error)
16690         __Pyx_GOTREF(__pyx_t_4);
16691         __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_max_gap); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L1_error)
16692         __Pyx_GOTREF(__pyx_t_5);
16693         __Pyx_INCREF(__pyx_t_1);
16694         __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
16695         __pyx_t_8 = 0;
16696         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16697           __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
16698           if (likely(__pyx_t_7)) {
16699             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
16700             __Pyx_INCREF(__pyx_t_7);
16701             __Pyx_INCREF(function);
16702             __Pyx_DECREF_SET(__pyx_t_6, function);
16703             __pyx_t_8 = 1;
16704           }
16705         }
16706         #if CYTHON_FAST_PYCALL
16707         if (PyFunction_Check(__pyx_t_6)) {
16708           PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_call_summits)};
16709           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
16710           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16711           __Pyx_GOTREF(__pyx_t_2);
16712           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16713           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16714           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16715         } else
16716         #endif
16717         #if CYTHON_FAST_PYCCALL
16718         if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
16719           PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_call_summits)};
16720           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
16721           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16722           __Pyx_GOTREF(__pyx_t_2);
16723           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16724           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16725           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16726         } else
16727         #endif
16728         {
16729           __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 978, __pyx_L1_error)
16730           __Pyx_GOTREF(__pyx_t_9);
16731           if (__pyx_t_7) {
16732             __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
16733           }
16734           __Pyx_GIVEREF(__pyx_t_3);
16735           PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
16736           __Pyx_GIVEREF(__pyx_t_4);
16737           PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
16738           __Pyx_GIVEREF(__pyx_t_5);
16739           PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
16740           __Pyx_INCREF(((PyObject *)__pyx_v_call_summits));
16741           __Pyx_GIVEREF(((PyObject *)__pyx_v_call_summits));
16742           PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_call_summits));
16743           __pyx_t_3 = 0;
16744           __pyx_t_4 = 0;
16745           __pyx_t_5 = 0;
16746           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
16747           __Pyx_GOTREF(__pyx_t_2);
16748           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16749         }
16750         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16751         __pyx_r = __pyx_t_2;
16752         __pyx_t_2 = 0;
16753         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16754         goto __pyx_L0;
16755       }
16756       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
16757       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
16758       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
16759       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
16760         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
16761       }
16762       #endif
16763       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16764       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
16765     }
16766     #endif
16767   }
16768 
16769   /* "MACS2/IO/ScoreTrack.pyx":999
16770  *             list peak_content
16771  *
16772  *         chrs  = self.get_chr_names()             # <<<<<<<<<<<<<<
16773  *         peaks = PeakIO()                      # dictionary to save peaks
16774  *
16775  */
16776   __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error)
16777   __Pyx_GOTREF(__pyx_t_1);
16778   __pyx_v_chrs = __pyx_t_1;
16779   __pyx_t_1 = 0;
16780 
16781   /* "MACS2/IO/ScoreTrack.pyx":1000
16782  *
16783  *         chrs  = self.get_chr_names()
16784  *         peaks = PeakIO()                      # dictionary to save peaks             # <<<<<<<<<<<<<<
16785  *
16786  *         self.cutoff = cutoff
16787  */
16788   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PeakIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
16789   __Pyx_GOTREF(__pyx_t_2);
16790   __pyx_t_6 = NULL;
16791   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
16792     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
16793     if (likely(__pyx_t_6)) {
16794       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
16795       __Pyx_INCREF(__pyx_t_6);
16796       __Pyx_INCREF(function);
16797       __Pyx_DECREF_SET(__pyx_t_2, function);
16798     }
16799   }
16800   __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
16801   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16802   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error)
16803   __Pyx_GOTREF(__pyx_t_1);
16804   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16805   __pyx_v_peaks = __pyx_t_1;
16806   __pyx_t_1 = 0;
16807 
16808   /* "MACS2/IO/ScoreTrack.pyx":1002
16809  *         peaks = PeakIO()                      # dictionary to save peaks
16810  *
16811  *         self.cutoff = cutoff             # <<<<<<<<<<<<<<
16812  *         for chrom in chrs:
16813  *             peak_content = []           # to store points above cutoff
16814  */
16815   __pyx_v_self->cutoff = __pyx_v_cutoff;
16816 
16817   /* "MACS2/IO/ScoreTrack.pyx":1003
16818  *
16819  *         self.cutoff = cutoff
16820  *         for chrom in chrs:             # <<<<<<<<<<<<<<
16821  *             peak_content = []           # to store points above cutoff
16822  *
16823  */
16824   if (likely(PyList_CheckExact(__pyx_v_chrs)) || PyTuple_CheckExact(__pyx_v_chrs)) {
16825     __pyx_t_1 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
16826     __pyx_t_11 = NULL;
16827   } else {
16828     __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
16829     __Pyx_GOTREF(__pyx_t_1);
16830     __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1003, __pyx_L1_error)
16831   }
16832   for (;;) {
16833     if (likely(!__pyx_t_11)) {
16834       if (likely(PyList_CheckExact(__pyx_t_1))) {
16835         if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
16836         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16837         __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1003, __pyx_L1_error)
16838         #else
16839         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
16840         __Pyx_GOTREF(__pyx_t_2);
16841         #endif
16842       } else {
16843         if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
16844         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16845         __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1003, __pyx_L1_error)
16846         #else
16847         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
16848         __Pyx_GOTREF(__pyx_t_2);
16849         #endif
16850       }
16851     } else {
16852       __pyx_t_2 = __pyx_t_11(__pyx_t_1);
16853       if (unlikely(!__pyx_t_2)) {
16854         PyObject* exc_type = PyErr_Occurred();
16855         if (exc_type) {
16856           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16857           else __PYX_ERR(0, 1003, __pyx_L1_error)
16858         }
16859         break;
16860       }
16861       __Pyx_GOTREF(__pyx_t_2);
16862     }
16863     if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1003, __pyx_L1_error)
16864     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_2));
16865     __pyx_t_2 = 0;
16866 
16867     /* "MACS2/IO/ScoreTrack.pyx":1004
16868  *         self.cutoff = cutoff
16869  *         for chrom in chrs:
16870  *             peak_content = []           # to store points above cutoff             # <<<<<<<<<<<<<<
16871  *
16872  *             pos = self.data[chrom][ 0 ]
16873  */
16874     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error)
16875     __Pyx_GOTREF(__pyx_t_2);
16876     __Pyx_XDECREF_SET(__pyx_v_peak_content, ((PyObject*)__pyx_t_2));
16877     __pyx_t_2 = 0;
16878 
16879     /* "MACS2/IO/ScoreTrack.pyx":1006
16880  *             peak_content = []           # to store points above cutoff
16881  *
16882  *             pos = self.data[chrom][ 0 ]             # <<<<<<<<<<<<<<
16883  *             sample = self.data[chrom][ 1 ]
16884  *             control = self.data[chrom][ 2 ]
16885  */
16886     if (unlikely(__pyx_v_self->data == Py_None)) {
16887       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16888       __PYX_ERR(0, 1006, __pyx_L1_error)
16889     }
16890     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error)
16891     __Pyx_GOTREF(__pyx_t_2);
16892     __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1006, __pyx_L1_error)
16893     __Pyx_GOTREF(__pyx_t_6);
16894     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16895     if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1006, __pyx_L1_error)
16896     __Pyx_XDECREF_SET(__pyx_v_pos, ((PyArrayObject *)__pyx_t_6));
16897     __pyx_t_6 = 0;
16898 
16899     /* "MACS2/IO/ScoreTrack.pyx":1007
16900  *
16901  *             pos = self.data[chrom][ 0 ]
16902  *             sample = self.data[chrom][ 1 ]             # <<<<<<<<<<<<<<
16903  *             control = self.data[chrom][ 2 ]
16904  *             value = self.data[chrom][ 3 ]
16905  */
16906     if (unlikely(__pyx_v_self->data == Py_None)) {
16907       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16908       __PYX_ERR(0, 1007, __pyx_L1_error)
16909     }
16910     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1007, __pyx_L1_error)
16911     __Pyx_GOTREF(__pyx_t_6);
16912     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1007, __pyx_L1_error)
16913     __Pyx_GOTREF(__pyx_t_2);
16914     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16915     if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1007, __pyx_L1_error)
16916     __Pyx_XDECREF_SET(__pyx_v_sample, ((PyArrayObject *)__pyx_t_2));
16917     __pyx_t_2 = 0;
16918 
16919     /* "MACS2/IO/ScoreTrack.pyx":1008
16920  *             pos = self.data[chrom][ 0 ]
16921  *             sample = self.data[chrom][ 1 ]
16922  *             control = self.data[chrom][ 2 ]             # <<<<<<<<<<<<<<
16923  *             value = self.data[chrom][ 3 ]
16924  *
16925  */
16926     if (unlikely(__pyx_v_self->data == Py_None)) {
16927       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16928       __PYX_ERR(0, 1008, __pyx_L1_error)
16929     }
16930     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error)
16931     __Pyx_GOTREF(__pyx_t_2);
16932     __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1008, __pyx_L1_error)
16933     __Pyx_GOTREF(__pyx_t_6);
16934     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16935     if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1008, __pyx_L1_error)
16936     __Pyx_XDECREF_SET(__pyx_v_control, ((PyArrayObject *)__pyx_t_6));
16937     __pyx_t_6 = 0;
16938 
16939     /* "MACS2/IO/ScoreTrack.pyx":1009
16940  *             sample = self.data[chrom][ 1 ]
16941  *             control = self.data[chrom][ 2 ]
16942  *             value = self.data[chrom][ 3 ]             # <<<<<<<<<<<<<<
16943  *
16944  *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff
16945  */
16946     if (unlikely(__pyx_v_self->data == Py_None)) {
16947       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16948       __PYX_ERR(0, 1009, __pyx_L1_error)
16949     }
16950     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1009, __pyx_L1_error)
16951     __Pyx_GOTREF(__pyx_t_6);
16952     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
16953     __Pyx_GOTREF(__pyx_t_2);
16954     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16955     if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1009, __pyx_L1_error)
16956     __Pyx_XDECREF_SET(__pyx_v_value, ((PyArrayObject *)__pyx_t_2));
16957     __pyx_t_2 = 0;
16958 
16959     /* "MACS2/IO/ScoreTrack.pyx":1011
16960  *             value = self.data[chrom][ 3 ]
16961  *
16962  *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff             # <<<<<<<<<<<<<<
16963  *             above_cutoff_v = value[above_cutoff] # scores where score is above cutoff
16964  *
16965  */
16966     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1011, __pyx_L1_error)
16967     __Pyx_GOTREF(__pyx_t_6);
16968     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1011, __pyx_L1_error)
16969     __Pyx_GOTREF(__pyx_t_9);
16970     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16971     __pyx_t_6 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1011, __pyx_L1_error)
16972     __Pyx_GOTREF(__pyx_t_6);
16973     __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_v_value), __pyx_t_6, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
16974     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16975     __pyx_t_6 = NULL;
16976     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
16977       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
16978       if (likely(__pyx_t_6)) {
16979         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
16980         __Pyx_INCREF(__pyx_t_6);
16981         __Pyx_INCREF(function);
16982         __Pyx_DECREF_SET(__pyx_t_9, function);
16983       }
16984     }
16985     __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5);
16986     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16987     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16988     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
16989     __Pyx_GOTREF(__pyx_t_2);
16990     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16991     __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1011, __pyx_L1_error)
16992     __Pyx_GOTREF(__pyx_t_9);
16993     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16994     if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1011, __pyx_L1_error)
16995     __Pyx_XDECREF_SET(__pyx_v_above_cutoff, ((PyArrayObject *)__pyx_t_9));
16996     __pyx_t_9 = 0;
16997 
16998     /* "MACS2/IO/ScoreTrack.pyx":1012
16999  *
17000  *             above_cutoff = np.nonzero( value >= cutoff )[0] # indices where score is above cutoff
17001  *             above_cutoff_v = value[above_cutoff] # scores where score is above cutoff             # <<<<<<<<<<<<<<
17002  *
17003  *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff
17004  */
17005     __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_value), ((PyObject *)__pyx_v_above_cutoff)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1012, __pyx_L1_error)
17006     __Pyx_GOTREF(__pyx_t_9);
17007     if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1012, __pyx_L1_error)
17008     __Pyx_XDECREF_SET(__pyx_v_above_cutoff_v, ((PyArrayObject *)__pyx_t_9));
17009     __pyx_t_9 = 0;
17010 
17011     /* "MACS2/IO/ScoreTrack.pyx":1014
17012  *             above_cutoff_v = value[above_cutoff] # scores where score is above cutoff
17013  *
17014  *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
17015  *             above_cutoff_startpos = pos[above_cutoff-1] # start positions of regions where score is above cutoff
17016  *             above_cutoff_sv= sample[above_cutoff] # sample pileup height where score is above cutoff
17017  */
17018     __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_pos), ((PyObject *)__pyx_v_above_cutoff)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1014, __pyx_L1_error)
17019     __Pyx_GOTREF(__pyx_t_9);
17020     if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1014, __pyx_L1_error)
17021     __Pyx_XDECREF_SET(__pyx_v_above_cutoff_endpos, ((PyArrayObject *)__pyx_t_9));
17022     __pyx_t_9 = 0;
17023 
17024     /* "MACS2/IO/ScoreTrack.pyx":1015
17025  *
17026  *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff
17027  *             above_cutoff_startpos = pos[above_cutoff-1] # start positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
17028  *             above_cutoff_sv= sample[above_cutoff] # sample pileup height where score is above cutoff
17029  *
17030  */
17031     __pyx_t_9 = PyNumber_Subtract(((PyObject *)__pyx_v_above_cutoff), __pyx_int_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1015, __pyx_L1_error)
17032     __Pyx_GOTREF(__pyx_t_9);
17033     __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error)
17034     __Pyx_GOTREF(__pyx_t_2);
17035     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17036     if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1015, __pyx_L1_error)
17037     __Pyx_XDECREF_SET(__pyx_v_above_cutoff_startpos, ((PyArrayObject *)__pyx_t_2));
17038     __pyx_t_2 = 0;
17039 
17040     /* "MACS2/IO/ScoreTrack.pyx":1016
17041  *             above_cutoff_endpos = pos[above_cutoff] # end positions of regions where score is above cutoff
17042  *             above_cutoff_startpos = pos[above_cutoff-1] # start positions of regions where score is above cutoff
17043  *             above_cutoff_sv= sample[above_cutoff] # sample pileup height where score is above cutoff             # <<<<<<<<<<<<<<
17044  *
17045  *             if above_cutoff_v.size == 0:
17046  */
17047     __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_sample), ((PyObject *)__pyx_v_above_cutoff)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error)
17048     __Pyx_GOTREF(__pyx_t_2);
17049     if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1016, __pyx_L1_error)
17050     __Pyx_XDECREF_SET(__pyx_v_above_cutoff_sv, ((PyArrayObject *)__pyx_t_2));
17051     __pyx_t_2 = 0;
17052 
17053     /* "MACS2/IO/ScoreTrack.pyx":1018
17054  *             above_cutoff_sv= sample[above_cutoff] # sample pileup height where score is above cutoff
17055  *
17056  *             if above_cutoff_v.size == 0:             # <<<<<<<<<<<<<<
17057  *                 # nothing above cutoff
17058  *                 continue
17059  */
17060     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_above_cutoff_v), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
17061     __Pyx_GOTREF(__pyx_t_2);
17062     __pyx_t_9 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1018, __pyx_L1_error)
17063     __Pyx_GOTREF(__pyx_t_9);
17064     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17065     __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1018, __pyx_L1_error)
17066     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17067     if (__pyx_t_12) {
17068 
17069       /* "MACS2/IO/ScoreTrack.pyx":1020
17070  *             if above_cutoff_v.size == 0:
17071  *                 # nothing above cutoff
17072  *                 continue             # <<<<<<<<<<<<<<
17073  *
17074  *             if above_cutoff[0] == 0:
17075  */
17076       goto __pyx_L3_continue;
17077 
17078       /* "MACS2/IO/ScoreTrack.pyx":1018
17079  *             above_cutoff_sv= sample[above_cutoff] # sample pileup height where score is above cutoff
17080  *
17081  *             if above_cutoff_v.size == 0:             # <<<<<<<<<<<<<<
17082  *                 # nothing above cutoff
17083  *                 continue
17084  */
17085     }
17086 
17087     /* "MACS2/IO/ScoreTrack.pyx":1022
17088  *                 continue
17089  *
17090  *             if above_cutoff[0] == 0:             # <<<<<<<<<<<<<<
17091  *                 # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
17092  *                 above_cutoff_startpos[0] = 0
17093  */
17094     __pyx_t_9 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1022, __pyx_L1_error)
17095     __Pyx_GOTREF(__pyx_t_9);
17096     __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_9, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L1_error)
17097     __Pyx_GOTREF(__pyx_t_2);
17098     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17099     __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1022, __pyx_L1_error)
17100     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17101     if (__pyx_t_12) {
17102 
17103       /* "MACS2/IO/ScoreTrack.pyx":1024
17104  *             if above_cutoff[0] == 0:
17105  *                 # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
17106  *                 above_cutoff_startpos[0] = 0             # <<<<<<<<<<<<<<
17107  *
17108  *             # first bit of region above cutoff
17109  */
17110       if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_above_cutoff_startpos), 0, __pyx_int_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1024, __pyx_L1_error)
17111 
17112       /* "MACS2/IO/ScoreTrack.pyx":1022
17113  *                 continue
17114  *
17115  *             if above_cutoff[0] == 0:             # <<<<<<<<<<<<<<
17116  *                 # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
17117  *                 above_cutoff_startpos[0] = 0
17118  */
17119     }
17120 
17121     /* "MACS2/IO/ScoreTrack.pyx":1027
17122  *
17123  *             # first bit of region above cutoff
17124  *             peak_content.append( (above_cutoff_startpos[0], above_cutoff_endpos[0], above_cutoff_v[0], above_cutoff_sv[0], above_cutoff[0]) )             # <<<<<<<<<<<<<<
17125  *             for i in range( 1,above_cutoff_startpos.size ):
17126  *                 if above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
17127  */
17128     __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_startpos), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1027, __pyx_L1_error)
17129     __Pyx_GOTREF(__pyx_t_2);
17130     __pyx_t_9 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1027, __pyx_L1_error)
17131     __Pyx_GOTREF(__pyx_t_9);
17132     __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_v), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1027, __pyx_L1_error)
17133     __Pyx_GOTREF(__pyx_t_5);
17134     __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_sv), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1027, __pyx_L1_error)
17135     __Pyx_GOTREF(__pyx_t_6);
17136     __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1027, __pyx_L1_error)
17137     __Pyx_GOTREF(__pyx_t_4);
17138     __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error)
17139     __Pyx_GOTREF(__pyx_t_3);
17140     __Pyx_GIVEREF(__pyx_t_2);
17141     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
17142     __Pyx_GIVEREF(__pyx_t_9);
17143     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9);
17144     __Pyx_GIVEREF(__pyx_t_5);
17145     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5);
17146     __Pyx_GIVEREF(__pyx_t_6);
17147     PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
17148     __Pyx_GIVEREF(__pyx_t_4);
17149     PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_4);
17150     __pyx_t_2 = 0;
17151     __pyx_t_9 = 0;
17152     __pyx_t_5 = 0;
17153     __pyx_t_6 = 0;
17154     __pyx_t_4 = 0;
17155     __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_peak_content, __pyx_t_3); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1027, __pyx_L1_error)
17156     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17157 
17158     /* "MACS2/IO/ScoreTrack.pyx":1028
17159  *             # first bit of region above cutoff
17160  *             peak_content.append( (above_cutoff_startpos[0], above_cutoff_endpos[0], above_cutoff_v[0], above_cutoff_sv[0], above_cutoff[0]) )
17161  *             for i in range( 1,above_cutoff_startpos.size ):             # <<<<<<<<<<<<<<
17162  *                 if above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
17163  *                     # append
17164  */
17165     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_above_cutoff_startpos), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1028, __pyx_L1_error)
17166     __Pyx_GOTREF(__pyx_t_3);
17167     __pyx_t_14 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_14 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1028, __pyx_L1_error)
17168     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17169     __pyx_t_15 = __pyx_t_14;
17170     for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
17171       __pyx_v_i = __pyx_t_16;
17172 
17173       /* "MACS2/IO/ScoreTrack.pyx":1029
17174  *             peak_content.append( (above_cutoff_startpos[0], above_cutoff_endpos[0], above_cutoff_v[0], above_cutoff_sv[0], above_cutoff[0]) )
17175  *             for i in range( 1,above_cutoff_startpos.size ):
17176  *                 if above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:             # <<<<<<<<<<<<<<
17177  *                     # append
17178  *                     peak_content.append( (above_cutoff_startpos[i], above_cutoff_endpos[i], above_cutoff_v[i], above_cutoff_sv[i], above_cutoff[i]) )
17179  */
17180       __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_startpos), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error)
17181       __Pyx_GOTREF(__pyx_t_3);
17182       __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_peak_content, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L1_error)
17183       __Pyx_GOTREF(__pyx_t_4);
17184       __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1029, __pyx_L1_error)
17185       __Pyx_GOTREF(__pyx_t_6);
17186       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17187       __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L1_error)
17188       __Pyx_GOTREF(__pyx_t_4);
17189       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17190       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17191       __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_max_gap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1029, __pyx_L1_error)
17192       __Pyx_GOTREF(__pyx_t_6);
17193       __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error)
17194       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17195       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17196       __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1029, __pyx_L1_error)
17197       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17198       if (__pyx_t_12) {
17199 
17200         /* "MACS2/IO/ScoreTrack.pyx":1031
17201  *                 if above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:
17202  *                     # append
17203  *                     peak_content.append( (above_cutoff_startpos[i], above_cutoff_endpos[i], above_cutoff_v[i], above_cutoff_sv[i], above_cutoff[i]) )             # <<<<<<<<<<<<<<
17204  *                 else:
17205  *                     # close
17206  */
17207         __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_startpos), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1031, __pyx_L1_error)
17208         __Pyx_GOTREF(__pyx_t_3);
17209         __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1031, __pyx_L1_error)
17210         __Pyx_GOTREF(__pyx_t_6);
17211         __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_v), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1031, __pyx_L1_error)
17212         __Pyx_GOTREF(__pyx_t_4);
17213         __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_sv), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1031, __pyx_L1_error)
17214         __Pyx_GOTREF(__pyx_t_5);
17215         __pyx_t_9 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1031, __pyx_L1_error)
17216         __Pyx_GOTREF(__pyx_t_9);
17217         __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error)
17218         __Pyx_GOTREF(__pyx_t_2);
17219         __Pyx_GIVEREF(__pyx_t_3);
17220         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
17221         __Pyx_GIVEREF(__pyx_t_6);
17222         PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
17223         __Pyx_GIVEREF(__pyx_t_4);
17224         PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
17225         __Pyx_GIVEREF(__pyx_t_5);
17226         PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
17227         __Pyx_GIVEREF(__pyx_t_9);
17228         PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_9);
17229         __pyx_t_3 = 0;
17230         __pyx_t_6 = 0;
17231         __pyx_t_4 = 0;
17232         __pyx_t_5 = 0;
17233         __pyx_t_9 = 0;
17234         __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_peak_content, __pyx_t_2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1031, __pyx_L1_error)
17235         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17236 
17237         /* "MACS2/IO/ScoreTrack.pyx":1029
17238  *             peak_content.append( (above_cutoff_startpos[0], above_cutoff_endpos[0], above_cutoff_v[0], above_cutoff_sv[0], above_cutoff[0]) )
17239  *             for i in range( 1,above_cutoff_startpos.size ):
17240  *                 if above_cutoff_startpos[i] - peak_content[-1][1] <= max_gap:             # <<<<<<<<<<<<<<
17241  *                     # append
17242  *                     peak_content.append( (above_cutoff_startpos[i], above_cutoff_endpos[i], above_cutoff_v[i], above_cutoff_sv[i], above_cutoff[i]) )
17243  */
17244         goto __pyx_L9;
17245       }
17246 
17247       /* "MACS2/IO/ScoreTrack.pyx":1034
17248  *                 else:
17249  *                     # close
17250  *                     if call_summits:             # <<<<<<<<<<<<<<
17251  *                         self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap//2 )
17252  *                     else:
17253  */
17254       /*else*/ {
17255         __pyx_t_12 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_call_summits)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1034, __pyx_L1_error)
17256         if (__pyx_t_12) {
17257 
17258           /* "MACS2/IO/ScoreTrack.pyx":1035
17259  *                     # close
17260  *                     if call_summits:
17261  *                         self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap//2 )             # <<<<<<<<<<<<<<
17262  *                     else:
17263  *                         self.__close_peak(peak_content, peaks, min_length, chrom, max_gap//2 )
17264  */
17265           __pyx_t_17.__pyx_n = 1;
17266           __pyx_t_17.smoothlen = __Pyx_div_long(__pyx_v_max_gap, 2);
17267           __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak2(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, &__pyx_t_17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1035, __pyx_L1_error)
17268           __Pyx_GOTREF(__pyx_t_2);
17269           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17270 
17271           /* "MACS2/IO/ScoreTrack.pyx":1034
17272  *                 else:
17273  *                     # close
17274  *                     if call_summits:             # <<<<<<<<<<<<<<
17275  *                         self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap//2 )
17276  *                     else:
17277  */
17278           goto __pyx_L10;
17279         }
17280 
17281         /* "MACS2/IO/ScoreTrack.pyx":1037
17282  *                         self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap//2 )
17283  *                     else:
17284  *                         self.__close_peak(peak_content, peaks, min_length, chrom, max_gap//2 )             # <<<<<<<<<<<<<<
17285  *                     peak_content = [(above_cutoff_startpos[i], above_cutoff_endpos[i], above_cutoff_v[i], above_cutoff_sv[i], above_cutoff[i]),]
17286  *
17287  */
17288         /*else*/ {
17289           __pyx_t_18.__pyx_n = 1;
17290           __pyx_t_18.smoothlen = __Pyx_div_long(__pyx_v_max_gap, 2);
17291           __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, &__pyx_t_18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error)
17292           __Pyx_GOTREF(__pyx_t_2);
17293           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17294         }
17295         __pyx_L10:;
17296 
17297         /* "MACS2/IO/ScoreTrack.pyx":1038
17298  *                     else:
17299  *                         self.__close_peak(peak_content, peaks, min_length, chrom, max_gap//2 )
17300  *                     peak_content = [(above_cutoff_startpos[i], above_cutoff_endpos[i], above_cutoff_v[i], above_cutoff_sv[i], above_cutoff[i]),]             # <<<<<<<<<<<<<<
17301  *
17302  *             # save the last peak
17303  */
17304         __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_startpos), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1038, __pyx_L1_error)
17305         __Pyx_GOTREF(__pyx_t_2);
17306         __pyx_t_9 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_endpos), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1038, __pyx_L1_error)
17307         __Pyx_GOTREF(__pyx_t_9);
17308         __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_v), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1038, __pyx_L1_error)
17309         __Pyx_GOTREF(__pyx_t_5);
17310         __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff_sv), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L1_error)
17311         __Pyx_GOTREF(__pyx_t_4);
17312         __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_above_cutoff), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1038, __pyx_L1_error)
17313         __Pyx_GOTREF(__pyx_t_6);
17314         __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error)
17315         __Pyx_GOTREF(__pyx_t_3);
17316         __Pyx_GIVEREF(__pyx_t_2);
17317         PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
17318         __Pyx_GIVEREF(__pyx_t_9);
17319         PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9);
17320         __Pyx_GIVEREF(__pyx_t_5);
17321         PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5);
17322         __Pyx_GIVEREF(__pyx_t_4);
17323         PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
17324         __Pyx_GIVEREF(__pyx_t_6);
17325         PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_6);
17326         __pyx_t_2 = 0;
17327         __pyx_t_9 = 0;
17328         __pyx_t_5 = 0;
17329         __pyx_t_4 = 0;
17330         __pyx_t_6 = 0;
17331         __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1038, __pyx_L1_error)
17332         __Pyx_GOTREF(__pyx_t_6);
17333         __Pyx_GIVEREF(__pyx_t_3);
17334         PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
17335         __pyx_t_3 = 0;
17336         __Pyx_DECREF_SET(__pyx_v_peak_content, ((PyObject*)__pyx_t_6));
17337         __pyx_t_6 = 0;
17338       }
17339       __pyx_L9:;
17340     }
17341 
17342     /* "MACS2/IO/ScoreTrack.pyx":1041
17343  *
17344  *             # save the last peak
17345  *             if not peak_content:             # <<<<<<<<<<<<<<
17346  *                 continue
17347  *             else:
17348  */
17349     __pyx_t_12 = (PyList_GET_SIZE(__pyx_v_peak_content) != 0);
17350     __pyx_t_19 = ((!__pyx_t_12) != 0);
17351     if (__pyx_t_19) {
17352 
17353       /* "MACS2/IO/ScoreTrack.pyx":1042
17354  *             # save the last peak
17355  *             if not peak_content:
17356  *                 continue             # <<<<<<<<<<<<<<
17357  *             else:
17358  *                 if call_summits:
17359  */
17360       goto __pyx_L3_continue;
17361 
17362       /* "MACS2/IO/ScoreTrack.pyx":1041
17363  *
17364  *             # save the last peak
17365  *             if not peak_content:             # <<<<<<<<<<<<<<
17366  *                 continue
17367  *             else:
17368  */
17369     }
17370 
17371     /* "MACS2/IO/ScoreTrack.pyx":1044
17372  *                 continue
17373  *             else:
17374  *                 if call_summits:             # <<<<<<<<<<<<<<
17375  *                     self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap//2 )
17376  *                 else:
17377  */
17378     /*else*/ {
17379       __pyx_t_19 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_call_summits)); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 1044, __pyx_L1_error)
17380       if (__pyx_t_19) {
17381 
17382         /* "MACS2/IO/ScoreTrack.pyx":1045
17383  *             else:
17384  *                 if call_summits:
17385  *                     self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap//2 )             # <<<<<<<<<<<<<<
17386  *                 else:
17387  *                     self.__close_peak(peak_content, peaks, min_length, chrom, max_gap//2 )
17388  */
17389         __pyx_t_17.__pyx_n = 1;
17390         __pyx_t_17.smoothlen = __Pyx_div_long(__pyx_v_max_gap, 2);
17391         __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak2(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, &__pyx_t_17)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1045, __pyx_L1_error)
17392         __Pyx_GOTREF(__pyx_t_6);
17393         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17394 
17395         /* "MACS2/IO/ScoreTrack.pyx":1044
17396  *                 continue
17397  *             else:
17398  *                 if call_summits:             # <<<<<<<<<<<<<<
17399  *                     self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap//2 )
17400  *                 else:
17401  */
17402         goto __pyx_L12;
17403       }
17404 
17405       /* "MACS2/IO/ScoreTrack.pyx":1047
17406  *                     self.__close_peak2(peak_content, peaks, min_length, chrom, max_gap//2 )
17407  *                 else:
17408  *                     self.__close_peak(peak_content, peaks, min_length, chrom, max_gap//2 )             # <<<<<<<<<<<<<<
17409  *
17410  *         return peaks
17411  */
17412       /*else*/ {
17413         __pyx_t_18.__pyx_n = 1;
17414         __pyx_t_18.smoothlen = __Pyx_div_long(__pyx_v_max_gap, 2);
17415         __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, &__pyx_t_18)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1047, __pyx_L1_error)
17416         __Pyx_GOTREF(__pyx_t_6);
17417         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17418       }
17419       __pyx_L12:;
17420     }
17421 
17422     /* "MACS2/IO/ScoreTrack.pyx":1003
17423  *
17424  *         self.cutoff = cutoff
17425  *         for chrom in chrs:             # <<<<<<<<<<<<<<
17426  *             peak_content = []           # to store points above cutoff
17427  *
17428  */
17429     __pyx_L3_continue:;
17430   }
17431   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17432 
17433   /* "MACS2/IO/ScoreTrack.pyx":1049
17434  *                     self.__close_peak(peak_content, peaks, min_length, chrom, max_gap//2 )
17435  *
17436  *         return peaks             # <<<<<<<<<<<<<<
17437  *
17438  *     cdef bool __close_peak (self, list peak_content, peaks, int32_t min_length,
17439  */
17440   __Pyx_XDECREF(__pyx_r);
17441   __Pyx_INCREF(__pyx_v_peaks);
17442   __pyx_r = __pyx_v_peaks;
17443   goto __pyx_L0;
17444 
17445   /* "MACS2/IO/ScoreTrack.pyx":978
17446  *         return True
17447  *
17448  *     cpdef call_peaks (self, float64_t cutoff=5.0, int32_t min_length=200, int32_t max_gap=50, bool call_summits=False):             # <<<<<<<<<<<<<<
17449  *         """This function try to find regions within which, scores
17450  *         are continuously higher than a given cutoff.
17451  */
17452 
17453   /* function exit code */
17454   __pyx_L1_error:;
17455   __Pyx_XDECREF(__pyx_t_1);
17456   __Pyx_XDECREF(__pyx_t_2);
17457   __Pyx_XDECREF(__pyx_t_3);
17458   __Pyx_XDECREF(__pyx_t_4);
17459   __Pyx_XDECREF(__pyx_t_5);
17460   __Pyx_XDECREF(__pyx_t_6);
17461   __Pyx_XDECREF(__pyx_t_7);
17462   __Pyx_XDECREF(__pyx_t_9);
17463   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
17464   __pyx_r = 0;
17465   __pyx_L0:;
17466   __Pyx_XDECREF(__pyx_v_chrom);
17467   __Pyx_XDECREF((PyObject *)__pyx_v_pos);
17468   __Pyx_XDECREF((PyObject *)__pyx_v_sample);
17469   __Pyx_XDECREF((PyObject *)__pyx_v_control);
17470   __Pyx_XDECREF((PyObject *)__pyx_v_value);
17471   __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff);
17472   __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff_v);
17473   __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff_endpos);
17474   __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff_startpos);
17475   __Pyx_XDECREF((PyObject *)__pyx_v_above_cutoff_sv);
17476   __Pyx_XDECREF(__pyx_v_peak_content);
17477   __Pyx_XDECREF(__pyx_v_chrs);
17478   __Pyx_XDECREF(__pyx_v_peaks);
17479   __Pyx_XGIVEREF(__pyx_r);
17480   __Pyx_TraceReturn(__pyx_r, 0);
17481   __Pyx_RefNannyFinishContext();
17482   return __pyx_r;
17483 }
17484 
17485 /* Python wrapper */
17486 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_25call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17487 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_24call_peaks[] = "This function try to find regions within which, scores\n        are continuously higher than a given cutoff.\n\n        This function is NOT using sliding-windows. Instead, any\n        regions in bedGraph above certain cutoff will be detected,\n        then merged if the gap between nearby two regions are below\n        max_gap. After this, peak is reported if its length is above\n        min_length.\n\n        cutoff:  cutoff of value, default 5. For -log10pvalue, it means 10^-5.\n        min_length :  minimum peak length, default 200.\n        gap   :  maximum gap to merge nearby peaks, default 50.\n        ptrack:  an optional track for pileup heights. If it's not None, use it to find summits. Otherwise, use self/scoreTrack.\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_25call_peaks(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)17488 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_25call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17489   __pyx_t_5numpy_float64_t __pyx_v_cutoff;
17490   __pyx_t_5numpy_int32_t __pyx_v_min_length;
17491   __pyx_t_5numpy_int32_t __pyx_v_max_gap;
17492   PyBoolObject *__pyx_v_call_summits = 0;
17493   PyObject *__pyx_r = 0;
17494   __Pyx_RefNannyDeclarations
17495   __Pyx_RefNannySetupContext("call_peaks (wrapper)", 0);
17496   {
17497     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cutoff,&__pyx_n_s_min_length,&__pyx_n_s_max_gap,&__pyx_n_s_call_summits,0};
17498     PyObject* values[4] = {0,0,0,0};
17499     values[3] = (PyObject *)((PyBoolObject *)Py_False);
17500     if (unlikely(__pyx_kwds)) {
17501       Py_ssize_t kw_args;
17502       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17503       switch (pos_args) {
17504         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17505         CYTHON_FALLTHROUGH;
17506         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17507         CYTHON_FALLTHROUGH;
17508         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17509         CYTHON_FALLTHROUGH;
17510         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17511         CYTHON_FALLTHROUGH;
17512         case  0: break;
17513         default: goto __pyx_L5_argtuple_error;
17514       }
17515       kw_args = PyDict_Size(__pyx_kwds);
17516       switch (pos_args) {
17517         case  0:
17518         if (kw_args > 0) {
17519           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff);
17520           if (value) { values[0] = value; kw_args--; }
17521         }
17522         CYTHON_FALLTHROUGH;
17523         case  1:
17524         if (kw_args > 0) {
17525           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_length);
17526           if (value) { values[1] = value; kw_args--; }
17527         }
17528         CYTHON_FALLTHROUGH;
17529         case  2:
17530         if (kw_args > 0) {
17531           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_gap);
17532           if (value) { values[2] = value; kw_args--; }
17533         }
17534         CYTHON_FALLTHROUGH;
17535         case  3:
17536         if (kw_args > 0) {
17537           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_call_summits);
17538           if (value) { values[3] = value; kw_args--; }
17539         }
17540       }
17541       if (unlikely(kw_args > 0)) {
17542         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "call_peaks") < 0)) __PYX_ERR(0, 978, __pyx_L3_error)
17543       }
17544     } else {
17545       switch (PyTuple_GET_SIZE(__pyx_args)) {
17546         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17547         CYTHON_FALLTHROUGH;
17548         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17549         CYTHON_FALLTHROUGH;
17550         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17551         CYTHON_FALLTHROUGH;
17552         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17553         CYTHON_FALLTHROUGH;
17554         case  0: break;
17555         default: goto __pyx_L5_argtuple_error;
17556       }
17557     }
17558     if (values[0]) {
17559       __pyx_v_cutoff = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_cutoff == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 978, __pyx_L3_error)
17560     } else {
17561       __pyx_v_cutoff = ((__pyx_t_5numpy_float64_t)5.0);
17562     }
17563     if (values[1]) {
17564       __pyx_v_min_length = __Pyx_PyInt_As_npy_int32(values[1]); if (unlikely((__pyx_v_min_length == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 978, __pyx_L3_error)
17565     } else {
17566       __pyx_v_min_length = ((__pyx_t_5numpy_int32_t)0xC8);
17567     }
17568     if (values[2]) {
17569       __pyx_v_max_gap = __Pyx_PyInt_As_npy_int32(values[2]); if (unlikely((__pyx_v_max_gap == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 978, __pyx_L3_error)
17570     } else {
17571       __pyx_v_max_gap = ((__pyx_t_5numpy_int32_t)50);
17572     }
17573     __pyx_v_call_summits = ((PyBoolObject *)values[3]);
17574   }
17575   goto __pyx_L4_argument_unpacking_done;
17576   __pyx_L5_argtuple_error:;
17577   __Pyx_RaiseArgtupleInvalid("call_peaks", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 978, __pyx_L3_error)
17578   __pyx_L3_error:;
17579   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
17580   __Pyx_RefNannyFinishContext();
17581   return NULL;
17582   __pyx_L4_argument_unpacking_done:;
17583   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_call_summits), __pyx_ptype_7cpython_4bool_bool, 1, "call_summits", 0))) __PYX_ERR(0, 978, __pyx_L1_error)
17584   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_24call_peaks(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_min_length, __pyx_v_max_gap, __pyx_v_call_summits);
17585 
17586   /* function exit code */
17587   goto __pyx_L0;
17588   __pyx_L1_error:;
17589   __pyx_r = NULL;
17590   __pyx_L0:;
17591   __Pyx_RefNannyFinishContext();
17592   return __pyx_r;
17593 }
17594 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_24call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,__pyx_t_5numpy_float64_t __pyx_v_cutoff,__pyx_t_5numpy_int32_t __pyx_v_min_length,__pyx_t_5numpy_int32_t __pyx_v_max_gap,PyBoolObject * __pyx_v_call_summits)17595 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_24call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_cutoff, __pyx_t_5numpy_int32_t __pyx_v_min_length, __pyx_t_5numpy_int32_t __pyx_v_max_gap, PyBoolObject *__pyx_v_call_summits) {
17596   PyObject *__pyx_r = NULL;
17597   __Pyx_TraceDeclarations
17598   __Pyx_RefNannyDeclarations
17599   PyObject *__pyx_t_1 = NULL;
17600   struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks __pyx_t_2;
17601   __Pyx_RefNannySetupContext("call_peaks", 0);
17602   __Pyx_TraceCall("call_peaks (wrapper)", __pyx_f[0], 978, 0, __PYX_ERR(0, 978, __pyx_L1_error));
17603   __Pyx_XDECREF(__pyx_r);
17604   __pyx_t_2.__pyx_n = 4;
17605   __pyx_t_2.cutoff = __pyx_v_cutoff;
17606   __pyx_t_2.min_length = __pyx_v_min_length;
17607   __pyx_t_2.max_gap = __pyx_v_max_gap;
17608   __pyx_t_2.call_summits = __pyx_v_call_summits;
17609   __pyx_t_1 = __pyx_vtabptr_5MACS2_2IO_10ScoreTrack_scoreTrackII->call_peaks(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
17610   __Pyx_GOTREF(__pyx_t_1);
17611   __pyx_r = __pyx_t_1;
17612   __pyx_t_1 = 0;
17613   goto __pyx_L0;
17614 
17615   /* function exit code */
17616   __pyx_L1_error:;
17617   __Pyx_XDECREF(__pyx_t_1);
17618   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
17619   __pyx_r = NULL;
17620   __pyx_L0:;
17621   __Pyx_XGIVEREF(__pyx_r);
17622   __Pyx_TraceReturn(__pyx_r, 0);
17623   __Pyx_RefNannyFinishContext();
17624   return __pyx_r;
17625 }
17626 
17627 /* "MACS2/IO/ScoreTrack.pyx":1051
17628  *         return peaks
17629  *
17630  *     cdef bool __close_peak (self, list peak_content, peaks, int32_t min_length,             # <<<<<<<<<<<<<<
17631  *                             bytes chrom, int32_t smoothlen=0):
17632  *         """Close the peak region, output peak boundaries, peak summit
17633  */
17634 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v_peak_content,PyObject * __pyx_v_peaks,__pyx_t_5numpy_int32_t __pyx_v_min_length,PyObject * __pyx_v_chrom,struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak * __pyx_optional_args)17635 static PyBoolObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_peak_content, PyObject *__pyx_v_peaks, __pyx_t_5numpy_int32_t __pyx_v_min_length, PyObject *__pyx_v_chrom, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak *__pyx_optional_args) {
17636   __pyx_t_5numpy_int32_t __pyx_v_summit_pos;
17637   __pyx_t_5numpy_int32_t __pyx_v_tstart;
17638   __pyx_t_5numpy_int32_t __pyx_v_tend;
17639   __pyx_t_5numpy_int32_t __pyx_v_summit_index;
17640   __pyx_t_5numpy_int32_t __pyx_v_i;
17641   __pyx_t_5numpy_int32_t __pyx_v_midindex;
17642   __pyx_t_5numpy_float64_t __pyx_v_summit_value;
17643   CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_tvalue;
17644   __pyx_t_5numpy_float64_t __pyx_v_tsummitvalue;
17645   PyObject *__pyx_v_peak_length = NULL;
17646   PyObject *__pyx_v_tsummit = NULL;
17647   PyObject *__pyx_v_tindex = NULL;
17648   PyObject *__pyx_v_tsummit_index = NULL;
17649   PyObject *__pyx_v_qscore = NULL;
17650   PyBoolObject *__pyx_r = NULL;
17651   __Pyx_TraceDeclarations
17652   __Pyx_RefNannyDeclarations
17653   PyObject *__pyx_t_1 = NULL;
17654   PyObject *__pyx_t_2 = NULL;
17655   PyObject *__pyx_t_3 = NULL;
17656   int __pyx_t_4;
17657   Py_ssize_t __pyx_t_5;
17658   Py_ssize_t __pyx_t_6;
17659   __pyx_t_5numpy_int32_t __pyx_t_7;
17660   PyObject *__pyx_t_8 = NULL;
17661   PyObject *__pyx_t_9 = NULL;
17662   PyObject *__pyx_t_10 = NULL;
17663   PyObject *__pyx_t_11 = NULL;
17664   PyObject *(*__pyx_t_12)(PyObject *);
17665   __pyx_t_5numpy_int32_t __pyx_t_13;
17666   __pyx_t_5numpy_int32_t __pyx_t_14;
17667   __pyx_t_5numpy_float64_t __pyx_t_15;
17668   __pyx_t_5numpy_float64_t __pyx_t_16;
17669   int __pyx_t_17;
17670   int __pyx_t_18;
17671   __Pyx_RefNannySetupContext("__close_peak", 0);
17672   __Pyx_TraceCall("__close_peak", __pyx_f[0], 1051, 0, __PYX_ERR(0, 1051, __pyx_L1_error));
17673   if (__pyx_optional_args) {
17674   }
17675 
17676   /* "MACS2/IO/ScoreTrack.pyx":1063
17677  *             float64_t summit_value, tvalue, tsummitvalue
17678  *
17679  *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]             # <<<<<<<<<<<<<<
17680  *         if peak_length >= min_length: # if the peak is too small, reject it
17681  *             tsummit = []
17682  */
17683   if (unlikely(__pyx_v_peak_content == Py_None)) {
17684     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17685     __PYX_ERR(0, 1063, __pyx_L1_error)
17686   }
17687   __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_peak_content, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error)
17688   __Pyx_GOTREF(__pyx_t_1);
17689   __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
17690   __Pyx_GOTREF(__pyx_t_2);
17691   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17692   if (unlikely(__pyx_v_peak_content == Py_None)) {
17693     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17694     __PYX_ERR(0, 1063, __pyx_L1_error)
17695   }
17696   __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_peak_content, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error)
17697   __Pyx_GOTREF(__pyx_t_1);
17698   __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error)
17699   __Pyx_GOTREF(__pyx_t_3);
17700   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17701   __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error)
17702   __Pyx_GOTREF(__pyx_t_1);
17703   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17704   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17705   __pyx_v_peak_length = __pyx_t_1;
17706   __pyx_t_1 = 0;
17707 
17708   /* "MACS2/IO/ScoreTrack.pyx":1064
17709  *
17710  *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
17711  *         if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
17712  *             tsummit = []
17713  *             summit_pos   = 0
17714  */
17715   __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_min_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error)
17716   __Pyx_GOTREF(__pyx_t_1);
17717   __pyx_t_3 = PyObject_RichCompare(__pyx_v_peak_length, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error)
17718   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17719   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1064, __pyx_L1_error)
17720   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17721   if (__pyx_t_4) {
17722 
17723     /* "MACS2/IO/ScoreTrack.pyx":1065
17724  *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
17725  *         if peak_length >= min_length: # if the peak is too small, reject it
17726  *             tsummit = []             # <<<<<<<<<<<<<<
17727  *             summit_pos   = 0
17728  *             summit_value = 0
17729  */
17730     __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error)
17731     __Pyx_GOTREF(__pyx_t_3);
17732     __pyx_v_tsummit = ((PyObject*)__pyx_t_3);
17733     __pyx_t_3 = 0;
17734 
17735     /* "MACS2/IO/ScoreTrack.pyx":1066
17736  *         if peak_length >= min_length: # if the peak is too small, reject it
17737  *             tsummit = []
17738  *             summit_pos   = 0             # <<<<<<<<<<<<<<
17739  *             summit_value = 0
17740  *             for i in range(len(peak_content)):
17741  */
17742     __pyx_v_summit_pos = 0;
17743 
17744     /* "MACS2/IO/ScoreTrack.pyx":1067
17745  *             tsummit = []
17746  *             summit_pos   = 0
17747  *             summit_value = 0             # <<<<<<<<<<<<<<
17748  *             for i in range(len(peak_content)):
17749  *                 (tstart,tend,tvalue,tsummitvalue, tindex) = peak_content[i]
17750  */
17751     __pyx_v_summit_value = 0.0;
17752 
17753     /* "MACS2/IO/ScoreTrack.pyx":1068
17754  *             summit_pos   = 0
17755  *             summit_value = 0
17756  *             for i in range(len(peak_content)):             # <<<<<<<<<<<<<<
17757  *                 (tstart,tend,tvalue,tsummitvalue, tindex) = peak_content[i]
17758  *                 #for (tstart,tend,tvalue,tsummitvalue, tindex) in peak_content:
17759  */
17760     if (unlikely(__pyx_v_peak_content == Py_None)) {
17761       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
17762       __PYX_ERR(0, 1068, __pyx_L1_error)
17763     }
17764     __pyx_t_5 = PyList_GET_SIZE(__pyx_v_peak_content); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1068, __pyx_L1_error)
17765     __pyx_t_6 = __pyx_t_5;
17766     for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17767       __pyx_v_i = __pyx_t_7;
17768 
17769       /* "MACS2/IO/ScoreTrack.pyx":1069
17770  *             summit_value = 0
17771  *             for i in range(len(peak_content)):
17772  *                 (tstart,tend,tvalue,tsummitvalue, tindex) = peak_content[i]             # <<<<<<<<<<<<<<
17773  *                 #for (tstart,tend,tvalue,tsummitvalue, tindex) in peak_content:
17774  *                 if not summit_value or summit_value < tsummitvalue:
17775  */
17776       if (unlikely(__pyx_v_peak_content == Py_None)) {
17777         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17778         __PYX_ERR(0, 1069, __pyx_L1_error)
17779       }
17780       __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_peak_content, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1069, __pyx_L1_error)
17781       __Pyx_GOTREF(__pyx_t_3);
17782       if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
17783         PyObject* sequence = __pyx_t_3;
17784         Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
17785         if (unlikely(size != 5)) {
17786           if (size > 5) __Pyx_RaiseTooManyValuesError(5);
17787           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
17788           __PYX_ERR(0, 1069, __pyx_L1_error)
17789         }
17790         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17791         if (likely(PyTuple_CheckExact(sequence))) {
17792           __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
17793           __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
17794           __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
17795           __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3);
17796           __pyx_t_10 = PyTuple_GET_ITEM(sequence, 4);
17797         } else {
17798           __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
17799           __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
17800           __pyx_t_8 = PyList_GET_ITEM(sequence, 2);
17801           __pyx_t_9 = PyList_GET_ITEM(sequence, 3);
17802           __pyx_t_10 = PyList_GET_ITEM(sequence, 4);
17803         }
17804         __Pyx_INCREF(__pyx_t_1);
17805         __Pyx_INCREF(__pyx_t_2);
17806         __Pyx_INCREF(__pyx_t_8);
17807         __Pyx_INCREF(__pyx_t_9);
17808         __Pyx_INCREF(__pyx_t_10);
17809         #else
17810         {
17811           Py_ssize_t i;
17812           PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
17813           for (i=0; i < 5; i++) {
17814             PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1069, __pyx_L1_error)
17815             __Pyx_GOTREF(item);
17816             *(temps[i]) = item;
17817           }
17818         }
17819         #endif
17820         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17821       } else {
17822         Py_ssize_t index = -1;
17823         PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
17824         __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1069, __pyx_L1_error)
17825         __Pyx_GOTREF(__pyx_t_11);
17826         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17827         __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
17828         for (index=0; index < 5; index++) {
17829           PyObject* item = __pyx_t_12(__pyx_t_11); if (unlikely(!item)) goto __pyx_L6_unpacking_failed;
17830           __Pyx_GOTREF(item);
17831           *(temps[index]) = item;
17832         }
17833         if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 5) < 0) __PYX_ERR(0, 1069, __pyx_L1_error)
17834         __pyx_t_12 = NULL;
17835         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
17836         goto __pyx_L7_unpacking_done;
17837         __pyx_L6_unpacking_failed:;
17838         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
17839         __pyx_t_12 = NULL;
17840         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
17841         __PYX_ERR(0, 1069, __pyx_L1_error)
17842         __pyx_L7_unpacking_done:;
17843       }
17844       __pyx_t_13 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_13 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1069, __pyx_L1_error)
17845       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17846       __pyx_t_14 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_14 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1069, __pyx_L1_error)
17847       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17848       __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1069, __pyx_L1_error)
17849       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17850       __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_16 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1069, __pyx_L1_error)
17851       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17852       __pyx_v_tstart = __pyx_t_13;
17853       __pyx_v_tend = __pyx_t_14;
17854       __pyx_v_tvalue = __pyx_t_15;
17855       __pyx_v_tsummitvalue = __pyx_t_16;
17856       __Pyx_XDECREF_SET(__pyx_v_tindex, __pyx_t_10);
17857       __pyx_t_10 = 0;
17858 
17859       /* "MACS2/IO/ScoreTrack.pyx":1071
17860  *                 (tstart,tend,tvalue,tsummitvalue, tindex) = peak_content[i]
17861  *                 #for (tstart,tend,tvalue,tsummitvalue, tindex) in peak_content:
17862  *                 if not summit_value or summit_value < tsummitvalue:             # <<<<<<<<<<<<<<
17863  *                     tsummit = [(tend + tstart) / 2, ]
17864  *                     tsummit_index = [ tindex, ]
17865  */
17866       __pyx_t_17 = ((!(__pyx_v_summit_value != 0)) != 0);
17867       if (!__pyx_t_17) {
17868       } else {
17869         __pyx_t_4 = __pyx_t_17;
17870         goto __pyx_L9_bool_binop_done;
17871       }
17872       __pyx_t_17 = ((__pyx_v_summit_value < __pyx_v_tsummitvalue) != 0);
17873       __pyx_t_4 = __pyx_t_17;
17874       __pyx_L9_bool_binop_done:;
17875       if (__pyx_t_4) {
17876 
17877         /* "MACS2/IO/ScoreTrack.pyx":1072
17878  *                 #for (tstart,tend,tvalue,tsummitvalue, tindex) in peak_content:
17879  *                 if not summit_value or summit_value < tsummitvalue:
17880  *                     tsummit = [(tend + tstart) / 2, ]             # <<<<<<<<<<<<<<
17881  *                     tsummit_index = [ tindex, ]
17882  *                     summit_value = tsummitvalue
17883  */
17884         __pyx_t_3 = PyFloat_FromDouble((((double)(__pyx_v_tend + __pyx_v_tstart)) / 2.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error)
17885         __Pyx_GOTREF(__pyx_t_3);
17886         __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1072, __pyx_L1_error)
17887         __Pyx_GOTREF(__pyx_t_10);
17888         __Pyx_GIVEREF(__pyx_t_3);
17889         PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
17890         __pyx_t_3 = 0;
17891         __Pyx_DECREF_SET(__pyx_v_tsummit, ((PyObject*)__pyx_t_10));
17892         __pyx_t_10 = 0;
17893 
17894         /* "MACS2/IO/ScoreTrack.pyx":1073
17895  *                 if not summit_value or summit_value < tsummitvalue:
17896  *                     tsummit = [(tend + tstart) / 2, ]
17897  *                     tsummit_index = [ tindex, ]             # <<<<<<<<<<<<<<
17898  *                     summit_value = tsummitvalue
17899  *                 elif summit_value == tsummitvalue:
17900  */
17901         __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1073, __pyx_L1_error)
17902         __Pyx_GOTREF(__pyx_t_10);
17903         __Pyx_INCREF(__pyx_v_tindex);
17904         __Pyx_GIVEREF(__pyx_v_tindex);
17905         PyList_SET_ITEM(__pyx_t_10, 0, __pyx_v_tindex);
17906         __Pyx_XDECREF_SET(__pyx_v_tsummit_index, ((PyObject*)__pyx_t_10));
17907         __pyx_t_10 = 0;
17908 
17909         /* "MACS2/IO/ScoreTrack.pyx":1074
17910  *                     tsummit = [(tend + tstart) / 2, ]
17911  *                     tsummit_index = [ tindex, ]
17912  *                     summit_value = tsummitvalue             # <<<<<<<<<<<<<<
17913  *                 elif summit_value == tsummitvalue:
17914  *                     # remember continuous summit values
17915  */
17916         __pyx_v_summit_value = __pyx_v_tsummitvalue;
17917 
17918         /* "MACS2/IO/ScoreTrack.pyx":1071
17919  *                 (tstart,tend,tvalue,tsummitvalue, tindex) = peak_content[i]
17920  *                 #for (tstart,tend,tvalue,tsummitvalue, tindex) in peak_content:
17921  *                 if not summit_value or summit_value < tsummitvalue:             # <<<<<<<<<<<<<<
17922  *                     tsummit = [(tend + tstart) / 2, ]
17923  *                     tsummit_index = [ tindex, ]
17924  */
17925         goto __pyx_L8;
17926       }
17927 
17928       /* "MACS2/IO/ScoreTrack.pyx":1075
17929  *                     tsummit_index = [ tindex, ]
17930  *                     summit_value = tsummitvalue
17931  *                 elif summit_value == tsummitvalue:             # <<<<<<<<<<<<<<
17932  *                     # remember continuous summit values
17933  *                     tsummit.append(int((tend + tstart) / 2))
17934  */
17935       __pyx_t_4 = ((__pyx_v_summit_value == __pyx_v_tsummitvalue) != 0);
17936       if (__pyx_t_4) {
17937 
17938         /* "MACS2/IO/ScoreTrack.pyx":1077
17939  *                 elif summit_value == tsummitvalue:
17940  *                     # remember continuous summit values
17941  *                     tsummit.append(int((tend + tstart) / 2))             # <<<<<<<<<<<<<<
17942  *                     tsummit_index.append( tindex )
17943  *             # the middle of all highest points in peak region is defined as summit
17944  */
17945         __pyx_t_10 = __Pyx_PyInt_FromDouble((((double)(__pyx_v_tend + __pyx_v_tstart)) / 2.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1077, __pyx_L1_error)
17946         __Pyx_GOTREF(__pyx_t_10);
17947         __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_tsummit, __pyx_t_10); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1077, __pyx_L1_error)
17948         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17949 
17950         /* "MACS2/IO/ScoreTrack.pyx":1078
17951  *                     # remember continuous summit values
17952  *                     tsummit.append(int((tend + tstart) / 2))
17953  *                     tsummit_index.append( tindex )             # <<<<<<<<<<<<<<
17954  *             # the middle of all highest points in peak region is defined as summit
17955  *             midindex = int((len(tsummit) + 1) / 2) - 1
17956  */
17957         if (unlikely(!__pyx_v_tsummit_index)) { __Pyx_RaiseUnboundLocalError("tsummit_index"); __PYX_ERR(0, 1078, __pyx_L1_error) }
17958         __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_tsummit_index, __pyx_v_tindex); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1078, __pyx_L1_error)
17959 
17960         /* "MACS2/IO/ScoreTrack.pyx":1075
17961  *                     tsummit_index = [ tindex, ]
17962  *                     summit_value = tsummitvalue
17963  *                 elif summit_value == tsummitvalue:             # <<<<<<<<<<<<<<
17964  *                     # remember continuous summit values
17965  *                     tsummit.append(int((tend + tstart) / 2))
17966  */
17967       }
17968       __pyx_L8:;
17969     }
17970 
17971     /* "MACS2/IO/ScoreTrack.pyx":1080
17972  *                     tsummit_index.append( tindex )
17973  *             # the middle of all highest points in peak region is defined as summit
17974  *             midindex = int((len(tsummit) + 1) / 2) - 1             # <<<<<<<<<<<<<<
17975  *             summit_pos    = tsummit[ midindex ]
17976  *             summit_index  = tsummit_index[ midindex ]
17977  */
17978     __pyx_t_5 = PyList_GET_SIZE(__pyx_v_tsummit); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1080, __pyx_L1_error)
17979     __pyx_t_10 = __Pyx_PyInt_FromDouble((((double)(__pyx_t_5 + 1)) / 2.0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1080, __pyx_L1_error)
17980     __Pyx_GOTREF(__pyx_t_10);
17981     __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1080, __pyx_L1_error)
17982     __Pyx_GOTREF(__pyx_t_3);
17983     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17984     __pyx_t_7 = __Pyx_PyInt_As_npy_int32(__pyx_t_3); if (unlikely((__pyx_t_7 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error)
17985     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17986     __pyx_v_midindex = __pyx_t_7;
17987 
17988     /* "MACS2/IO/ScoreTrack.pyx":1081
17989  *             # the middle of all highest points in peak region is defined as summit
17990  *             midindex = int((len(tsummit) + 1) / 2) - 1
17991  *             summit_pos    = tsummit[ midindex ]             # <<<<<<<<<<<<<<
17992  *             summit_index  = tsummit_index[ midindex ]
17993  *             if self.scoring_method == ord('q'):
17994  */
17995     __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_tsummit, __pyx_v_midindex, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1081, __pyx_L1_error)
17996     __Pyx_GOTREF(__pyx_t_3);
17997     __pyx_t_7 = __Pyx_PyInt_As_npy_int32(__pyx_t_3); if (unlikely((__pyx_t_7 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1081, __pyx_L1_error)
17998     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17999     __pyx_v_summit_pos = __pyx_t_7;
18000 
18001     /* "MACS2/IO/ScoreTrack.pyx":1082
18002  *             midindex = int((len(tsummit) + 1) / 2) - 1
18003  *             summit_pos    = tsummit[ midindex ]
18004  *             summit_index  = tsummit_index[ midindex ]             # <<<<<<<<<<<<<<
18005  *             if self.scoring_method == ord('q'):
18006  *                 qscore = self.data[chrom][3][ summit_index ]
18007  */
18008     if (unlikely(!__pyx_v_tsummit_index)) { __Pyx_RaiseUnboundLocalError("tsummit_index"); __PYX_ERR(0, 1082, __pyx_L1_error) }
18009     __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_tsummit_index, __pyx_v_midindex, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1082, __pyx_L1_error)
18010     __Pyx_GOTREF(__pyx_t_3);
18011     __pyx_t_7 = __Pyx_PyInt_As_npy_int32(__pyx_t_3); if (unlikely((__pyx_t_7 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1082, __pyx_L1_error)
18012     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18013     __pyx_v_summit_index = __pyx_t_7;
18014 
18015     /* "MACS2/IO/ScoreTrack.pyx":1083
18016  *             summit_pos    = tsummit[ midindex ]
18017  *             summit_index  = tsummit_index[ midindex ]
18018  *             if self.scoring_method == ord('q'):             # <<<<<<<<<<<<<<
18019  *                 qscore = self.data[chrom][3][ summit_index ]
18020  *             else:
18021  */
18022     __pyx_t_4 = ((__pyx_v_self->scoring_method == 0x71) != 0);
18023     if (__pyx_t_4) {
18024 
18025       /* "MACS2/IO/ScoreTrack.pyx":1084
18026  *             summit_index  = tsummit_index[ midindex ]
18027  *             if self.scoring_method == ord('q'):
18028  *                 qscore = self.data[chrom][3][ summit_index ]             # <<<<<<<<<<<<<<
18029  *             else:
18030  *                 # if q value is not computed, use -1
18031  */
18032       if (unlikely(__pyx_v_self->data == Py_None)) {
18033         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18034         __PYX_ERR(0, 1084, __pyx_L1_error)
18035       }
18036       __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error)
18037       __Pyx_GOTREF(__pyx_t_3);
18038       __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_3, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1084, __pyx_L1_error)
18039       __Pyx_GOTREF(__pyx_t_10);
18040       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18041       __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_10, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error)
18042       __Pyx_GOTREF(__pyx_t_3);
18043       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18044       __pyx_v_qscore = __pyx_t_3;
18045       __pyx_t_3 = 0;
18046 
18047       /* "MACS2/IO/ScoreTrack.pyx":1083
18048  *             summit_pos    = tsummit[ midindex ]
18049  *             summit_index  = tsummit_index[ midindex ]
18050  *             if self.scoring_method == ord('q'):             # <<<<<<<<<<<<<<
18051  *                 qscore = self.data[chrom][3][ summit_index ]
18052  *             else:
18053  */
18054       goto __pyx_L11;
18055     }
18056 
18057     /* "MACS2/IO/ScoreTrack.pyx":1087
18058  *             else:
18059  *                 # if q value is not computed, use -1
18060  *                 qscore = -1             # <<<<<<<<<<<<<<
18061  *
18062  *             peaks.add( chrom,
18063  */
18064     /*else*/ {
18065       __Pyx_INCREF(__pyx_int_neg_1);
18066       __pyx_v_qscore = __pyx_int_neg_1;
18067     }
18068     __pyx_L11:;
18069 
18070     /* "MACS2/IO/ScoreTrack.pyx":1089
18071  *                 qscore = -1
18072  *
18073  *             peaks.add( chrom,             # <<<<<<<<<<<<<<
18074  *                        peak_content[0][0],
18075  *                        peak_content[-1][1],
18076  */
18077     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_peaks, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1089, __pyx_L1_error)
18078     __Pyx_GOTREF(__pyx_t_3);
18079 
18080     /* "MACS2/IO/ScoreTrack.pyx":1090
18081  *
18082  *             peaks.add( chrom,
18083  *                        peak_content[0][0],             # <<<<<<<<<<<<<<
18084  *                        peak_content[-1][1],
18085  *                        summit      = summit_pos,
18086  */
18087     if (unlikely(__pyx_v_peak_content == Py_None)) {
18088       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18089       __PYX_ERR(0, 1090, __pyx_L1_error)
18090     }
18091     __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_peak_content, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1090, __pyx_L1_error)
18092     __Pyx_GOTREF(__pyx_t_10);
18093     __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1090, __pyx_L1_error)
18094     __Pyx_GOTREF(__pyx_t_9);
18095     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18096 
18097     /* "MACS2/IO/ScoreTrack.pyx":1091
18098  *             peaks.add( chrom,
18099  *                        peak_content[0][0],
18100  *                        peak_content[-1][1],             # <<<<<<<<<<<<<<
18101  *                        summit      = summit_pos,
18102  *                        peak_score  = self.data[chrom][ 3 ][ summit_index ],
18103  */
18104     if (unlikely(__pyx_v_peak_content == Py_None)) {
18105       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18106       __PYX_ERR(0, 1091, __pyx_L1_error)
18107     }
18108     __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_peak_content, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1091, __pyx_L1_error)
18109     __Pyx_GOTREF(__pyx_t_10);
18110     __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1091, __pyx_L1_error)
18111     __Pyx_GOTREF(__pyx_t_8);
18112     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18113 
18114     /* "MACS2/IO/ScoreTrack.pyx":1089
18115  *                 qscore = -1
18116  *
18117  *             peaks.add( chrom,             # <<<<<<<<<<<<<<
18118  *                        peak_content[0][0],
18119  *                        peak_content[-1][1],
18120  */
18121     __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1089, __pyx_L1_error)
18122     __Pyx_GOTREF(__pyx_t_10);
18123     __Pyx_INCREF(__pyx_v_chrom);
18124     __Pyx_GIVEREF(__pyx_v_chrom);
18125     PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_chrom);
18126     __Pyx_GIVEREF(__pyx_t_9);
18127     PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
18128     __Pyx_GIVEREF(__pyx_t_8);
18129     PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8);
18130     __pyx_t_9 = 0;
18131     __pyx_t_8 = 0;
18132 
18133     /* "MACS2/IO/ScoreTrack.pyx":1092
18134  *                        peak_content[0][0],
18135  *                        peak_content[-1][1],
18136  *                        summit      = summit_pos,             # <<<<<<<<<<<<<<
18137  *                        peak_score  = self.data[chrom][ 3 ][ summit_index ],
18138  *                        pileup      = self.data[chrom][ 1 ][ summit_index ], # should be the same as summit_value
18139  */
18140     __pyx_t_8 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1092, __pyx_L1_error)
18141     __Pyx_GOTREF(__pyx_t_8);
18142     __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__pyx_v_summit_pos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1092, __pyx_L1_error)
18143     __Pyx_GOTREF(__pyx_t_9);
18144     if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_summit, __pyx_t_9) < 0) __PYX_ERR(0, 1092, __pyx_L1_error)
18145     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18146 
18147     /* "MACS2/IO/ScoreTrack.pyx":1093
18148  *                        peak_content[-1][1],
18149  *                        summit      = summit_pos,
18150  *                        peak_score  = self.data[chrom][ 3 ][ summit_index ],             # <<<<<<<<<<<<<<
18151  *                        pileup      = self.data[chrom][ 1 ][ summit_index ], # should be the same as summit_value
18152  *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
18153  */
18154     if (unlikely(__pyx_v_self->data == Py_None)) {
18155       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18156       __PYX_ERR(0, 1093, __pyx_L1_error)
18157     }
18158     __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1093, __pyx_L1_error)
18159     __Pyx_GOTREF(__pyx_t_9);
18160     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __pyx_L1_error)
18161     __Pyx_GOTREF(__pyx_t_2);
18162     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18163     __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1093, __pyx_L1_error)
18164     __Pyx_GOTREF(__pyx_t_9);
18165     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18166     if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_peak_score, __pyx_t_9) < 0) __PYX_ERR(0, 1092, __pyx_L1_error)
18167     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18168 
18169     /* "MACS2/IO/ScoreTrack.pyx":1094
18170  *                        summit      = summit_pos,
18171  *                        peak_score  = self.data[chrom][ 3 ][ summit_index ],
18172  *                        pileup      = self.data[chrom][ 1 ][ summit_index ], # should be the same as summit_value             # <<<<<<<<<<<<<<
18173  *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
18174  *                        fold_change = ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
18175  */
18176     if (unlikely(__pyx_v_self->data == Py_None)) {
18177       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18178       __PYX_ERR(0, 1094, __pyx_L1_error)
18179     }
18180     __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1094, __pyx_L1_error)
18181     __Pyx_GOTREF(__pyx_t_9);
18182     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error)
18183     __Pyx_GOTREF(__pyx_t_2);
18184     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18185     __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1094, __pyx_L1_error)
18186     __Pyx_GOTREF(__pyx_t_9);
18187     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18188     if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_pileup, __pyx_t_9) < 0) __PYX_ERR(0, 1092, __pyx_L1_error)
18189     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18190 
18191     /* "MACS2/IO/ScoreTrack.pyx":1095
18192  *                        peak_score  = self.data[chrom][ 3 ][ summit_index ],
18193  *                        pileup      = self.data[chrom][ 1 ][ summit_index ], # should be the same as summit_value
18194  *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),             # <<<<<<<<<<<<<<
18195  *                        fold_change = ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
18196  *                        qscore      = qscore,
18197  */
18198     if (unlikely(__pyx_v_self->data == Py_None)) {
18199       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18200       __PYX_ERR(0, 1095, __pyx_L1_error)
18201     }
18202     __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
18203     __Pyx_GOTREF(__pyx_t_9);
18204     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error)
18205     __Pyx_GOTREF(__pyx_t_2);
18206     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18207     __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
18208     __Pyx_GOTREF(__pyx_t_9);
18209     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18210     __pyx_t_7 = __Pyx_PyInt_As_npy_int32(__pyx_t_9); if (unlikely((__pyx_t_7 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
18211     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18212     if (unlikely(__pyx_v_self->data == Py_None)) {
18213       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18214       __PYX_ERR(0, 1095, __pyx_L1_error)
18215     }
18216     __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
18217     __Pyx_GOTREF(__pyx_t_9);
18218     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error)
18219     __Pyx_GOTREF(__pyx_t_2);
18220     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18221     __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
18222     __Pyx_GOTREF(__pyx_t_9);
18223     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18224     __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_16 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
18225     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18226     __pyx_t_9 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_10ScoreTrack_get_pscore(__pyx_t_7, __pyx_t_16)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
18227     __Pyx_GOTREF(__pyx_t_9);
18228     if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_pscore, __pyx_t_9) < 0) __PYX_ERR(0, 1092, __pyx_L1_error)
18229     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18230 
18231     /* "MACS2/IO/ScoreTrack.pyx":1096
18232  *                        pileup      = self.data[chrom][ 1 ][ summit_index ], # should be the same as summit_value
18233  *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
18234  *                        fold_change = ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),             # <<<<<<<<<<<<<<
18235  *                        qscore      = qscore,
18236  *                        )
18237  */
18238     if (unlikely(__pyx_v_self->data == Py_None)) {
18239       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18240       __PYX_ERR(0, 1096, __pyx_L1_error)
18241     }
18242     __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1096, __pyx_L1_error)
18243     __Pyx_GOTREF(__pyx_t_9);
18244     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error)
18245     __Pyx_GOTREF(__pyx_t_2);
18246     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18247     __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1096, __pyx_L1_error)
18248     __Pyx_GOTREF(__pyx_t_9);
18249     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18250     __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error)
18251     __Pyx_GOTREF(__pyx_t_2);
18252     __pyx_t_1 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error)
18253     __Pyx_GOTREF(__pyx_t_1);
18254     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18255     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18256     if (unlikely(__pyx_v_self->data == Py_None)) {
18257       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18258       __PYX_ERR(0, 1096, __pyx_L1_error)
18259     }
18260     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error)
18261     __Pyx_GOTREF(__pyx_t_2);
18262     __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1096, __pyx_L1_error)
18263     __Pyx_GOTREF(__pyx_t_9);
18264     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18265     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error)
18266     __Pyx_GOTREF(__pyx_t_2);
18267     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18268     __pyx_t_9 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1096, __pyx_L1_error)
18269     __Pyx_GOTREF(__pyx_t_9);
18270     __pyx_t_11 = PyNumber_Add(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1096, __pyx_L1_error)
18271     __Pyx_GOTREF(__pyx_t_11);
18272     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18273     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18274     __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1096, __pyx_L1_error)
18275     __Pyx_GOTREF(__pyx_t_9);
18276     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18277     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
18278     if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_fold_change, __pyx_t_9) < 0) __PYX_ERR(0, 1092, __pyx_L1_error)
18279     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18280 
18281     /* "MACS2/IO/ScoreTrack.pyx":1097
18282  *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
18283  *                        fold_change = ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
18284  *                        qscore      = qscore,             # <<<<<<<<<<<<<<
18285  *                        )
18286  *             # start a new peak
18287  */
18288     if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_qscore, __pyx_v_qscore) < 0) __PYX_ERR(0, 1092, __pyx_L1_error)
18289 
18290     /* "MACS2/IO/ScoreTrack.pyx":1089
18291  *                 qscore = -1
18292  *
18293  *             peaks.add( chrom,             # <<<<<<<<<<<<<<
18294  *                        peak_content[0][0],
18295  *                        peak_content[-1][1],
18296  */
18297     __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1089, __pyx_L1_error)
18298     __Pyx_GOTREF(__pyx_t_9);
18299     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18300     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18301     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18302     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18303 
18304     /* "MACS2/IO/ScoreTrack.pyx":1100
18305  *                        )
18306  *             # start a new peak
18307  *             return True             # <<<<<<<<<<<<<<
18308  *
18309  *     cdef bool __close_peak2 (self, list peak_content, peaks, int32_t min_length,
18310  */
18311     __Pyx_XDECREF(((PyObject *)__pyx_r));
18312     __Pyx_INCREF(Py_True);
18313     __pyx_r = ((PyBoolObject *)Py_True);
18314     goto __pyx_L0;
18315 
18316     /* "MACS2/IO/ScoreTrack.pyx":1064
18317  *
18318  *         peak_length = peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ]
18319  *         if peak_length >= min_length: # if the peak is too small, reject it             # <<<<<<<<<<<<<<
18320  *             tsummit = []
18321  *             summit_pos   = 0
18322  */
18323   }
18324 
18325   /* "MACS2/IO/ScoreTrack.pyx":1051
18326  *         return peaks
18327  *
18328  *     cdef bool __close_peak (self, list peak_content, peaks, int32_t min_length,             # <<<<<<<<<<<<<<
18329  *                             bytes chrom, int32_t smoothlen=0):
18330  *         """Close the peak region, output peak boundaries, peak summit
18331  */
18332 
18333   /* function exit code */
18334   __pyx_r = ((PyBoolObject *)Py_None); __Pyx_INCREF(Py_None);
18335   goto __pyx_L0;
18336   __pyx_L1_error:;
18337   __Pyx_XDECREF(__pyx_t_1);
18338   __Pyx_XDECREF(__pyx_t_2);
18339   __Pyx_XDECREF(__pyx_t_3);
18340   __Pyx_XDECREF(__pyx_t_8);
18341   __Pyx_XDECREF(__pyx_t_9);
18342   __Pyx_XDECREF(__pyx_t_10);
18343   __Pyx_XDECREF(__pyx_t_11);
18344   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.__close_peak", __pyx_clineno, __pyx_lineno, __pyx_filename);
18345   __pyx_r = 0;
18346   __pyx_L0:;
18347   __Pyx_XDECREF(__pyx_v_peak_length);
18348   __Pyx_XDECREF(__pyx_v_tsummit);
18349   __Pyx_XDECREF(__pyx_v_tindex);
18350   __Pyx_XDECREF(__pyx_v_tsummit_index);
18351   __Pyx_XDECREF(__pyx_v_qscore);
18352   __Pyx_XGIVEREF((PyObject *)__pyx_r);
18353   __Pyx_TraceReturn(__pyx_r, 0);
18354   __Pyx_RefNannyFinishContext();
18355   return __pyx_r;
18356 }
18357 
18358 /* "MACS2/IO/ScoreTrack.pyx":1102
18359  *             return True
18360  *
18361  *     cdef bool __close_peak2 (self, list peak_content, peaks, int32_t min_length,             # <<<<<<<<<<<<<<
18362  *                              bytes chrom, int32_t smoothlen=51,
18363  *                              float64_t min_valley = 0.9):
18364  */
18365 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v_peak_content,PyObject * __pyx_v_peaks,__pyx_t_5numpy_int32_t __pyx_v_min_length,PyObject * __pyx_v_chrom,struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2 * __pyx_optional_args)18366 static PyBoolObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_peak_content, PyObject *__pyx_v_peaks, __pyx_t_5numpy_int32_t __pyx_v_min_length, PyObject *__pyx_v_chrom, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2 *__pyx_optional_args) {
18367   __pyx_t_5numpy_int32_t __pyx_v_smoothlen = ((__pyx_t_5numpy_int32_t)51);
18368   __pyx_t_5numpy_int32_t __pyx_v_tstart;
18369   __pyx_t_5numpy_int32_t __pyx_v_tend;
18370   __pyx_t_5numpy_int32_t __pyx_v_tmpindex;
18371   __pyx_t_5numpy_int32_t __pyx_v_summit_index;
18372   __pyx_t_5numpy_int32_t __pyx_v_summit_offset;
18373   __pyx_t_5numpy_int32_t __pyx_v_start;
18374   __pyx_t_5numpy_int32_t __pyx_v_end;
18375   __pyx_t_5numpy_int32_t __pyx_v_i;
18376   __pyx_t_5numpy_int32_t __pyx_v_j;
18377   __pyx_t_5numpy_int32_t __pyx_v_start_boundary;
18378   CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_tvalue;
18379   PyArrayObject *__pyx_v_peakdata = 0;
18380   PyArrayObject *__pyx_v_peakindices = 0;
18381   PyArrayObject *__pyx_v_summit_offsets = 0;
18382   PyObject *__pyx_v_peak_length = NULL;
18383   PyObject *__pyx_v_tsvalue = NULL;
18384   PyObject *__pyx_v_summit_indices = NULL;
18385   PyObject *__pyx_v_peak_scores = NULL;
18386   PyObject *__pyx_v_qscore = NULL;
18387   __Pyx_LocalBuf_ND __pyx_pybuffernd_peakdata;
18388   __Pyx_Buffer __pyx_pybuffer_peakdata;
18389   __Pyx_LocalBuf_ND __pyx_pybuffernd_peakindices;
18390   __Pyx_Buffer __pyx_pybuffer_peakindices;
18391   __Pyx_LocalBuf_ND __pyx_pybuffernd_summit_offsets;
18392   __Pyx_Buffer __pyx_pybuffer_summit_offsets;
18393   PyBoolObject *__pyx_r = NULL;
18394   __Pyx_TraceDeclarations
18395   __Pyx_RefNannyDeclarations
18396   PyObject *__pyx_t_1 = NULL;
18397   PyObject *__pyx_t_2 = NULL;
18398   __pyx_t_5numpy_int32_t __pyx_t_3;
18399   int __pyx_t_4;
18400   PyObject *__pyx_t_5 = NULL;
18401   PyObject *__pyx_t_6 = NULL;
18402   PyArrayObject *__pyx_t_7 = NULL;
18403   int __pyx_t_8;
18404   PyObject *__pyx_t_9 = NULL;
18405   PyObject *__pyx_t_10 = NULL;
18406   PyObject *__pyx_t_11 = NULL;
18407   PyArrayObject *__pyx_t_12 = NULL;
18408   Py_ssize_t __pyx_t_13;
18409   PyObject *__pyx_t_14 = NULL;
18410   PyObject *__pyx_t_15 = NULL;
18411   PyObject *__pyx_t_16 = NULL;
18412   PyObject *__pyx_t_17 = NULL;
18413   PyObject *(*__pyx_t_18)(PyObject *);
18414   __pyx_t_5numpy_int32_t __pyx_t_19;
18415   __pyx_t_5numpy_float64_t __pyx_t_20;
18416   __pyx_t_5numpy_int32_t __pyx_t_21;
18417   int __pyx_t_22;
18418   PyObject *(*__pyx_t_23)(PyObject *);
18419   __Pyx_RefNannySetupContext("__close_peak2", 0);
18420   __Pyx_TraceCall("__close_peak2", __pyx_f[0], 1102, 0, __PYX_ERR(0, 1102, __pyx_L1_error));
18421   if (__pyx_optional_args) {
18422     if (__pyx_optional_args->__pyx_n > 0) {
18423       __pyx_v_smoothlen = __pyx_optional_args->smoothlen;
18424     }
18425   }
18426   __pyx_pybuffer_peakdata.pybuffer.buf = NULL;
18427   __pyx_pybuffer_peakdata.refcount = 0;
18428   __pyx_pybuffernd_peakdata.data = NULL;
18429   __pyx_pybuffernd_peakdata.rcbuffer = &__pyx_pybuffer_peakdata;
18430   __pyx_pybuffer_peakindices.pybuffer.buf = NULL;
18431   __pyx_pybuffer_peakindices.refcount = 0;
18432   __pyx_pybuffernd_peakindices.data = NULL;
18433   __pyx_pybuffernd_peakindices.rcbuffer = &__pyx_pybuffer_peakindices;
18434   __pyx_pybuffer_summit_offsets.pybuffer.buf = NULL;
18435   __pyx_pybuffer_summit_offsets.refcount = 0;
18436   __pyx_pybuffernd_summit_offsets.data = NULL;
18437   __pyx_pybuffernd_summit_offsets.rcbuffer = &__pyx_pybuffer_summit_offsets;
18438 
18439   /* "MACS2/IO/ScoreTrack.pyx":1114
18440  *
18441  *         # Add 10 bp padding to peak region so that we can get true minima
18442  *         end = peak_content[ -1 ][ 1 ] + 10             # <<<<<<<<<<<<<<
18443  *         start = peak_content[ 0 ][ 0 ] - 10
18444  *         if start < 0:
18445  */
18446   if (unlikely(__pyx_v_peak_content == Py_None)) {
18447     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18448     __PYX_ERR(0, 1114, __pyx_L1_error)
18449   }
18450   __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_peak_content, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error)
18451   __Pyx_GOTREF(__pyx_t_1);
18452   __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __pyx_L1_error)
18453   __Pyx_GOTREF(__pyx_t_2);
18454   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18455   __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error)
18456   __Pyx_GOTREF(__pyx_t_1);
18457   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18458   __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1114, __pyx_L1_error)
18459   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18460   __pyx_v_end = __pyx_t_3;
18461 
18462   /* "MACS2/IO/ScoreTrack.pyx":1115
18463  *         # Add 10 bp padding to peak region so that we can get true minima
18464  *         end = peak_content[ -1 ][ 1 ] + 10
18465  *         start = peak_content[ 0 ][ 0 ] - 10             # <<<<<<<<<<<<<<
18466  *         if start < 0:
18467  *             start_boundary = 10 + start
18468  */
18469   if (unlikely(__pyx_v_peak_content == Py_None)) {
18470     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18471     __PYX_ERR(0, 1115, __pyx_L1_error)
18472   }
18473   __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_peak_content, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error)
18474   __Pyx_GOTREF(__pyx_t_1);
18475   __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error)
18476   __Pyx_GOTREF(__pyx_t_2);
18477   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18478   __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error)
18479   __Pyx_GOTREF(__pyx_t_1);
18480   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18481   __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1115, __pyx_L1_error)
18482   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18483   __pyx_v_start = __pyx_t_3;
18484 
18485   /* "MACS2/IO/ScoreTrack.pyx":1116
18486  *         end = peak_content[ -1 ][ 1 ] + 10
18487  *         start = peak_content[ 0 ][ 0 ] - 10
18488  *         if start < 0:             # <<<<<<<<<<<<<<
18489  *             start_boundary = 10 + start
18490  *             start = 0
18491  */
18492   __pyx_t_4 = ((__pyx_v_start < 0) != 0);
18493   if (__pyx_t_4) {
18494 
18495     /* "MACS2/IO/ScoreTrack.pyx":1117
18496  *         start = peak_content[ 0 ][ 0 ] - 10
18497  *         if start < 0:
18498  *             start_boundary = 10 + start             # <<<<<<<<<<<<<<
18499  *             start = 0
18500  *         else:
18501  */
18502     __pyx_v_start_boundary = (10 + __pyx_v_start);
18503 
18504     /* "MACS2/IO/ScoreTrack.pyx":1118
18505  *         if start < 0:
18506  *             start_boundary = 10 + start
18507  *             start = 0             # <<<<<<<<<<<<<<
18508  *         else:
18509  *             start_boundary = 10
18510  */
18511     __pyx_v_start = 0;
18512 
18513     /* "MACS2/IO/ScoreTrack.pyx":1116
18514  *         end = peak_content[ -1 ][ 1 ] + 10
18515  *         start = peak_content[ 0 ][ 0 ] - 10
18516  *         if start < 0:             # <<<<<<<<<<<<<<
18517  *             start_boundary = 10 + start
18518  *             start = 0
18519  */
18520     goto __pyx_L3;
18521   }
18522 
18523   /* "MACS2/IO/ScoreTrack.pyx":1120
18524  *             start = 0
18525  *         else:
18526  *             start_boundary = 10             # <<<<<<<<<<<<<<
18527  *         peak_length = end - start
18528  *         if end - start < min_length: return # if the region is too small, reject it
18529  */
18530   /*else*/ {
18531     __pyx_v_start_boundary = 10;
18532   }
18533   __pyx_L3:;
18534 
18535   /* "MACS2/IO/ScoreTrack.pyx":1121
18536  *         else:
18537  *             start_boundary = 10
18538  *         peak_length = end - start             # <<<<<<<<<<<<<<
18539  *         if end - start < min_length: return # if the region is too small, reject it
18540  *
18541  */
18542   __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_end - __pyx_v_start)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error)
18543   __Pyx_GOTREF(__pyx_t_1);
18544   __pyx_v_peak_length = __pyx_t_1;
18545   __pyx_t_1 = 0;
18546 
18547   /* "MACS2/IO/ScoreTrack.pyx":1122
18548  *             start_boundary = 10
18549  *         peak_length = end - start
18550  *         if end - start < min_length: return # if the region is too small, reject it             # <<<<<<<<<<<<<<
18551  *
18552  *         peakdata = np.zeros(end - start, dtype='float32')
18553  */
18554   __pyx_t_4 = (((__pyx_v_end - __pyx_v_start) < __pyx_v_min_length) != 0);
18555   if (__pyx_t_4) {
18556     __Pyx_XDECREF(((PyObject *)__pyx_r));
18557     __pyx_r = ((PyBoolObject *)Py_None); __Pyx_INCREF(Py_None);
18558     goto __pyx_L0;
18559   }
18560 
18561   /* "MACS2/IO/ScoreTrack.pyx":1124
18562  *         if end - start < min_length: return # if the region is too small, reject it
18563  *
18564  *         peakdata = np.zeros(end - start, dtype='float32')             # <<<<<<<<<<<<<<
18565  *         peakindices = np.zeros(end - start, dtype='int32')
18566  *         for (tstart,tend,tvalue,tsvalue, tmpindex) in peak_content:
18567  */
18568   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
18569   __Pyx_GOTREF(__pyx_t_1);
18570   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __pyx_L1_error)
18571   __Pyx_GOTREF(__pyx_t_2);
18572   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18573   __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_end - __pyx_v_start)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
18574   __Pyx_GOTREF(__pyx_t_1);
18575   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1124, __pyx_L1_error)
18576   __Pyx_GOTREF(__pyx_t_5);
18577   __Pyx_GIVEREF(__pyx_t_1);
18578   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
18579   __pyx_t_1 = 0;
18580   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
18581   __Pyx_GOTREF(__pyx_t_1);
18582   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 1124, __pyx_L1_error)
18583   __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error)
18584   __Pyx_GOTREF(__pyx_t_6);
18585   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18586   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18587   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18588   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1124, __pyx_L1_error)
18589   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
18590   {
18591     __Pyx_BufFmt_StackElem __pyx_stack[1];
18592     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakdata.rcbuffer->pybuffer);
18593     __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peakdata.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
18594     if (unlikely(__pyx_t_8 < 0)) {
18595       PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
18596       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peakdata.rcbuffer->pybuffer, (PyObject*)__pyx_v_peakdata, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
18597         Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
18598         __Pyx_RaiseBufferFallbackError();
18599       } else {
18600         PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
18601       }
18602       __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
18603     }
18604     __pyx_pybuffernd_peakdata.diminfo[0].strides = __pyx_pybuffernd_peakdata.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_peakdata.diminfo[0].shape = __pyx_pybuffernd_peakdata.rcbuffer->pybuffer.shape[0];
18605     if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1124, __pyx_L1_error)
18606   }
18607   __pyx_t_7 = 0;
18608   __pyx_v_peakdata = ((PyArrayObject *)__pyx_t_6);
18609   __pyx_t_6 = 0;
18610 
18611   /* "MACS2/IO/ScoreTrack.pyx":1125
18612  *
18613  *         peakdata = np.zeros(end - start, dtype='float32')
18614  *         peakindices = np.zeros(end - start, dtype='int32')             # <<<<<<<<<<<<<<
18615  *         for (tstart,tend,tvalue,tsvalue, tmpindex) in peak_content:
18616  *             i = tstart - start + start_boundary
18617  */
18618   __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1125, __pyx_L1_error)
18619   __Pyx_GOTREF(__pyx_t_6);
18620   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error)
18621   __Pyx_GOTREF(__pyx_t_1);
18622   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18623   __pyx_t_6 = __Pyx_PyInt_From_npy_int32((__pyx_v_end - __pyx_v_start)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1125, __pyx_L1_error)
18624   __Pyx_GOTREF(__pyx_t_6);
18625   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1125, __pyx_L1_error)
18626   __Pyx_GOTREF(__pyx_t_5);
18627   __Pyx_GIVEREF(__pyx_t_6);
18628   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
18629   __pyx_t_6 = 0;
18630   __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1125, __pyx_L1_error)
18631   __Pyx_GOTREF(__pyx_t_6);
18632   if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_int32) < 0) __PYX_ERR(0, 1125, __pyx_L1_error)
18633   __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1125, __pyx_L1_error)
18634   __Pyx_GOTREF(__pyx_t_2);
18635   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18636   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18637   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18638   if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1125, __pyx_L1_error)
18639   __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
18640   {
18641     __Pyx_BufFmt_StackElem __pyx_stack[1];
18642     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakindices.rcbuffer->pybuffer);
18643     __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peakindices.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
18644     if (unlikely(__pyx_t_8 < 0)) {
18645       PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
18646       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_peakindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_peakindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
18647         Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
18648         __Pyx_RaiseBufferFallbackError();
18649       } else {
18650         PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
18651       }
18652       __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
18653     }
18654     __pyx_pybuffernd_peakindices.diminfo[0].strides = __pyx_pybuffernd_peakindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_peakindices.diminfo[0].shape = __pyx_pybuffernd_peakindices.rcbuffer->pybuffer.shape[0];
18655     if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1125, __pyx_L1_error)
18656   }
18657   __pyx_t_12 = 0;
18658   __pyx_v_peakindices = ((PyArrayObject *)__pyx_t_2);
18659   __pyx_t_2 = 0;
18660 
18661   /* "MACS2/IO/ScoreTrack.pyx":1126
18662  *         peakdata = np.zeros(end - start, dtype='float32')
18663  *         peakindices = np.zeros(end - start, dtype='int32')
18664  *         for (tstart,tend,tvalue,tsvalue, tmpindex) in peak_content:             # <<<<<<<<<<<<<<
18665  *             i = tstart - start + start_boundary
18666  *             j = tend - start + start_boundary
18667  */
18668   if (unlikely(__pyx_v_peak_content == Py_None)) {
18669     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
18670     __PYX_ERR(0, 1126, __pyx_L1_error)
18671   }
18672   __pyx_t_2 = __pyx_v_peak_content; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0;
18673   for (;;) {
18674     if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break;
18675     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18676     __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1126, __pyx_L1_error)
18677     #else
18678     __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1126, __pyx_L1_error)
18679     __Pyx_GOTREF(__pyx_t_6);
18680     #endif
18681     if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
18682       PyObject* sequence = __pyx_t_6;
18683       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
18684       if (unlikely(size != 5)) {
18685         if (size > 5) __Pyx_RaiseTooManyValuesError(5);
18686         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
18687         __PYX_ERR(0, 1126, __pyx_L1_error)
18688       }
18689       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18690       if (likely(PyTuple_CheckExact(sequence))) {
18691         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
18692         __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
18693         __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2);
18694         __pyx_t_15 = PyTuple_GET_ITEM(sequence, 3);
18695         __pyx_t_16 = PyTuple_GET_ITEM(sequence, 4);
18696       } else {
18697         __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
18698         __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
18699         __pyx_t_14 = PyList_GET_ITEM(sequence, 2);
18700         __pyx_t_15 = PyList_GET_ITEM(sequence, 3);
18701         __pyx_t_16 = PyList_GET_ITEM(sequence, 4);
18702       }
18703       __Pyx_INCREF(__pyx_t_5);
18704       __Pyx_INCREF(__pyx_t_1);
18705       __Pyx_INCREF(__pyx_t_14);
18706       __Pyx_INCREF(__pyx_t_15);
18707       __Pyx_INCREF(__pyx_t_16);
18708       #else
18709       {
18710         Py_ssize_t i;
18711         PyObject** temps[5] = {&__pyx_t_5,&__pyx_t_1,&__pyx_t_14,&__pyx_t_15,&__pyx_t_16};
18712         for (i=0; i < 5; i++) {
18713           PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1126, __pyx_L1_error)
18714           __Pyx_GOTREF(item);
18715           *(temps[i]) = item;
18716         }
18717       }
18718       #endif
18719       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18720     } else {
18721       Py_ssize_t index = -1;
18722       PyObject** temps[5] = {&__pyx_t_5,&__pyx_t_1,&__pyx_t_14,&__pyx_t_15,&__pyx_t_16};
18723       __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1126, __pyx_L1_error)
18724       __Pyx_GOTREF(__pyx_t_17);
18725       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18726       __pyx_t_18 = Py_TYPE(__pyx_t_17)->tp_iternext;
18727       for (index=0; index < 5; index++) {
18728         PyObject* item = __pyx_t_18(__pyx_t_17); if (unlikely(!item)) goto __pyx_L7_unpacking_failed;
18729         __Pyx_GOTREF(item);
18730         *(temps[index]) = item;
18731       }
18732       if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_17), 5) < 0) __PYX_ERR(0, 1126, __pyx_L1_error)
18733       __pyx_t_18 = NULL;
18734       __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
18735       goto __pyx_L8_unpacking_done;
18736       __pyx_L7_unpacking_failed:;
18737       __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
18738       __pyx_t_18 = NULL;
18739       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
18740       __PYX_ERR(0, 1126, __pyx_L1_error)
18741       __pyx_L8_unpacking_done:;
18742     }
18743     __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_5); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
18744     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18745     __pyx_t_19 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_19 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
18746     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18747     __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_14); if (unlikely((__pyx_t_20 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
18748     __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
18749     __pyx_t_21 = __Pyx_PyInt_As_npy_int32(__pyx_t_16); if (unlikely((__pyx_t_21 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
18750     __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
18751     __pyx_v_tstart = __pyx_t_3;
18752     __pyx_v_tend = __pyx_t_19;
18753     __pyx_v_tvalue = __pyx_t_20;
18754     __Pyx_XDECREF_SET(__pyx_v_tsvalue, __pyx_t_15);
18755     __pyx_t_15 = 0;
18756     __pyx_v_tmpindex = __pyx_t_21;
18757 
18758     /* "MACS2/IO/ScoreTrack.pyx":1127
18759  *         peakindices = np.zeros(end - start, dtype='int32')
18760  *         for (tstart,tend,tvalue,tsvalue, tmpindex) in peak_content:
18761  *             i = tstart - start + start_boundary             # <<<<<<<<<<<<<<
18762  *             j = tend - start + start_boundary
18763  *             peakdata[i:j] = tsvalue
18764  */
18765     __pyx_v_i = ((__pyx_v_tstart - __pyx_v_start) + __pyx_v_start_boundary);
18766 
18767     /* "MACS2/IO/ScoreTrack.pyx":1128
18768  *         for (tstart,tend,tvalue,tsvalue, tmpindex) in peak_content:
18769  *             i = tstart - start + start_boundary
18770  *             j = tend - start + start_boundary             # <<<<<<<<<<<<<<
18771  *             peakdata[i:j] = tsvalue
18772  *             peakindices[i:j] = tmpindex
18773  */
18774     __pyx_v_j = ((__pyx_v_tend - __pyx_v_start) + __pyx_v_start_boundary);
18775 
18776     /* "MACS2/IO/ScoreTrack.pyx":1129
18777  *             i = tstart - start + start_boundary
18778  *             j = tend - start + start_boundary
18779  *             peakdata[i:j] = tsvalue             # <<<<<<<<<<<<<<
18780  *             peakindices[i:j] = tmpindex
18781  *         # apply smoothing window of smoothlen
18782  */
18783     __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1129, __pyx_L1_error)
18784     __Pyx_GOTREF(__pyx_t_6);
18785     __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_j); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1129, __pyx_L1_error)
18786     __Pyx_GOTREF(__pyx_t_16);
18787     __pyx_t_15 = PySlice_New(__pyx_t_6, __pyx_t_16, Py_None); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1129, __pyx_L1_error)
18788     __Pyx_GOTREF(__pyx_t_15);
18789     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18790     __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
18791     if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_peakdata), __pyx_t_15, __pyx_v_tsvalue) < 0)) __PYX_ERR(0, 1129, __pyx_L1_error)
18792     __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
18793 
18794     /* "MACS2/IO/ScoreTrack.pyx":1130
18795  *             j = tend - start + start_boundary
18796  *             peakdata[i:j] = tsvalue
18797  *             peakindices[i:j] = tmpindex             # <<<<<<<<<<<<<<
18798  *         # apply smoothing window of smoothlen
18799  * #        w = np.ones(smoothlen, dtype='float32') / smoothlen
18800  */
18801     __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_tmpindex); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1130, __pyx_L1_error)
18802     __Pyx_GOTREF(__pyx_t_15);
18803     __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_i); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1130, __pyx_L1_error)
18804     __Pyx_GOTREF(__pyx_t_16);
18805     __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1130, __pyx_L1_error)
18806     __Pyx_GOTREF(__pyx_t_6);
18807     __pyx_t_14 = PySlice_New(__pyx_t_16, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1130, __pyx_L1_error)
18808     __Pyx_GOTREF(__pyx_t_14);
18809     __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
18810     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18811     if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_peakindices), __pyx_t_14, __pyx_t_15) < 0)) __PYX_ERR(0, 1130, __pyx_L1_error)
18812     __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
18813     __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
18814 
18815     /* "MACS2/IO/ScoreTrack.pyx":1126
18816  *         peakdata = np.zeros(end - start, dtype='float32')
18817  *         peakindices = np.zeros(end - start, dtype='int32')
18818  *         for (tstart,tend,tvalue,tsvalue, tmpindex) in peak_content:             # <<<<<<<<<<<<<<
18819  *             i = tstart - start + start_boundary
18820  *             j = tend - start + start_boundary
18821  */
18822   }
18823   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18824 
18825   /* "MACS2/IO/ScoreTrack.pyx":1137
18826  * #        else:
18827  * #            smoothdata = peakdata.copy()
18828  *         summit_offsets = maxima(peakdata, smoothlen)             # <<<<<<<<<<<<<<
18829  *         if summit_offsets.shape[0] == 0:
18830  *             # **failsafe** if no summits, fall back on old approach #
18831  */
18832   __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_maxima); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1137, __pyx_L1_error)
18833   __Pyx_GOTREF(__pyx_t_15);
18834   __pyx_t_14 = __Pyx_PyInt_From_npy_int32(__pyx_v_smoothlen); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1137, __pyx_L1_error)
18835   __Pyx_GOTREF(__pyx_t_14);
18836   __pyx_t_6 = NULL;
18837   __pyx_t_8 = 0;
18838   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
18839     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_15);
18840     if (likely(__pyx_t_6)) {
18841       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
18842       __Pyx_INCREF(__pyx_t_6);
18843       __Pyx_INCREF(function);
18844       __Pyx_DECREF_SET(__pyx_t_15, function);
18845       __pyx_t_8 = 1;
18846     }
18847   }
18848   #if CYTHON_FAST_PYCALL
18849   if (PyFunction_Check(__pyx_t_15)) {
18850     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_peakdata), __pyx_t_14};
18851     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
18852     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18853     __Pyx_GOTREF(__pyx_t_2);
18854     __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
18855   } else
18856   #endif
18857   #if CYTHON_FAST_PYCCALL
18858   if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
18859     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_peakdata), __pyx_t_14};
18860     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
18861     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18862     __Pyx_GOTREF(__pyx_t_2);
18863     __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
18864   } else
18865   #endif
18866   {
18867     __pyx_t_16 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1137, __pyx_L1_error)
18868     __Pyx_GOTREF(__pyx_t_16);
18869     if (__pyx_t_6) {
18870       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_6); __pyx_t_6 = NULL;
18871     }
18872     __Pyx_INCREF(((PyObject *)__pyx_v_peakdata));
18873     __Pyx_GIVEREF(((PyObject *)__pyx_v_peakdata));
18874     PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_8, ((PyObject *)__pyx_v_peakdata));
18875     __Pyx_GIVEREF(__pyx_t_14);
18876     PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_8, __pyx_t_14);
18877     __pyx_t_14 = 0;
18878     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
18879     __Pyx_GOTREF(__pyx_t_2);
18880     __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
18881   }
18882   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
18883   if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1137, __pyx_L1_error)
18884   __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
18885   {
18886     __Pyx_BufFmt_StackElem __pyx_stack[1];
18887     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
18888     __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
18889     if (unlikely(__pyx_t_8 < 0)) {
18890       PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
18891       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_v_summit_offsets, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
18892         Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
18893         __Pyx_RaiseBufferFallbackError();
18894       } else {
18895         PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
18896       }
18897       __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
18898     }
18899     __pyx_pybuffernd_summit_offsets.diminfo[0].strides = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_summit_offsets.diminfo[0].shape = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.shape[0];
18900     if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1137, __pyx_L1_error)
18901   }
18902   __pyx_t_12 = 0;
18903   __pyx_v_summit_offsets = ((PyArrayObject *)__pyx_t_2);
18904   __pyx_t_2 = 0;
18905 
18906   /* "MACS2/IO/ScoreTrack.pyx":1138
18907  * #            smoothdata = peakdata.copy()
18908  *         summit_offsets = maxima(peakdata, smoothlen)
18909  *         if summit_offsets.shape[0] == 0:             # <<<<<<<<<<<<<<
18910  *             # **failsafe** if no summits, fall back on old approach #
18911  *             return self.__close_peak(peak_content, peaks, min_length, chrom)
18912  */
18913   __pyx_t_4 = (((__pyx_v_summit_offsets->dimensions[0]) == 0) != 0);
18914   if (__pyx_t_4) {
18915 
18916     /* "MACS2/IO/ScoreTrack.pyx":1140
18917  *         if summit_offsets.shape[0] == 0:
18918  *             # **failsafe** if no summits, fall back on old approach #
18919  *             return self.__close_peak(peak_content, peaks, min_length, chrom)             # <<<<<<<<<<<<<<
18920  *         else:
18921  *             # remove maxima that occurred in padding
18922  */
18923     __Pyx_XDECREF(((PyObject *)__pyx_r));
18924     __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1140, __pyx_L1_error)
18925     __Pyx_GOTREF(__pyx_t_2);
18926     __pyx_r = ((PyBoolObject *)__pyx_t_2);
18927     __pyx_t_2 = 0;
18928     goto __pyx_L0;
18929 
18930     /* "MACS2/IO/ScoreTrack.pyx":1138
18931  * #            smoothdata = peakdata.copy()
18932  *         summit_offsets = maxima(peakdata, smoothlen)
18933  *         if summit_offsets.shape[0] == 0:             # <<<<<<<<<<<<<<
18934  *             # **failsafe** if no summits, fall back on old approach #
18935  *             return self.__close_peak(peak_content, peaks, min_length, chrom)
18936  */
18937   }
18938 
18939   /* "MACS2/IO/ScoreTrack.pyx":1143
18940  *         else:
18941  *             # remove maxima that occurred in padding
18942  *             i = np.searchsorted(summit_offsets, start_boundary)             # <<<<<<<<<<<<<<
18943  *             j = np.searchsorted(summit_offsets, peak_length + start_boundary, 'right')
18944  *             summit_offsets = summit_offsets[i:j]
18945  */
18946   /*else*/ {
18947     __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1143, __pyx_L1_error)
18948     __Pyx_GOTREF(__pyx_t_15);
18949     __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1143, __pyx_L1_error)
18950     __Pyx_GOTREF(__pyx_t_16);
18951     __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
18952     __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_start_boundary); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1143, __pyx_L1_error)
18953     __Pyx_GOTREF(__pyx_t_15);
18954     __pyx_t_14 = NULL;
18955     __pyx_t_8 = 0;
18956     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
18957       __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_16);
18958       if (likely(__pyx_t_14)) {
18959         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
18960         __Pyx_INCREF(__pyx_t_14);
18961         __Pyx_INCREF(function);
18962         __Pyx_DECREF_SET(__pyx_t_16, function);
18963         __pyx_t_8 = 1;
18964       }
18965     }
18966     #if CYTHON_FAST_PYCALL
18967     if (PyFunction_Check(__pyx_t_16)) {
18968       PyObject *__pyx_temp[3] = {__pyx_t_14, ((PyObject *)__pyx_v_summit_offsets), __pyx_t_15};
18969       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
18970       __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
18971       __Pyx_GOTREF(__pyx_t_2);
18972       __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
18973     } else
18974     #endif
18975     #if CYTHON_FAST_PYCCALL
18976     if (__Pyx_PyFastCFunction_Check(__pyx_t_16)) {
18977       PyObject *__pyx_temp[3] = {__pyx_t_14, ((PyObject *)__pyx_v_summit_offsets), __pyx_t_15};
18978       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
18979       __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
18980       __Pyx_GOTREF(__pyx_t_2);
18981       __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
18982     } else
18983     #endif
18984     {
18985       __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1143, __pyx_L1_error)
18986       __Pyx_GOTREF(__pyx_t_6);
18987       if (__pyx_t_14) {
18988         __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_14); __pyx_t_14 = NULL;
18989       }
18990       __Pyx_INCREF(((PyObject *)__pyx_v_summit_offsets));
18991       __Pyx_GIVEREF(((PyObject *)__pyx_v_summit_offsets));
18992       PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, ((PyObject *)__pyx_v_summit_offsets));
18993       __Pyx_GIVEREF(__pyx_t_15);
18994       PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_t_15);
18995       __pyx_t_15 = 0;
18996       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
18997       __Pyx_GOTREF(__pyx_t_2);
18998       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18999     }
19000     __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
19001     __pyx_t_21 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_21 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error)
19002     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19003     __pyx_v_i = __pyx_t_21;
19004 
19005     /* "MACS2/IO/ScoreTrack.pyx":1144
19006  *             # remove maxima that occurred in padding
19007  *             i = np.searchsorted(summit_offsets, start_boundary)
19008  *             j = np.searchsorted(summit_offsets, peak_length + start_boundary, 'right')             # <<<<<<<<<<<<<<
19009  *             summit_offsets = summit_offsets[i:j]
19010  *
19011  */
19012     __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1144, __pyx_L1_error)
19013     __Pyx_GOTREF(__pyx_t_16);
19014     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1144, __pyx_L1_error)
19015     __Pyx_GOTREF(__pyx_t_6);
19016     __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
19017     __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_start_boundary); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1144, __pyx_L1_error)
19018     __Pyx_GOTREF(__pyx_t_16);
19019     __pyx_t_15 = PyNumber_Add(__pyx_v_peak_length, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1144, __pyx_L1_error)
19020     __Pyx_GOTREF(__pyx_t_15);
19021     __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
19022     __pyx_t_16 = NULL;
19023     __pyx_t_8 = 0;
19024     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
19025       __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_6);
19026       if (likely(__pyx_t_16)) {
19027         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
19028         __Pyx_INCREF(__pyx_t_16);
19029         __Pyx_INCREF(function);
19030         __Pyx_DECREF_SET(__pyx_t_6, function);
19031         __pyx_t_8 = 1;
19032       }
19033     }
19034     #if CYTHON_FAST_PYCALL
19035     if (PyFunction_Check(__pyx_t_6)) {
19036       PyObject *__pyx_temp[4] = {__pyx_t_16, ((PyObject *)__pyx_v_summit_offsets), __pyx_t_15, __pyx_n_u_right};
19037       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
19038       __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
19039       __Pyx_GOTREF(__pyx_t_2);
19040       __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
19041     } else
19042     #endif
19043     #if CYTHON_FAST_PYCCALL
19044     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
19045       PyObject *__pyx_temp[4] = {__pyx_t_16, ((PyObject *)__pyx_v_summit_offsets), __pyx_t_15, __pyx_n_u_right};
19046       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
19047       __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
19048       __Pyx_GOTREF(__pyx_t_2);
19049       __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
19050     } else
19051     #endif
19052     {
19053       __pyx_t_14 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1144, __pyx_L1_error)
19054       __Pyx_GOTREF(__pyx_t_14);
19055       if (__pyx_t_16) {
19056         __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16); __pyx_t_16 = NULL;
19057       }
19058       __Pyx_INCREF(((PyObject *)__pyx_v_summit_offsets));
19059       __Pyx_GIVEREF(((PyObject *)__pyx_v_summit_offsets));
19060       PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_8, ((PyObject *)__pyx_v_summit_offsets));
19061       __Pyx_GIVEREF(__pyx_t_15);
19062       PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_8, __pyx_t_15);
19063       __Pyx_INCREF(__pyx_n_u_right);
19064       __Pyx_GIVEREF(__pyx_n_u_right);
19065       PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_8, __pyx_n_u_right);
19066       __pyx_t_15 = 0;
19067       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
19068       __Pyx_GOTREF(__pyx_t_2);
19069       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
19070     }
19071     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19072     __pyx_t_21 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_21 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L1_error)
19073     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19074     __pyx_v_j = __pyx_t_21;
19075 
19076     /* "MACS2/IO/ScoreTrack.pyx":1145
19077  *             i = np.searchsorted(summit_offsets, start_boundary)
19078  *             j = np.searchsorted(summit_offsets, peak_length + start_boundary, 'right')
19079  *             summit_offsets = summit_offsets[i:j]             # <<<<<<<<<<<<<<
19080  *
19081  *         summit_offsets = enforce_peakyness(peakdata, summit_offsets)
19082  */
19083     __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error)
19084     __Pyx_GOTREF(__pyx_t_2);
19085     __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1145, __pyx_L1_error)
19086     __Pyx_GOTREF(__pyx_t_6);
19087     __pyx_t_14 = PySlice_New(__pyx_t_2, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1145, __pyx_L1_error)
19088     __Pyx_GOTREF(__pyx_t_14);
19089     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19090     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19091     __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_summit_offsets), __pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1145, __pyx_L1_error)
19092     __Pyx_GOTREF(__pyx_t_6);
19093     __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
19094     if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1145, __pyx_L1_error)
19095     __pyx_t_12 = ((PyArrayObject *)__pyx_t_6);
19096     {
19097       __Pyx_BufFmt_StackElem __pyx_stack[1];
19098       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
19099       __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
19100       if (unlikely(__pyx_t_8 < 0)) {
19101         PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
19102         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_v_summit_offsets, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
19103           Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
19104           __Pyx_RaiseBufferFallbackError();
19105         } else {
19106           PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
19107         }
19108         __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
19109       }
19110       __pyx_pybuffernd_summit_offsets.diminfo[0].strides = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_summit_offsets.diminfo[0].shape = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.shape[0];
19111       if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1145, __pyx_L1_error)
19112     }
19113     __pyx_t_12 = 0;
19114     __Pyx_DECREF_SET(__pyx_v_summit_offsets, ((PyArrayObject *)__pyx_t_6));
19115     __pyx_t_6 = 0;
19116   }
19117 
19118   /* "MACS2/IO/ScoreTrack.pyx":1147
19119  *             summit_offsets = summit_offsets[i:j]
19120  *
19121  *         summit_offsets = enforce_peakyness(peakdata, summit_offsets)             # <<<<<<<<<<<<<<
19122  *         if summit_offsets.shape[0] == 0:
19123  *             # **failsafe** if no summits, fall back on old approach #
19124  */
19125   __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_enforce_peakyness); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1147, __pyx_L1_error)
19126   __Pyx_GOTREF(__pyx_t_14);
19127   __pyx_t_2 = NULL;
19128   __pyx_t_8 = 0;
19129   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
19130     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
19131     if (likely(__pyx_t_2)) {
19132       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
19133       __Pyx_INCREF(__pyx_t_2);
19134       __Pyx_INCREF(function);
19135       __Pyx_DECREF_SET(__pyx_t_14, function);
19136       __pyx_t_8 = 1;
19137     }
19138   }
19139   #if CYTHON_FAST_PYCALL
19140   if (PyFunction_Check(__pyx_t_14)) {
19141     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_peakdata), ((PyObject *)__pyx_v_summit_offsets)};
19142     __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1147, __pyx_L1_error)
19143     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19144     __Pyx_GOTREF(__pyx_t_6);
19145   } else
19146   #endif
19147   #if CYTHON_FAST_PYCCALL
19148   if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
19149     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_peakdata), ((PyObject *)__pyx_v_summit_offsets)};
19150     __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1147, __pyx_L1_error)
19151     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19152     __Pyx_GOTREF(__pyx_t_6);
19153   } else
19154   #endif
19155   {
19156     __pyx_t_15 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1147, __pyx_L1_error)
19157     __Pyx_GOTREF(__pyx_t_15);
19158     if (__pyx_t_2) {
19159       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); __pyx_t_2 = NULL;
19160     }
19161     __Pyx_INCREF(((PyObject *)__pyx_v_peakdata));
19162     __Pyx_GIVEREF(((PyObject *)__pyx_v_peakdata));
19163     PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_8, ((PyObject *)__pyx_v_peakdata));
19164     __Pyx_INCREF(((PyObject *)__pyx_v_summit_offsets));
19165     __Pyx_GIVEREF(((PyObject *)__pyx_v_summit_offsets));
19166     PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_8, ((PyObject *)__pyx_v_summit_offsets));
19167     __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_15, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1147, __pyx_L1_error)
19168     __Pyx_GOTREF(__pyx_t_6);
19169     __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
19170   }
19171   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
19172   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1147, __pyx_L1_error)
19173   __pyx_t_12 = ((PyArrayObject *)__pyx_t_6);
19174   {
19175     __Pyx_BufFmt_StackElem __pyx_stack[1];
19176     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
19177     __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
19178     if (unlikely(__pyx_t_8 < 0)) {
19179       PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
19180       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_v_summit_offsets, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
19181         Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
19182         __Pyx_RaiseBufferFallbackError();
19183       } else {
19184         PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
19185       }
19186       __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
19187     }
19188     __pyx_pybuffernd_summit_offsets.diminfo[0].strides = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_summit_offsets.diminfo[0].shape = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.shape[0];
19189     if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1147, __pyx_L1_error)
19190   }
19191   __pyx_t_12 = 0;
19192   __Pyx_DECREF_SET(__pyx_v_summit_offsets, ((PyArrayObject *)__pyx_t_6));
19193   __pyx_t_6 = 0;
19194 
19195   /* "MACS2/IO/ScoreTrack.pyx":1148
19196  *
19197  *         summit_offsets = enforce_peakyness(peakdata, summit_offsets)
19198  *         if summit_offsets.shape[0] == 0:             # <<<<<<<<<<<<<<
19199  *             # **failsafe** if no summits, fall back on old approach #
19200  *             return self.__close_peak(peak_content, peaks, min_length, chrom)
19201  */
19202   __pyx_t_4 = (((__pyx_v_summit_offsets->dimensions[0]) == 0) != 0);
19203   if (__pyx_t_4) {
19204 
19205     /* "MACS2/IO/ScoreTrack.pyx":1150
19206  *         if summit_offsets.shape[0] == 0:
19207  *             # **failsafe** if no summits, fall back on old approach #
19208  *             return self.__close_peak(peak_content, peaks, min_length, chrom)             # <<<<<<<<<<<<<<
19209  *
19210  * #        summit_offsets = enforce_valleys(peakdata, summit_offsets, min_valley = min_valley)
19211  */
19212     __Pyx_XDECREF(((PyObject *)__pyx_r));
19213     __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1150, __pyx_L1_error)
19214     __Pyx_GOTREF(__pyx_t_6);
19215     __pyx_r = ((PyBoolObject *)__pyx_t_6);
19216     __pyx_t_6 = 0;
19217     goto __pyx_L0;
19218 
19219     /* "MACS2/IO/ScoreTrack.pyx":1148
19220  *
19221  *         summit_offsets = enforce_peakyness(peakdata, summit_offsets)
19222  *         if summit_offsets.shape[0] == 0:             # <<<<<<<<<<<<<<
19223  *             # **failsafe** if no summits, fall back on old approach #
19224  *             return self.__close_peak(peak_content, peaks, min_length, chrom)
19225  */
19226   }
19227 
19228   /* "MACS2/IO/ScoreTrack.pyx":1153
19229  *
19230  * #        summit_offsets = enforce_valleys(peakdata, summit_offsets, min_valley = min_valley)
19231  *         summit_indices = peakindices[summit_offsets]             # <<<<<<<<<<<<<<
19232  *         summit_offsets -= start_boundary
19233  *
19234  */
19235   __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_peakindices), ((PyObject *)__pyx_v_summit_offsets)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1153, __pyx_L1_error)
19236   __Pyx_GOTREF(__pyx_t_6);
19237   __pyx_v_summit_indices = __pyx_t_6;
19238   __pyx_t_6 = 0;
19239 
19240   /* "MACS2/IO/ScoreTrack.pyx":1154
19241  * #        summit_offsets = enforce_valleys(peakdata, summit_offsets, min_valley = min_valley)
19242  *         summit_indices = peakindices[summit_offsets]
19243  *         summit_offsets -= start_boundary             # <<<<<<<<<<<<<<
19244  *
19245  *         peak_scores  = self.data[chrom][3][ summit_indices ]
19246  */
19247   __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_start_boundary); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1154, __pyx_L1_error)
19248   __Pyx_GOTREF(__pyx_t_6);
19249   __pyx_t_14 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_summit_offsets), __pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1154, __pyx_L1_error)
19250   __Pyx_GOTREF(__pyx_t_14);
19251   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19252   if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1154, __pyx_L1_error)
19253   __pyx_t_12 = ((PyArrayObject *)__pyx_t_14);
19254   {
19255     __Pyx_BufFmt_StackElem __pyx_stack[1];
19256     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
19257     __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
19258     if (unlikely(__pyx_t_8 < 0)) {
19259       PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
19260       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_v_summit_offsets, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
19261         Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
19262         __Pyx_RaiseBufferFallbackError();
19263       } else {
19264         PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
19265       }
19266       __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
19267     }
19268     __pyx_pybuffernd_summit_offsets.diminfo[0].strides = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_summit_offsets.diminfo[0].shape = __pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer.shape[0];
19269     if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1154, __pyx_L1_error)
19270   }
19271   __pyx_t_12 = 0;
19272   __Pyx_DECREF_SET(__pyx_v_summit_offsets, ((PyArrayObject *)__pyx_t_14));
19273   __pyx_t_14 = 0;
19274 
19275   /* "MACS2/IO/ScoreTrack.pyx":1156
19276  *         summit_offsets -= start_boundary
19277  *
19278  *         peak_scores  = self.data[chrom][3][ summit_indices ]             # <<<<<<<<<<<<<<
19279  *         if not (peak_scores > self.cutoff).all():
19280  *             return self.__close_peak(peak_content, peaks, min_length, chrom)
19281  */
19282   if (unlikely(__pyx_v_self->data == Py_None)) {
19283     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19284     __PYX_ERR(0, 1156, __pyx_L1_error)
19285   }
19286   __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1156, __pyx_L1_error)
19287   __Pyx_GOTREF(__pyx_t_14);
19288   __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_14, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1156, __pyx_L1_error)
19289   __Pyx_GOTREF(__pyx_t_6);
19290   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
19291   __pyx_t_14 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_summit_indices); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1156, __pyx_L1_error)
19292   __Pyx_GOTREF(__pyx_t_14);
19293   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19294   __pyx_v_peak_scores = __pyx_t_14;
19295   __pyx_t_14 = 0;
19296 
19297   /* "MACS2/IO/ScoreTrack.pyx":1157
19298  *
19299  *         peak_scores  = self.data[chrom][3][ summit_indices ]
19300  *         if not (peak_scores > self.cutoff).all():             # <<<<<<<<<<<<<<
19301  *             return self.__close_peak(peak_content, peaks, min_length, chrom)
19302  *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):
19303  */
19304   __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1157, __pyx_L1_error)
19305   __Pyx_GOTREF(__pyx_t_6);
19306   __pyx_t_15 = PyObject_RichCompare(__pyx_v_peak_scores, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1157, __pyx_L1_error)
19307   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19308   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_all); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1157, __pyx_L1_error)
19309   __Pyx_GOTREF(__pyx_t_6);
19310   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
19311   __pyx_t_15 = NULL;
19312   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
19313     __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_6);
19314     if (likely(__pyx_t_15)) {
19315       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
19316       __Pyx_INCREF(__pyx_t_15);
19317       __Pyx_INCREF(function);
19318       __Pyx_DECREF_SET(__pyx_t_6, function);
19319     }
19320   }
19321   __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
19322   __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
19323   if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1157, __pyx_L1_error)
19324   __Pyx_GOTREF(__pyx_t_14);
19325   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19326   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1157, __pyx_L1_error)
19327   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
19328   __pyx_t_22 = ((!__pyx_t_4) != 0);
19329   if (__pyx_t_22) {
19330 
19331     /* "MACS2/IO/ScoreTrack.pyx":1158
19332  *         peak_scores  = self.data[chrom][3][ summit_indices ]
19333  *         if not (peak_scores > self.cutoff).all():
19334  *             return self.__close_peak(peak_content, peaks, min_length, chrom)             # <<<<<<<<<<<<<<
19335  *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):
19336  *             if self.scoring_method == ord('q'):
19337  */
19338     __Pyx_XDECREF(((PyObject *)__pyx_r));
19339     __pyx_t_14 = ((PyObject *)((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->__pyx___close_peak(__pyx_v_self, __pyx_v_peak_content, __pyx_v_peaks, __pyx_v_min_length, __pyx_v_chrom, NULL)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1158, __pyx_L1_error)
19340     __Pyx_GOTREF(__pyx_t_14);
19341     __pyx_r = ((PyBoolObject *)__pyx_t_14);
19342     __pyx_t_14 = 0;
19343     goto __pyx_L0;
19344 
19345     /* "MACS2/IO/ScoreTrack.pyx":1157
19346  *
19347  *         peak_scores  = self.data[chrom][3][ summit_indices ]
19348  *         if not (peak_scores > self.cutoff).all():             # <<<<<<<<<<<<<<
19349  *             return self.__close_peak(peak_content, peaks, min_length, chrom)
19350  *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):
19351  */
19352   }
19353 
19354   /* "MACS2/IO/ScoreTrack.pyx":1159
19355  *         if not (peak_scores > self.cutoff).all():
19356  *             return self.__close_peak(peak_content, peaks, min_length, chrom)
19357  *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):             # <<<<<<<<<<<<<<
19358  *             if self.scoring_method == ord('q'):
19359  *                 qscore = self.data[chrom][3][ summit_index ]
19360  */
19361   __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1159, __pyx_L1_error)
19362   __Pyx_GOTREF(__pyx_t_14);
19363   __Pyx_INCREF(((PyObject *)__pyx_v_summit_offsets));
19364   __Pyx_GIVEREF(((PyObject *)__pyx_v_summit_offsets));
19365   PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_summit_offsets));
19366   __Pyx_INCREF(__pyx_v_summit_indices);
19367   __Pyx_GIVEREF(__pyx_v_summit_indices);
19368   PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_summit_indices);
19369   __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1159, __pyx_L1_error)
19370   __Pyx_GOTREF(__pyx_t_6);
19371   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
19372   if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
19373     __pyx_t_14 = __pyx_t_6; __Pyx_INCREF(__pyx_t_14); __pyx_t_13 = 0;
19374     __pyx_t_23 = NULL;
19375   } else {
19376     __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1159, __pyx_L1_error)
19377     __Pyx_GOTREF(__pyx_t_14);
19378     __pyx_t_23 = Py_TYPE(__pyx_t_14)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1159, __pyx_L1_error)
19379   }
19380   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19381   for (;;) {
19382     if (likely(!__pyx_t_23)) {
19383       if (likely(PyList_CheckExact(__pyx_t_14))) {
19384         if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_14)) break;
19385         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19386         __pyx_t_6 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1159, __pyx_L1_error)
19387         #else
19388         __pyx_t_6 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1159, __pyx_L1_error)
19389         __Pyx_GOTREF(__pyx_t_6);
19390         #endif
19391       } else {
19392         if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
19393         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19394         __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1159, __pyx_L1_error)
19395         #else
19396         __pyx_t_6 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1159, __pyx_L1_error)
19397         __Pyx_GOTREF(__pyx_t_6);
19398         #endif
19399       }
19400     } else {
19401       __pyx_t_6 = __pyx_t_23(__pyx_t_14);
19402       if (unlikely(!__pyx_t_6)) {
19403         PyObject* exc_type = PyErr_Occurred();
19404         if (exc_type) {
19405           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
19406           else __PYX_ERR(0, 1159, __pyx_L1_error)
19407         }
19408         break;
19409       }
19410       __Pyx_GOTREF(__pyx_t_6);
19411     }
19412     if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
19413       PyObject* sequence = __pyx_t_6;
19414       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
19415       if (unlikely(size != 2)) {
19416         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
19417         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
19418         __PYX_ERR(0, 1159, __pyx_L1_error)
19419       }
19420       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19421       if (likely(PyTuple_CheckExact(sequence))) {
19422         __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0);
19423         __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
19424       } else {
19425         __pyx_t_15 = PyList_GET_ITEM(sequence, 0);
19426         __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
19427       }
19428       __Pyx_INCREF(__pyx_t_15);
19429       __Pyx_INCREF(__pyx_t_2);
19430       #else
19431       __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1159, __pyx_L1_error)
19432       __Pyx_GOTREF(__pyx_t_15);
19433       __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error)
19434       __Pyx_GOTREF(__pyx_t_2);
19435       #endif
19436       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19437     } else {
19438       Py_ssize_t index = -1;
19439       __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1159, __pyx_L1_error)
19440       __Pyx_GOTREF(__pyx_t_16);
19441       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19442       __pyx_t_18 = Py_TYPE(__pyx_t_16)->tp_iternext;
19443       index = 0; __pyx_t_15 = __pyx_t_18(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L14_unpacking_failed;
19444       __Pyx_GOTREF(__pyx_t_15);
19445       index = 1; __pyx_t_2 = __pyx_t_18(__pyx_t_16); if (unlikely(!__pyx_t_2)) goto __pyx_L14_unpacking_failed;
19446       __Pyx_GOTREF(__pyx_t_2);
19447       if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_16), 2) < 0) __PYX_ERR(0, 1159, __pyx_L1_error)
19448       __pyx_t_18 = NULL;
19449       __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
19450       goto __pyx_L15_unpacking_done;
19451       __pyx_L14_unpacking_failed:;
19452       __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
19453       __pyx_t_18 = NULL;
19454       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
19455       __PYX_ERR(0, 1159, __pyx_L1_error)
19456       __pyx_L15_unpacking_done:;
19457     }
19458     __pyx_t_21 = __Pyx_PyInt_As_npy_int32(__pyx_t_15); if (unlikely((__pyx_t_21 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error)
19459     __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
19460     __pyx_t_19 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_19 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error)
19461     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19462     __pyx_v_summit_offset = __pyx_t_21;
19463     __pyx_v_summit_index = __pyx_t_19;
19464 
19465     /* "MACS2/IO/ScoreTrack.pyx":1160
19466  *             return self.__close_peak(peak_content, peaks, min_length, chrom)
19467  *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):
19468  *             if self.scoring_method == ord('q'):             # <<<<<<<<<<<<<<
19469  *                 qscore = self.data[chrom][3][ summit_index ]
19470  *             else:
19471  */
19472     __pyx_t_22 = ((__pyx_v_self->scoring_method == 0x71) != 0);
19473     if (__pyx_t_22) {
19474 
19475       /* "MACS2/IO/ScoreTrack.pyx":1161
19476  *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):
19477  *             if self.scoring_method == ord('q'):
19478  *                 qscore = self.data[chrom][3][ summit_index ]             # <<<<<<<<<<<<<<
19479  *             else:
19480  *                 # if q value is not computed, use -1
19481  */
19482       if (unlikely(__pyx_v_self->data == Py_None)) {
19483         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19484         __PYX_ERR(0, 1161, __pyx_L1_error)
19485       }
19486       __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1161, __pyx_L1_error)
19487       __Pyx_GOTREF(__pyx_t_6);
19488       __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1161, __pyx_L1_error)
19489       __Pyx_GOTREF(__pyx_t_2);
19490       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19491       __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1161, __pyx_L1_error)
19492       __Pyx_GOTREF(__pyx_t_6);
19493       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19494       __Pyx_XDECREF_SET(__pyx_v_qscore, __pyx_t_6);
19495       __pyx_t_6 = 0;
19496 
19497       /* "MACS2/IO/ScoreTrack.pyx":1160
19498  *             return self.__close_peak(peak_content, peaks, min_length, chrom)
19499  *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):
19500  *             if self.scoring_method == ord('q'):             # <<<<<<<<<<<<<<
19501  *                 qscore = self.data[chrom][3][ summit_index ]
19502  *             else:
19503  */
19504       goto __pyx_L16;
19505     }
19506 
19507     /* "MACS2/IO/ScoreTrack.pyx":1164
19508  *             else:
19509  *                 # if q value is not computed, use -1
19510  *                 qscore = -1             # <<<<<<<<<<<<<<
19511  *             peaks.add( chrom,
19512  *                        start,
19513  */
19514     /*else*/ {
19515       __Pyx_INCREF(__pyx_int_neg_1);
19516       __Pyx_XDECREF_SET(__pyx_v_qscore, __pyx_int_neg_1);
19517     }
19518     __pyx_L16:;
19519 
19520     /* "MACS2/IO/ScoreTrack.pyx":1165
19521  *                 # if q value is not computed, use -1
19522  *                 qscore = -1
19523  *             peaks.add( chrom,             # <<<<<<<<<<<<<<
19524  *                        start,
19525  *                        end,
19526  */
19527     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_peaks, __pyx_n_s_add); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1165, __pyx_L1_error)
19528     __Pyx_GOTREF(__pyx_t_6);
19529 
19530     /* "MACS2/IO/ScoreTrack.pyx":1166
19531  *                 qscore = -1
19532  *             peaks.add( chrom,
19533  *                        start,             # <<<<<<<<<<<<<<
19534  *                        end,
19535  *                        summit      = start + summit_offset,
19536  */
19537     __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error)
19538     __Pyx_GOTREF(__pyx_t_2);
19539 
19540     /* "MACS2/IO/ScoreTrack.pyx":1167
19541  *             peaks.add( chrom,
19542  *                        start,
19543  *                        end,             # <<<<<<<<<<<<<<
19544  *                        summit      = start + summit_offset,
19545  *                        peak_score  = self.data[chrom][3][ summit_index ],
19546  */
19547     __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_end); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1167, __pyx_L1_error)
19548     __Pyx_GOTREF(__pyx_t_15);
19549 
19550     /* "MACS2/IO/ScoreTrack.pyx":1165
19551  *                 # if q value is not computed, use -1
19552  *                 qscore = -1
19553  *             peaks.add( chrom,             # <<<<<<<<<<<<<<
19554  *                        start,
19555  *                        end,
19556  */
19557     __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1165, __pyx_L1_error)
19558     __Pyx_GOTREF(__pyx_t_16);
19559     __Pyx_INCREF(__pyx_v_chrom);
19560     __Pyx_GIVEREF(__pyx_v_chrom);
19561     PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_chrom);
19562     __Pyx_GIVEREF(__pyx_t_2);
19563     PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_2);
19564     __Pyx_GIVEREF(__pyx_t_15);
19565     PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_15);
19566     __pyx_t_2 = 0;
19567     __pyx_t_15 = 0;
19568 
19569     /* "MACS2/IO/ScoreTrack.pyx":1168
19570  *                        start,
19571  *                        end,
19572  *                        summit      = start + summit_offset,             # <<<<<<<<<<<<<<
19573  *                        peak_score  = self.data[chrom][3][ summit_index ],
19574  *                        pileup      = self.data[chrom][1][ summit_index ], # should be the same as summit_value
19575  */
19576     __pyx_t_15 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1168, __pyx_L1_error)
19577     __Pyx_GOTREF(__pyx_t_15);
19578     __pyx_t_2 = __Pyx_PyInt_From_npy_int32((__pyx_v_start + __pyx_v_summit_offset)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1168, __pyx_L1_error)
19579     __Pyx_GOTREF(__pyx_t_2);
19580     if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_summit, __pyx_t_2) < 0) __PYX_ERR(0, 1168, __pyx_L1_error)
19581     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19582 
19583     /* "MACS2/IO/ScoreTrack.pyx":1169
19584  *                        end,
19585  *                        summit      = start + summit_offset,
19586  *                        peak_score  = self.data[chrom][3][ summit_index ],             # <<<<<<<<<<<<<<
19587  *                        pileup      = self.data[chrom][1][ summit_index ], # should be the same as summit_value
19588  *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
19589  */
19590     if (unlikely(__pyx_v_self->data == Py_None)) {
19591       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19592       __PYX_ERR(0, 1169, __pyx_L1_error)
19593     }
19594     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error)
19595     __Pyx_GOTREF(__pyx_t_2);
19596     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error)
19597     __Pyx_GOTREF(__pyx_t_1);
19598     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19599     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error)
19600     __Pyx_GOTREF(__pyx_t_2);
19601     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19602     if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_peak_score, __pyx_t_2) < 0) __PYX_ERR(0, 1168, __pyx_L1_error)
19603     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19604 
19605     /* "MACS2/IO/ScoreTrack.pyx":1170
19606  *                        summit      = start + summit_offset,
19607  *                        peak_score  = self.data[chrom][3][ summit_index ],
19608  *                        pileup      = self.data[chrom][1][ summit_index ], # should be the same as summit_value             # <<<<<<<<<<<<<<
19609  *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
19610  *                        fold_change = ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
19611  */
19612     if (unlikely(__pyx_v_self->data == Py_None)) {
19613       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19614       __PYX_ERR(0, 1170, __pyx_L1_error)
19615     }
19616     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __pyx_L1_error)
19617     __Pyx_GOTREF(__pyx_t_2);
19618     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error)
19619     __Pyx_GOTREF(__pyx_t_1);
19620     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19621     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __pyx_L1_error)
19622     __Pyx_GOTREF(__pyx_t_2);
19623     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19624     if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_pileup, __pyx_t_2) < 0) __PYX_ERR(0, 1168, __pyx_L1_error)
19625     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19626 
19627     /* "MACS2/IO/ScoreTrack.pyx":1171
19628  *                        peak_score  = self.data[chrom][3][ summit_index ],
19629  *                        pileup      = self.data[chrom][1][ summit_index ], # should be the same as summit_value
19630  *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),             # <<<<<<<<<<<<<<
19631  *                        fold_change = ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
19632  *                        qscore      = qscore,
19633  */
19634     if (unlikely(__pyx_v_self->data == Py_None)) {
19635       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19636       __PYX_ERR(0, 1171, __pyx_L1_error)
19637     }
19638     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error)
19639     __Pyx_GOTREF(__pyx_t_2);
19640     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error)
19641     __Pyx_GOTREF(__pyx_t_1);
19642     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19643     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error)
19644     __Pyx_GOTREF(__pyx_t_2);
19645     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19646     __pyx_t_19 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_19 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1171, __pyx_L1_error)
19647     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19648     if (unlikely(__pyx_v_self->data == Py_None)) {
19649       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19650       __PYX_ERR(0, 1171, __pyx_L1_error)
19651     }
19652     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error)
19653     __Pyx_GOTREF(__pyx_t_2);
19654     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error)
19655     __Pyx_GOTREF(__pyx_t_1);
19656     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19657     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error)
19658     __Pyx_GOTREF(__pyx_t_2);
19659     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19660     __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_20 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1171, __pyx_L1_error)
19661     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19662     __pyx_t_2 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_10ScoreTrack_get_pscore(__pyx_t_19, __pyx_t_20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error)
19663     __Pyx_GOTREF(__pyx_t_2);
19664     if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_pscore, __pyx_t_2) < 0) __PYX_ERR(0, 1168, __pyx_L1_error)
19665     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19666 
19667     /* "MACS2/IO/ScoreTrack.pyx":1172
19668  *                        pileup      = self.data[chrom][1][ summit_index ], # should be the same as summit_value
19669  *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
19670  *                        fold_change = ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),             # <<<<<<<<<<<<<<
19671  *                        qscore      = qscore,
19672  *                        )
19673  */
19674     if (unlikely(__pyx_v_self->data == Py_None)) {
19675       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19676       __PYX_ERR(0, 1172, __pyx_L1_error)
19677     }
19678     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error)
19679     __Pyx_GOTREF(__pyx_t_2);
19680     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
19681     __Pyx_GOTREF(__pyx_t_1);
19682     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19683     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error)
19684     __Pyx_GOTREF(__pyx_t_2);
19685     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19686     __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
19687     __Pyx_GOTREF(__pyx_t_1);
19688     __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1172, __pyx_L1_error)
19689     __Pyx_GOTREF(__pyx_t_5);
19690     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19691     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19692     if (unlikely(__pyx_v_self->data == Py_None)) {
19693       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19694       __PYX_ERR(0, 1172, __pyx_L1_error)
19695     }
19696     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
19697     __Pyx_GOTREF(__pyx_t_1);
19698     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error)
19699     __Pyx_GOTREF(__pyx_t_2);
19700     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19701     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_summit_index, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
19702     __Pyx_GOTREF(__pyx_t_1);
19703     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19704     __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error)
19705     __Pyx_GOTREF(__pyx_t_2);
19706     __pyx_t_17 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1172, __pyx_L1_error)
19707     __Pyx_GOTREF(__pyx_t_17);
19708     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19709     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19710     __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error)
19711     __Pyx_GOTREF(__pyx_t_2);
19712     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19713     __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
19714     if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_fold_change, __pyx_t_2) < 0) __PYX_ERR(0, 1168, __pyx_L1_error)
19715     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19716 
19717     /* "MACS2/IO/ScoreTrack.pyx":1173
19718  *                        pscore      = get_pscore(self.data[chrom][ 1 ][ summit_index ], self.data[chrom][ 2 ][ summit_index ]),
19719  *                        fold_change = ( self.data[chrom][ 1 ][ summit_index ] + self.pseudocount ) / ( self.data[chrom][ 2 ][ summit_index ] + self.pseudocount ),
19720  *                        qscore      = qscore,             # <<<<<<<<<<<<<<
19721  *                        )
19722  *         # start a new peak
19723  */
19724     if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_qscore, __pyx_v_qscore) < 0) __PYX_ERR(0, 1168, __pyx_L1_error)
19725 
19726     /* "MACS2/IO/ScoreTrack.pyx":1165
19727  *                 # if q value is not computed, use -1
19728  *                 qscore = -1
19729  *             peaks.add( chrom,             # <<<<<<<<<<<<<<
19730  *                        start,
19731  *                        end,
19732  */
19733     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error)
19734     __Pyx_GOTREF(__pyx_t_2);
19735     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19736     __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
19737     __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
19738     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19739 
19740     /* "MACS2/IO/ScoreTrack.pyx":1159
19741  *         if not (peak_scores > self.cutoff).all():
19742  *             return self.__close_peak(peak_content, peaks, min_length, chrom)
19743  *         for summit_offset, summit_index in zip(summit_offsets, summit_indices):             # <<<<<<<<<<<<<<
19744  *             if self.scoring_method == ord('q'):
19745  *                 qscore = self.data[chrom][3][ summit_index ]
19746  */
19747   }
19748   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
19749 
19750   /* "MACS2/IO/ScoreTrack.pyx":1176
19751  *                        )
19752  *         # start a new peak
19753  *         return True             # <<<<<<<<<<<<<<
19754  *
19755  *     cdef int64_t total ( self ):
19756  */
19757   __Pyx_XDECREF(((PyObject *)__pyx_r));
19758   __Pyx_INCREF(Py_True);
19759   __pyx_r = ((PyBoolObject *)Py_True);
19760   goto __pyx_L0;
19761 
19762   /* "MACS2/IO/ScoreTrack.pyx":1102
19763  *             return True
19764  *
19765  *     cdef bool __close_peak2 (self, list peak_content, peaks, int32_t min_length,             # <<<<<<<<<<<<<<
19766  *                              bytes chrom, int32_t smoothlen=51,
19767  *                              float64_t min_valley = 0.9):
19768  */
19769 
19770   /* function exit code */
19771   __pyx_L1_error:;
19772   __Pyx_XDECREF(__pyx_t_1);
19773   __Pyx_XDECREF(__pyx_t_2);
19774   __Pyx_XDECREF(__pyx_t_5);
19775   __Pyx_XDECREF(__pyx_t_6);
19776   __Pyx_XDECREF(__pyx_t_14);
19777   __Pyx_XDECREF(__pyx_t_15);
19778   __Pyx_XDECREF(__pyx_t_16);
19779   __Pyx_XDECREF(__pyx_t_17);
19780   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19781     __Pyx_PyThreadState_declare
19782     __Pyx_PyThreadState_assign
19783     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19784     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakdata.rcbuffer->pybuffer);
19785     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakindices.rcbuffer->pybuffer);
19786     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
19787   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19788   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.__close_peak2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19789   __pyx_r = 0;
19790   goto __pyx_L2;
19791   __pyx_L0:;
19792   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakdata.rcbuffer->pybuffer);
19793   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_peakindices.rcbuffer->pybuffer);
19794   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_summit_offsets.rcbuffer->pybuffer);
19795   __pyx_L2:;
19796   __Pyx_XDECREF((PyObject *)__pyx_v_peakdata);
19797   __Pyx_XDECREF((PyObject *)__pyx_v_peakindices);
19798   __Pyx_XDECREF((PyObject *)__pyx_v_summit_offsets);
19799   __Pyx_XDECREF(__pyx_v_peak_length);
19800   __Pyx_XDECREF(__pyx_v_tsvalue);
19801   __Pyx_XDECREF(__pyx_v_summit_indices);
19802   __Pyx_XDECREF(__pyx_v_peak_scores);
19803   __Pyx_XDECREF(__pyx_v_qscore);
19804   __Pyx_XGIVEREF((PyObject *)__pyx_r);
19805   __Pyx_TraceReturn(__pyx_r, 0);
19806   __Pyx_RefNannyFinishContext();
19807   return __pyx_r;
19808 }
19809 
19810 /* "MACS2/IO/ScoreTrack.pyx":1178
19811  *         return True
19812  *
19813  *     cdef int64_t total ( self ):             # <<<<<<<<<<<<<<
19814  *         """Return the number of regions in this object.
19815  *
19816  */
19817 
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_total(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)19818 static __pyx_t_5numpy_int64_t __pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_total(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
19819   __pyx_t_5numpy_int64_t __pyx_v_t;
19820   PyObject *__pyx_v_chrom = 0;
19821   __pyx_t_5numpy_int64_t __pyx_r;
19822   __Pyx_TraceDeclarations
19823   __Pyx_RefNannyDeclarations
19824   PyObject *__pyx_t_1 = NULL;
19825   Py_ssize_t __pyx_t_2;
19826   Py_ssize_t __pyx_t_3;
19827   int __pyx_t_4;
19828   PyObject *__pyx_t_5 = NULL;
19829   int __pyx_t_6;
19830   PyObject *__pyx_t_7 = NULL;
19831   PyObject *__pyx_t_8 = NULL;
19832   __pyx_t_5numpy_int64_t __pyx_t_9;
19833   __Pyx_RefNannySetupContext("total", 0);
19834   __Pyx_TraceCall("total", __pyx_f[0], 1178, 0, __PYX_ERR(0, 1178, __pyx_L1_error));
19835 
19836   /* "MACS2/IO/ScoreTrack.pyx":1186
19837  *             bytes chrom
19838  *
19839  *         t = 0             # <<<<<<<<<<<<<<
19840  *         for chrom in self.data.keys():
19841  *             t += self.datalength[chrom]
19842  */
19843   __pyx_v_t = 0;
19844 
19845   /* "MACS2/IO/ScoreTrack.pyx":1187
19846  *
19847  *         t = 0
19848  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
19849  *             t += self.datalength[chrom]
19850  *         return t
19851  */
19852   __pyx_t_2 = 0;
19853   if (unlikely(__pyx_v_self->data == Py_None)) {
19854     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
19855     __PYX_ERR(0, 1187, __pyx_L1_error)
19856   }
19857   __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1187, __pyx_L1_error)
19858   __Pyx_GOTREF(__pyx_t_5);
19859   __Pyx_XDECREF(__pyx_t_1);
19860   __pyx_t_1 = __pyx_t_5;
19861   __pyx_t_5 = 0;
19862   while (1) {
19863     __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, NULL, NULL, __pyx_t_4);
19864     if (unlikely(__pyx_t_6 == 0)) break;
19865     if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1187, __pyx_L1_error)
19866     __Pyx_GOTREF(__pyx_t_5);
19867     if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 1187, __pyx_L1_error)
19868     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_5));
19869     __pyx_t_5 = 0;
19870 
19871     /* "MACS2/IO/ScoreTrack.pyx":1188
19872  *         t = 0
19873  *         for chrom in self.data.keys():
19874  *             t += self.datalength[chrom]             # <<<<<<<<<<<<<<
19875  *         return t
19876  *
19877  */
19878     __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1188, __pyx_L1_error)
19879     __Pyx_GOTREF(__pyx_t_5);
19880     if (unlikely(__pyx_v_self->datalength == Py_None)) {
19881       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19882       __PYX_ERR(0, 1188, __pyx_L1_error)
19883     }
19884     __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1188, __pyx_L1_error)
19885     __Pyx_GOTREF(__pyx_t_7);
19886     __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1188, __pyx_L1_error)
19887     __Pyx_GOTREF(__pyx_t_8);
19888     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19889     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19890     __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1188, __pyx_L1_error)
19891     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19892     __pyx_v_t = __pyx_t_9;
19893   }
19894   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19895 
19896   /* "MACS2/IO/ScoreTrack.pyx":1189
19897  *         for chrom in self.data.keys():
19898  *             t += self.datalength[chrom]
19899  *         return t             # <<<<<<<<<<<<<<
19900  *
19901  *     cpdef call_broadpeaks (self, float64_t lvl1_cutoff=5.0, float64_t lvl2_cutoff=1.0, int32_t min_length=200, int32_t lvl1_max_gap=50, int32_t lvl2_max_gap=400):
19902  */
19903   __pyx_r = __pyx_v_t;
19904   goto __pyx_L0;
19905 
19906   /* "MACS2/IO/ScoreTrack.pyx":1178
19907  *         return True
19908  *
19909  *     cdef int64_t total ( self ):             # <<<<<<<<<<<<<<
19910  *         """Return the number of regions in this object.
19911  *
19912  */
19913 
19914   /* function exit code */
19915   __pyx_L1_error:;
19916   __Pyx_XDECREF(__pyx_t_1);
19917   __Pyx_XDECREF(__pyx_t_5);
19918   __Pyx_XDECREF(__pyx_t_7);
19919   __Pyx_XDECREF(__pyx_t_8);
19920   __Pyx_WriteUnraisable("MACS2.IO.ScoreTrack.scoreTrackII.total", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19921   __pyx_r = 0;
19922   __pyx_L0:;
19923   __Pyx_XDECREF(__pyx_v_chrom);
19924   __Pyx_TraceReturn(Py_None, 0);
19925   __Pyx_RefNannyFinishContext();
19926   return __pyx_r;
19927 }
19928 
19929 /* "MACS2/IO/ScoreTrack.pyx":1191
19930  *         return t
19931  *
19932  *     cpdef call_broadpeaks (self, float64_t lvl1_cutoff=5.0, float64_t lvl2_cutoff=1.0, int32_t min_length=200, int32_t lvl1_max_gap=50, int32_t lvl2_max_gap=400):             # <<<<<<<<<<<<<<
19933  *         """This function try to find enriched regions within which,
19934  *         scores are continuously higher than a given cutoff for level
19935  */
19936 
19937 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_27call_broadpeaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,int __pyx_skip_dispatch,struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks * __pyx_optional_args)19938 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks *__pyx_optional_args) {
19939   __pyx_t_5numpy_float64_t __pyx_v_lvl1_cutoff = ((__pyx_t_5numpy_float64_t)5.0);
19940   __pyx_t_5numpy_float64_t __pyx_v_lvl2_cutoff = ((__pyx_t_5numpy_float64_t)1.0);
19941   __pyx_t_5numpy_int32_t __pyx_v_min_length = ((__pyx_t_5numpy_int32_t)0xC8);
19942   __pyx_t_5numpy_int32_t __pyx_v_lvl1_max_gap = ((__pyx_t_5numpy_int32_t)50);
19943   __pyx_t_5numpy_int32_t __pyx_v_lvl2_max_gap = ((__pyx_t_5numpy_int32_t)0x190);
19944   __pyx_t_5numpy_int32_t __pyx_v_i;
19945   PyObject *__pyx_v_chrom = 0;
19946   PyObject *__pyx_v_lvl1_peaks = NULL;
19947   PyObject *__pyx_v_lvl2_peaks = NULL;
19948   PyObject *__pyx_v_chrs = NULL;
19949   PyObject *__pyx_v_broadpeaks = NULL;
19950   PyObject *__pyx_v_lvl1peakschrom = NULL;
19951   PyObject *__pyx_v_lvl2peakschrom = NULL;
19952   PyObject *__pyx_v_lvl1peakschrom_next = NULL;
19953   PyObject *__pyx_v_tmppeakset = NULL;
19954   PyObject *__pyx_v_lvl1 = NULL;
19955   PyObject *__pyx_v_lvl2 = NULL;
19956   Py_ssize_t __pyx_v_j;
19957   PyObject *__pyx_r = NULL;
19958   __Pyx_TraceDeclarations
19959   __Pyx_RefNannyDeclarations
19960   PyObject *__pyx_t_1 = NULL;
19961   PyObject *__pyx_t_2 = NULL;
19962   PyObject *__pyx_t_3 = NULL;
19963   PyObject *__pyx_t_4 = NULL;
19964   PyObject *__pyx_t_5 = NULL;
19965   PyObject *__pyx_t_6 = NULL;
19966   PyObject *__pyx_t_7 = NULL;
19967   PyObject *__pyx_t_8 = NULL;
19968   PyObject *__pyx_t_9 = NULL;
19969   int __pyx_t_10;
19970   PyObject *__pyx_t_11 = NULL;
19971   struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks __pyx_t_12;
19972   Py_ssize_t __pyx_t_13;
19973   PyObject *(*__pyx_t_14)(PyObject *);
19974   PyObject *__pyx_t_15 = NULL;
19975   PyObject *__pyx_t_16 = NULL;
19976   PyObject *__pyx_t_17 = NULL;
19977   Py_ssize_t __pyx_t_18;
19978   Py_ssize_t __pyx_t_19;
19979   __pyx_t_5numpy_int32_t __pyx_t_20;
19980   int __pyx_t_21;
19981   int __pyx_t_22;
19982   int __pyx_t_23;
19983   Py_ssize_t __pyx_t_24;
19984   __Pyx_RefNannySetupContext("call_broadpeaks", 0);
19985   __Pyx_TraceCall("call_broadpeaks", __pyx_f[0], 1191, 0, __PYX_ERR(0, 1191, __pyx_L1_error));
19986   if (__pyx_optional_args) {
19987     if (__pyx_optional_args->__pyx_n > 0) {
19988       __pyx_v_lvl1_cutoff = __pyx_optional_args->lvl1_cutoff;
19989       if (__pyx_optional_args->__pyx_n > 1) {
19990         __pyx_v_lvl2_cutoff = __pyx_optional_args->lvl2_cutoff;
19991         if (__pyx_optional_args->__pyx_n > 2) {
19992           __pyx_v_min_length = __pyx_optional_args->min_length;
19993           if (__pyx_optional_args->__pyx_n > 3) {
19994             __pyx_v_lvl1_max_gap = __pyx_optional_args->lvl1_max_gap;
19995             if (__pyx_optional_args->__pyx_n > 4) {
19996               __pyx_v_lvl2_max_gap = __pyx_optional_args->lvl2_max_gap;
19997             }
19998           }
19999         }
20000       }
20001     }
20002   }
20003   /* Check if called by wrapper */
20004   if (unlikely(__pyx_skip_dispatch)) ;
20005   /* Check if overridden in Python */
20006   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
20007     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
20008     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
20009     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
20010       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
20011       #endif
20012       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_call_broadpeaks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error)
20013       __Pyx_GOTREF(__pyx_t_1);
20014       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_27call_broadpeaks)) {
20015         __Pyx_XDECREF(__pyx_r);
20016         __pyx_t_3 = PyFloat_FromDouble(__pyx_v_lvl1_cutoff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1191, __pyx_L1_error)
20017         __Pyx_GOTREF(__pyx_t_3);
20018         __pyx_t_4 = PyFloat_FromDouble(__pyx_v_lvl2_cutoff); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1191, __pyx_L1_error)
20019         __Pyx_GOTREF(__pyx_t_4);
20020         __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_min_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1191, __pyx_L1_error)
20021         __Pyx_GOTREF(__pyx_t_5);
20022         __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_lvl1_max_gap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1191, __pyx_L1_error)
20023         __Pyx_GOTREF(__pyx_t_6);
20024         __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_lvl2_max_gap); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1191, __pyx_L1_error)
20025         __Pyx_GOTREF(__pyx_t_7);
20026         __Pyx_INCREF(__pyx_t_1);
20027         __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
20028         __pyx_t_10 = 0;
20029         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
20030           __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
20031           if (likely(__pyx_t_9)) {
20032             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
20033             __Pyx_INCREF(__pyx_t_9);
20034             __Pyx_INCREF(function);
20035             __Pyx_DECREF_SET(__pyx_t_8, function);
20036             __pyx_t_10 = 1;
20037           }
20038         }
20039         #if CYTHON_FAST_PYCALL
20040         if (PyFunction_Check(__pyx_t_8)) {
20041           PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
20042           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error)
20043           __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20044           __Pyx_GOTREF(__pyx_t_2);
20045           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20046           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20047           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20048           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20049           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20050         } else
20051         #endif
20052         #if CYTHON_FAST_PYCCALL
20053         if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
20054           PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
20055           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error)
20056           __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20057           __Pyx_GOTREF(__pyx_t_2);
20058           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20059           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20060           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20061           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20062           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20063         } else
20064         #endif
20065         {
20066           __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1191, __pyx_L1_error)
20067           __Pyx_GOTREF(__pyx_t_11);
20068           if (__pyx_t_9) {
20069             __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
20070           }
20071           __Pyx_GIVEREF(__pyx_t_3);
20072           PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
20073           __Pyx_GIVEREF(__pyx_t_4);
20074           PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
20075           __Pyx_GIVEREF(__pyx_t_5);
20076           PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
20077           __Pyx_GIVEREF(__pyx_t_6);
20078           PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
20079           __Pyx_GIVEREF(__pyx_t_7);
20080           PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
20081           __pyx_t_3 = 0;
20082           __pyx_t_4 = 0;
20083           __pyx_t_5 = 0;
20084           __pyx_t_6 = 0;
20085           __pyx_t_7 = 0;
20086           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error)
20087           __Pyx_GOTREF(__pyx_t_2);
20088           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
20089         }
20090         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20091         __pyx_r = __pyx_t_2;
20092         __pyx_t_2 = 0;
20093         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20094         goto __pyx_L0;
20095       }
20096       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
20097       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
20098       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
20099       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
20100         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
20101       }
20102       #endif
20103       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20104       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
20105     }
20106     #endif
20107   }
20108 
20109   /* "MACS2/IO/ScoreTrack.pyx":1210
20110  *             bytes chrom
20111  *
20112  *         assert lvl1_cutoff > lvl2_cutoff, "level 1 cutoff should be larger than level 2."             # <<<<<<<<<<<<<<
20113  *         assert lvl1_max_gap < lvl2_max_gap, "level 2 maximum gap should be larger than level 1."
20114  *         lvl1_peaks = self.call_peaks(cutoff=lvl1_cutoff, min_length=min_length, max_gap=lvl1_max_gap)
20115  */
20116   #ifndef CYTHON_WITHOUT_ASSERTIONS
20117   if (unlikely(!Py_OptimizeFlag)) {
20118     if (unlikely(!((__pyx_v_lvl1_cutoff > __pyx_v_lvl2_cutoff) != 0))) {
20119       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_level_1_cutoff_should_be_larger);
20120       __PYX_ERR(0, 1210, __pyx_L1_error)
20121     }
20122   }
20123   #endif
20124 
20125   /* "MACS2/IO/ScoreTrack.pyx":1211
20126  *
20127  *         assert lvl1_cutoff > lvl2_cutoff, "level 1 cutoff should be larger than level 2."
20128  *         assert lvl1_max_gap < lvl2_max_gap, "level 2 maximum gap should be larger than level 1."             # <<<<<<<<<<<<<<
20129  *         lvl1_peaks = self.call_peaks(cutoff=lvl1_cutoff, min_length=min_length, max_gap=lvl1_max_gap)
20130  *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap)
20131  */
20132   #ifndef CYTHON_WITHOUT_ASSERTIONS
20133   if (unlikely(!Py_OptimizeFlag)) {
20134     if (unlikely(!((__pyx_v_lvl1_max_gap < __pyx_v_lvl2_max_gap) != 0))) {
20135       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_level_2_maximum_gap_should_be_la);
20136       __PYX_ERR(0, 1211, __pyx_L1_error)
20137     }
20138   }
20139   #endif
20140 
20141   /* "MACS2/IO/ScoreTrack.pyx":1212
20142  *         assert lvl1_cutoff > lvl2_cutoff, "level 1 cutoff should be larger than level 2."
20143  *         assert lvl1_max_gap < lvl2_max_gap, "level 2 maximum gap should be larger than level 1."
20144  *         lvl1_peaks = self.call_peaks(cutoff=lvl1_cutoff, min_length=min_length, max_gap=lvl1_max_gap)             # <<<<<<<<<<<<<<
20145  *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap)
20146  *         chrs = lvl1_peaks.peaks.keys()
20147  */
20148   __pyx_t_12.__pyx_n = 3;
20149   __pyx_t_12.cutoff = __pyx_v_lvl1_cutoff;
20150   __pyx_t_12.min_length = __pyx_v_min_length;
20151   __pyx_t_12.max_gap = __pyx_v_lvl1_max_gap;
20152   __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->call_peaks(__pyx_v_self, 0, &__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
20153   __Pyx_GOTREF(__pyx_t_1);
20154   __pyx_v_lvl1_peaks = __pyx_t_1;
20155   __pyx_t_1 = 0;
20156 
20157   /* "MACS2/IO/ScoreTrack.pyx":1213
20158  *         assert lvl1_max_gap < lvl2_max_gap, "level 2 maximum gap should be larger than level 1."
20159  *         lvl1_peaks = self.call_peaks(cutoff=lvl1_cutoff, min_length=min_length, max_gap=lvl1_max_gap)
20160  *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap)             # <<<<<<<<<<<<<<
20161  *         chrs = lvl1_peaks.peaks.keys()
20162  *         broadpeaks = BroadPeakIO()
20163  */
20164   __pyx_t_12.__pyx_n = 3;
20165   __pyx_t_12.cutoff = __pyx_v_lvl2_cutoff;
20166   __pyx_t_12.min_length = __pyx_v_min_length;
20167   __pyx_t_12.max_gap = __pyx_v_lvl2_max_gap;
20168   __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self->__pyx_vtab)->call_peaks(__pyx_v_self, 0, &__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
20169   __Pyx_GOTREF(__pyx_t_1);
20170   __pyx_v_lvl2_peaks = __pyx_t_1;
20171   __pyx_t_1 = 0;
20172 
20173   /* "MACS2/IO/ScoreTrack.pyx":1214
20174  *         lvl1_peaks = self.call_peaks(cutoff=lvl1_cutoff, min_length=min_length, max_gap=lvl1_max_gap)
20175  *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap)
20176  *         chrs = lvl1_peaks.peaks.keys()             # <<<<<<<<<<<<<<
20177  *         broadpeaks = BroadPeakIO()
20178  *         # use lvl2_peaks as linking regions between lvl1_peaks
20179  */
20180   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_lvl1_peaks, __pyx_n_s_peaks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1214, __pyx_L1_error)
20181   __Pyx_GOTREF(__pyx_t_2);
20182   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_keys); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1214, __pyx_L1_error)
20183   __Pyx_GOTREF(__pyx_t_8);
20184   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20185   __pyx_t_2 = NULL;
20186   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
20187     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
20188     if (likely(__pyx_t_2)) {
20189       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
20190       __Pyx_INCREF(__pyx_t_2);
20191       __Pyx_INCREF(function);
20192       __Pyx_DECREF_SET(__pyx_t_8, function);
20193     }
20194   }
20195   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
20196   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20197   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L1_error)
20198   __Pyx_GOTREF(__pyx_t_1);
20199   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20200   __pyx_v_chrs = __pyx_t_1;
20201   __pyx_t_1 = 0;
20202 
20203   /* "MACS2/IO/ScoreTrack.pyx":1215
20204  *         lvl2_peaks = self.call_peaks(cutoff=lvl2_cutoff, min_length=min_length, max_gap=lvl2_max_gap)
20205  *         chrs = lvl1_peaks.peaks.keys()
20206  *         broadpeaks = BroadPeakIO()             # <<<<<<<<<<<<<<
20207  *         # use lvl2_peaks as linking regions between lvl1_peaks
20208  *         for chrom in chrs:
20209  */
20210   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BroadPeakIO); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1215, __pyx_L1_error)
20211   __Pyx_GOTREF(__pyx_t_8);
20212   __pyx_t_2 = NULL;
20213   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
20214     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
20215     if (likely(__pyx_t_2)) {
20216       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
20217       __Pyx_INCREF(__pyx_t_2);
20218       __Pyx_INCREF(function);
20219       __Pyx_DECREF_SET(__pyx_t_8, function);
20220     }
20221   }
20222   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
20223   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20224   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1215, __pyx_L1_error)
20225   __Pyx_GOTREF(__pyx_t_1);
20226   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20227   __pyx_v_broadpeaks = __pyx_t_1;
20228   __pyx_t_1 = 0;
20229 
20230   /* "MACS2/IO/ScoreTrack.pyx":1217
20231  *         broadpeaks = BroadPeakIO()
20232  *         # use lvl2_peaks as linking regions between lvl1_peaks
20233  *         for chrom in chrs:             # <<<<<<<<<<<<<<
20234  *             lvl1peakschrom = lvl1_peaks.peaks[chrom]
20235  *             lvl2peakschrom = lvl2_peaks.peaks[chrom]
20236  */
20237   if (likely(PyList_CheckExact(__pyx_v_chrs)) || PyTuple_CheckExact(__pyx_v_chrs)) {
20238     __pyx_t_1 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0;
20239     __pyx_t_14 = NULL;
20240   } else {
20241     __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error)
20242     __Pyx_GOTREF(__pyx_t_1);
20243     __pyx_t_14 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1217, __pyx_L1_error)
20244   }
20245   for (;;) {
20246     if (likely(!__pyx_t_14)) {
20247       if (likely(PyList_CheckExact(__pyx_t_1))) {
20248         if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break;
20249         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20250         __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1217, __pyx_L1_error)
20251         #else
20252         __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1217, __pyx_L1_error)
20253         __Pyx_GOTREF(__pyx_t_8);
20254         #endif
20255       } else {
20256         if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
20257         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20258         __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1217, __pyx_L1_error)
20259         #else
20260         __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1217, __pyx_L1_error)
20261         __Pyx_GOTREF(__pyx_t_8);
20262         #endif
20263       }
20264     } else {
20265       __pyx_t_8 = __pyx_t_14(__pyx_t_1);
20266       if (unlikely(!__pyx_t_8)) {
20267         PyObject* exc_type = PyErr_Occurred();
20268         if (exc_type) {
20269           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
20270           else __PYX_ERR(0, 1217, __pyx_L1_error)
20271         }
20272         break;
20273       }
20274       __Pyx_GOTREF(__pyx_t_8);
20275     }
20276     if (!(likely(PyBytes_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 1217, __pyx_L1_error)
20277     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_8));
20278     __pyx_t_8 = 0;
20279 
20280     /* "MACS2/IO/ScoreTrack.pyx":1218
20281  *         # use lvl2_peaks as linking regions between lvl1_peaks
20282  *         for chrom in chrs:
20283  *             lvl1peakschrom = lvl1_peaks.peaks[chrom]             # <<<<<<<<<<<<<<
20284  *             lvl2peakschrom = lvl2_peaks.peaks[chrom]
20285  *             lvl1peakschrom_next = iter(lvl1peakschrom).__next__
20286  */
20287     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_lvl1_peaks, __pyx_n_s_peaks); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1218, __pyx_L1_error)
20288     __Pyx_GOTREF(__pyx_t_8);
20289     __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error)
20290     __Pyx_GOTREF(__pyx_t_2);
20291     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20292     __Pyx_XDECREF_SET(__pyx_v_lvl1peakschrom, __pyx_t_2);
20293     __pyx_t_2 = 0;
20294 
20295     /* "MACS2/IO/ScoreTrack.pyx":1219
20296  *         for chrom in chrs:
20297  *             lvl1peakschrom = lvl1_peaks.peaks[chrom]
20298  *             lvl2peakschrom = lvl2_peaks.peaks[chrom]             # <<<<<<<<<<<<<<
20299  *             lvl1peakschrom_next = iter(lvl1peakschrom).__next__
20300  *             tmppeakset = []             # to temporarily store lvl1 region inside a lvl2 region
20301  */
20302     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_lvl2_peaks, __pyx_n_s_peaks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1219, __pyx_L1_error)
20303     __Pyx_GOTREF(__pyx_t_2);
20304     __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_chrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1219, __pyx_L1_error)
20305     __Pyx_GOTREF(__pyx_t_8);
20306     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20307     __Pyx_XDECREF_SET(__pyx_v_lvl2peakschrom, __pyx_t_8);
20308     __pyx_t_8 = 0;
20309 
20310     /* "MACS2/IO/ScoreTrack.pyx":1220
20311  *             lvl1peakschrom = lvl1_peaks.peaks[chrom]
20312  *             lvl2peakschrom = lvl2_peaks.peaks[chrom]
20313  *             lvl1peakschrom_next = iter(lvl1peakschrom).__next__             # <<<<<<<<<<<<<<
20314  *             tmppeakset = []             # to temporarily store lvl1 region inside a lvl2 region
20315  *             # our assumption is lvl1 regions should be included in lvl2 regions
20316  */
20317     __pyx_t_8 = PyObject_GetIter(__pyx_v_lvl1peakschrom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1220, __pyx_L1_error)
20318     __Pyx_GOTREF(__pyx_t_8);
20319     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1220, __pyx_L1_error)
20320     __Pyx_GOTREF(__pyx_t_2);
20321     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20322     __Pyx_XDECREF_SET(__pyx_v_lvl1peakschrom_next, __pyx_t_2);
20323     __pyx_t_2 = 0;
20324 
20325     /* "MACS2/IO/ScoreTrack.pyx":1221
20326  *             lvl2peakschrom = lvl2_peaks.peaks[chrom]
20327  *             lvl1peakschrom_next = iter(lvl1peakschrom).__next__
20328  *             tmppeakset = []             # to temporarily store lvl1 region inside a lvl2 region             # <<<<<<<<<<<<<<
20329  *             # our assumption is lvl1 regions should be included in lvl2 regions
20330  *             try:
20331  */
20332     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __pyx_L1_error)
20333     __Pyx_GOTREF(__pyx_t_2);
20334     __Pyx_XDECREF_SET(__pyx_v_tmppeakset, ((PyObject*)__pyx_t_2));
20335     __pyx_t_2 = 0;
20336 
20337     /* "MACS2/IO/ScoreTrack.pyx":1223
20338  *             tmppeakset = []             # to temporarily store lvl1 region inside a lvl2 region
20339  *             # our assumption is lvl1 regions should be included in lvl2 regions
20340  *             try:             # <<<<<<<<<<<<<<
20341  *                 lvl1 = lvl1peakschrom_next()
20342  *                 for i in range( len(lvl2peakschrom) ):
20343  */
20344     {
20345       __Pyx_PyThreadState_declare
20346       __Pyx_PyThreadState_assign
20347       __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
20348       __Pyx_XGOTREF(__pyx_t_15);
20349       __Pyx_XGOTREF(__pyx_t_16);
20350       __Pyx_XGOTREF(__pyx_t_17);
20351       /*try:*/ {
20352 
20353         /* "MACS2/IO/ScoreTrack.pyx":1224
20354  *             # our assumption is lvl1 regions should be included in lvl2 regions
20355  *             try:
20356  *                 lvl1 = lvl1peakschrom_next()             # <<<<<<<<<<<<<<
20357  *                 for i in range( len(lvl2peakschrom) ):
20358  *                     # for each lvl2 peak, find all lvl1 peaks inside
20359  */
20360         __Pyx_INCREF(__pyx_v_lvl1peakschrom_next);
20361         __pyx_t_8 = __pyx_v_lvl1peakschrom_next; __pyx_t_11 = NULL;
20362         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
20363           __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
20364           if (likely(__pyx_t_11)) {
20365             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
20366             __Pyx_INCREF(__pyx_t_11);
20367             __Pyx_INCREF(function);
20368             __Pyx_DECREF_SET(__pyx_t_8, function);
20369           }
20370         }
20371         __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
20372         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
20373         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L5_error)
20374         __Pyx_GOTREF(__pyx_t_2);
20375         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20376         __Pyx_XDECREF_SET(__pyx_v_lvl1, __pyx_t_2);
20377         __pyx_t_2 = 0;
20378 
20379         /* "MACS2/IO/ScoreTrack.pyx":1225
20380  *             try:
20381  *                 lvl1 = lvl1peakschrom_next()
20382  *                 for i in range( len(lvl2peakschrom) ):             # <<<<<<<<<<<<<<
20383  *                     # for each lvl2 peak, find all lvl1 peaks inside
20384  *                     # I assume lvl1 peaks can be ALL covered by lvl2 peaks.
20385  */
20386         __pyx_t_18 = PyObject_Length(__pyx_v_lvl2peakschrom); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1225, __pyx_L5_error)
20387         __pyx_t_19 = __pyx_t_18;
20388         for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
20389           __pyx_v_i = __pyx_t_20;
20390 
20391           /* "MACS2/IO/ScoreTrack.pyx":1228
20392  *                     # for each lvl2 peak, find all lvl1 peaks inside
20393  *                     # I assume lvl1 peaks can be ALL covered by lvl2 peaks.
20394  *                     lvl2 = lvl2peakschrom[i]             # <<<<<<<<<<<<<<
20395  *
20396  *                     while True:
20397  */
20398           __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_lvl2peakschrom, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L5_error)
20399           __Pyx_GOTREF(__pyx_t_2);
20400           __Pyx_XDECREF_SET(__pyx_v_lvl2, __pyx_t_2);
20401           __pyx_t_2 = 0;
20402 
20403           /* "MACS2/IO/ScoreTrack.pyx":1230
20404  *                     lvl2 = lvl2peakschrom[i]
20405  *
20406  *                     while True:             # <<<<<<<<<<<<<<
20407  *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:
20408  *                             tmppeakset.append(lvl1)
20409  */
20410           while (1) {
20411 
20412             /* "MACS2/IO/ScoreTrack.pyx":1231
20413  *
20414  *                     while True:
20415  *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:             # <<<<<<<<<<<<<<
20416  *                             tmppeakset.append(lvl1)
20417  *                             lvl1 = lvl1peakschrom_next()
20418  */
20419             __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_lvl2, __pyx_n_u_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1231, __pyx_L5_error)
20420             __Pyx_GOTREF(__pyx_t_2);
20421             __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_lvl1, __pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1231, __pyx_L5_error)
20422             __Pyx_GOTREF(__pyx_t_8);
20423             __pyx_t_11 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_LE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1231, __pyx_L5_error)
20424             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20425             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20426             __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_22 < 0)) __PYX_ERR(0, 1231, __pyx_L5_error)
20427             __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
20428             if (__pyx_t_22) {
20429             } else {
20430               __pyx_t_21 = __pyx_t_22;
20431               goto __pyx_L18_bool_binop_done;
20432             }
20433             __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_lvl1, __pyx_n_u_end); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1231, __pyx_L5_error)
20434             __Pyx_GOTREF(__pyx_t_11);
20435             __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_lvl2, __pyx_n_u_end); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1231, __pyx_L5_error)
20436             __Pyx_GOTREF(__pyx_t_8);
20437             __pyx_t_2 = PyObject_RichCompare(__pyx_t_11, __pyx_t_8, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1231, __pyx_L5_error)
20438             __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
20439             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20440             __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_22 < 0)) __PYX_ERR(0, 1231, __pyx_L5_error)
20441             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20442             __pyx_t_21 = __pyx_t_22;
20443             __pyx_L18_bool_binop_done:;
20444             if (__pyx_t_21) {
20445 
20446               /* "MACS2/IO/ScoreTrack.pyx":1232
20447  *                     while True:
20448  *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:
20449  *                             tmppeakset.append(lvl1)             # <<<<<<<<<<<<<<
20450  *                             lvl1 = lvl1peakschrom_next()
20451  *                         else:
20452  */
20453               __pyx_t_23 = __Pyx_PyList_Append(__pyx_v_tmppeakset, __pyx_v_lvl1); if (unlikely(__pyx_t_23 == ((int)-1))) __PYX_ERR(0, 1232, __pyx_L5_error)
20454 
20455               /* "MACS2/IO/ScoreTrack.pyx":1233
20456  *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:
20457  *                             tmppeakset.append(lvl1)
20458  *                             lvl1 = lvl1peakschrom_next()             # <<<<<<<<<<<<<<
20459  *                         else:
20460  *                             # make a hierarchical broad peak
20461  */
20462               __Pyx_INCREF(__pyx_v_lvl1peakschrom_next);
20463               __pyx_t_8 = __pyx_v_lvl1peakschrom_next; __pyx_t_11 = NULL;
20464               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
20465                 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
20466                 if (likely(__pyx_t_11)) {
20467                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
20468                   __Pyx_INCREF(__pyx_t_11);
20469                   __Pyx_INCREF(function);
20470                   __Pyx_DECREF_SET(__pyx_t_8, function);
20471                 }
20472               }
20473               __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
20474               __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
20475               if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1233, __pyx_L5_error)
20476               __Pyx_GOTREF(__pyx_t_2);
20477               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20478               __Pyx_DECREF_SET(__pyx_v_lvl1, __pyx_t_2);
20479               __pyx_t_2 = 0;
20480 
20481               /* "MACS2/IO/ScoreTrack.pyx":1231
20482  *
20483  *                     while True:
20484  *                         if lvl2["start"] <= lvl1["start"]  and lvl1["end"] <= lvl2["end"]:             # <<<<<<<<<<<<<<
20485  *                             tmppeakset.append(lvl1)
20486  *                             lvl1 = lvl1peakschrom_next()
20487  */
20488               goto __pyx_L17;
20489             }
20490 
20491             /* "MACS2/IO/ScoreTrack.pyx":1237
20492  *                             # make a hierarchical broad peak
20493  *                             #print lvl2["start"], lvl2["end"], lvl2["score"]
20494  *                             self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)             # <<<<<<<<<<<<<<
20495  *                             tmppeakset = []
20496  *                             break
20497  */
20498             /*else*/ {
20499               __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_broadpeak); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1237, __pyx_L5_error)
20500               __Pyx_GOTREF(__pyx_t_8);
20501               __pyx_t_11 = NULL;
20502               __pyx_t_10 = 0;
20503               if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
20504                 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
20505                 if (likely(__pyx_t_11)) {
20506                   PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
20507                   __Pyx_INCREF(__pyx_t_11);
20508                   __Pyx_INCREF(function);
20509                   __Pyx_DECREF_SET(__pyx_t_8, function);
20510                   __pyx_t_10 = 1;
20511                 }
20512               }
20513               #if CYTHON_FAST_PYCALL
20514               if (PyFunction_Check(__pyx_t_8)) {
20515                 PyObject *__pyx_temp[5] = {__pyx_t_11, __pyx_v_broadpeaks, __pyx_v_chrom, __pyx_v_lvl2, __pyx_v_tmppeakset};
20516                 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L5_error)
20517                 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
20518                 __Pyx_GOTREF(__pyx_t_2);
20519               } else
20520               #endif
20521               #if CYTHON_FAST_PYCCALL
20522               if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
20523                 PyObject *__pyx_temp[5] = {__pyx_t_11, __pyx_v_broadpeaks, __pyx_v_chrom, __pyx_v_lvl2, __pyx_v_tmppeakset};
20524                 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L5_error)
20525                 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
20526                 __Pyx_GOTREF(__pyx_t_2);
20527               } else
20528               #endif
20529               {
20530                 __pyx_t_7 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1237, __pyx_L5_error)
20531                 __Pyx_GOTREF(__pyx_t_7);
20532                 if (__pyx_t_11) {
20533                   __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11); __pyx_t_11 = NULL;
20534                 }
20535                 __Pyx_INCREF(__pyx_v_broadpeaks);
20536                 __Pyx_GIVEREF(__pyx_v_broadpeaks);
20537                 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_v_broadpeaks);
20538                 __Pyx_INCREF(__pyx_v_chrom);
20539                 __Pyx_GIVEREF(__pyx_v_chrom);
20540                 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_v_chrom);
20541                 __Pyx_INCREF(__pyx_v_lvl2);
20542                 __Pyx_GIVEREF(__pyx_v_lvl2);
20543                 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_10, __pyx_v_lvl2);
20544                 __Pyx_INCREF(__pyx_v_tmppeakset);
20545                 __Pyx_GIVEREF(__pyx_v_tmppeakset);
20546                 PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_10, __pyx_v_tmppeakset);
20547                 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L5_error)
20548                 __Pyx_GOTREF(__pyx_t_2);
20549                 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20550               }
20551               __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20552               __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20553 
20554               /* "MACS2/IO/ScoreTrack.pyx":1238
20555  *                             #print lvl2["start"], lvl2["end"], lvl2["score"]
20556  *                             self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
20557  *                             tmppeakset = []             # <<<<<<<<<<<<<<
20558  *                             break
20559  *             except StopIteration:
20560  */
20561               __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1238, __pyx_L5_error)
20562               __Pyx_GOTREF(__pyx_t_2);
20563               __Pyx_DECREF_SET(__pyx_v_tmppeakset, ((PyObject*)__pyx_t_2));
20564               __pyx_t_2 = 0;
20565 
20566               /* "MACS2/IO/ScoreTrack.pyx":1239
20567  *                             self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
20568  *                             tmppeakset = []
20569  *                             break             # <<<<<<<<<<<<<<
20570  *             except StopIteration:
20571  *                 # no more strong (aka lvl1) peaks left
20572  */
20573               goto __pyx_L16_break;
20574             }
20575             __pyx_L17:;
20576           }
20577           __pyx_L16_break:;
20578         }
20579 
20580         /* "MACS2/IO/ScoreTrack.pyx":1223
20581  *             tmppeakset = []             # to temporarily store lvl1 region inside a lvl2 region
20582  *             # our assumption is lvl1 regions should be included in lvl2 regions
20583  *             try:             # <<<<<<<<<<<<<<
20584  *                 lvl1 = lvl1peakschrom_next()
20585  *                 for i in range( len(lvl2peakschrom) ):
20586  */
20587       }
20588       __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
20589       __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
20590       __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
20591       goto __pyx_L12_try_end;
20592       __pyx_L5_error:;
20593       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
20594       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20595       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20596       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20597       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20598       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20599       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
20600       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20601       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20602 
20603       /* "MACS2/IO/ScoreTrack.pyx":1240
20604  *                             tmppeakset = []
20605  *                             break
20606  *             except StopIteration:             # <<<<<<<<<<<<<<
20607  *                 # no more strong (aka lvl1) peaks left
20608  *                 self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
20609  */
20610       __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
20611       if (__pyx_t_10) {
20612         __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
20613         if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_8, &__pyx_t_7) < 0) __PYX_ERR(0, 1240, __pyx_L7_except_error)
20614         __Pyx_GOTREF(__pyx_t_2);
20615         __Pyx_GOTREF(__pyx_t_8);
20616         __Pyx_GOTREF(__pyx_t_7);
20617 
20618         /* "MACS2/IO/ScoreTrack.pyx":1242
20619  *             except StopIteration:
20620  *                 # no more strong (aka lvl1) peaks left
20621  *                 self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)             # <<<<<<<<<<<<<<
20622  *                 tmppeakset = []
20623  *                 # add the rest lvl2 peaks
20624  */
20625         __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_broadpeak); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L7_except_error)
20626         __Pyx_GOTREF(__pyx_t_6);
20627         if (unlikely(!__pyx_v_lvl2)) { __Pyx_RaiseUnboundLocalError("lvl2"); __PYX_ERR(0, 1242, __pyx_L7_except_error) }
20628         __pyx_t_5 = NULL;
20629         __pyx_t_10 = 0;
20630         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
20631           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
20632           if (likely(__pyx_t_5)) {
20633             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
20634             __Pyx_INCREF(__pyx_t_5);
20635             __Pyx_INCREF(function);
20636             __Pyx_DECREF_SET(__pyx_t_6, function);
20637             __pyx_t_10 = 1;
20638           }
20639         }
20640         #if CYTHON_FAST_PYCALL
20641         if (PyFunction_Check(__pyx_t_6)) {
20642           PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_broadpeaks, __pyx_v_chrom, __pyx_v_lvl2, __pyx_v_tmppeakset};
20643           __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1242, __pyx_L7_except_error)
20644           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20645           __Pyx_GOTREF(__pyx_t_11);
20646         } else
20647         #endif
20648         #if CYTHON_FAST_PYCCALL
20649         if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
20650           PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_broadpeaks, __pyx_v_chrom, __pyx_v_lvl2, __pyx_v_tmppeakset};
20651           __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1242, __pyx_L7_except_error)
20652           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20653           __Pyx_GOTREF(__pyx_t_11);
20654         } else
20655         #endif
20656         {
20657           __pyx_t_4 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1242, __pyx_L7_except_error)
20658           __Pyx_GOTREF(__pyx_t_4);
20659           if (__pyx_t_5) {
20660             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
20661           }
20662           __Pyx_INCREF(__pyx_v_broadpeaks);
20663           __Pyx_GIVEREF(__pyx_v_broadpeaks);
20664           PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_10, __pyx_v_broadpeaks);
20665           __Pyx_INCREF(__pyx_v_chrom);
20666           __Pyx_GIVEREF(__pyx_v_chrom);
20667           PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_10, __pyx_v_chrom);
20668           __Pyx_INCREF(__pyx_v_lvl2);
20669           __Pyx_GIVEREF(__pyx_v_lvl2);
20670           PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_10, __pyx_v_lvl2);
20671           __Pyx_INCREF(__pyx_v_tmppeakset);
20672           __Pyx_GIVEREF(__pyx_v_tmppeakset);
20673           PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_10, __pyx_v_tmppeakset);
20674           __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1242, __pyx_L7_except_error)
20675           __Pyx_GOTREF(__pyx_t_11);
20676           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20677         }
20678         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20679         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
20680 
20681         /* "MACS2/IO/ScoreTrack.pyx":1243
20682  *                 # no more strong (aka lvl1) peaks left
20683  *                 self.__add_broadpeak ( broadpeaks, chrom, lvl2, tmppeakset)
20684  *                 tmppeakset = []             # <<<<<<<<<<<<<<
20685  *                 # add the rest lvl2 peaks
20686  *                 for j in range( i+1, len(lvl2peakschrom) ):
20687  */
20688         __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1243, __pyx_L7_except_error)
20689         __Pyx_GOTREF(__pyx_t_11);
20690         __Pyx_DECREF_SET(__pyx_v_tmppeakset, ((PyObject*)__pyx_t_11));
20691         __pyx_t_11 = 0;
20692 
20693         /* "MACS2/IO/ScoreTrack.pyx":1245
20694  *                 tmppeakset = []
20695  *                 # add the rest lvl2 peaks
20696  *                 for j in range( i+1, len(lvl2peakschrom) ):             # <<<<<<<<<<<<<<
20697  *                     self.__add_broadpeak( broadpeaks, chrom, lvl2peakschrom[j], tmppeakset )
20698  *
20699  */
20700         __pyx_t_18 = PyObject_Length(__pyx_v_lvl2peakschrom); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1245, __pyx_L7_except_error)
20701         __pyx_t_19 = __pyx_t_18;
20702         for (__pyx_t_24 = (__pyx_v_i + 1); __pyx_t_24 < __pyx_t_19; __pyx_t_24+=1) {
20703           __pyx_v_j = __pyx_t_24;
20704 
20705           /* "MACS2/IO/ScoreTrack.pyx":1246
20706  *                 # add the rest lvl2 peaks
20707  *                 for j in range( i+1, len(lvl2peakschrom) ):
20708  *                     self.__add_broadpeak( broadpeaks, chrom, lvl2peakschrom[j], tmppeakset )             # <<<<<<<<<<<<<<
20709  *
20710  *         return broadpeaks
20711  */
20712           __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_broadpeak); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1246, __pyx_L7_except_error)
20713           __Pyx_GOTREF(__pyx_t_6);
20714           __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_lvl2peakschrom, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1246, __pyx_L7_except_error)
20715           __Pyx_GOTREF(__pyx_t_4);
20716           __pyx_t_5 = NULL;
20717           __pyx_t_10 = 0;
20718           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
20719             __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
20720             if (likely(__pyx_t_5)) {
20721               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
20722               __Pyx_INCREF(__pyx_t_5);
20723               __Pyx_INCREF(function);
20724               __Pyx_DECREF_SET(__pyx_t_6, function);
20725               __pyx_t_10 = 1;
20726             }
20727           }
20728           #if CYTHON_FAST_PYCALL
20729           if (PyFunction_Check(__pyx_t_6)) {
20730             PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_broadpeaks, __pyx_v_chrom, __pyx_t_4, __pyx_v_tmppeakset};
20731             __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1246, __pyx_L7_except_error)
20732             __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20733             __Pyx_GOTREF(__pyx_t_11);
20734             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20735           } else
20736           #endif
20737           #if CYTHON_FAST_PYCCALL
20738           if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
20739             PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_broadpeaks, __pyx_v_chrom, __pyx_t_4, __pyx_v_tmppeakset};
20740             __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1246, __pyx_L7_except_error)
20741             __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20742             __Pyx_GOTREF(__pyx_t_11);
20743             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20744           } else
20745           #endif
20746           {
20747             __pyx_t_3 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L7_except_error)
20748             __Pyx_GOTREF(__pyx_t_3);
20749             if (__pyx_t_5) {
20750               __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
20751             }
20752             __Pyx_INCREF(__pyx_v_broadpeaks);
20753             __Pyx_GIVEREF(__pyx_v_broadpeaks);
20754             PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_10, __pyx_v_broadpeaks);
20755             __Pyx_INCREF(__pyx_v_chrom);
20756             __Pyx_GIVEREF(__pyx_v_chrom);
20757             PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_v_chrom);
20758             __Pyx_GIVEREF(__pyx_t_4);
20759             PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_10, __pyx_t_4);
20760             __Pyx_INCREF(__pyx_v_tmppeakset);
20761             __Pyx_GIVEREF(__pyx_v_tmppeakset);
20762             PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_10, __pyx_v_tmppeakset);
20763             __pyx_t_4 = 0;
20764             __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1246, __pyx_L7_except_error)
20765             __Pyx_GOTREF(__pyx_t_11);
20766             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20767           }
20768           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20769           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
20770         }
20771         __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20772         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20773         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
20774         goto __pyx_L6_exception_handled;
20775       }
20776       goto __pyx_L7_except_error;
20777       __pyx_L7_except_error:;
20778 
20779       /* "MACS2/IO/ScoreTrack.pyx":1223
20780  *             tmppeakset = []             # to temporarily store lvl1 region inside a lvl2 region
20781  *             # our assumption is lvl1 regions should be included in lvl2 regions
20782  *             try:             # <<<<<<<<<<<<<<
20783  *                 lvl1 = lvl1peakschrom_next()
20784  *                 for i in range( len(lvl2peakschrom) ):
20785  */
20786       __Pyx_XGIVEREF(__pyx_t_15);
20787       __Pyx_XGIVEREF(__pyx_t_16);
20788       __Pyx_XGIVEREF(__pyx_t_17);
20789       __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
20790       goto __pyx_L1_error;
20791       __pyx_L6_exception_handled:;
20792       __Pyx_XGIVEREF(__pyx_t_15);
20793       __Pyx_XGIVEREF(__pyx_t_16);
20794       __Pyx_XGIVEREF(__pyx_t_17);
20795       __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
20796       __pyx_L12_try_end:;
20797     }
20798 
20799     /* "MACS2/IO/ScoreTrack.pyx":1217
20800  *         broadpeaks = BroadPeakIO()
20801  *         # use lvl2_peaks as linking regions between lvl1_peaks
20802  *         for chrom in chrs:             # <<<<<<<<<<<<<<
20803  *             lvl1peakschrom = lvl1_peaks.peaks[chrom]
20804  *             lvl2peakschrom = lvl2_peaks.peaks[chrom]
20805  */
20806   }
20807   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20808 
20809   /* "MACS2/IO/ScoreTrack.pyx":1248
20810  *                     self.__add_broadpeak( broadpeaks, chrom, lvl2peakschrom[j], tmppeakset )
20811  *
20812  *         return broadpeaks             # <<<<<<<<<<<<<<
20813  *
20814  *     def __add_broadpeak (self, bpeaks, bytes chrom, dict lvl2peak, list lvl1peakset):
20815  */
20816   __Pyx_XDECREF(__pyx_r);
20817   __Pyx_INCREF(__pyx_v_broadpeaks);
20818   __pyx_r = __pyx_v_broadpeaks;
20819   goto __pyx_L0;
20820 
20821   /* "MACS2/IO/ScoreTrack.pyx":1191
20822  *         return t
20823  *
20824  *     cpdef call_broadpeaks (self, float64_t lvl1_cutoff=5.0, float64_t lvl2_cutoff=1.0, int32_t min_length=200, int32_t lvl1_max_gap=50, int32_t lvl2_max_gap=400):             # <<<<<<<<<<<<<<
20825  *         """This function try to find enriched regions within which,
20826  *         scores are continuously higher than a given cutoff for level
20827  */
20828 
20829   /* function exit code */
20830   __pyx_L1_error:;
20831   __Pyx_XDECREF(__pyx_t_1);
20832   __Pyx_XDECREF(__pyx_t_2);
20833   __Pyx_XDECREF(__pyx_t_3);
20834   __Pyx_XDECREF(__pyx_t_4);
20835   __Pyx_XDECREF(__pyx_t_5);
20836   __Pyx_XDECREF(__pyx_t_6);
20837   __Pyx_XDECREF(__pyx_t_7);
20838   __Pyx_XDECREF(__pyx_t_8);
20839   __Pyx_XDECREF(__pyx_t_9);
20840   __Pyx_XDECREF(__pyx_t_11);
20841   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
20842   __pyx_r = 0;
20843   __pyx_L0:;
20844   __Pyx_XDECREF(__pyx_v_chrom);
20845   __Pyx_XDECREF(__pyx_v_lvl1_peaks);
20846   __Pyx_XDECREF(__pyx_v_lvl2_peaks);
20847   __Pyx_XDECREF(__pyx_v_chrs);
20848   __Pyx_XDECREF(__pyx_v_broadpeaks);
20849   __Pyx_XDECREF(__pyx_v_lvl1peakschrom);
20850   __Pyx_XDECREF(__pyx_v_lvl2peakschrom);
20851   __Pyx_XDECREF(__pyx_v_lvl1peakschrom_next);
20852   __Pyx_XDECREF(__pyx_v_tmppeakset);
20853   __Pyx_XDECREF(__pyx_v_lvl1);
20854   __Pyx_XDECREF(__pyx_v_lvl2);
20855   __Pyx_XGIVEREF(__pyx_r);
20856   __Pyx_TraceReturn(__pyx_r, 0);
20857   __Pyx_RefNannyFinishContext();
20858   return __pyx_r;
20859 }
20860 
20861 /* Python wrapper */
20862 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_27call_broadpeaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20863 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_26call_broadpeaks[] = "This function try to find enriched regions within which,\n        scores are continuously higher than a given cutoff for level\n        1, and link them using the gap above level 2 cutoff with a\n        maximum length of lvl2_max_gap.\n\n        lvl1_cutoff:  cutoff of value at enriched regions, default 5.0.\n        lvl2_cutoff:  cutoff of value at linkage regions, default 1.0.        \n        min_length :  minimum peak length, default 200.\n        lvl1_max_gap   :  maximum gap to merge nearby enriched peaks, default 50.\n        lvl2_max_gap   :  maximum length of linkage regions, default 400.        \n\n        Return both general PeakIO object for highly enriched regions\n        and gapped broad regions in BroadPeakIO.\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_27call_broadpeaks(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)20864 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_27call_broadpeaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20865   __pyx_t_5numpy_float64_t __pyx_v_lvl1_cutoff;
20866   __pyx_t_5numpy_float64_t __pyx_v_lvl2_cutoff;
20867   __pyx_t_5numpy_int32_t __pyx_v_min_length;
20868   __pyx_t_5numpy_int32_t __pyx_v_lvl1_max_gap;
20869   __pyx_t_5numpy_int32_t __pyx_v_lvl2_max_gap;
20870   PyObject *__pyx_r = 0;
20871   __Pyx_RefNannyDeclarations
20872   __Pyx_RefNannySetupContext("call_broadpeaks (wrapper)", 0);
20873   {
20874     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lvl1_cutoff,&__pyx_n_s_lvl2_cutoff,&__pyx_n_s_min_length,&__pyx_n_s_lvl1_max_gap,&__pyx_n_s_lvl2_max_gap,0};
20875     PyObject* values[5] = {0,0,0,0,0};
20876     if (unlikely(__pyx_kwds)) {
20877       Py_ssize_t kw_args;
20878       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20879       switch (pos_args) {
20880         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
20881         CYTHON_FALLTHROUGH;
20882         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
20883         CYTHON_FALLTHROUGH;
20884         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20885         CYTHON_FALLTHROUGH;
20886         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20887         CYTHON_FALLTHROUGH;
20888         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20889         CYTHON_FALLTHROUGH;
20890         case  0: break;
20891         default: goto __pyx_L5_argtuple_error;
20892       }
20893       kw_args = PyDict_Size(__pyx_kwds);
20894       switch (pos_args) {
20895         case  0:
20896         if (kw_args > 0) {
20897           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lvl1_cutoff);
20898           if (value) { values[0] = value; kw_args--; }
20899         }
20900         CYTHON_FALLTHROUGH;
20901         case  1:
20902         if (kw_args > 0) {
20903           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lvl2_cutoff);
20904           if (value) { values[1] = value; kw_args--; }
20905         }
20906         CYTHON_FALLTHROUGH;
20907         case  2:
20908         if (kw_args > 0) {
20909           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_length);
20910           if (value) { values[2] = value; kw_args--; }
20911         }
20912         CYTHON_FALLTHROUGH;
20913         case  3:
20914         if (kw_args > 0) {
20915           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lvl1_max_gap);
20916           if (value) { values[3] = value; kw_args--; }
20917         }
20918         CYTHON_FALLTHROUGH;
20919         case  4:
20920         if (kw_args > 0) {
20921           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lvl2_max_gap);
20922           if (value) { values[4] = value; kw_args--; }
20923         }
20924       }
20925       if (unlikely(kw_args > 0)) {
20926         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "call_broadpeaks") < 0)) __PYX_ERR(0, 1191, __pyx_L3_error)
20927       }
20928     } else {
20929       switch (PyTuple_GET_SIZE(__pyx_args)) {
20930         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
20931         CYTHON_FALLTHROUGH;
20932         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
20933         CYTHON_FALLTHROUGH;
20934         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20935         CYTHON_FALLTHROUGH;
20936         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20937         CYTHON_FALLTHROUGH;
20938         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20939         CYTHON_FALLTHROUGH;
20940         case  0: break;
20941         default: goto __pyx_L5_argtuple_error;
20942       }
20943     }
20944     if (values[0]) {
20945       __pyx_v_lvl1_cutoff = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_lvl1_cutoff == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1191, __pyx_L3_error)
20946     } else {
20947       __pyx_v_lvl1_cutoff = ((__pyx_t_5numpy_float64_t)5.0);
20948     }
20949     if (values[1]) {
20950       __pyx_v_lvl2_cutoff = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_lvl2_cutoff == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1191, __pyx_L3_error)
20951     } else {
20952       __pyx_v_lvl2_cutoff = ((__pyx_t_5numpy_float64_t)1.0);
20953     }
20954     if (values[2]) {
20955       __pyx_v_min_length = __Pyx_PyInt_As_npy_int32(values[2]); if (unlikely((__pyx_v_min_length == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1191, __pyx_L3_error)
20956     } else {
20957       __pyx_v_min_length = ((__pyx_t_5numpy_int32_t)0xC8);
20958     }
20959     if (values[3]) {
20960       __pyx_v_lvl1_max_gap = __Pyx_PyInt_As_npy_int32(values[3]); if (unlikely((__pyx_v_lvl1_max_gap == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1191, __pyx_L3_error)
20961     } else {
20962       __pyx_v_lvl1_max_gap = ((__pyx_t_5numpy_int32_t)50);
20963     }
20964     if (values[4]) {
20965       __pyx_v_lvl2_max_gap = __Pyx_PyInt_As_npy_int32(values[4]); if (unlikely((__pyx_v_lvl2_max_gap == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1191, __pyx_L3_error)
20966     } else {
20967       __pyx_v_lvl2_max_gap = ((__pyx_t_5numpy_int32_t)0x190);
20968     }
20969   }
20970   goto __pyx_L4_argument_unpacking_done;
20971   __pyx_L5_argtuple_error:;
20972   __Pyx_RaiseArgtupleInvalid("call_broadpeaks", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1191, __pyx_L3_error)
20973   __pyx_L3_error:;
20974   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
20975   __Pyx_RefNannyFinishContext();
20976   return NULL;
20977   __pyx_L4_argument_unpacking_done:;
20978   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_26call_broadpeaks(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_lvl1_cutoff, __pyx_v_lvl2_cutoff, __pyx_v_min_length, __pyx_v_lvl1_max_gap, __pyx_v_lvl2_max_gap);
20979 
20980   /* function exit code */
20981   __Pyx_RefNannyFinishContext();
20982   return __pyx_r;
20983 }
20984 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_26call_broadpeaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,__pyx_t_5numpy_float64_t __pyx_v_lvl1_cutoff,__pyx_t_5numpy_float64_t __pyx_v_lvl2_cutoff,__pyx_t_5numpy_int32_t __pyx_v_min_length,__pyx_t_5numpy_int32_t __pyx_v_lvl1_max_gap,__pyx_t_5numpy_int32_t __pyx_v_lvl2_max_gap)20985 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_26call_broadpeaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_lvl1_cutoff, __pyx_t_5numpy_float64_t __pyx_v_lvl2_cutoff, __pyx_t_5numpy_int32_t __pyx_v_min_length, __pyx_t_5numpy_int32_t __pyx_v_lvl1_max_gap, __pyx_t_5numpy_int32_t __pyx_v_lvl2_max_gap) {
20986   PyObject *__pyx_r = NULL;
20987   __Pyx_TraceDeclarations
20988   __Pyx_RefNannyDeclarations
20989   PyObject *__pyx_t_1 = NULL;
20990   struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks __pyx_t_2;
20991   __Pyx_RefNannySetupContext("call_broadpeaks", 0);
20992   __Pyx_TraceCall("call_broadpeaks (wrapper)", __pyx_f[0], 1191, 0, __PYX_ERR(0, 1191, __pyx_L1_error));
20993   __Pyx_XDECREF(__pyx_r);
20994   __pyx_t_2.__pyx_n = 5;
20995   __pyx_t_2.lvl1_cutoff = __pyx_v_lvl1_cutoff;
20996   __pyx_t_2.lvl2_cutoff = __pyx_v_lvl2_cutoff;
20997   __pyx_t_2.min_length = __pyx_v_min_length;
20998   __pyx_t_2.lvl1_max_gap = __pyx_v_lvl1_max_gap;
20999   __pyx_t_2.lvl2_max_gap = __pyx_v_lvl2_max_gap;
21000   __pyx_t_1 = __pyx_vtabptr_5MACS2_2IO_10ScoreTrack_scoreTrackII->call_broadpeaks(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error)
21001   __Pyx_GOTREF(__pyx_t_1);
21002   __pyx_r = __pyx_t_1;
21003   __pyx_t_1 = 0;
21004   goto __pyx_L0;
21005 
21006   /* function exit code */
21007   __pyx_L1_error:;
21008   __Pyx_XDECREF(__pyx_t_1);
21009   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.call_broadpeaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
21010   __pyx_r = NULL;
21011   __pyx_L0:;
21012   __Pyx_XGIVEREF(__pyx_r);
21013   __Pyx_TraceReturn(__pyx_r, 0);
21014   __Pyx_RefNannyFinishContext();
21015   return __pyx_r;
21016 }
21017 
21018 /* "MACS2/IO/ScoreTrack.pyx":1250
21019  *         return broadpeaks
21020  *
21021  *     def __add_broadpeak (self, bpeaks, bytes chrom, dict lvl2peak, list lvl1peakset):             # <<<<<<<<<<<<<<
21022  *         """Internal function to create broad peak.
21023  *         """
21024  */
21025 
21026 /* Python wrapper */
21027 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_29__add_broadpeak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
21028 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_28__add_broadpeak[] = "Internal function to create broad peak.\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_29__add_broadpeak(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)21029 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_29__add_broadpeak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21030   PyObject *__pyx_v_bpeaks = 0;
21031   PyObject *__pyx_v_chrom = 0;
21032   PyObject *__pyx_v_lvl2peak = 0;
21033   PyObject *__pyx_v_lvl1peakset = 0;
21034   PyObject *__pyx_r = 0;
21035   __Pyx_RefNannyDeclarations
21036   __Pyx_RefNannySetupContext("__add_broadpeak (wrapper)", 0);
21037   {
21038     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bpeaks,&__pyx_n_s_chrom,&__pyx_n_s_lvl2peak,&__pyx_n_s_lvl1peakset,0};
21039     PyObject* values[4] = {0,0,0,0};
21040     if (unlikely(__pyx_kwds)) {
21041       Py_ssize_t kw_args;
21042       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21043       switch (pos_args) {
21044         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
21045         CYTHON_FALLTHROUGH;
21046         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21047         CYTHON_FALLTHROUGH;
21048         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21049         CYTHON_FALLTHROUGH;
21050         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21051         CYTHON_FALLTHROUGH;
21052         case  0: break;
21053         default: goto __pyx_L5_argtuple_error;
21054       }
21055       kw_args = PyDict_Size(__pyx_kwds);
21056       switch (pos_args) {
21057         case  0:
21058         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpeaks)) != 0)) kw_args--;
21059         else goto __pyx_L5_argtuple_error;
21060         CYTHON_FALLTHROUGH;
21061         case  1:
21062         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
21063         else {
21064           __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 4, 4, 1); __PYX_ERR(0, 1250, __pyx_L3_error)
21065         }
21066         CYTHON_FALLTHROUGH;
21067         case  2:
21068         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lvl2peak)) != 0)) kw_args--;
21069         else {
21070           __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 4, 4, 2); __PYX_ERR(0, 1250, __pyx_L3_error)
21071         }
21072         CYTHON_FALLTHROUGH;
21073         case  3:
21074         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lvl1peakset)) != 0)) kw_args--;
21075         else {
21076           __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 4, 4, 3); __PYX_ERR(0, 1250, __pyx_L3_error)
21077         }
21078       }
21079       if (unlikely(kw_args > 0)) {
21080         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__add_broadpeak") < 0)) __PYX_ERR(0, 1250, __pyx_L3_error)
21081       }
21082     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
21083       goto __pyx_L5_argtuple_error;
21084     } else {
21085       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21086       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21087       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21088       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
21089     }
21090     __pyx_v_bpeaks = values[0];
21091     __pyx_v_chrom = ((PyObject*)values[1]);
21092     __pyx_v_lvl2peak = ((PyObject*)values[2]);
21093     __pyx_v_lvl1peakset = ((PyObject*)values[3]);
21094   }
21095   goto __pyx_L4_argument_unpacking_done;
21096   __pyx_L5_argtuple_error:;
21097   __Pyx_RaiseArgtupleInvalid("__add_broadpeak", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1250, __pyx_L3_error)
21098   __pyx_L3_error:;
21099   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.__add_broadpeak", __pyx_clineno, __pyx_lineno, __pyx_filename);
21100   __Pyx_RefNannyFinishContext();
21101   return NULL;
21102   __pyx_L4_argument_unpacking_done:;
21103   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chrom), (&PyBytes_Type), 1, "chrom", 1))) __PYX_ERR(0, 1250, __pyx_L1_error)
21104   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lvl2peak), (&PyDict_Type), 1, "lvl2peak", 1))) __PYX_ERR(0, 1250, __pyx_L1_error)
21105   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lvl1peakset), (&PyList_Type), 1, "lvl1peakset", 1))) __PYX_ERR(0, 1250, __pyx_L1_error)
21106   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_28__add_broadpeak(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), __pyx_v_bpeaks, __pyx_v_chrom, __pyx_v_lvl2peak, __pyx_v_lvl1peakset);
21107 
21108   /* function exit code */
21109   goto __pyx_L0;
21110   __pyx_L1_error:;
21111   __pyx_r = NULL;
21112   __pyx_L0:;
21113   __Pyx_RefNannyFinishContext();
21114   return __pyx_r;
21115 }
21116 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_28__add_broadpeak(CYTHON_UNUSED struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v_bpeaks,PyObject * __pyx_v_chrom,PyObject * __pyx_v_lvl2peak,PyObject * __pyx_v_lvl1peakset)21117 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_28__add_broadpeak(CYTHON_UNUSED struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v_bpeaks, PyObject *__pyx_v_chrom, PyObject *__pyx_v_lvl2peak, PyObject *__pyx_v_lvl1peakset) {
21118   __pyx_t_5numpy_int32_t __pyx_v_blockNum;
21119   __pyx_t_5numpy_int32_t __pyx_v_thickStart;
21120   __pyx_t_5numpy_int32_t __pyx_v_thickEnd;
21121   __pyx_t_5numpy_int32_t __pyx_v_start;
21122   __pyx_t_5numpy_int32_t __pyx_v_end;
21123   PyObject *__pyx_v_blockSizes = 0;
21124   PyObject *__pyx_v_blockStarts = 0;
21125   PyObject *__pyx_7genexpr__pyx_v_x = NULL;
21126   PyObject *__pyx_8genexpr1__pyx_v_x = NULL;
21127   PyObject *__pyx_r = NULL;
21128   __Pyx_TraceDeclarations
21129   __Pyx_RefNannyDeclarations
21130   PyObject *__pyx_t_1 = NULL;
21131   __pyx_t_5numpy_int32_t __pyx_t_2;
21132   int __pyx_t_3;
21133   int __pyx_t_4;
21134   PyObject *__pyx_t_5 = NULL;
21135   PyObject *__pyx_t_6 = NULL;
21136   PyObject *__pyx_t_7 = NULL;
21137   PyObject *__pyx_t_8 = NULL;
21138   Py_ssize_t __pyx_t_9;
21139   __Pyx_RefNannySetupContext("__add_broadpeak", 0);
21140   __Pyx_TraceCall("__add_broadpeak", __pyx_f[0], 1250, 0, __PYX_ERR(0, 1250, __pyx_L1_error));
21141 
21142   /* "MACS2/IO/ScoreTrack.pyx":1258
21143  *             bytes blockSizes, blockStarts
21144  *
21145  *         start      = lvl2peak["start"]             # <<<<<<<<<<<<<<
21146  *         end        = lvl2peak["end"]
21147  *
21148  */
21149   if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21150     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21151     __PYX_ERR(0, 1258, __pyx_L1_error)
21152   }
21153   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error)
21154   __Pyx_GOTREF(__pyx_t_1);
21155   __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1258, __pyx_L1_error)
21156   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21157   __pyx_v_start = __pyx_t_2;
21158 
21159   /* "MACS2/IO/ScoreTrack.pyx":1259
21160  *
21161  *         start      = lvl2peak["start"]
21162  *         end        = lvl2peak["end"]             # <<<<<<<<<<<<<<
21163  *
21164  *         # the following code will add those broad/lvl2 peaks with no strong/lvl1 peaks inside
21165  */
21166   if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21167     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21168     __PYX_ERR(0, 1259, __pyx_L1_error)
21169   }
21170   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error)
21171   __Pyx_GOTREF(__pyx_t_1);
21172   __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1259, __pyx_L1_error)
21173   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21174   __pyx_v_end = __pyx_t_2;
21175 
21176   /* "MACS2/IO/ScoreTrack.pyx":1262
21177  *
21178  *         # the following code will add those broad/lvl2 peaks with no strong/lvl1 peaks inside
21179  *         if not lvl1peakset:             # <<<<<<<<<<<<<<
21180  *             # will complement by adding 1bps start and end to this region
21181  *             # may change in the future if gappedPeak format was improved.
21182  */
21183   __pyx_t_3 = (__pyx_v_lvl1peakset != Py_None)&&(PyList_GET_SIZE(__pyx_v_lvl1peakset) != 0);
21184   __pyx_t_4 = ((!__pyx_t_3) != 0);
21185   if (__pyx_t_4) {
21186 
21187     /* "MACS2/IO/ScoreTrack.pyx":1265
21188  *             # will complement by adding 1bps start and end to this region
21189  *             # may change in the future if gappedPeak format was improved.
21190  *             bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=(b"%d" % start), thickEnd=(b"%d" % end),             # <<<<<<<<<<<<<<
21191  *                        blockNum = 2, blockSizes = b"1,1", blockStarts = (b"0,%d" % (end-start-1)), pileup = lvl2peak["pileup"],
21192  *                        pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],
21193  */
21194     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_bpeaks, __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
21195     __Pyx_GOTREF(__pyx_t_1);
21196     __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error)
21197     __Pyx_GOTREF(__pyx_t_5);
21198     __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1265, __pyx_L1_error)
21199     __Pyx_GOTREF(__pyx_t_6);
21200     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1265, __pyx_L1_error)
21201     __Pyx_GOTREF(__pyx_t_7);
21202     __Pyx_INCREF(__pyx_v_chrom);
21203     __Pyx_GIVEREF(__pyx_v_chrom);
21204     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chrom);
21205     __Pyx_GIVEREF(__pyx_t_5);
21206     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
21207     __Pyx_GIVEREF(__pyx_t_6);
21208     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
21209     __pyx_t_5 = 0;
21210     __pyx_t_6 = 0;
21211     __pyx_t_6 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1265, __pyx_L1_error)
21212     __Pyx_GOTREF(__pyx_t_6);
21213     if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21214       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21215       __PYX_ERR(0, 1265, __pyx_L1_error)
21216     }
21217     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_score); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error)
21218     __Pyx_GOTREF(__pyx_t_5);
21219     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_score, __pyx_t_5) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
21220     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21221     __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error)
21222     __Pyx_GOTREF(__pyx_t_5);
21223     __pyx_t_8 = PyNumber_Remainder(__pyx_kp_b_d_2, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1265, __pyx_L1_error)
21224     __Pyx_GOTREF(__pyx_t_8);
21225     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21226     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_thickStart, __pyx_t_8) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
21227     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21228     __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_end); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1265, __pyx_L1_error)
21229     __Pyx_GOTREF(__pyx_t_8);
21230     __pyx_t_5 = PyNumber_Remainder(__pyx_kp_b_d_2, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error)
21231     __Pyx_GOTREF(__pyx_t_5);
21232     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21233     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_thickEnd, __pyx_t_5) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
21234     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21235     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_blockNum, __pyx_int_2) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
21236     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_blockSizes, __pyx_kp_b_1_1) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
21237 
21238     /* "MACS2/IO/ScoreTrack.pyx":1266
21239  *             # may change in the future if gappedPeak format was improved.
21240  *             bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=(b"%d" % start), thickEnd=(b"%d" % end),
21241  *                        blockNum = 2, blockSizes = b"1,1", blockStarts = (b"0,%d" % (end-start-1)), pileup = lvl2peak["pileup"],             # <<<<<<<<<<<<<<
21242  *                        pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],
21243  *                        qscore = lvl2peak["qscore"] )
21244  */
21245     __pyx_t_5 = __Pyx_PyInt_From_long(((__pyx_v_end - __pyx_v_start) - 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1266, __pyx_L1_error)
21246     __Pyx_GOTREF(__pyx_t_5);
21247     __pyx_t_8 = PyNumber_Remainder(__pyx_kp_b_0_d, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1266, __pyx_L1_error)
21248     __Pyx_GOTREF(__pyx_t_8);
21249     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21250     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_blockStarts, __pyx_t_8) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
21251     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21252     if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21253       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21254       __PYX_ERR(0, 1266, __pyx_L1_error)
21255     }
21256     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_pileup); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1266, __pyx_L1_error)
21257     __Pyx_GOTREF(__pyx_t_8);
21258     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pileup, __pyx_t_8) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
21259     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21260 
21261     /* "MACS2/IO/ScoreTrack.pyx":1267
21262  *             bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=(b"%d" % start), thickEnd=(b"%d" % end),
21263  *                        blockNum = 2, blockSizes = b"1,1", blockStarts = (b"0,%d" % (end-start-1)), pileup = lvl2peak["pileup"],
21264  *                        pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],             # <<<<<<<<<<<<<<
21265  *                        qscore = lvl2peak["qscore"] )
21266  *             return bpeaks
21267  */
21268     if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21269       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21270       __PYX_ERR(0, 1267, __pyx_L1_error)
21271     }
21272     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_pscore); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1267, __pyx_L1_error)
21273     __Pyx_GOTREF(__pyx_t_8);
21274     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pscore, __pyx_t_8) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
21275     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21276     if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21277       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21278       __PYX_ERR(0, 1267, __pyx_L1_error)
21279     }
21280     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_fc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1267, __pyx_L1_error)
21281     __Pyx_GOTREF(__pyx_t_8);
21282     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fold_change, __pyx_t_8) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
21283     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21284 
21285     /* "MACS2/IO/ScoreTrack.pyx":1268
21286  *                        blockNum = 2, blockSizes = b"1,1", blockStarts = (b"0,%d" % (end-start-1)), pileup = lvl2peak["pileup"],
21287  *                        pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],
21288  *                        qscore = lvl2peak["qscore"] )             # <<<<<<<<<<<<<<
21289  *             return bpeaks
21290  *
21291  */
21292     if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21293       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21294       __PYX_ERR(0, 1268, __pyx_L1_error)
21295     }
21296     __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_qscore); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1268, __pyx_L1_error)
21297     __Pyx_GOTREF(__pyx_t_8);
21298     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_qscore, __pyx_t_8) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
21299     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21300 
21301     /* "MACS2/IO/ScoreTrack.pyx":1265
21302  *             # will complement by adding 1bps start and end to this region
21303  *             # may change in the future if gappedPeak format was improved.
21304  *             bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=(b"%d" % start), thickEnd=(b"%d" % end),             # <<<<<<<<<<<<<<
21305  *                        blockNum = 2, blockSizes = b"1,1", blockStarts = (b"0,%d" % (end-start-1)), pileup = lvl2peak["pileup"],
21306  *                        pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],
21307  */
21308     __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1265, __pyx_L1_error)
21309     __Pyx_GOTREF(__pyx_t_8);
21310     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21311     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21312     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21313     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21314 
21315     /* "MACS2/IO/ScoreTrack.pyx":1269
21316  *                        pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],
21317  *                        qscore = lvl2peak["qscore"] )
21318  *             return bpeaks             # <<<<<<<<<<<<<<
21319  *
21320  *         thickStart = b"%d" % lvl1peakset[0]["start"]
21321  */
21322     __Pyx_XDECREF(__pyx_r);
21323     __Pyx_INCREF(__pyx_v_bpeaks);
21324     __pyx_r = __pyx_v_bpeaks;
21325     goto __pyx_L0;
21326 
21327     /* "MACS2/IO/ScoreTrack.pyx":1262
21328  *
21329  *         # the following code will add those broad/lvl2 peaks with no strong/lvl1 peaks inside
21330  *         if not lvl1peakset:             # <<<<<<<<<<<<<<
21331  *             # will complement by adding 1bps start and end to this region
21332  *             # may change in the future if gappedPeak format was improved.
21333  */
21334   }
21335 
21336   /* "MACS2/IO/ScoreTrack.pyx":1271
21337  *             return bpeaks
21338  *
21339  *         thickStart = b"%d" % lvl1peakset[0]["start"]             # <<<<<<<<<<<<<<
21340  *         thickEnd   = b"%d" % lvl1peakset[-1]["end"]
21341  *         blockNum   = int(len(lvl1peakset))
21342  */
21343   if (unlikely(__pyx_v_lvl1peakset == Py_None)) {
21344     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21345     __PYX_ERR(0, 1271, __pyx_L1_error)
21346   }
21347   __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_lvl1peakset, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1271, __pyx_L1_error)
21348   __Pyx_GOTREF(__pyx_t_8);
21349   __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_u_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1271, __pyx_L1_error)
21350   __Pyx_GOTREF(__pyx_t_6);
21351   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21352   __pyx_t_8 = PyNumber_Remainder(__pyx_kp_b_d_2, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1271, __pyx_L1_error)
21353   __Pyx_GOTREF(__pyx_t_8);
21354   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21355   __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_8); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1271, __pyx_L1_error)
21356   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21357   __pyx_v_thickStart = __pyx_t_2;
21358 
21359   /* "MACS2/IO/ScoreTrack.pyx":1272
21360  *
21361  *         thickStart = b"%d" % lvl1peakset[0]["start"]
21362  *         thickEnd   = b"%d" % lvl1peakset[-1]["end"]             # <<<<<<<<<<<<<<
21363  *         blockNum   = int(len(lvl1peakset))
21364  *         blockSizes = b",".join( [b"%d" % x["length"] for x in lvl1peakset] )
21365  */
21366   if (unlikely(__pyx_v_lvl1peakset == Py_None)) {
21367     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21368     __PYX_ERR(0, 1272, __pyx_L1_error)
21369   }
21370   __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_lvl1peakset, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1272, __pyx_L1_error)
21371   __Pyx_GOTREF(__pyx_t_8);
21372   __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_u_end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1272, __pyx_L1_error)
21373   __Pyx_GOTREF(__pyx_t_6);
21374   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21375   __pyx_t_8 = PyNumber_Remainder(__pyx_kp_b_d_2, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1272, __pyx_L1_error)
21376   __Pyx_GOTREF(__pyx_t_8);
21377   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21378   __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_8); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1272, __pyx_L1_error)
21379   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21380   __pyx_v_thickEnd = __pyx_t_2;
21381 
21382   /* "MACS2/IO/ScoreTrack.pyx":1273
21383  *         thickStart = b"%d" % lvl1peakset[0]["start"]
21384  *         thickEnd   = b"%d" % lvl1peakset[-1]["end"]
21385  *         blockNum   = int(len(lvl1peakset))             # <<<<<<<<<<<<<<
21386  *         blockSizes = b",".join( [b"%d" % x["length"] for x in lvl1peakset] )
21387  *         blockStarts = b",".join( [b"%d" % (x["start"]-start) for x in lvl1peakset] )
21388  */
21389   if (unlikely(__pyx_v_lvl1peakset == Py_None)) {
21390     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21391     __PYX_ERR(0, 1273, __pyx_L1_error)
21392   }
21393   __pyx_t_9 = PyList_GET_SIZE(__pyx_v_lvl1peakset); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1273, __pyx_L1_error)
21394   __pyx_v_blockNum = ((__pyx_t_5numpy_int32_t)__pyx_t_9);
21395 
21396   /* "MACS2/IO/ScoreTrack.pyx":1274
21397  *         thickEnd   = b"%d" % lvl1peakset[-1]["end"]
21398  *         blockNum   = int(len(lvl1peakset))
21399  *         blockSizes = b",".join( [b"%d" % x["length"] for x in lvl1peakset] )             # <<<<<<<<<<<<<<
21400  *         blockStarts = b",".join( [b"%d" % (x["start"]-start) for x in lvl1peakset] )
21401  *
21402  */
21403   { /* enter inner scope */
21404     __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1274, __pyx_L6_error)
21405     __Pyx_GOTREF(__pyx_t_8);
21406     if (unlikely(__pyx_v_lvl1peakset == Py_None)) {
21407       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
21408       __PYX_ERR(0, 1274, __pyx_L6_error)
21409     }
21410     __pyx_t_6 = __pyx_v_lvl1peakset; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
21411     for (;;) {
21412       if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
21413       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21414       __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1274, __pyx_L6_error)
21415       #else
21416       __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L6_error)
21417       __Pyx_GOTREF(__pyx_t_7);
21418       #endif
21419       __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_7);
21420       __pyx_t_7 = 0;
21421       __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_7genexpr__pyx_v_x, __pyx_n_u_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L6_error)
21422       __Pyx_GOTREF(__pyx_t_7);
21423       __pyx_t_1 = PyNumber_Remainder(__pyx_kp_b_d_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1274, __pyx_L6_error)
21424       __Pyx_GOTREF(__pyx_t_1);
21425       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21426       if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1274, __pyx_L6_error)
21427       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21428     }
21429     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21430     __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
21431     goto __pyx_L9_exit_scope;
21432     __pyx_L6_error:;
21433     __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
21434     goto __pyx_L1_error;
21435     __pyx_L9_exit_scope:;
21436   } /* exit inner scope */
21437   __pyx_t_6 = __Pyx_PyBytes_Join(__pyx_kp_b__20, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1274, __pyx_L1_error)
21438   __Pyx_GOTREF(__pyx_t_6);
21439   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21440   if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 1274, __pyx_L1_error)
21441   __pyx_v_blockSizes = ((PyObject*)__pyx_t_6);
21442   __pyx_t_6 = 0;
21443 
21444   /* "MACS2/IO/ScoreTrack.pyx":1275
21445  *         blockNum   = int(len(lvl1peakset))
21446  *         blockSizes = b",".join( [b"%d" % x["length"] for x in lvl1peakset] )
21447  *         blockStarts = b",".join( [b"%d" % (x["start"]-start) for x in lvl1peakset] )             # <<<<<<<<<<<<<<
21448  *
21449  *         if lvl2peak["start"] != thickStart:
21450  */
21451   { /* enter inner scope */
21452     __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1275, __pyx_L12_error)
21453     __Pyx_GOTREF(__pyx_t_6);
21454     if (unlikely(__pyx_v_lvl1peakset == Py_None)) {
21455       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
21456       __PYX_ERR(0, 1275, __pyx_L12_error)
21457     }
21458     __pyx_t_8 = __pyx_v_lvl1peakset; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
21459     for (;;) {
21460       if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
21461       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21462       __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1275, __pyx_L12_error)
21463       #else
21464       __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1275, __pyx_L12_error)
21465       __Pyx_GOTREF(__pyx_t_1);
21466       #endif
21467       __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_x, __pyx_t_1);
21468       __pyx_t_1 = 0;
21469       __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_8genexpr1__pyx_v_x, __pyx_n_u_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1275, __pyx_L12_error)
21470       __Pyx_GOTREF(__pyx_t_1);
21471       __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1275, __pyx_L12_error)
21472       __Pyx_GOTREF(__pyx_t_7);
21473       __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1275, __pyx_L12_error)
21474       __Pyx_GOTREF(__pyx_t_5);
21475       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21476       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21477       __pyx_t_7 = PyNumber_Remainder(__pyx_kp_b_d_2, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1275, __pyx_L12_error)
21478       __Pyx_GOTREF(__pyx_t_7);
21479       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21480       if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1275, __pyx_L12_error)
21481       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21482     }
21483     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21484     __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
21485     goto __pyx_L15_exit_scope;
21486     __pyx_L12_error:;
21487     __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
21488     goto __pyx_L1_error;
21489     __pyx_L15_exit_scope:;
21490   } /* exit inner scope */
21491   __pyx_t_8 = __Pyx_PyBytes_Join(__pyx_kp_b__20, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1275, __pyx_L1_error)
21492   __Pyx_GOTREF(__pyx_t_8);
21493   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21494   if (!(likely(PyBytes_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 1275, __pyx_L1_error)
21495   __pyx_v_blockStarts = ((PyObject*)__pyx_t_8);
21496   __pyx_t_8 = 0;
21497 
21498   /* "MACS2/IO/ScoreTrack.pyx":1277
21499  *         blockStarts = b",".join( [b"%d" % (x["start"]-start) for x in lvl1peakset] )
21500  *
21501  *         if lvl2peak["start"] != thickStart:             # <<<<<<<<<<<<<<
21502  *             # add 1bp mark for the start of lvl2 peak
21503  *             thickStart = b"%d" % start
21504  */
21505   if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21506     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21507     __PYX_ERR(0, 1277, __pyx_L1_error)
21508   }
21509   __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1277, __pyx_L1_error)
21510   __Pyx_GOTREF(__pyx_t_8);
21511   __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_thickStart); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1277, __pyx_L1_error)
21512   __Pyx_GOTREF(__pyx_t_6);
21513   __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1277, __pyx_L1_error)
21514   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21515   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21516   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1277, __pyx_L1_error)
21517   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21518   if (__pyx_t_4) {
21519 
21520     /* "MACS2/IO/ScoreTrack.pyx":1279
21521  *         if lvl2peak["start"] != thickStart:
21522  *             # add 1bp mark for the start of lvl2 peak
21523  *             thickStart = b"%d" % start             # <<<<<<<<<<<<<<
21524  *             blockNum += 1
21525  *             blockSizes = b"1,"+blockSizes
21526  */
21527     __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1279, __pyx_L1_error)
21528     __Pyx_GOTREF(__pyx_t_7);
21529     __pyx_t_6 = PyNumber_Remainder(__pyx_kp_b_d_2, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L1_error)
21530     __Pyx_GOTREF(__pyx_t_6);
21531     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21532     __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_6); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L1_error)
21533     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21534     __pyx_v_thickStart = __pyx_t_2;
21535 
21536     /* "MACS2/IO/ScoreTrack.pyx":1280
21537  *             # add 1bp mark for the start of lvl2 peak
21538  *             thickStart = b"%d" % start
21539  *             blockNum += 1             # <<<<<<<<<<<<<<
21540  *             blockSizes = b"1,"+blockSizes
21541  *             blockStarts = b"0,"+blockStarts
21542  */
21543     __pyx_v_blockNum = (__pyx_v_blockNum + 1);
21544 
21545     /* "MACS2/IO/ScoreTrack.pyx":1281
21546  *             thickStart = b"%d" % start
21547  *             blockNum += 1
21548  *             blockSizes = b"1,"+blockSizes             # <<<<<<<<<<<<<<
21549  *             blockStarts = b"0,"+blockStarts
21550  *         if lvl2peak["end"] != thickEnd:
21551  */
21552     __pyx_t_6 = PyNumber_Add(__pyx_kp_b_1, __pyx_v_blockSizes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1281, __pyx_L1_error)
21553     __Pyx_GOTREF(__pyx_t_6);
21554     __Pyx_DECREF_SET(__pyx_v_blockSizes, ((PyObject*)__pyx_t_6));
21555     __pyx_t_6 = 0;
21556 
21557     /* "MACS2/IO/ScoreTrack.pyx":1282
21558  *             blockNum += 1
21559  *             blockSizes = b"1,"+blockSizes
21560  *             blockStarts = b"0,"+blockStarts             # <<<<<<<<<<<<<<
21561  *         if lvl2peak["end"] != thickEnd:
21562  *             # add 1bp mark for the end of lvl2 peak
21563  */
21564     __pyx_t_6 = PyNumber_Add(__pyx_kp_b_0, __pyx_v_blockStarts); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1282, __pyx_L1_error)
21565     __Pyx_GOTREF(__pyx_t_6);
21566     __Pyx_DECREF_SET(__pyx_v_blockStarts, ((PyObject*)__pyx_t_6));
21567     __pyx_t_6 = 0;
21568 
21569     /* "MACS2/IO/ScoreTrack.pyx":1277
21570  *         blockStarts = b",".join( [b"%d" % (x["start"]-start) for x in lvl1peakset] )
21571  *
21572  *         if lvl2peak["start"] != thickStart:             # <<<<<<<<<<<<<<
21573  *             # add 1bp mark for the start of lvl2 peak
21574  *             thickStart = b"%d" % start
21575  */
21576   }
21577 
21578   /* "MACS2/IO/ScoreTrack.pyx":1283
21579  *             blockSizes = b"1,"+blockSizes
21580  *             blockStarts = b"0,"+blockStarts
21581  *         if lvl2peak["end"] != thickEnd:             # <<<<<<<<<<<<<<
21582  *             # add 1bp mark for the end of lvl2 peak
21583  *             thickEnd = b"%d" % end
21584  */
21585   if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21586     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21587     __PYX_ERR(0, 1283, __pyx_L1_error)
21588   }
21589   __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1283, __pyx_L1_error)
21590   __Pyx_GOTREF(__pyx_t_6);
21591   __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_thickEnd); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1283, __pyx_L1_error)
21592   __Pyx_GOTREF(__pyx_t_7);
21593   __pyx_t_8 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1283, __pyx_L1_error)
21594   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21595   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21596   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1283, __pyx_L1_error)
21597   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21598   if (__pyx_t_4) {
21599 
21600     /* "MACS2/IO/ScoreTrack.pyx":1285
21601  *         if lvl2peak["end"] != thickEnd:
21602  *             # add 1bp mark for the end of lvl2 peak
21603  *             thickEnd = b"%d" % end             # <<<<<<<<<<<<<<
21604  *             blockNum += 1
21605  *             blockSizes = blockSizes+b",1"
21606  */
21607     __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_end); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1285, __pyx_L1_error)
21608     __Pyx_GOTREF(__pyx_t_8);
21609     __pyx_t_7 = PyNumber_Remainder(__pyx_kp_b_d_2, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1285, __pyx_L1_error)
21610     __Pyx_GOTREF(__pyx_t_7);
21611     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21612     __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_7); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1285, __pyx_L1_error)
21613     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21614     __pyx_v_thickEnd = __pyx_t_2;
21615 
21616     /* "MACS2/IO/ScoreTrack.pyx":1286
21617  *             # add 1bp mark for the end of lvl2 peak
21618  *             thickEnd = b"%d" % end
21619  *             blockNum += 1             # <<<<<<<<<<<<<<
21620  *             blockSizes = blockSizes+b",1"
21621  *             blockStarts = blockStarts + b"," + (b"%d" % (end-start-1))
21622  */
21623     __pyx_v_blockNum = (__pyx_v_blockNum + 1);
21624 
21625     /* "MACS2/IO/ScoreTrack.pyx":1287
21626  *             thickEnd = b"%d" % end
21627  *             blockNum += 1
21628  *             blockSizes = blockSizes+b",1"             # <<<<<<<<<<<<<<
21629  *             blockStarts = blockStarts + b"," + (b"%d" % (end-start-1))
21630  *
21631  */
21632     __pyx_t_7 = PyNumber_Add(__pyx_v_blockSizes, __pyx_kp_b_1_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1287, __pyx_L1_error)
21633     __Pyx_GOTREF(__pyx_t_7);
21634     __Pyx_DECREF_SET(__pyx_v_blockSizes, ((PyObject*)__pyx_t_7));
21635     __pyx_t_7 = 0;
21636 
21637     /* "MACS2/IO/ScoreTrack.pyx":1288
21638  *             blockNum += 1
21639  *             blockSizes = blockSizes+b",1"
21640  *             blockStarts = blockStarts + b"," + (b"%d" % (end-start-1))             # <<<<<<<<<<<<<<
21641  *
21642  *         # add to BroadPeakIO object
21643  */
21644     __pyx_t_7 = PyNumber_Add(__pyx_v_blockStarts, __pyx_kp_b__20); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1288, __pyx_L1_error)
21645     __Pyx_GOTREF(__pyx_t_7);
21646     __pyx_t_8 = __Pyx_PyInt_From_long(((__pyx_v_end - __pyx_v_start) - 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1288, __pyx_L1_error)
21647     __Pyx_GOTREF(__pyx_t_8);
21648     __pyx_t_6 = PyNumber_Remainder(__pyx_kp_b_d_2, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1288, __pyx_L1_error)
21649     __Pyx_GOTREF(__pyx_t_6);
21650     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21651     __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1288, __pyx_L1_error)
21652     __Pyx_GOTREF(__pyx_t_8);
21653     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21654     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21655     __Pyx_DECREF_SET(__pyx_v_blockStarts, ((PyObject*)__pyx_t_8));
21656     __pyx_t_8 = 0;
21657 
21658     /* "MACS2/IO/ScoreTrack.pyx":1283
21659  *             blockSizes = b"1,"+blockSizes
21660  *             blockStarts = b"0,"+blockStarts
21661  *         if lvl2peak["end"] != thickEnd:             # <<<<<<<<<<<<<<
21662  *             # add 1bp mark for the end of lvl2 peak
21663  *             thickEnd = b"%d" % end
21664  */
21665   }
21666 
21667   /* "MACS2/IO/ScoreTrack.pyx":1291
21668  *
21669  *         # add to BroadPeakIO object
21670  *         bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=thickStart, thickEnd=thickEnd,             # <<<<<<<<<<<<<<
21671  *                    blockNum = blockNum, blockSizes = blockSizes, blockStarts = blockStarts,  pileup = lvl2peak["pileup"],
21672  *                    pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],
21673  */
21674   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_bpeaks, __pyx_n_s_add); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1291, __pyx_L1_error)
21675   __Pyx_GOTREF(__pyx_t_8);
21676   __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1291, __pyx_L1_error)
21677   __Pyx_GOTREF(__pyx_t_6);
21678   __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_end); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1291, __pyx_L1_error)
21679   __Pyx_GOTREF(__pyx_t_7);
21680   __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1291, __pyx_L1_error)
21681   __Pyx_GOTREF(__pyx_t_5);
21682   __Pyx_INCREF(__pyx_v_chrom);
21683   __Pyx_GIVEREF(__pyx_v_chrom);
21684   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
21685   __Pyx_GIVEREF(__pyx_t_6);
21686   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
21687   __Pyx_GIVEREF(__pyx_t_7);
21688   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_7);
21689   __pyx_t_6 = 0;
21690   __pyx_t_7 = 0;
21691   __pyx_t_7 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1291, __pyx_L1_error)
21692   __Pyx_GOTREF(__pyx_t_7);
21693   if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21694     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21695     __PYX_ERR(0, 1291, __pyx_L1_error)
21696   }
21697   __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_score); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1291, __pyx_L1_error)
21698   __Pyx_GOTREF(__pyx_t_6);
21699   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_score, __pyx_t_6) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
21700   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21701   __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_thickStart); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1291, __pyx_L1_error)
21702   __Pyx_GOTREF(__pyx_t_6);
21703   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_thickStart, __pyx_t_6) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
21704   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21705   __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_thickEnd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1291, __pyx_L1_error)
21706   __Pyx_GOTREF(__pyx_t_6);
21707   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_thickEnd, __pyx_t_6) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
21708   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21709 
21710   /* "MACS2/IO/ScoreTrack.pyx":1292
21711  *         # add to BroadPeakIO object
21712  *         bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=thickStart, thickEnd=thickEnd,
21713  *                    blockNum = blockNum, blockSizes = blockSizes, blockStarts = blockStarts,  pileup = lvl2peak["pileup"],             # <<<<<<<<<<<<<<
21714  *                    pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],
21715  *                    qscore = lvl2peak["qscore"] )
21716  */
21717   __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_blockNum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1292, __pyx_L1_error)
21718   __Pyx_GOTREF(__pyx_t_6);
21719   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_blockNum, __pyx_t_6) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
21720   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21721   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_blockSizes, __pyx_v_blockSizes) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
21722   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_blockStarts, __pyx_v_blockStarts) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
21723   if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21724     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21725     __PYX_ERR(0, 1292, __pyx_L1_error)
21726   }
21727   __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_pileup); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1292, __pyx_L1_error)
21728   __Pyx_GOTREF(__pyx_t_6);
21729   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_pileup, __pyx_t_6) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
21730   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21731 
21732   /* "MACS2/IO/ScoreTrack.pyx":1293
21733  *         bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=thickStart, thickEnd=thickEnd,
21734  *                    blockNum = blockNum, blockSizes = blockSizes, blockStarts = blockStarts,  pileup = lvl2peak["pileup"],
21735  *                    pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],             # <<<<<<<<<<<<<<
21736  *                    qscore = lvl2peak["qscore"] )
21737  *         return bpeaks
21738  */
21739   if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21740     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21741     __PYX_ERR(0, 1293, __pyx_L1_error)
21742   }
21743   __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_pscore); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1293, __pyx_L1_error)
21744   __Pyx_GOTREF(__pyx_t_6);
21745   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_pscore, __pyx_t_6) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
21746   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21747   if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21748     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21749     __PYX_ERR(0, 1293, __pyx_L1_error)
21750   }
21751   __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_fc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1293, __pyx_L1_error)
21752   __Pyx_GOTREF(__pyx_t_6);
21753   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fold_change, __pyx_t_6) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
21754   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21755 
21756   /* "MACS2/IO/ScoreTrack.pyx":1294
21757  *                    blockNum = blockNum, blockSizes = blockSizes, blockStarts = blockStarts,  pileup = lvl2peak["pileup"],
21758  *                    pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],
21759  *                    qscore = lvl2peak["qscore"] )             # <<<<<<<<<<<<<<
21760  *         return bpeaks
21761  *
21762  */
21763   if (unlikely(__pyx_v_lvl2peak == Py_None)) {
21764     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21765     __PYX_ERR(0, 1294, __pyx_L1_error)
21766   }
21767   __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_lvl2peak, __pyx_n_u_qscore); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error)
21768   __Pyx_GOTREF(__pyx_t_6);
21769   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_qscore, __pyx_t_6) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
21770   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21771 
21772   /* "MACS2/IO/ScoreTrack.pyx":1291
21773  *
21774  *         # add to BroadPeakIO object
21775  *         bpeaks.add(chrom, start, end, score=lvl2peak["score"], thickStart=thickStart, thickEnd=thickEnd,             # <<<<<<<<<<<<<<
21776  *                    blockNum = blockNum, blockSizes = blockSizes, blockStarts = blockStarts,  pileup = lvl2peak["pileup"],
21777  *                    pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],
21778  */
21779   __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1291, __pyx_L1_error)
21780   __Pyx_GOTREF(__pyx_t_6);
21781   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21782   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21783   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21784   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21785 
21786   /* "MACS2/IO/ScoreTrack.pyx":1295
21787  *                    pscore = lvl2peak["pscore"], fold_change = lvl2peak["fc"],
21788  *                    qscore = lvl2peak["qscore"] )
21789  *         return bpeaks             # <<<<<<<<<<<<<<
21790  *
21791  * cdef class TwoConditionScores:
21792  */
21793   __Pyx_XDECREF(__pyx_r);
21794   __Pyx_INCREF(__pyx_v_bpeaks);
21795   __pyx_r = __pyx_v_bpeaks;
21796   goto __pyx_L0;
21797 
21798   /* "MACS2/IO/ScoreTrack.pyx":1250
21799  *         return broadpeaks
21800  *
21801  *     def __add_broadpeak (self, bpeaks, bytes chrom, dict lvl2peak, list lvl1peakset):             # <<<<<<<<<<<<<<
21802  *         """Internal function to create broad peak.
21803  *         """
21804  */
21805 
21806   /* function exit code */
21807   __pyx_L1_error:;
21808   __Pyx_XDECREF(__pyx_t_1);
21809   __Pyx_XDECREF(__pyx_t_5);
21810   __Pyx_XDECREF(__pyx_t_6);
21811   __Pyx_XDECREF(__pyx_t_7);
21812   __Pyx_XDECREF(__pyx_t_8);
21813   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.__add_broadpeak", __pyx_clineno, __pyx_lineno, __pyx_filename);
21814   __pyx_r = NULL;
21815   __pyx_L0:;
21816   __Pyx_XDECREF(__pyx_v_blockSizes);
21817   __Pyx_XDECREF(__pyx_v_blockStarts);
21818   __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x);
21819   __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x);
21820   __Pyx_XGIVEREF(__pyx_r);
21821   __Pyx_TraceReturn(__pyx_r, 0);
21822   __Pyx_RefNannyFinishContext();
21823   return __pyx_r;
21824 }
21825 
21826 /* "(tree fragment)":1
21827  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
21828  *     cdef tuple state
21829  *     cdef object _dict
21830  */
21831 
21832 /* Python wrapper */
21833 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_31__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)21834 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
21835   PyObject *__pyx_r = 0;
21836   __Pyx_RefNannyDeclarations
21837   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
21838   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_30__reduce_cython__(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self));
21839 
21840   /* function exit code */
21841   __Pyx_RefNannyFinishContext();
21842   return __pyx_r;
21843 }
21844 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_30__reduce_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self)21845 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_30__reduce_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self) {
21846   PyObject *__pyx_v_state = 0;
21847   PyObject *__pyx_v__dict = 0;
21848   int __pyx_v_use_setstate;
21849   PyObject *__pyx_r = NULL;
21850   __Pyx_TraceDeclarations
21851   __Pyx_RefNannyDeclarations
21852   PyObject *__pyx_t_1 = NULL;
21853   PyObject *__pyx_t_2 = NULL;
21854   PyObject *__pyx_t_3 = NULL;
21855   PyObject *__pyx_t_4 = NULL;
21856   PyObject *__pyx_t_5 = NULL;
21857   PyObject *__pyx_t_6 = NULL;
21858   PyObject *__pyx_t_7 = NULL;
21859   int __pyx_t_8;
21860   int __pyx_t_9;
21861   int __pyx_t_10;
21862   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
21863   __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
21864 
21865   /* "(tree fragment)":5
21866  *     cdef object _dict
21867  *     cdef bint use_setstate
21868  *     state = (self.ctrl_edm, self.cutoff, self.data, self.data_stderr, self.datalength, self.normalization_method, self.pseudocount, self.pvalue_stat, self.scoring_method, self.stderr_on, self.trackline, self.treat_edm)             # <<<<<<<<<<<<<<
21869  *     _dict = getattr(self, '__dict__', None)
21870  *     if _dict is not None:
21871  */
21872   __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->ctrl_edm); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
21873   __Pyx_GOTREF(__pyx_t_1);
21874   __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21875   __Pyx_GOTREF(__pyx_t_2);
21876   __pyx_t_3 = __Pyx_PyInt_From_char(__pyx_v_self->normalization_method); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21877   __Pyx_GOTREF(__pyx_t_3);
21878   __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
21879   __Pyx_GOTREF(__pyx_t_4);
21880   __pyx_t_5 = __Pyx_PyInt_From_char(__pyx_v_self->scoring_method); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
21881   __Pyx_GOTREF(__pyx_t_5);
21882   __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->treat_edm); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
21883   __Pyx_GOTREF(__pyx_t_6);
21884   __pyx_t_7 = PyTuple_New(12); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
21885   __Pyx_GOTREF(__pyx_t_7);
21886   __Pyx_GIVEREF(__pyx_t_1);
21887   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
21888   __Pyx_GIVEREF(__pyx_t_2);
21889   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
21890   __Pyx_INCREF(__pyx_v_self->data);
21891   __Pyx_GIVEREF(__pyx_v_self->data);
21892   PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_self->data);
21893   __Pyx_INCREF(__pyx_v_self->data_stderr);
21894   __Pyx_GIVEREF(__pyx_v_self->data_stderr);
21895   PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_self->data_stderr);
21896   __Pyx_INCREF(__pyx_v_self->datalength);
21897   __Pyx_GIVEREF(__pyx_v_self->datalength);
21898   PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_self->datalength);
21899   __Pyx_GIVEREF(__pyx_t_3);
21900   PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_3);
21901   __Pyx_GIVEREF(__pyx_t_4);
21902   PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_4);
21903   __Pyx_INCREF(__pyx_v_self->pvalue_stat);
21904   __Pyx_GIVEREF(__pyx_v_self->pvalue_stat);
21905   PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_v_self->pvalue_stat);
21906   __Pyx_GIVEREF(__pyx_t_5);
21907   PyTuple_SET_ITEM(__pyx_t_7, 8, __pyx_t_5);
21908   __Pyx_INCREF(((PyObject *)__pyx_v_self->stderr_on));
21909   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->stderr_on));
21910   PyTuple_SET_ITEM(__pyx_t_7, 9, ((PyObject *)__pyx_v_self->stderr_on));
21911   __Pyx_INCREF(((PyObject *)__pyx_v_self->trackline));
21912   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->trackline));
21913   PyTuple_SET_ITEM(__pyx_t_7, 10, ((PyObject *)__pyx_v_self->trackline));
21914   __Pyx_GIVEREF(__pyx_t_6);
21915   PyTuple_SET_ITEM(__pyx_t_7, 11, __pyx_t_6);
21916   __pyx_t_1 = 0;
21917   __pyx_t_2 = 0;
21918   __pyx_t_3 = 0;
21919   __pyx_t_4 = 0;
21920   __pyx_t_5 = 0;
21921   __pyx_t_6 = 0;
21922   __pyx_v_state = ((PyObject*)__pyx_t_7);
21923   __pyx_t_7 = 0;
21924 
21925   /* "(tree fragment)":6
21926  *     cdef bint use_setstate
21927  *     state = (self.ctrl_edm, self.cutoff, self.data, self.data_stderr, self.datalength, self.normalization_method, self.pseudocount, self.pvalue_stat, self.scoring_method, self.stderr_on, self.trackline, self.treat_edm)
21928  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
21929  *     if _dict is not None:
21930  *         state += (_dict,)
21931  */
21932   __pyx_t_7 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 6, __pyx_L1_error)
21933   __Pyx_GOTREF(__pyx_t_7);
21934   __pyx_v__dict = __pyx_t_7;
21935   __pyx_t_7 = 0;
21936 
21937   /* "(tree fragment)":7
21938  *     state = (self.ctrl_edm, self.cutoff, self.data, self.data_stderr, self.datalength, self.normalization_method, self.pseudocount, self.pvalue_stat, self.scoring_method, self.stderr_on, self.trackline, self.treat_edm)
21939  *     _dict = getattr(self, '__dict__', None)
21940  *     if _dict is not None:             # <<<<<<<<<<<<<<
21941  *         state += (_dict,)
21942  *         use_setstate = True
21943  */
21944   __pyx_t_8 = (__pyx_v__dict != Py_None);
21945   __pyx_t_9 = (__pyx_t_8 != 0);
21946   if (__pyx_t_9) {
21947 
21948     /* "(tree fragment)":8
21949  *     _dict = getattr(self, '__dict__', None)
21950  *     if _dict is not None:
21951  *         state += (_dict,)             # <<<<<<<<<<<<<<
21952  *         use_setstate = True
21953  *     else:
21954  */
21955     __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 8, __pyx_L1_error)
21956     __Pyx_GOTREF(__pyx_t_7);
21957     __Pyx_INCREF(__pyx_v__dict);
21958     __Pyx_GIVEREF(__pyx_v__dict);
21959     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v__dict);
21960     __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 8, __pyx_L1_error)
21961     __Pyx_GOTREF(__pyx_t_6);
21962     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21963     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_6));
21964     __pyx_t_6 = 0;
21965 
21966     /* "(tree fragment)":9
21967  *     if _dict is not None:
21968  *         state += (_dict,)
21969  *         use_setstate = True             # <<<<<<<<<<<<<<
21970  *     else:
21971  *         use_setstate = self.data is not None or self.data_stderr is not None or self.datalength is not None or self.pvalue_stat is not None or self.stderr_on is not None or self.trackline is not None
21972  */
21973     __pyx_v_use_setstate = 1;
21974 
21975     /* "(tree fragment)":7
21976  *     state = (self.ctrl_edm, self.cutoff, self.data, self.data_stderr, self.datalength, self.normalization_method, self.pseudocount, self.pvalue_stat, self.scoring_method, self.stderr_on, self.trackline, self.treat_edm)
21977  *     _dict = getattr(self, '__dict__', None)
21978  *     if _dict is not None:             # <<<<<<<<<<<<<<
21979  *         state += (_dict,)
21980  *         use_setstate = True
21981  */
21982     goto __pyx_L3;
21983   }
21984 
21985   /* "(tree fragment)":11
21986  *         use_setstate = True
21987  *     else:
21988  *         use_setstate = self.data is not None or self.data_stderr is not None or self.datalength is not None or self.pvalue_stat is not None or self.stderr_on is not None or self.trackline is not None             # <<<<<<<<<<<<<<
21989  *     if use_setstate:
21990  *         return __pyx_unpickle_scoreTrackII, (type(self), 0x77c358c, None), state
21991  */
21992   /*else*/ {
21993     __pyx_t_8 = (__pyx_v_self->data != ((PyObject*)Py_None));
21994     __pyx_t_10 = (__pyx_t_8 != 0);
21995     if (!__pyx_t_10) {
21996     } else {
21997       __pyx_t_9 = __pyx_t_10;
21998       goto __pyx_L4_bool_binop_done;
21999     }
22000     __pyx_t_10 = (__pyx_v_self->data_stderr != ((PyObject*)Py_None));
22001     __pyx_t_8 = (__pyx_t_10 != 0);
22002     if (!__pyx_t_8) {
22003     } else {
22004       __pyx_t_9 = __pyx_t_8;
22005       goto __pyx_L4_bool_binop_done;
22006     }
22007     __pyx_t_8 = (__pyx_v_self->datalength != ((PyObject*)Py_None));
22008     __pyx_t_10 = (__pyx_t_8 != 0);
22009     if (!__pyx_t_10) {
22010     } else {
22011       __pyx_t_9 = __pyx_t_10;
22012       goto __pyx_L4_bool_binop_done;
22013     }
22014     __pyx_t_10 = (__pyx_v_self->pvalue_stat != ((PyObject*)Py_None));
22015     __pyx_t_8 = (__pyx_t_10 != 0);
22016     if (!__pyx_t_8) {
22017     } else {
22018       __pyx_t_9 = __pyx_t_8;
22019       goto __pyx_L4_bool_binop_done;
22020     }
22021     __pyx_t_8 = (((PyObject *)__pyx_v_self->stderr_on) != Py_None);
22022     __pyx_t_10 = (__pyx_t_8 != 0);
22023     if (!__pyx_t_10) {
22024     } else {
22025       __pyx_t_9 = __pyx_t_10;
22026       goto __pyx_L4_bool_binop_done;
22027     }
22028     __pyx_t_10 = (((PyObject *)__pyx_v_self->trackline) != Py_None);
22029     __pyx_t_8 = (__pyx_t_10 != 0);
22030     __pyx_t_9 = __pyx_t_8;
22031     __pyx_L4_bool_binop_done:;
22032     __pyx_v_use_setstate = __pyx_t_9;
22033   }
22034   __pyx_L3:;
22035 
22036   /* "(tree fragment)":12
22037  *     else:
22038  *         use_setstate = self.data is not None or self.data_stderr is not None or self.datalength is not None or self.pvalue_stat is not None or self.stderr_on is not None or self.trackline is not None
22039  *     if use_setstate:             # <<<<<<<<<<<<<<
22040  *         return __pyx_unpickle_scoreTrackII, (type(self), 0x77c358c, None), state
22041  *     else:
22042  */
22043   __pyx_t_9 = (__pyx_v_use_setstate != 0);
22044   if (__pyx_t_9) {
22045 
22046     /* "(tree fragment)":13
22047  *         use_setstate = self.data is not None or self.data_stderr is not None or self.datalength is not None or self.pvalue_stat is not None or self.stderr_on is not None or self.trackline is not None
22048  *     if use_setstate:
22049  *         return __pyx_unpickle_scoreTrackII, (type(self), 0x77c358c, None), state             # <<<<<<<<<<<<<<
22050  *     else:
22051  *         return __pyx_unpickle_scoreTrackII, (type(self), 0x77c358c, state)
22052  */
22053     __Pyx_XDECREF(__pyx_r);
22054     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_scoreTrackII); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
22055     __Pyx_GOTREF(__pyx_t_6);
22056     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error)
22057     __Pyx_GOTREF(__pyx_t_7);
22058     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22059     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22060     PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22061     __Pyx_INCREF(__pyx_int_125580684);
22062     __Pyx_GIVEREF(__pyx_int_125580684);
22063     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_125580684);
22064     __Pyx_INCREF(Py_None);
22065     __Pyx_GIVEREF(Py_None);
22066     PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None);
22067     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
22068     __Pyx_GOTREF(__pyx_t_5);
22069     __Pyx_GIVEREF(__pyx_t_6);
22070     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
22071     __Pyx_GIVEREF(__pyx_t_7);
22072     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
22073     __Pyx_INCREF(__pyx_v_state);
22074     __Pyx_GIVEREF(__pyx_v_state);
22075     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
22076     __pyx_t_6 = 0;
22077     __pyx_t_7 = 0;
22078     __pyx_r = __pyx_t_5;
22079     __pyx_t_5 = 0;
22080     goto __pyx_L0;
22081 
22082     /* "(tree fragment)":12
22083  *     else:
22084  *         use_setstate = self.data is not None or self.data_stderr is not None or self.datalength is not None or self.pvalue_stat is not None or self.stderr_on is not None or self.trackline is not None
22085  *     if use_setstate:             # <<<<<<<<<<<<<<
22086  *         return __pyx_unpickle_scoreTrackII, (type(self), 0x77c358c, None), state
22087  *     else:
22088  */
22089   }
22090 
22091   /* "(tree fragment)":15
22092  *         return __pyx_unpickle_scoreTrackII, (type(self), 0x77c358c, None), state
22093  *     else:
22094  *         return __pyx_unpickle_scoreTrackII, (type(self), 0x77c358c, state)             # <<<<<<<<<<<<<<
22095  * def __setstate_cython__(self, __pyx_state):
22096  *     __pyx_unpickle_scoreTrackII__set_state(self, __pyx_state)
22097  */
22098   /*else*/ {
22099     __Pyx_XDECREF(__pyx_r);
22100     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_scoreTrackII); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
22101     __Pyx_GOTREF(__pyx_t_5);
22102     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 15, __pyx_L1_error)
22103     __Pyx_GOTREF(__pyx_t_7);
22104     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22105     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22106     PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22107     __Pyx_INCREF(__pyx_int_125580684);
22108     __Pyx_GIVEREF(__pyx_int_125580684);
22109     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_125580684);
22110     __Pyx_INCREF(__pyx_v_state);
22111     __Pyx_GIVEREF(__pyx_v_state);
22112     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
22113     __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
22114     __Pyx_GOTREF(__pyx_t_6);
22115     __Pyx_GIVEREF(__pyx_t_5);
22116     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
22117     __Pyx_GIVEREF(__pyx_t_7);
22118     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
22119     __pyx_t_5 = 0;
22120     __pyx_t_7 = 0;
22121     __pyx_r = __pyx_t_6;
22122     __pyx_t_6 = 0;
22123     goto __pyx_L0;
22124   }
22125 
22126   /* "(tree fragment)":1
22127  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
22128  *     cdef tuple state
22129  *     cdef object _dict
22130  */
22131 
22132   /* function exit code */
22133   __pyx_L1_error:;
22134   __Pyx_XDECREF(__pyx_t_1);
22135   __Pyx_XDECREF(__pyx_t_2);
22136   __Pyx_XDECREF(__pyx_t_3);
22137   __Pyx_XDECREF(__pyx_t_4);
22138   __Pyx_XDECREF(__pyx_t_5);
22139   __Pyx_XDECREF(__pyx_t_6);
22140   __Pyx_XDECREF(__pyx_t_7);
22141   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22142   __pyx_r = NULL;
22143   __pyx_L0:;
22144   __Pyx_XDECREF(__pyx_v_state);
22145   __Pyx_XDECREF(__pyx_v__dict);
22146   __Pyx_XGIVEREF(__pyx_r);
22147   __Pyx_TraceReturn(__pyx_r, 0);
22148   __Pyx_RefNannyFinishContext();
22149   return __pyx_r;
22150 }
22151 
22152 /* "(tree fragment)":16
22153  *     else:
22154  *         return __pyx_unpickle_scoreTrackII, (type(self), 0x77c358c, state)
22155  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
22156  *     __pyx_unpickle_scoreTrackII__set_state(self, __pyx_state)
22157  */
22158 
22159 /* Python wrapper */
22160 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_33__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)22161 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
22162   PyObject *__pyx_r = 0;
22163   __Pyx_RefNannyDeclarations
22164   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
22165   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_32__setstate_cython__(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
22166 
22167   /* function exit code */
22168   __Pyx_RefNannyFinishContext();
22169   return __pyx_r;
22170 }
22171 
__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_32__setstate_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v_self,PyObject * __pyx_v___pyx_state)22172 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_12scoreTrackII_32__setstate_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
22173   PyObject *__pyx_r = NULL;
22174   __Pyx_TraceDeclarations
22175   __Pyx_RefNannyDeclarations
22176   PyObject *__pyx_t_1 = NULL;
22177   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
22178   __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
22179 
22180   /* "(tree fragment)":17
22181  *         return __pyx_unpickle_scoreTrackII, (type(self), 0x77c358c, state)
22182  * def __setstate_cython__(self, __pyx_state):
22183  *     __pyx_unpickle_scoreTrackII__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
22184  */
22185   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
22186   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack___pyx_unpickle_scoreTrackII__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
22187   __Pyx_GOTREF(__pyx_t_1);
22188   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22189 
22190   /* "(tree fragment)":16
22191  *     else:
22192  *         return __pyx_unpickle_scoreTrackII, (type(self), 0x77c358c, state)
22193  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
22194  *     __pyx_unpickle_scoreTrackII__set_state(self, __pyx_state)
22195  */
22196 
22197   /* function exit code */
22198   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22199   goto __pyx_L0;
22200   __pyx_L1_error:;
22201   __Pyx_XDECREF(__pyx_t_1);
22202   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.scoreTrackII.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22203   __pyx_r = NULL;
22204   __pyx_L0:;
22205   __Pyx_XGIVEREF(__pyx_r);
22206   __Pyx_TraceReturn(__pyx_r, 0);
22207   __Pyx_RefNannyFinishContext();
22208   return __pyx_r;
22209 }
22210 
22211 /* "MACS2/IO/ScoreTrack.pyx":1310
22212  *         dict pvalue_stat1, pvalue_stat2, pvalue_stat3
22213  *
22214  *     def __init__ (self, t1bdg, c1bdg, t2bdg, c2bdg, float64_t cond1_factor = 1.0, float64_t cond2_factor = 1.0, float64_t pseudocount = 0.01, proportion_background_empirical_distribution = 0.99999 ):             # <<<<<<<<<<<<<<
22215  *         """
22216  *         t1bdg: a bedGraphTrackI object for treat 1
22217  */
22218 
22219 /* Python wrapper */
22220 static int __pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
22221 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___init__[] = "\n        t1bdg: a bedGraphTrackI object for treat 1\n        c1bdg: a bedGraphTrackI object for control 1\n        t2bdg: a bedGraphTrackI object for treat 2\n        c2bdg: a bedGraphTrackI object for control 2\n\n        cond1_factor: this will be multiplied to values in t1bdg and c1bdg\n        cond2_factor: this will be multiplied to values in t2bdg and c2bdg\n\n        pseudocount: pseudocount, by default 0.01.\n\n        proportion_background_empirical_distribution: proportion of genome as the background to build empirical distribution\n\n        ";
22222 #if CYTHON_COMPILING_IN_CPYTHON
22223 struct wrapperbase __pyx_wrapperbase_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___init__;
22224 #endif
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)22225 static int __pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22226   PyObject *__pyx_v_t1bdg = 0;
22227   PyObject *__pyx_v_c1bdg = 0;
22228   PyObject *__pyx_v_t2bdg = 0;
22229   PyObject *__pyx_v_c2bdg = 0;
22230   __pyx_t_5numpy_float64_t __pyx_v_cond1_factor;
22231   __pyx_t_5numpy_float64_t __pyx_v_cond2_factor;
22232   __pyx_t_5numpy_float64_t __pyx_v_pseudocount;
22233   CYTHON_UNUSED PyObject *__pyx_v_proportion_background_empirical_distribution = 0;
22234   int __pyx_r;
22235   __Pyx_RefNannyDeclarations
22236   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
22237   {
22238     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t1bdg,&__pyx_n_s_c1bdg,&__pyx_n_s_t2bdg,&__pyx_n_s_c2bdg,&__pyx_n_s_cond1_factor,&__pyx_n_s_cond2_factor,&__pyx_n_s_pseudocount,&__pyx_n_s_proportion_background_empirical,0};
22239     PyObject* values[8] = {0,0,0,0,0,0,0,0};
22240     values[7] = ((PyObject *)__pyx_float_0_99999);
22241     if (unlikely(__pyx_kwds)) {
22242       Py_ssize_t kw_args;
22243       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
22244       switch (pos_args) {
22245         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
22246         CYTHON_FALLTHROUGH;
22247         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
22248         CYTHON_FALLTHROUGH;
22249         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
22250         CYTHON_FALLTHROUGH;
22251         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
22252         CYTHON_FALLTHROUGH;
22253         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
22254         CYTHON_FALLTHROUGH;
22255         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
22256         CYTHON_FALLTHROUGH;
22257         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22258         CYTHON_FALLTHROUGH;
22259         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22260         CYTHON_FALLTHROUGH;
22261         case  0: break;
22262         default: goto __pyx_L5_argtuple_error;
22263       }
22264       kw_args = PyDict_Size(__pyx_kwds);
22265       switch (pos_args) {
22266         case  0:
22267         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1bdg)) != 0)) kw_args--;
22268         else goto __pyx_L5_argtuple_error;
22269         CYTHON_FALLTHROUGH;
22270         case  1:
22271         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1bdg)) != 0)) kw_args--;
22272         else {
22273           __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 8, 1); __PYX_ERR(0, 1310, __pyx_L3_error)
22274         }
22275         CYTHON_FALLTHROUGH;
22276         case  2:
22277         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t2bdg)) != 0)) kw_args--;
22278         else {
22279           __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 8, 2); __PYX_ERR(0, 1310, __pyx_L3_error)
22280         }
22281         CYTHON_FALLTHROUGH;
22282         case  3:
22283         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2bdg)) != 0)) kw_args--;
22284         else {
22285           __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 8, 3); __PYX_ERR(0, 1310, __pyx_L3_error)
22286         }
22287         CYTHON_FALLTHROUGH;
22288         case  4:
22289         if (kw_args > 0) {
22290           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond1_factor);
22291           if (value) { values[4] = value; kw_args--; }
22292         }
22293         CYTHON_FALLTHROUGH;
22294         case  5:
22295         if (kw_args > 0) {
22296           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond2_factor);
22297           if (value) { values[5] = value; kw_args--; }
22298         }
22299         CYTHON_FALLTHROUGH;
22300         case  6:
22301         if (kw_args > 0) {
22302           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pseudocount);
22303           if (value) { values[6] = value; kw_args--; }
22304         }
22305         CYTHON_FALLTHROUGH;
22306         case  7:
22307         if (kw_args > 0) {
22308           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_proportion_background_empirical);
22309           if (value) { values[7] = value; kw_args--; }
22310         }
22311       }
22312       if (unlikely(kw_args > 0)) {
22313         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1310, __pyx_L3_error)
22314       }
22315     } else {
22316       switch (PyTuple_GET_SIZE(__pyx_args)) {
22317         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
22318         CYTHON_FALLTHROUGH;
22319         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
22320         CYTHON_FALLTHROUGH;
22321         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
22322         CYTHON_FALLTHROUGH;
22323         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
22324         CYTHON_FALLTHROUGH;
22325         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
22326         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
22327         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22328         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22329         break;
22330         default: goto __pyx_L5_argtuple_error;
22331       }
22332     }
22333     __pyx_v_t1bdg = values[0];
22334     __pyx_v_c1bdg = values[1];
22335     __pyx_v_t2bdg = values[2];
22336     __pyx_v_c2bdg = values[3];
22337     if (values[4]) {
22338       __pyx_v_cond1_factor = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_cond1_factor == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1310, __pyx_L3_error)
22339     } else {
22340       __pyx_v_cond1_factor = ((__pyx_t_5numpy_float64_t)1.0);
22341     }
22342     if (values[5]) {
22343       __pyx_v_cond2_factor = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_cond2_factor == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1310, __pyx_L3_error)
22344     } else {
22345       __pyx_v_cond2_factor = ((__pyx_t_5numpy_float64_t)1.0);
22346     }
22347     if (values[6]) {
22348       __pyx_v_pseudocount = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_pseudocount == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1310, __pyx_L3_error)
22349     } else {
22350       __pyx_v_pseudocount = ((__pyx_t_5numpy_float64_t)0.01);
22351     }
22352     __pyx_v_proportion_background_empirical_distribution = values[7];
22353   }
22354   goto __pyx_L4_argument_unpacking_done;
22355   __pyx_L5_argtuple_error:;
22356   __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1310, __pyx_L3_error)
22357   __pyx_L3_error:;
22358   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22359   __Pyx_RefNannyFinishContext();
22360   return -1;
22361   __pyx_L4_argument_unpacking_done:;
22362   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___init__(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self), __pyx_v_t1bdg, __pyx_v_c1bdg, __pyx_v_t2bdg, __pyx_v_c2bdg, __pyx_v_cond1_factor, __pyx_v_cond2_factor, __pyx_v_pseudocount, __pyx_v_proportion_background_empirical_distribution);
22363 
22364   /* function exit code */
22365   __Pyx_RefNannyFinishContext();
22366   return __pyx_r;
22367 }
22368 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___init__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_t1bdg,PyObject * __pyx_v_c1bdg,PyObject * __pyx_v_t2bdg,PyObject * __pyx_v_c2bdg,__pyx_t_5numpy_float64_t __pyx_v_cond1_factor,__pyx_t_5numpy_float64_t __pyx_v_cond2_factor,__pyx_t_5numpy_float64_t __pyx_v_pseudocount,CYTHON_UNUSED PyObject * __pyx_v_proportion_background_empirical_distribution)22369 static int __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___init__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_t1bdg, PyObject *__pyx_v_c1bdg, PyObject *__pyx_v_t2bdg, PyObject *__pyx_v_c2bdg, __pyx_t_5numpy_float64_t __pyx_v_cond1_factor, __pyx_t_5numpy_float64_t __pyx_v_cond2_factor, __pyx_t_5numpy_float64_t __pyx_v_pseudocount, CYTHON_UNUSED PyObject *__pyx_v_proportion_background_empirical_distribution) {
22370   int __pyx_r;
22371   __Pyx_TraceDeclarations
22372   __Pyx_RefNannyDeclarations
22373   PyObject *__pyx_t_1 = NULL;
22374   __Pyx_RefNannySetupContext("__init__", 0);
22375   __Pyx_TraceCall("__init__", __pyx_f[0], 1310, 0, __PYX_ERR(0, 1310, __pyx_L1_error));
22376 
22377   /* "MACS2/IO/ScoreTrack.pyx":1326
22378  *         """
22379  *
22380  *         self.data = {}           # for each chromosome, there is a l*4             # <<<<<<<<<<<<<<
22381  *                                  # matrix. First column: end position
22382  *                                  # of a region; Second: treatment
22383  */
22384   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1326, __pyx_L1_error)
22385   __Pyx_GOTREF(__pyx_t_1);
22386   __Pyx_GIVEREF(__pyx_t_1);
22387   __Pyx_GOTREF(__pyx_v_self->data);
22388   __Pyx_DECREF(__pyx_v_self->data);
22389   __pyx_v_self->data = ((PyObject*)__pyx_t_1);
22390   __pyx_t_1 = 0;
22391 
22392   /* "MACS2/IO/ScoreTrack.pyx":1334
22393  *                                  # ratio/fold-enrichment/subtraction
22394  *                                  # depending on -c setting)
22395  *         self.datalength = {}             # <<<<<<<<<<<<<<
22396  *         self.cond1_factor = cond1_factor
22397  *         self.cond2_factor = cond2_factor
22398  */
22399   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error)
22400   __Pyx_GOTREF(__pyx_t_1);
22401   __Pyx_GIVEREF(__pyx_t_1);
22402   __Pyx_GOTREF(__pyx_v_self->datalength);
22403   __Pyx_DECREF(__pyx_v_self->datalength);
22404   __pyx_v_self->datalength = ((PyObject*)__pyx_t_1);
22405   __pyx_t_1 = 0;
22406 
22407   /* "MACS2/IO/ScoreTrack.pyx":1335
22408  *                                  # depending on -c setting)
22409  *         self.datalength = {}
22410  *         self.cond1_factor = cond1_factor             # <<<<<<<<<<<<<<
22411  *         self.cond2_factor = cond2_factor
22412  *         self.pseudocount = pseudocount
22413  */
22414   __pyx_v_self->cond1_factor = __pyx_v_cond1_factor;
22415 
22416   /* "MACS2/IO/ScoreTrack.pyx":1336
22417  *         self.datalength = {}
22418  *         self.cond1_factor = cond1_factor
22419  *         self.cond2_factor = cond2_factor             # <<<<<<<<<<<<<<
22420  *         self.pseudocount = pseudocount
22421  *         self.pvalue_stat1 = {}
22422  */
22423   __pyx_v_self->cond2_factor = __pyx_v_cond2_factor;
22424 
22425   /* "MACS2/IO/ScoreTrack.pyx":1337
22426  *         self.cond1_factor = cond1_factor
22427  *         self.cond2_factor = cond2_factor
22428  *         self.pseudocount = pseudocount             # <<<<<<<<<<<<<<
22429  *         self.pvalue_stat1 = {}
22430  *         self.pvalue_stat2 = {}
22431  */
22432   __pyx_v_self->pseudocount = __pyx_v_pseudocount;
22433 
22434   /* "MACS2/IO/ScoreTrack.pyx":1338
22435  *         self.cond2_factor = cond2_factor
22436  *         self.pseudocount = pseudocount
22437  *         self.pvalue_stat1 = {}             # <<<<<<<<<<<<<<
22438  *         self.pvalue_stat2 = {}
22439  *         self.t1bdg = t1bdg
22440  */
22441   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L1_error)
22442   __Pyx_GOTREF(__pyx_t_1);
22443   __Pyx_GIVEREF(__pyx_t_1);
22444   __Pyx_GOTREF(__pyx_v_self->pvalue_stat1);
22445   __Pyx_DECREF(__pyx_v_self->pvalue_stat1);
22446   __pyx_v_self->pvalue_stat1 = ((PyObject*)__pyx_t_1);
22447   __pyx_t_1 = 0;
22448 
22449   /* "MACS2/IO/ScoreTrack.pyx":1339
22450  *         self.pseudocount = pseudocount
22451  *         self.pvalue_stat1 = {}
22452  *         self.pvalue_stat2 = {}             # <<<<<<<<<<<<<<
22453  *         self.t1bdg = t1bdg
22454  *         self.c1bdg = c1bdg
22455  */
22456   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L1_error)
22457   __Pyx_GOTREF(__pyx_t_1);
22458   __Pyx_GIVEREF(__pyx_t_1);
22459   __Pyx_GOTREF(__pyx_v_self->pvalue_stat2);
22460   __Pyx_DECREF(__pyx_v_self->pvalue_stat2);
22461   __pyx_v_self->pvalue_stat2 = ((PyObject*)__pyx_t_1);
22462   __pyx_t_1 = 0;
22463 
22464   /* "MACS2/IO/ScoreTrack.pyx":1340
22465  *         self.pvalue_stat1 = {}
22466  *         self.pvalue_stat2 = {}
22467  *         self.t1bdg = t1bdg             # <<<<<<<<<<<<<<
22468  *         self.c1bdg = c1bdg
22469  *         self.t2bdg = t2bdg
22470  */
22471   __Pyx_INCREF(__pyx_v_t1bdg);
22472   __Pyx_GIVEREF(__pyx_v_t1bdg);
22473   __Pyx_GOTREF(__pyx_v_self->t1bdg);
22474   __Pyx_DECREF(__pyx_v_self->t1bdg);
22475   __pyx_v_self->t1bdg = __pyx_v_t1bdg;
22476 
22477   /* "MACS2/IO/ScoreTrack.pyx":1341
22478  *         self.pvalue_stat2 = {}
22479  *         self.t1bdg = t1bdg
22480  *         self.c1bdg = c1bdg             # <<<<<<<<<<<<<<
22481  *         self.t2bdg = t2bdg
22482  *         self.c2bdg = c2bdg
22483  */
22484   __Pyx_INCREF(__pyx_v_c1bdg);
22485   __Pyx_GIVEREF(__pyx_v_c1bdg);
22486   __Pyx_GOTREF(__pyx_v_self->c1bdg);
22487   __Pyx_DECREF(__pyx_v_self->c1bdg);
22488   __pyx_v_self->c1bdg = __pyx_v_c1bdg;
22489 
22490   /* "MACS2/IO/ScoreTrack.pyx":1342
22491  *         self.t1bdg = t1bdg
22492  *         self.c1bdg = c1bdg
22493  *         self.t2bdg = t2bdg             # <<<<<<<<<<<<<<
22494  *         self.c2bdg = c2bdg
22495  *
22496  */
22497   __Pyx_INCREF(__pyx_v_t2bdg);
22498   __Pyx_GIVEREF(__pyx_v_t2bdg);
22499   __Pyx_GOTREF(__pyx_v_self->t2bdg);
22500   __Pyx_DECREF(__pyx_v_self->t2bdg);
22501   __pyx_v_self->t2bdg = __pyx_v_t2bdg;
22502 
22503   /* "MACS2/IO/ScoreTrack.pyx":1343
22504  *         self.c1bdg = c1bdg
22505  *         self.t2bdg = t2bdg
22506  *         self.c2bdg = c2bdg             # <<<<<<<<<<<<<<
22507  *
22508  *         #self.empirical_distr_llr = [] # save all values in histogram
22509  */
22510   __Pyx_INCREF(__pyx_v_c2bdg);
22511   __Pyx_GIVEREF(__pyx_v_c2bdg);
22512   __Pyx_GOTREF(__pyx_v_self->c2bdg);
22513   __Pyx_DECREF(__pyx_v_self->c2bdg);
22514   __pyx_v_self->c2bdg = __pyx_v_c2bdg;
22515 
22516   /* "MACS2/IO/ScoreTrack.pyx":1310
22517  *         dict pvalue_stat1, pvalue_stat2, pvalue_stat3
22518  *
22519  *     def __init__ (self, t1bdg, c1bdg, t2bdg, c2bdg, float64_t cond1_factor = 1.0, float64_t cond2_factor = 1.0, float64_t pseudocount = 0.01, proportion_background_empirical_distribution = 0.99999 ):             # <<<<<<<<<<<<<<
22520  *         """
22521  *         t1bdg: a bedGraphTrackI object for treat 1
22522  */
22523 
22524   /* function exit code */
22525   __pyx_r = 0;
22526   goto __pyx_L0;
22527   __pyx_L1_error:;
22528   __Pyx_XDECREF(__pyx_t_1);
22529   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22530   __pyx_r = -1;
22531   __pyx_L0:;
22532   __Pyx_TraceReturn(Py_None, 0);
22533   __Pyx_RefNannyFinishContext();
22534   return __pyx_r;
22535 }
22536 
22537 /* "MACS2/IO/ScoreTrack.pyx":1347
22538  *         #self.empirical_distr_llr = [] # save all values in histogram
22539  *
22540  *     cpdef set_pseudocount( self, float64_t pseudocount ):             # <<<<<<<<<<<<<<
22541  *         self.pseudocount = pseudocount
22542  *
22543  */
22544 
22545 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,__pyx_t_5numpy_float64_t __pyx_v_pseudocount,int __pyx_skip_dispatch)22546 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_pseudocount, int __pyx_skip_dispatch) {
22547   PyObject *__pyx_r = NULL;
22548   __Pyx_TraceDeclarations
22549   __Pyx_RefNannyDeclarations
22550   PyObject *__pyx_t_1 = NULL;
22551   PyObject *__pyx_t_2 = NULL;
22552   PyObject *__pyx_t_3 = NULL;
22553   PyObject *__pyx_t_4 = NULL;
22554   PyObject *__pyx_t_5 = NULL;
22555   __Pyx_RefNannySetupContext("set_pseudocount", 0);
22556   __Pyx_TraceCall("set_pseudocount", __pyx_f[0], 1347, 0, __PYX_ERR(0, 1347, __pyx_L1_error));
22557   /* Check if called by wrapper */
22558   if (unlikely(__pyx_skip_dispatch)) ;
22559   /* Check if overridden in Python */
22560   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
22561     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
22562     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
22563     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
22564       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
22565       #endif
22566       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_pseudocount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
22567       __Pyx_GOTREF(__pyx_t_1);
22568       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_3set_pseudocount)) {
22569         __Pyx_XDECREF(__pyx_r);
22570         __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pseudocount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1347, __pyx_L1_error)
22571         __Pyx_GOTREF(__pyx_t_3);
22572         __Pyx_INCREF(__pyx_t_1);
22573         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
22574         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
22575           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
22576           if (likely(__pyx_t_5)) {
22577             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
22578             __Pyx_INCREF(__pyx_t_5);
22579             __Pyx_INCREF(function);
22580             __Pyx_DECREF_SET(__pyx_t_4, function);
22581           }
22582         }
22583         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
22584         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22585         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22586         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error)
22587         __Pyx_GOTREF(__pyx_t_2);
22588         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22589         __pyx_r = __pyx_t_2;
22590         __pyx_t_2 = 0;
22591         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22592         goto __pyx_L0;
22593       }
22594       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
22595       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
22596       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
22597       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
22598         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
22599       }
22600       #endif
22601       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22602       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
22603     }
22604     #endif
22605   }
22606 
22607   /* "MACS2/IO/ScoreTrack.pyx":1348
22608  *
22609  *     cpdef set_pseudocount( self, float64_t pseudocount ):
22610  *         self.pseudocount = pseudocount             # <<<<<<<<<<<<<<
22611  *
22612  *     cpdef build ( self ):
22613  */
22614   __pyx_v_self->pseudocount = __pyx_v_pseudocount;
22615 
22616   /* "MACS2/IO/ScoreTrack.pyx":1347
22617  *         #self.empirical_distr_llr = [] # save all values in histogram
22618  *
22619  *     cpdef set_pseudocount( self, float64_t pseudocount ):             # <<<<<<<<<<<<<<
22620  *         self.pseudocount = pseudocount
22621  *
22622  */
22623 
22624   /* function exit code */
22625   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22626   goto __pyx_L0;
22627   __pyx_L1_error:;
22628   __Pyx_XDECREF(__pyx_t_1);
22629   __Pyx_XDECREF(__pyx_t_2);
22630   __Pyx_XDECREF(__pyx_t_3);
22631   __Pyx_XDECREF(__pyx_t_4);
22632   __Pyx_XDECREF(__pyx_t_5);
22633   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
22634   __pyx_r = 0;
22635   __pyx_L0:;
22636   __Pyx_XGIVEREF(__pyx_r);
22637   __Pyx_TraceReturn(__pyx_r, 0);
22638   __Pyx_RefNannyFinishContext();
22639   return __pyx_r;
22640 }
22641 
22642 /* Python wrapper */
22643 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount); /*proto*/
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_3set_pseudocount(PyObject * __pyx_v_self,PyObject * __pyx_arg_pseudocount)22644 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_3set_pseudocount(PyObject *__pyx_v_self, PyObject *__pyx_arg_pseudocount) {
22645   __pyx_t_5numpy_float64_t __pyx_v_pseudocount;
22646   PyObject *__pyx_r = 0;
22647   __Pyx_RefNannyDeclarations
22648   __Pyx_RefNannySetupContext("set_pseudocount (wrapper)", 0);
22649   assert(__pyx_arg_pseudocount); {
22650     __pyx_v_pseudocount = __pyx_PyFloat_AsDouble(__pyx_arg_pseudocount); if (unlikely((__pyx_v_pseudocount == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1347, __pyx_L3_error)
22651   }
22652   goto __pyx_L4_argument_unpacking_done;
22653   __pyx_L3_error:;
22654   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
22655   __Pyx_RefNannyFinishContext();
22656   return NULL;
22657   __pyx_L4_argument_unpacking_done:;
22658   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_2set_pseudocount(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self), ((__pyx_t_5numpy_float64_t)__pyx_v_pseudocount));
22659 
22660   /* function exit code */
22661   __Pyx_RefNannyFinishContext();
22662   return __pyx_r;
22663 }
22664 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,__pyx_t_5numpy_float64_t __pyx_v_pseudocount)22665 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_2set_pseudocount(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_pseudocount) {
22666   PyObject *__pyx_r = NULL;
22667   __Pyx_TraceDeclarations
22668   __Pyx_RefNannyDeclarations
22669   PyObject *__pyx_t_1 = NULL;
22670   __Pyx_RefNannySetupContext("set_pseudocount", 0);
22671   __Pyx_TraceCall("set_pseudocount (wrapper)", __pyx_f[0], 1347, 0, __PYX_ERR(0, 1347, __pyx_L1_error));
22672   __Pyx_XDECREF(__pyx_r);
22673   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_set_pseudocount(__pyx_v_self, __pyx_v_pseudocount, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
22674   __Pyx_GOTREF(__pyx_t_1);
22675   __pyx_r = __pyx_t_1;
22676   __pyx_t_1 = 0;
22677   goto __pyx_L0;
22678 
22679   /* function exit code */
22680   __pyx_L1_error:;
22681   __Pyx_XDECREF(__pyx_t_1);
22682   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.set_pseudocount", __pyx_clineno, __pyx_lineno, __pyx_filename);
22683   __pyx_r = NULL;
22684   __pyx_L0:;
22685   __Pyx_XGIVEREF(__pyx_r);
22686   __Pyx_TraceReturn(__pyx_r, 0);
22687   __Pyx_RefNannyFinishContext();
22688   return __pyx_r;
22689 }
22690 
22691 /* "MACS2/IO/ScoreTrack.pyx":1350
22692  *         self.pseudocount = pseudocount
22693  *
22694  *     cpdef build ( self ):             # <<<<<<<<<<<<<<
22695  *         """Compute scores from 3 types of comparisons and store them in self.data.
22696  *
22697  */
22698 
22699 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_5build(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_build(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,int __pyx_skip_dispatch)22700 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_build(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch) {
22701   PyObject *__pyx_v_common_chrs = 0;
22702   PyObject *__pyx_v_chrname = 0;
22703   PyObject *__pyx_v_cond1_treat_ps = NULL;
22704   PyObject *__pyx_v_cond1_treat_vs = NULL;
22705   PyObject *__pyx_v_cond1_control_ps = NULL;
22706   PyObject *__pyx_v_cond1_control_vs = NULL;
22707   PyObject *__pyx_v_cond2_treat_ps = NULL;
22708   PyObject *__pyx_v_cond2_treat_vs = NULL;
22709   PyObject *__pyx_v_cond2_control_ps = NULL;
22710   PyObject *__pyx_v_cond2_control_vs = NULL;
22711   Py_ssize_t __pyx_v_chrom_max_len;
22712   PyObject *__pyx_r = NULL;
22713   __Pyx_TraceDeclarations
22714   __Pyx_RefNannyDeclarations
22715   PyObject *__pyx_t_1 = NULL;
22716   PyObject *__pyx_t_2 = NULL;
22717   PyObject *__pyx_t_3 = NULL;
22718   PyObject *__pyx_t_4 = NULL;
22719   Py_ssize_t __pyx_t_5;
22720   Py_ssize_t __pyx_t_6;
22721   int __pyx_t_7;
22722   int __pyx_t_8;
22723   PyObject *__pyx_t_9 = NULL;
22724   PyObject *(*__pyx_t_10)(PyObject *);
22725   Py_ssize_t __pyx_t_11;
22726   Py_ssize_t __pyx_t_12;
22727   Py_ssize_t __pyx_t_13;
22728   Py_ssize_t __pyx_t_14;
22729   __Pyx_RefNannySetupContext("build", 0);
22730   __Pyx_TraceCall("build", __pyx_f[0], 1350, 0, __PYX_ERR(0, 1350, __pyx_L1_error));
22731   /* Check if called by wrapper */
22732   if (unlikely(__pyx_skip_dispatch)) ;
22733   /* Check if overridden in Python */
22734   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
22735     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
22736     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
22737     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
22738       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
22739       #endif
22740       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error)
22741       __Pyx_GOTREF(__pyx_t_1);
22742       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_5build)) {
22743         __Pyx_XDECREF(__pyx_r);
22744         __Pyx_INCREF(__pyx_t_1);
22745         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
22746         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
22747           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
22748           if (likely(__pyx_t_4)) {
22749             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
22750             __Pyx_INCREF(__pyx_t_4);
22751             __Pyx_INCREF(function);
22752             __Pyx_DECREF_SET(__pyx_t_3, function);
22753           }
22754         }
22755         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
22756         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
22757         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1350, __pyx_L1_error)
22758         __Pyx_GOTREF(__pyx_t_2);
22759         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22760         __pyx_r = __pyx_t_2;
22761         __pyx_t_2 = 0;
22762         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22763         goto __pyx_L0;
22764       }
22765       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
22766       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
22767       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
22768       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
22769         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
22770       }
22771       #endif
22772       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22773       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
22774     }
22775     #endif
22776   }
22777 
22778   /* "MACS2/IO/ScoreTrack.pyx":1358
22779  *             bytes chrname
22780  *         # common chromosome names
22781  *         common_chrs = self.get_common_chrs()             # <<<<<<<<<<<<<<
22782  *         for chrname in common_chrs:
22783  *             (cond1_treat_ps, cond1_treat_vs) = self.t1bdg.get_data_by_chr(chrname)
22784  */
22785   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_common_chrs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1358, __pyx_L1_error)
22786   __Pyx_GOTREF(__pyx_t_2);
22787   __pyx_t_3 = NULL;
22788   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
22789     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
22790     if (likely(__pyx_t_3)) {
22791       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
22792       __Pyx_INCREF(__pyx_t_3);
22793       __Pyx_INCREF(function);
22794       __Pyx_DECREF_SET(__pyx_t_2, function);
22795     }
22796   }
22797   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
22798   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22799   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
22800   __Pyx_GOTREF(__pyx_t_1);
22801   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22802   if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1358, __pyx_L1_error)
22803   __pyx_v_common_chrs = ((PyObject*)__pyx_t_1);
22804   __pyx_t_1 = 0;
22805 
22806   /* "MACS2/IO/ScoreTrack.pyx":1359
22807  *         # common chromosome names
22808  *         common_chrs = self.get_common_chrs()
22809  *         for chrname in common_chrs:             # <<<<<<<<<<<<<<
22810  *             (cond1_treat_ps, cond1_treat_vs) = self.t1bdg.get_data_by_chr(chrname)
22811  *             (cond1_control_ps, cond1_control_vs) = self.c1bdg.get_data_by_chr(chrname)
22812  */
22813   __pyx_t_5 = 0;
22814   __pyx_t_2 = __Pyx_set_iterator(__pyx_v_common_chrs, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1359, __pyx_L1_error)
22815   __Pyx_GOTREF(__pyx_t_2);
22816   __Pyx_XDECREF(__pyx_t_1);
22817   __pyx_t_1 = __pyx_t_2;
22818   __pyx_t_2 = 0;
22819   while (1) {
22820     __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_2, __pyx_t_7);
22821     if (unlikely(__pyx_t_8 == 0)) break;
22822     if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1359, __pyx_L1_error)
22823     __Pyx_GOTREF(__pyx_t_2);
22824     if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1359, __pyx_L1_error)
22825     __Pyx_XDECREF_SET(__pyx_v_chrname, ((PyObject*)__pyx_t_2));
22826     __pyx_t_2 = 0;
22827 
22828     /* "MACS2/IO/ScoreTrack.pyx":1360
22829  *         common_chrs = self.get_common_chrs()
22830  *         for chrname in common_chrs:
22831  *             (cond1_treat_ps, cond1_treat_vs) = self.t1bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
22832  *             (cond1_control_ps, cond1_control_vs) = self.c1bdg.get_data_by_chr(chrname)
22833  *             (cond2_treat_ps, cond2_treat_vs) = self.t2bdg.get_data_by_chr(chrname)
22834  */
22835     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->t1bdg, __pyx_n_s_get_data_by_chr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1360, __pyx_L1_error)
22836     __Pyx_GOTREF(__pyx_t_3);
22837     __pyx_t_4 = NULL;
22838     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
22839       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
22840       if (likely(__pyx_t_4)) {
22841         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
22842         __Pyx_INCREF(__pyx_t_4);
22843         __Pyx_INCREF(function);
22844         __Pyx_DECREF_SET(__pyx_t_3, function);
22845       }
22846     }
22847     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_chrname) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_chrname);
22848     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
22849     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1360, __pyx_L1_error)
22850     __Pyx_GOTREF(__pyx_t_2);
22851     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22852     if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
22853       PyObject* sequence = __pyx_t_2;
22854       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
22855       if (unlikely(size != 2)) {
22856         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
22857         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
22858         __PYX_ERR(0, 1360, __pyx_L1_error)
22859       }
22860       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22861       if (likely(PyTuple_CheckExact(sequence))) {
22862         __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
22863         __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
22864       } else {
22865         __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
22866         __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
22867       }
22868       __Pyx_INCREF(__pyx_t_3);
22869       __Pyx_INCREF(__pyx_t_4);
22870       #else
22871       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1360, __pyx_L1_error)
22872       __Pyx_GOTREF(__pyx_t_3);
22873       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1360, __pyx_L1_error)
22874       __Pyx_GOTREF(__pyx_t_4);
22875       #endif
22876       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22877     } else {
22878       Py_ssize_t index = -1;
22879       __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1360, __pyx_L1_error)
22880       __Pyx_GOTREF(__pyx_t_9);
22881       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22882       __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
22883       index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
22884       __Pyx_GOTREF(__pyx_t_3);
22885       index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
22886       __Pyx_GOTREF(__pyx_t_4);
22887       if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1360, __pyx_L1_error)
22888       __pyx_t_10 = NULL;
22889       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22890       goto __pyx_L6_unpacking_done;
22891       __pyx_L5_unpacking_failed:;
22892       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22893       __pyx_t_10 = NULL;
22894       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
22895       __PYX_ERR(0, 1360, __pyx_L1_error)
22896       __pyx_L6_unpacking_done:;
22897     }
22898     __Pyx_XDECREF_SET(__pyx_v_cond1_treat_ps, __pyx_t_3);
22899     __pyx_t_3 = 0;
22900     __Pyx_XDECREF_SET(__pyx_v_cond1_treat_vs, __pyx_t_4);
22901     __pyx_t_4 = 0;
22902 
22903     /* "MACS2/IO/ScoreTrack.pyx":1361
22904  *         for chrname in common_chrs:
22905  *             (cond1_treat_ps, cond1_treat_vs) = self.t1bdg.get_data_by_chr(chrname)
22906  *             (cond1_control_ps, cond1_control_vs) = self.c1bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
22907  *             (cond2_treat_ps, cond2_treat_vs) = self.t2bdg.get_data_by_chr(chrname)
22908  *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)
22909  */
22910     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->c1bdg, __pyx_n_s_get_data_by_chr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1361, __pyx_L1_error)
22911     __Pyx_GOTREF(__pyx_t_4);
22912     __pyx_t_3 = NULL;
22913     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
22914       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
22915       if (likely(__pyx_t_3)) {
22916         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
22917         __Pyx_INCREF(__pyx_t_3);
22918         __Pyx_INCREF(function);
22919         __Pyx_DECREF_SET(__pyx_t_4, function);
22920       }
22921     }
22922     __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_chrname) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_chrname);
22923     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22924     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1361, __pyx_L1_error)
22925     __Pyx_GOTREF(__pyx_t_2);
22926     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22927     if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
22928       PyObject* sequence = __pyx_t_2;
22929       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
22930       if (unlikely(size != 2)) {
22931         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
22932         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
22933         __PYX_ERR(0, 1361, __pyx_L1_error)
22934       }
22935       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22936       if (likely(PyTuple_CheckExact(sequence))) {
22937         __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
22938         __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
22939       } else {
22940         __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
22941         __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
22942       }
22943       __Pyx_INCREF(__pyx_t_4);
22944       __Pyx_INCREF(__pyx_t_3);
22945       #else
22946       __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1361, __pyx_L1_error)
22947       __Pyx_GOTREF(__pyx_t_4);
22948       __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error)
22949       __Pyx_GOTREF(__pyx_t_3);
22950       #endif
22951       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22952     } else {
22953       Py_ssize_t index = -1;
22954       __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1361, __pyx_L1_error)
22955       __Pyx_GOTREF(__pyx_t_9);
22956       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22957       __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
22958       index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
22959       __Pyx_GOTREF(__pyx_t_4);
22960       index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
22961       __Pyx_GOTREF(__pyx_t_3);
22962       if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1361, __pyx_L1_error)
22963       __pyx_t_10 = NULL;
22964       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22965       goto __pyx_L8_unpacking_done;
22966       __pyx_L7_unpacking_failed:;
22967       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22968       __pyx_t_10 = NULL;
22969       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
22970       __PYX_ERR(0, 1361, __pyx_L1_error)
22971       __pyx_L8_unpacking_done:;
22972     }
22973     __Pyx_XDECREF_SET(__pyx_v_cond1_control_ps, __pyx_t_4);
22974     __pyx_t_4 = 0;
22975     __Pyx_XDECREF_SET(__pyx_v_cond1_control_vs, __pyx_t_3);
22976     __pyx_t_3 = 0;
22977 
22978     /* "MACS2/IO/ScoreTrack.pyx":1362
22979  *             (cond1_treat_ps, cond1_treat_vs) = self.t1bdg.get_data_by_chr(chrname)
22980  *             (cond1_control_ps, cond1_control_vs) = self.c1bdg.get_data_by_chr(chrname)
22981  *             (cond2_treat_ps, cond2_treat_vs) = self.t2bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
22982  *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)
22983  *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
22984  */
22985     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->t2bdg, __pyx_n_s_get_data_by_chr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L1_error)
22986     __Pyx_GOTREF(__pyx_t_3);
22987     __pyx_t_4 = NULL;
22988     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
22989       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
22990       if (likely(__pyx_t_4)) {
22991         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
22992         __Pyx_INCREF(__pyx_t_4);
22993         __Pyx_INCREF(function);
22994         __Pyx_DECREF_SET(__pyx_t_3, function);
22995       }
22996     }
22997     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_chrname) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_chrname);
22998     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
22999     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error)
23000     __Pyx_GOTREF(__pyx_t_2);
23001     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23002     if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
23003       PyObject* sequence = __pyx_t_2;
23004       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
23005       if (unlikely(size != 2)) {
23006         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
23007         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
23008         __PYX_ERR(0, 1362, __pyx_L1_error)
23009       }
23010       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23011       if (likely(PyTuple_CheckExact(sequence))) {
23012         __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
23013         __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
23014       } else {
23015         __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
23016         __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
23017       }
23018       __Pyx_INCREF(__pyx_t_3);
23019       __Pyx_INCREF(__pyx_t_4);
23020       #else
23021       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L1_error)
23022       __Pyx_GOTREF(__pyx_t_3);
23023       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1362, __pyx_L1_error)
23024       __Pyx_GOTREF(__pyx_t_4);
23025       #endif
23026       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23027     } else {
23028       Py_ssize_t index = -1;
23029       __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1362, __pyx_L1_error)
23030       __Pyx_GOTREF(__pyx_t_9);
23031       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23032       __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
23033       index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
23034       __Pyx_GOTREF(__pyx_t_3);
23035       index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
23036       __Pyx_GOTREF(__pyx_t_4);
23037       if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1362, __pyx_L1_error)
23038       __pyx_t_10 = NULL;
23039       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
23040       goto __pyx_L10_unpacking_done;
23041       __pyx_L9_unpacking_failed:;
23042       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
23043       __pyx_t_10 = NULL;
23044       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
23045       __PYX_ERR(0, 1362, __pyx_L1_error)
23046       __pyx_L10_unpacking_done:;
23047     }
23048     __Pyx_XDECREF_SET(__pyx_v_cond2_treat_ps, __pyx_t_3);
23049     __pyx_t_3 = 0;
23050     __Pyx_XDECREF_SET(__pyx_v_cond2_treat_vs, __pyx_t_4);
23051     __pyx_t_4 = 0;
23052 
23053     /* "MACS2/IO/ScoreTrack.pyx":1363
23054  *             (cond1_control_ps, cond1_control_vs) = self.c1bdg.get_data_by_chr(chrname)
23055  *             (cond2_treat_ps, cond2_treat_vs) = self.t2bdg.get_data_by_chr(chrname)
23056  *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)             # <<<<<<<<<<<<<<
23057  *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
23058  *                             len(cond2_treat_ps) + len(cond2_control_ps)
23059  */
23060     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->c2bdg, __pyx_n_s_get_data_by_chr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1363, __pyx_L1_error)
23061     __Pyx_GOTREF(__pyx_t_4);
23062     __pyx_t_3 = NULL;
23063     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
23064       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
23065       if (likely(__pyx_t_3)) {
23066         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
23067         __Pyx_INCREF(__pyx_t_3);
23068         __Pyx_INCREF(function);
23069         __Pyx_DECREF_SET(__pyx_t_4, function);
23070       }
23071     }
23072     __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_chrname) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_chrname);
23073     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23074     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __pyx_L1_error)
23075     __Pyx_GOTREF(__pyx_t_2);
23076     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23077     if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
23078       PyObject* sequence = __pyx_t_2;
23079       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
23080       if (unlikely(size != 2)) {
23081         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
23082         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
23083         __PYX_ERR(0, 1363, __pyx_L1_error)
23084       }
23085       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23086       if (likely(PyTuple_CheckExact(sequence))) {
23087         __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
23088         __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
23089       } else {
23090         __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
23091         __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
23092       }
23093       __Pyx_INCREF(__pyx_t_4);
23094       __Pyx_INCREF(__pyx_t_3);
23095       #else
23096       __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1363, __pyx_L1_error)
23097       __Pyx_GOTREF(__pyx_t_4);
23098       __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1363, __pyx_L1_error)
23099       __Pyx_GOTREF(__pyx_t_3);
23100       #endif
23101       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23102     } else {
23103       Py_ssize_t index = -1;
23104       __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1363, __pyx_L1_error)
23105       __Pyx_GOTREF(__pyx_t_9);
23106       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23107       __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
23108       index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
23109       __Pyx_GOTREF(__pyx_t_4);
23110       index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
23111       __Pyx_GOTREF(__pyx_t_3);
23112       if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1363, __pyx_L1_error)
23113       __pyx_t_10 = NULL;
23114       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
23115       goto __pyx_L12_unpacking_done;
23116       __pyx_L11_unpacking_failed:;
23117       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
23118       __pyx_t_10 = NULL;
23119       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
23120       __PYX_ERR(0, 1363, __pyx_L1_error)
23121       __pyx_L12_unpacking_done:;
23122     }
23123     __Pyx_XDECREF_SET(__pyx_v_cond2_control_ps, __pyx_t_4);
23124     __pyx_t_4 = 0;
23125     __Pyx_XDECREF_SET(__pyx_v_cond2_control_vs, __pyx_t_3);
23126     __pyx_t_3 = 0;
23127 
23128     /* "MACS2/IO/ScoreTrack.pyx":1364
23129  *             (cond2_treat_ps, cond2_treat_vs) = self.t2bdg.get_data_by_chr(chrname)
23130  *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)
23131  *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\             # <<<<<<<<<<<<<<
23132  *                             len(cond2_treat_ps) + len(cond2_control_ps)
23133  *             self.add_chromosome( chrname, chrom_max_len )
23134  */
23135     __pyx_t_11 = PyObject_Length(__pyx_v_cond1_treat_ps); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1364, __pyx_L1_error)
23136     __pyx_t_12 = PyObject_Length(__pyx_v_cond1_control_ps); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1364, __pyx_L1_error)
23137 
23138     /* "MACS2/IO/ScoreTrack.pyx":1365
23139  *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)
23140  *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
23141  *                             len(cond2_treat_ps) + len(cond2_control_ps)             # <<<<<<<<<<<<<<
23142  *             self.add_chromosome( chrname, chrom_max_len )
23143  *             self.build_chromosome( chrname,
23144  */
23145     __pyx_t_13 = PyObject_Length(__pyx_v_cond2_treat_ps); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1365, __pyx_L1_error)
23146 
23147     /* "MACS2/IO/ScoreTrack.pyx":1364
23148  *             (cond2_treat_ps, cond2_treat_vs) = self.t2bdg.get_data_by_chr(chrname)
23149  *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)
23150  *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\             # <<<<<<<<<<<<<<
23151  *                             len(cond2_treat_ps) + len(cond2_control_ps)
23152  *             self.add_chromosome( chrname, chrom_max_len )
23153  */
23154     __pyx_t_14 = PyObject_Length(__pyx_v_cond2_control_ps); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1365, __pyx_L1_error)
23155 
23156     /* "MACS2/IO/ScoreTrack.pyx":1365
23157  *             (cond2_control_ps, cond2_control_vs) = self.c2bdg.get_data_by_chr(chrname)
23158  *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
23159  *                             len(cond2_treat_ps) + len(cond2_control_ps)             # <<<<<<<<<<<<<<
23160  *             self.add_chromosome( chrname, chrom_max_len )
23161  *             self.build_chromosome( chrname,
23162  */
23163     __pyx_v_chrom_max_len = (((__pyx_t_11 + __pyx_t_12) + __pyx_t_13) + __pyx_t_14);
23164 
23165     /* "MACS2/IO/ScoreTrack.pyx":1366
23166  *             chrom_max_len = len(cond1_treat_ps) + len(cond1_control_ps) +\
23167  *                             len(cond2_treat_ps) + len(cond2_control_ps)
23168  *             self.add_chromosome( chrname, chrom_max_len )             # <<<<<<<<<<<<<<
23169  *             self.build_chromosome( chrname,
23170  *                                    cond1_treat_ps, cond1_control_ps,
23171  */
23172     __pyx_t_2 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->add_chromosome(__pyx_v_self, __pyx_v_chrname, __pyx_v_chrom_max_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error)
23173     __Pyx_GOTREF(__pyx_t_2);
23174     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23175 
23176     /* "MACS2/IO/ScoreTrack.pyx":1367
23177  *                             len(cond2_treat_ps) + len(cond2_control_ps)
23178  *             self.add_chromosome( chrname, chrom_max_len )
23179  *             self.build_chromosome( chrname,             # <<<<<<<<<<<<<<
23180  *                                    cond1_treat_ps, cond1_control_ps,
23181  *                                    cond2_treat_ps, cond2_control_ps,
23182  */
23183     __pyx_t_2 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->build_chromosome(__pyx_v_self, __pyx_v_chrname, __pyx_v_cond1_treat_ps, __pyx_v_cond1_control_ps, __pyx_v_cond2_treat_ps, __pyx_v_cond2_control_ps, __pyx_v_cond1_treat_vs, __pyx_v_cond1_control_vs, __pyx_v_cond2_treat_vs, __pyx_v_cond2_control_vs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1367, __pyx_L1_error)
23184     __Pyx_GOTREF(__pyx_t_2);
23185     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23186   }
23187   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23188 
23189   /* "MACS2/IO/ScoreTrack.pyx":1350
23190  *         self.pseudocount = pseudocount
23191  *
23192  *     cpdef build ( self ):             # <<<<<<<<<<<<<<
23193  *         """Compute scores from 3 types of comparisons and store them in self.data.
23194  *
23195  */
23196 
23197   /* function exit code */
23198   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23199   goto __pyx_L0;
23200   __pyx_L1_error:;
23201   __Pyx_XDECREF(__pyx_t_1);
23202   __Pyx_XDECREF(__pyx_t_2);
23203   __Pyx_XDECREF(__pyx_t_3);
23204   __Pyx_XDECREF(__pyx_t_4);
23205   __Pyx_XDECREF(__pyx_t_9);
23206   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.build", __pyx_clineno, __pyx_lineno, __pyx_filename);
23207   __pyx_r = 0;
23208   __pyx_L0:;
23209   __Pyx_XDECREF(__pyx_v_common_chrs);
23210   __Pyx_XDECREF(__pyx_v_chrname);
23211   __Pyx_XDECREF(__pyx_v_cond1_treat_ps);
23212   __Pyx_XDECREF(__pyx_v_cond1_treat_vs);
23213   __Pyx_XDECREF(__pyx_v_cond1_control_ps);
23214   __Pyx_XDECREF(__pyx_v_cond1_control_vs);
23215   __Pyx_XDECREF(__pyx_v_cond2_treat_ps);
23216   __Pyx_XDECREF(__pyx_v_cond2_treat_vs);
23217   __Pyx_XDECREF(__pyx_v_cond2_control_ps);
23218   __Pyx_XDECREF(__pyx_v_cond2_control_vs);
23219   __Pyx_XGIVEREF(__pyx_r);
23220   __Pyx_TraceReturn(__pyx_r, 0);
23221   __Pyx_RefNannyFinishContext();
23222   return __pyx_r;
23223 }
23224 
23225 /* Python wrapper */
23226 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_5build(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
23227 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_4build[] = "Compute scores from 3 types of comparisons and store them in self.data.\n\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_5build(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)23228 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_5build(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
23229   PyObject *__pyx_r = 0;
23230   __Pyx_RefNannyDeclarations
23231   __Pyx_RefNannySetupContext("build (wrapper)", 0);
23232   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_4build(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self));
23233 
23234   /* function exit code */
23235   __Pyx_RefNannyFinishContext();
23236   return __pyx_r;
23237 }
23238 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_4build(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self)23239 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_4build(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self) {
23240   PyObject *__pyx_r = NULL;
23241   __Pyx_TraceDeclarations
23242   __Pyx_RefNannyDeclarations
23243   PyObject *__pyx_t_1 = NULL;
23244   __Pyx_RefNannySetupContext("build", 0);
23245   __Pyx_TraceCall("build (wrapper)", __pyx_f[0], 1350, 0, __PYX_ERR(0, 1350, __pyx_L1_error));
23246   __Pyx_XDECREF(__pyx_r);
23247   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_build(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error)
23248   __Pyx_GOTREF(__pyx_t_1);
23249   __pyx_r = __pyx_t_1;
23250   __pyx_t_1 = 0;
23251   goto __pyx_L0;
23252 
23253   /* function exit code */
23254   __pyx_L1_error:;
23255   __Pyx_XDECREF(__pyx_t_1);
23256   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.build", __pyx_clineno, __pyx_lineno, __pyx_filename);
23257   __pyx_r = NULL;
23258   __pyx_L0:;
23259   __Pyx_XGIVEREF(__pyx_r);
23260   __Pyx_TraceReturn(__pyx_r, 0);
23261   __Pyx_RefNannyFinishContext();
23262   return __pyx_r;
23263 }
23264 
23265 /* "MACS2/IO/ScoreTrack.pyx":1374
23266  *
23267  *
23268  *     cdef build_chromosome( self, chrname,             # <<<<<<<<<<<<<<
23269  *                            cond1_treat_ps, cond1_control_ps,
23270  *                            cond2_treat_ps, cond2_control_ps,
23271  */
23272 
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_build_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_chrname,PyObject * __pyx_v_cond1_treat_ps,PyObject * __pyx_v_cond1_control_ps,PyObject * __pyx_v_cond2_treat_ps,PyObject * __pyx_v_cond2_control_ps,PyObject * __pyx_v_cond1_treat_vs,PyObject * __pyx_v_cond1_control_vs,PyObject * __pyx_v_cond2_treat_vs,PyObject * __pyx_v_cond2_control_vs)23273 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_build_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chrname, PyObject *__pyx_v_cond1_treat_ps, PyObject *__pyx_v_cond1_control_ps, PyObject *__pyx_v_cond2_treat_ps, PyObject *__pyx_v_cond2_control_ps, PyObject *__pyx_v_cond1_treat_vs, PyObject *__pyx_v_cond1_control_vs, PyObject *__pyx_v_cond2_treat_vs, PyObject *__pyx_v_cond2_control_vs) {
23274   PyObject *__pyx_v_c1tpn = NULL;
23275   PyObject *__pyx_v_c1cpn = NULL;
23276   PyObject *__pyx_v_c2tpn = NULL;
23277   PyObject *__pyx_v_c2cpn = NULL;
23278   PyObject *__pyx_v_c1tvn = NULL;
23279   PyObject *__pyx_v_c1cvn = NULL;
23280   PyObject *__pyx_v_c2tvn = NULL;
23281   PyObject *__pyx_v_c2cvn = NULL;
23282   PyObject *__pyx_v_pre_p = NULL;
23283   PyObject *__pyx_v_c1tp = NULL;
23284   PyObject *__pyx_v_c1tv = NULL;
23285   PyObject *__pyx_v_c1cp = NULL;
23286   PyObject *__pyx_v_c1cv = NULL;
23287   PyObject *__pyx_v_c2tp = NULL;
23288   PyObject *__pyx_v_c2tv = NULL;
23289   PyObject *__pyx_v_c2cp = NULL;
23290   PyObject *__pyx_v_c2cv = NULL;
23291   PyObject *__pyx_v_minp = NULL;
23292   PyObject *__pyx_r = NULL;
23293   __Pyx_TraceDeclarations
23294   __Pyx_RefNannyDeclarations
23295   PyObject *__pyx_t_1 = NULL;
23296   PyObject *__pyx_t_2 = NULL;
23297   PyObject *__pyx_t_3 = NULL;
23298   PyObject *__pyx_t_4 = NULL;
23299   PyObject *__pyx_t_5 = NULL;
23300   PyObject *__pyx_t_6 = NULL;
23301   PyObject *__pyx_t_7 = NULL;
23302   PyObject *__pyx_t_8 = NULL;
23303   PyObject *__pyx_t_9 = NULL;
23304   int __pyx_t_10;
23305   __pyx_t_5numpy_int32_t __pyx_t_11;
23306   __pyx_t_5numpy_float64_t __pyx_t_12;
23307   __pyx_t_5numpy_float64_t __pyx_t_13;
23308   __pyx_t_5numpy_float64_t __pyx_t_14;
23309   __pyx_t_5numpy_float64_t __pyx_t_15;
23310   int __pyx_t_16;
23311   __Pyx_RefNannySetupContext("build_chromosome", 0);
23312   __Pyx_TraceCall("build_chromosome", __pyx_f[0], 1374, 0, __PYX_ERR(0, 1374, __pyx_L1_error));
23313 
23314   /* "MACS2/IO/ScoreTrack.pyx":1388
23315  *         """
23316  *
23317  *         c1tpn = iter(cond1_treat_ps).__next__             # <<<<<<<<<<<<<<
23318  *         c1cpn = iter(cond1_control_ps).__next__
23319  *         c2tpn = iter(cond2_treat_ps).__next__
23320  */
23321   __pyx_t_1 = PyObject_GetIter(__pyx_v_cond1_treat_ps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
23322   __Pyx_GOTREF(__pyx_t_1);
23323   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1388, __pyx_L1_error)
23324   __Pyx_GOTREF(__pyx_t_2);
23325   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23326   __pyx_v_c1tpn = __pyx_t_2;
23327   __pyx_t_2 = 0;
23328 
23329   /* "MACS2/IO/ScoreTrack.pyx":1389
23330  *
23331  *         c1tpn = iter(cond1_treat_ps).__next__
23332  *         c1cpn = iter(cond1_control_ps).__next__             # <<<<<<<<<<<<<<
23333  *         c2tpn = iter(cond2_treat_ps).__next__
23334  *         c2cpn = iter(cond2_control_ps).__next__
23335  */
23336   __pyx_t_2 = PyObject_GetIter(__pyx_v_cond1_control_ps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1389, __pyx_L1_error)
23337   __Pyx_GOTREF(__pyx_t_2);
23338   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1389, __pyx_L1_error)
23339   __Pyx_GOTREF(__pyx_t_1);
23340   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23341   __pyx_v_c1cpn = __pyx_t_1;
23342   __pyx_t_1 = 0;
23343 
23344   /* "MACS2/IO/ScoreTrack.pyx":1390
23345  *         c1tpn = iter(cond1_treat_ps).__next__
23346  *         c1cpn = iter(cond1_control_ps).__next__
23347  *         c2tpn = iter(cond2_treat_ps).__next__             # <<<<<<<<<<<<<<
23348  *         c2cpn = iter(cond2_control_ps).__next__
23349  *         c1tvn = iter(cond1_treat_vs).__next__
23350  */
23351   __pyx_t_1 = PyObject_GetIter(__pyx_v_cond2_treat_ps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error)
23352   __Pyx_GOTREF(__pyx_t_1);
23353   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error)
23354   __Pyx_GOTREF(__pyx_t_2);
23355   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23356   __pyx_v_c2tpn = __pyx_t_2;
23357   __pyx_t_2 = 0;
23358 
23359   /* "MACS2/IO/ScoreTrack.pyx":1391
23360  *         c1cpn = iter(cond1_control_ps).__next__
23361  *         c2tpn = iter(cond2_treat_ps).__next__
23362  *         c2cpn = iter(cond2_control_ps).__next__             # <<<<<<<<<<<<<<
23363  *         c1tvn = iter(cond1_treat_vs).__next__
23364  *         c1cvn = iter(cond1_control_vs).__next__
23365  */
23366   __pyx_t_2 = PyObject_GetIter(__pyx_v_cond2_control_ps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1391, __pyx_L1_error)
23367   __Pyx_GOTREF(__pyx_t_2);
23368   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1391, __pyx_L1_error)
23369   __Pyx_GOTREF(__pyx_t_1);
23370   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23371   __pyx_v_c2cpn = __pyx_t_1;
23372   __pyx_t_1 = 0;
23373 
23374   /* "MACS2/IO/ScoreTrack.pyx":1392
23375  *         c2tpn = iter(cond2_treat_ps).__next__
23376  *         c2cpn = iter(cond2_control_ps).__next__
23377  *         c1tvn = iter(cond1_treat_vs).__next__             # <<<<<<<<<<<<<<
23378  *         c1cvn = iter(cond1_control_vs).__next__
23379  *         c2tvn = iter(cond2_treat_vs).__next__
23380  */
23381   __pyx_t_1 = PyObject_GetIter(__pyx_v_cond1_treat_vs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __pyx_L1_error)
23382   __Pyx_GOTREF(__pyx_t_1);
23383   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __pyx_L1_error)
23384   __Pyx_GOTREF(__pyx_t_2);
23385   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23386   __pyx_v_c1tvn = __pyx_t_2;
23387   __pyx_t_2 = 0;
23388 
23389   /* "MACS2/IO/ScoreTrack.pyx":1393
23390  *         c2cpn = iter(cond2_control_ps).__next__
23391  *         c1tvn = iter(cond1_treat_vs).__next__
23392  *         c1cvn = iter(cond1_control_vs).__next__             # <<<<<<<<<<<<<<
23393  *         c2tvn = iter(cond2_treat_vs).__next__
23394  *         c2cvn = iter(cond2_control_vs).__next__
23395  */
23396   __pyx_t_2 = PyObject_GetIter(__pyx_v_cond1_control_vs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1393, __pyx_L1_error)
23397   __Pyx_GOTREF(__pyx_t_2);
23398   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error)
23399   __Pyx_GOTREF(__pyx_t_1);
23400   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23401   __pyx_v_c1cvn = __pyx_t_1;
23402   __pyx_t_1 = 0;
23403 
23404   /* "MACS2/IO/ScoreTrack.pyx":1394
23405  *         c1tvn = iter(cond1_treat_vs).__next__
23406  *         c1cvn = iter(cond1_control_vs).__next__
23407  *         c2tvn = iter(cond2_treat_vs).__next__             # <<<<<<<<<<<<<<
23408  *         c2cvn = iter(cond2_control_vs).__next__
23409  *
23410  */
23411   __pyx_t_1 = PyObject_GetIter(__pyx_v_cond2_treat_vs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
23412   __Pyx_GOTREF(__pyx_t_1);
23413   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1394, __pyx_L1_error)
23414   __Pyx_GOTREF(__pyx_t_2);
23415   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23416   __pyx_v_c2tvn = __pyx_t_2;
23417   __pyx_t_2 = 0;
23418 
23419   /* "MACS2/IO/ScoreTrack.pyx":1395
23420  *         c1cvn = iter(cond1_control_vs).__next__
23421  *         c2tvn = iter(cond2_treat_vs).__next__
23422  *         c2cvn = iter(cond2_control_vs).__next__             # <<<<<<<<<<<<<<
23423  *
23424  *         pre_p = 0
23425  */
23426   __pyx_t_2 = PyObject_GetIter(__pyx_v_cond2_control_vs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1395, __pyx_L1_error)
23427   __Pyx_GOTREF(__pyx_t_2);
23428   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
23429   __Pyx_GOTREF(__pyx_t_1);
23430   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23431   __pyx_v_c2cvn = __pyx_t_1;
23432   __pyx_t_1 = 0;
23433 
23434   /* "MACS2/IO/ScoreTrack.pyx":1397
23435  *         c2cvn = iter(cond2_control_vs).__next__
23436  *
23437  *         pre_p = 0             # <<<<<<<<<<<<<<
23438  *
23439  *         try:
23440  */
23441   __Pyx_INCREF(__pyx_int_0);
23442   __pyx_v_pre_p = __pyx_int_0;
23443 
23444   /* "MACS2/IO/ScoreTrack.pyx":1399
23445  *         pre_p = 0
23446  *
23447  *         try:             # <<<<<<<<<<<<<<
23448  *             c1tp = c1tpn()
23449  *             c1tv = c1tvn()
23450  */
23451   {
23452     __Pyx_PyThreadState_declare
23453     __Pyx_PyThreadState_assign
23454     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
23455     __Pyx_XGOTREF(__pyx_t_3);
23456     __Pyx_XGOTREF(__pyx_t_4);
23457     __Pyx_XGOTREF(__pyx_t_5);
23458     /*try:*/ {
23459 
23460       /* "MACS2/IO/ScoreTrack.pyx":1400
23461  *
23462  *         try:
23463  *             c1tp = c1tpn()             # <<<<<<<<<<<<<<
23464  *             c1tv = c1tvn()
23465  *
23466  */
23467       __Pyx_INCREF(__pyx_v_c1tpn);
23468       __pyx_t_2 = __pyx_v_c1tpn; __pyx_t_6 = NULL;
23469       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
23470         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
23471         if (likely(__pyx_t_6)) {
23472           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
23473           __Pyx_INCREF(__pyx_t_6);
23474           __Pyx_INCREF(function);
23475           __Pyx_DECREF_SET(__pyx_t_2, function);
23476         }
23477       }
23478       __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
23479       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23480       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L3_error)
23481       __Pyx_GOTREF(__pyx_t_1);
23482       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23483       __pyx_v_c1tp = __pyx_t_1;
23484       __pyx_t_1 = 0;
23485 
23486       /* "MACS2/IO/ScoreTrack.pyx":1401
23487  *         try:
23488  *             c1tp = c1tpn()
23489  *             c1tv = c1tvn()             # <<<<<<<<<<<<<<
23490  *
23491  *             c1cp = c1cpn()
23492  */
23493       __Pyx_INCREF(__pyx_v_c1tvn);
23494       __pyx_t_2 = __pyx_v_c1tvn; __pyx_t_6 = NULL;
23495       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
23496         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
23497         if (likely(__pyx_t_6)) {
23498           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
23499           __Pyx_INCREF(__pyx_t_6);
23500           __Pyx_INCREF(function);
23501           __Pyx_DECREF_SET(__pyx_t_2, function);
23502         }
23503       }
23504       __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
23505       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23506       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L3_error)
23507       __Pyx_GOTREF(__pyx_t_1);
23508       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23509       __pyx_v_c1tv = __pyx_t_1;
23510       __pyx_t_1 = 0;
23511 
23512       /* "MACS2/IO/ScoreTrack.pyx":1403
23513  *             c1tv = c1tvn()
23514  *
23515  *             c1cp = c1cpn()             # <<<<<<<<<<<<<<
23516  *             c1cv = c1cvn()
23517  *
23518  */
23519       __Pyx_INCREF(__pyx_v_c1cpn);
23520       __pyx_t_2 = __pyx_v_c1cpn; __pyx_t_6 = NULL;
23521       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
23522         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
23523         if (likely(__pyx_t_6)) {
23524           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
23525           __Pyx_INCREF(__pyx_t_6);
23526           __Pyx_INCREF(function);
23527           __Pyx_DECREF_SET(__pyx_t_2, function);
23528         }
23529       }
23530       __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
23531       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23532       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L3_error)
23533       __Pyx_GOTREF(__pyx_t_1);
23534       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23535       __pyx_v_c1cp = __pyx_t_1;
23536       __pyx_t_1 = 0;
23537 
23538       /* "MACS2/IO/ScoreTrack.pyx":1404
23539  *
23540  *             c1cp = c1cpn()
23541  *             c1cv = c1cvn()             # <<<<<<<<<<<<<<
23542  *
23543  *             c2tp = c2tpn()
23544  */
23545       __Pyx_INCREF(__pyx_v_c1cvn);
23546       __pyx_t_2 = __pyx_v_c1cvn; __pyx_t_6 = NULL;
23547       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
23548         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
23549         if (likely(__pyx_t_6)) {
23550           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
23551           __Pyx_INCREF(__pyx_t_6);
23552           __Pyx_INCREF(function);
23553           __Pyx_DECREF_SET(__pyx_t_2, function);
23554         }
23555       }
23556       __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
23557       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23558       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L3_error)
23559       __Pyx_GOTREF(__pyx_t_1);
23560       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23561       __pyx_v_c1cv = __pyx_t_1;
23562       __pyx_t_1 = 0;
23563 
23564       /* "MACS2/IO/ScoreTrack.pyx":1406
23565  *             c1cv = c1cvn()
23566  *
23567  *             c2tp = c2tpn()             # <<<<<<<<<<<<<<
23568  *             c2tv = c2tvn()
23569  *
23570  */
23571       __Pyx_INCREF(__pyx_v_c2tpn);
23572       __pyx_t_2 = __pyx_v_c2tpn; __pyx_t_6 = NULL;
23573       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
23574         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
23575         if (likely(__pyx_t_6)) {
23576           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
23577           __Pyx_INCREF(__pyx_t_6);
23578           __Pyx_INCREF(function);
23579           __Pyx_DECREF_SET(__pyx_t_2, function);
23580         }
23581       }
23582       __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
23583       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23584       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L3_error)
23585       __Pyx_GOTREF(__pyx_t_1);
23586       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23587       __pyx_v_c2tp = __pyx_t_1;
23588       __pyx_t_1 = 0;
23589 
23590       /* "MACS2/IO/ScoreTrack.pyx":1407
23591  *
23592  *             c2tp = c2tpn()
23593  *             c2tv = c2tvn()             # <<<<<<<<<<<<<<
23594  *
23595  *             c2cp = c2cpn()
23596  */
23597       __Pyx_INCREF(__pyx_v_c2tvn);
23598       __pyx_t_2 = __pyx_v_c2tvn; __pyx_t_6 = NULL;
23599       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
23600         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
23601         if (likely(__pyx_t_6)) {
23602           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
23603           __Pyx_INCREF(__pyx_t_6);
23604           __Pyx_INCREF(function);
23605           __Pyx_DECREF_SET(__pyx_t_2, function);
23606         }
23607       }
23608       __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
23609       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23610       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L3_error)
23611       __Pyx_GOTREF(__pyx_t_1);
23612       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23613       __pyx_v_c2tv = __pyx_t_1;
23614       __pyx_t_1 = 0;
23615 
23616       /* "MACS2/IO/ScoreTrack.pyx":1409
23617  *             c2tv = c2tvn()
23618  *
23619  *             c2cp = c2cpn()             # <<<<<<<<<<<<<<
23620  *             c2cv = c2cvn()
23621  *
23622  */
23623       __Pyx_INCREF(__pyx_v_c2cpn);
23624       __pyx_t_2 = __pyx_v_c2cpn; __pyx_t_6 = NULL;
23625       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
23626         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
23627         if (likely(__pyx_t_6)) {
23628           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
23629           __Pyx_INCREF(__pyx_t_6);
23630           __Pyx_INCREF(function);
23631           __Pyx_DECREF_SET(__pyx_t_2, function);
23632         }
23633       }
23634       __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
23635       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23636       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __pyx_L3_error)
23637       __Pyx_GOTREF(__pyx_t_1);
23638       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23639       __pyx_v_c2cp = __pyx_t_1;
23640       __pyx_t_1 = 0;
23641 
23642       /* "MACS2/IO/ScoreTrack.pyx":1410
23643  *
23644  *             c2cp = c2cpn()
23645  *             c2cv = c2cvn()             # <<<<<<<<<<<<<<
23646  *
23647  *             while True:
23648  */
23649       __Pyx_INCREF(__pyx_v_c2cvn);
23650       __pyx_t_2 = __pyx_v_c2cvn; __pyx_t_6 = NULL;
23651       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
23652         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
23653         if (likely(__pyx_t_6)) {
23654           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
23655           __Pyx_INCREF(__pyx_t_6);
23656           __Pyx_INCREF(function);
23657           __Pyx_DECREF_SET(__pyx_t_2, function);
23658         }
23659       }
23660       __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
23661       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23662       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L3_error)
23663       __Pyx_GOTREF(__pyx_t_1);
23664       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23665       __pyx_v_c2cv = __pyx_t_1;
23666       __pyx_t_1 = 0;
23667 
23668       /* "MACS2/IO/ScoreTrack.pyx":1412
23669  *             c2cv = c2cvn()
23670  *
23671  *             while True:             # <<<<<<<<<<<<<<
23672  *                 minp = min(c1tp, c1cp, c2tp, c2cp)
23673  *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
23674  */
23675       while (1) {
23676 
23677         /* "MACS2/IO/ScoreTrack.pyx":1413
23678  *
23679  *             while True:
23680  *                 minp = min(c1tp, c1cp, c2tp, c2cp)             # <<<<<<<<<<<<<<
23681  *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
23682  *                 pre_p = minp
23683  */
23684         __Pyx_INCREF(__pyx_v_c1cp);
23685         __pyx_t_1 = __pyx_v_c1cp;
23686         __Pyx_INCREF(__pyx_v_c2tp);
23687         __pyx_t_2 = __pyx_v_c2tp;
23688         __Pyx_INCREF(__pyx_v_c2cp);
23689         __pyx_t_6 = __pyx_v_c2cp;
23690         __Pyx_INCREF(__pyx_v_c1tp);
23691         __pyx_t_7 = __pyx_v_c1tp;
23692         __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1413, __pyx_L3_error)
23693         __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1413, __pyx_L3_error)
23694         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
23695         if (__pyx_t_10) {
23696           __Pyx_INCREF(__pyx_t_1);
23697           __pyx_t_8 = __pyx_t_1;
23698         } else {
23699           __Pyx_INCREF(__pyx_t_7);
23700           __pyx_t_8 = __pyx_t_7;
23701         }
23702         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23703         __Pyx_INCREF(__pyx_t_8);
23704         __pyx_t_7 = __pyx_t_8;
23705         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23706         __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1413, __pyx_L3_error)
23707         __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1413, __pyx_L3_error)
23708         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
23709         if (__pyx_t_10) {
23710           __Pyx_INCREF(__pyx_t_2);
23711           __pyx_t_8 = __pyx_t_2;
23712         } else {
23713           __Pyx_INCREF(__pyx_t_7);
23714           __pyx_t_8 = __pyx_t_7;
23715         }
23716         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23717         __Pyx_INCREF(__pyx_t_8);
23718         __pyx_t_7 = __pyx_t_8;
23719         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23720         __pyx_t_9 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1413, __pyx_L3_error)
23721         __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1413, __pyx_L3_error)
23722         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
23723         if (__pyx_t_10) {
23724           __Pyx_INCREF(__pyx_t_6);
23725           __pyx_t_8 = __pyx_t_6;
23726         } else {
23727           __Pyx_INCREF(__pyx_t_7);
23728           __pyx_t_8 = __pyx_t_7;
23729         }
23730         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23731         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23732         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23733         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23734         __pyx_t_1 = __pyx_t_8;
23735         __Pyx_INCREF(__pyx_t_1);
23736         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23737         __Pyx_XDECREF_SET(__pyx_v_minp, __pyx_t_1);
23738         __pyx_t_1 = 0;
23739 
23740         /* "MACS2/IO/ScoreTrack.pyx":1414
23741  *             while True:
23742  *                 minp = min(c1tp, c1cp, c2tp, c2cp)
23743  *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )             # <<<<<<<<<<<<<<
23744  *                 pre_p = minp
23745  *                 if c1tp == minp:
23746  */
23747         if (!(likely(PyBytes_CheckExact(__pyx_v_chrname))||((__pyx_v_chrname) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_chrname)->tp_name), 0))) __PYX_ERR(0, 1414, __pyx_L3_error)
23748         __pyx_t_11 = __Pyx_PyInt_As_npy_int32(__pyx_v_pre_p); if (unlikely((__pyx_t_11 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1414, __pyx_L3_error)
23749         __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_c1tv); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1414, __pyx_L3_error)
23750         __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_c1cv); if (unlikely((__pyx_t_13 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1414, __pyx_L3_error)
23751         __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_c2tv); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1414, __pyx_L3_error)
23752         __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_c2cv); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1414, __pyx_L3_error)
23753         __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->add(__pyx_v_self, ((PyObject*)__pyx_v_chrname), __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1414, __pyx_L3_error)
23754         __Pyx_GOTREF(__pyx_t_1);
23755         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23756 
23757         /* "MACS2/IO/ScoreTrack.pyx":1415
23758  *                 minp = min(c1tp, c1cp, c2tp, c2cp)
23759  *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
23760  *                 pre_p = minp             # <<<<<<<<<<<<<<
23761  *                 if c1tp == minp:
23762  *                     c1tp = c1tpn()
23763  */
23764         __Pyx_INCREF(__pyx_v_minp);
23765         __Pyx_DECREF_SET(__pyx_v_pre_p, __pyx_v_minp);
23766 
23767         /* "MACS2/IO/ScoreTrack.pyx":1416
23768  *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
23769  *                 pre_p = minp
23770  *                 if c1tp == minp:             # <<<<<<<<<<<<<<
23771  *                     c1tp = c1tpn()
23772  *                     c1tv = c1tvn()
23773  */
23774         __pyx_t_1 = PyObject_RichCompare(__pyx_v_c1tp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1416, __pyx_L3_error)
23775         __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1416, __pyx_L3_error)
23776         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23777         if (__pyx_t_10) {
23778 
23779           /* "MACS2/IO/ScoreTrack.pyx":1417
23780  *                 pre_p = minp
23781  *                 if c1tp == minp:
23782  *                     c1tp = c1tpn()             # <<<<<<<<<<<<<<
23783  *                     c1tv = c1tvn()
23784  *                 if c1cp == minp:
23785  */
23786           __Pyx_INCREF(__pyx_v_c1tpn);
23787           __pyx_t_8 = __pyx_v_c1tpn; __pyx_t_2 = NULL;
23788           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
23789             __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
23790             if (likely(__pyx_t_2)) {
23791               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
23792               __Pyx_INCREF(__pyx_t_2);
23793               __Pyx_INCREF(function);
23794               __Pyx_DECREF_SET(__pyx_t_8, function);
23795             }
23796           }
23797           __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
23798           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23799           if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1417, __pyx_L3_error)
23800           __Pyx_GOTREF(__pyx_t_1);
23801           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23802           __Pyx_DECREF_SET(__pyx_v_c1tp, __pyx_t_1);
23803           __pyx_t_1 = 0;
23804 
23805           /* "MACS2/IO/ScoreTrack.pyx":1418
23806  *                 if c1tp == minp:
23807  *                     c1tp = c1tpn()
23808  *                     c1tv = c1tvn()             # <<<<<<<<<<<<<<
23809  *                 if c1cp == minp:
23810  *                     c1cp = c1cpn()
23811  */
23812           __Pyx_INCREF(__pyx_v_c1tvn);
23813           __pyx_t_8 = __pyx_v_c1tvn; __pyx_t_2 = NULL;
23814           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
23815             __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
23816             if (likely(__pyx_t_2)) {
23817               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
23818               __Pyx_INCREF(__pyx_t_2);
23819               __Pyx_INCREF(function);
23820               __Pyx_DECREF_SET(__pyx_t_8, function);
23821             }
23822           }
23823           __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
23824           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23825           if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __pyx_L3_error)
23826           __Pyx_GOTREF(__pyx_t_1);
23827           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23828           __Pyx_DECREF_SET(__pyx_v_c1tv, __pyx_t_1);
23829           __pyx_t_1 = 0;
23830 
23831           /* "MACS2/IO/ScoreTrack.pyx":1416
23832  *                 self.add( chrname, pre_p, c1tv, c1cv, c2tv, c2cv )
23833  *                 pre_p = minp
23834  *                 if c1tp == minp:             # <<<<<<<<<<<<<<
23835  *                     c1tp = c1tpn()
23836  *                     c1tv = c1tvn()
23837  */
23838         }
23839 
23840         /* "MACS2/IO/ScoreTrack.pyx":1419
23841  *                     c1tp = c1tpn()
23842  *                     c1tv = c1tvn()
23843  *                 if c1cp == minp:             # <<<<<<<<<<<<<<
23844  *                     c1cp = c1cpn()
23845  *                     c1cv = c1cvn()
23846  */
23847         __pyx_t_1 = PyObject_RichCompare(__pyx_v_c1cp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L3_error)
23848         __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1419, __pyx_L3_error)
23849         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23850         if (__pyx_t_10) {
23851 
23852           /* "MACS2/IO/ScoreTrack.pyx":1420
23853  *                     c1tv = c1tvn()
23854  *                 if c1cp == minp:
23855  *                     c1cp = c1cpn()             # <<<<<<<<<<<<<<
23856  *                     c1cv = c1cvn()
23857  *                 if c2tp == minp:
23858  */
23859           __Pyx_INCREF(__pyx_v_c1cpn);
23860           __pyx_t_8 = __pyx_v_c1cpn; __pyx_t_2 = NULL;
23861           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
23862             __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
23863             if (likely(__pyx_t_2)) {
23864               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
23865               __Pyx_INCREF(__pyx_t_2);
23866               __Pyx_INCREF(function);
23867               __Pyx_DECREF_SET(__pyx_t_8, function);
23868             }
23869           }
23870           __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
23871           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23872           if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L3_error)
23873           __Pyx_GOTREF(__pyx_t_1);
23874           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23875           __Pyx_DECREF_SET(__pyx_v_c1cp, __pyx_t_1);
23876           __pyx_t_1 = 0;
23877 
23878           /* "MACS2/IO/ScoreTrack.pyx":1421
23879  *                 if c1cp == minp:
23880  *                     c1cp = c1cpn()
23881  *                     c1cv = c1cvn()             # <<<<<<<<<<<<<<
23882  *                 if c2tp == minp:
23883  *                     c2tp = c2tpn()
23884  */
23885           __Pyx_INCREF(__pyx_v_c1cvn);
23886           __pyx_t_8 = __pyx_v_c1cvn; __pyx_t_2 = NULL;
23887           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
23888             __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
23889             if (likely(__pyx_t_2)) {
23890               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
23891               __Pyx_INCREF(__pyx_t_2);
23892               __Pyx_INCREF(function);
23893               __Pyx_DECREF_SET(__pyx_t_8, function);
23894             }
23895           }
23896           __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
23897           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23898           if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L3_error)
23899           __Pyx_GOTREF(__pyx_t_1);
23900           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23901           __Pyx_DECREF_SET(__pyx_v_c1cv, __pyx_t_1);
23902           __pyx_t_1 = 0;
23903 
23904           /* "MACS2/IO/ScoreTrack.pyx":1419
23905  *                     c1tp = c1tpn()
23906  *                     c1tv = c1tvn()
23907  *                 if c1cp == minp:             # <<<<<<<<<<<<<<
23908  *                     c1cp = c1cpn()
23909  *                     c1cv = c1cvn()
23910  */
23911         }
23912 
23913         /* "MACS2/IO/ScoreTrack.pyx":1422
23914  *                     c1cp = c1cpn()
23915  *                     c1cv = c1cvn()
23916  *                 if c2tp == minp:             # <<<<<<<<<<<<<<
23917  *                     c2tp = c2tpn()
23918  *                     c2tv = c2tvn()
23919  */
23920         __pyx_t_1 = PyObject_RichCompare(__pyx_v_c2tp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L3_error)
23921         __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1422, __pyx_L3_error)
23922         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23923         if (__pyx_t_10) {
23924 
23925           /* "MACS2/IO/ScoreTrack.pyx":1423
23926  *                     c1cv = c1cvn()
23927  *                 if c2tp == minp:
23928  *                     c2tp = c2tpn()             # <<<<<<<<<<<<<<
23929  *                     c2tv = c2tvn()
23930  *                 if c2cp == minp:
23931  */
23932           __Pyx_INCREF(__pyx_v_c2tpn);
23933           __pyx_t_8 = __pyx_v_c2tpn; __pyx_t_2 = NULL;
23934           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
23935             __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
23936             if (likely(__pyx_t_2)) {
23937               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
23938               __Pyx_INCREF(__pyx_t_2);
23939               __Pyx_INCREF(function);
23940               __Pyx_DECREF_SET(__pyx_t_8, function);
23941             }
23942           }
23943           __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
23944           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23945           if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L3_error)
23946           __Pyx_GOTREF(__pyx_t_1);
23947           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23948           __Pyx_DECREF_SET(__pyx_v_c2tp, __pyx_t_1);
23949           __pyx_t_1 = 0;
23950 
23951           /* "MACS2/IO/ScoreTrack.pyx":1424
23952  *                 if c2tp == minp:
23953  *                     c2tp = c2tpn()
23954  *                     c2tv = c2tvn()             # <<<<<<<<<<<<<<
23955  *                 if c2cp == minp:
23956  *                     c2cp = c2cpn()
23957  */
23958           __Pyx_INCREF(__pyx_v_c2tvn);
23959           __pyx_t_8 = __pyx_v_c2tvn; __pyx_t_2 = NULL;
23960           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
23961             __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
23962             if (likely(__pyx_t_2)) {
23963               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
23964               __Pyx_INCREF(__pyx_t_2);
23965               __Pyx_INCREF(function);
23966               __Pyx_DECREF_SET(__pyx_t_8, function);
23967             }
23968           }
23969           __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
23970           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23971           if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L3_error)
23972           __Pyx_GOTREF(__pyx_t_1);
23973           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23974           __Pyx_DECREF_SET(__pyx_v_c2tv, __pyx_t_1);
23975           __pyx_t_1 = 0;
23976 
23977           /* "MACS2/IO/ScoreTrack.pyx":1422
23978  *                     c1cp = c1cpn()
23979  *                     c1cv = c1cvn()
23980  *                 if c2tp == minp:             # <<<<<<<<<<<<<<
23981  *                     c2tp = c2tpn()
23982  *                     c2tv = c2tvn()
23983  */
23984         }
23985 
23986         /* "MACS2/IO/ScoreTrack.pyx":1425
23987  *                     c2tp = c2tpn()
23988  *                     c2tv = c2tvn()
23989  *                 if c2cp == minp:             # <<<<<<<<<<<<<<
23990  *                     c2cp = c2cpn()
23991  *                     c2cv = c2cvn()
23992  */
23993         __pyx_t_1 = PyObject_RichCompare(__pyx_v_c2cp, __pyx_v_minp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L3_error)
23994         __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1425, __pyx_L3_error)
23995         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23996         if (__pyx_t_10) {
23997 
23998           /* "MACS2/IO/ScoreTrack.pyx":1426
23999  *                     c2tv = c2tvn()
24000  *                 if c2cp == minp:
24001  *                     c2cp = c2cpn()             # <<<<<<<<<<<<<<
24002  *                     c2cv = c2cvn()
24003  *         except StopIteration:
24004  */
24005           __Pyx_INCREF(__pyx_v_c2cpn);
24006           __pyx_t_8 = __pyx_v_c2cpn; __pyx_t_2 = NULL;
24007           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
24008             __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
24009             if (likely(__pyx_t_2)) {
24010               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
24011               __Pyx_INCREF(__pyx_t_2);
24012               __Pyx_INCREF(function);
24013               __Pyx_DECREF_SET(__pyx_t_8, function);
24014             }
24015           }
24016           __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
24017           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24018           if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L3_error)
24019           __Pyx_GOTREF(__pyx_t_1);
24020           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24021           __Pyx_DECREF_SET(__pyx_v_c2cp, __pyx_t_1);
24022           __pyx_t_1 = 0;
24023 
24024           /* "MACS2/IO/ScoreTrack.pyx":1427
24025  *                 if c2cp == minp:
24026  *                     c2cp = c2cpn()
24027  *                     c2cv = c2cvn()             # <<<<<<<<<<<<<<
24028  *         except StopIteration:
24029  *             # meet the end of either bedGraphTrackI, simply exit
24030  */
24031           __Pyx_INCREF(__pyx_v_c2cvn);
24032           __pyx_t_8 = __pyx_v_c2cvn; __pyx_t_2 = NULL;
24033           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
24034             __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
24035             if (likely(__pyx_t_2)) {
24036               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
24037               __Pyx_INCREF(__pyx_t_2);
24038               __Pyx_INCREF(function);
24039               __Pyx_DECREF_SET(__pyx_t_8, function);
24040             }
24041           }
24042           __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
24043           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24044           if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L3_error)
24045           __Pyx_GOTREF(__pyx_t_1);
24046           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24047           __Pyx_DECREF_SET(__pyx_v_c2cv, __pyx_t_1);
24048           __pyx_t_1 = 0;
24049 
24050           /* "MACS2/IO/ScoreTrack.pyx":1425
24051  *                     c2tp = c2tpn()
24052  *                     c2tv = c2tvn()
24053  *                 if c2cp == minp:             # <<<<<<<<<<<<<<
24054  *                     c2cp = c2cpn()
24055  *                     c2cv = c2cvn()
24056  */
24057         }
24058       }
24059 
24060       /* "MACS2/IO/ScoreTrack.pyx":1399
24061  *         pre_p = 0
24062  *
24063  *         try:             # <<<<<<<<<<<<<<
24064  *             c1tp = c1tpn()
24065  *             c1tv = c1tvn()
24066  */
24067     }
24068     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24069     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24070     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24071     goto __pyx_L8_try_end;
24072     __pyx_L3_error:;
24073     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24074     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24075     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
24076     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
24077     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
24078     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
24079 
24080     /* "MACS2/IO/ScoreTrack.pyx":1428
24081  *                     c2cp = c2cpn()
24082  *                     c2cv = c2cvn()
24083  *         except StopIteration:             # <<<<<<<<<<<<<<
24084  *             # meet the end of either bedGraphTrackI, simply exit
24085  *             pass
24086  */
24087     __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
24088     if (__pyx_t_16) {
24089       __Pyx_ErrRestore(0,0,0);
24090       goto __pyx_L4_exception_handled;
24091     }
24092     goto __pyx_L5_except_error;
24093     __pyx_L5_except_error:;
24094 
24095     /* "MACS2/IO/ScoreTrack.pyx":1399
24096  *         pre_p = 0
24097  *
24098  *         try:             # <<<<<<<<<<<<<<
24099  *             c1tp = c1tpn()
24100  *             c1tv = c1tvn()
24101  */
24102     __Pyx_XGIVEREF(__pyx_t_3);
24103     __Pyx_XGIVEREF(__pyx_t_4);
24104     __Pyx_XGIVEREF(__pyx_t_5);
24105     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
24106     goto __pyx_L1_error;
24107     __pyx_L4_exception_handled:;
24108     __Pyx_XGIVEREF(__pyx_t_3);
24109     __Pyx_XGIVEREF(__pyx_t_4);
24110     __Pyx_XGIVEREF(__pyx_t_5);
24111     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
24112     __pyx_L8_try_end:;
24113   }
24114 
24115   /* "MACS2/IO/ScoreTrack.pyx":1374
24116  *
24117  *
24118  *     cdef build_chromosome( self, chrname,             # <<<<<<<<<<<<<<
24119  *                            cond1_treat_ps, cond1_control_ps,
24120  *                            cond2_treat_ps, cond2_control_ps,
24121  */
24122 
24123   /* function exit code */
24124   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24125   goto __pyx_L0;
24126   __pyx_L1_error:;
24127   __Pyx_XDECREF(__pyx_t_1);
24128   __Pyx_XDECREF(__pyx_t_2);
24129   __Pyx_XDECREF(__pyx_t_6);
24130   __Pyx_XDECREF(__pyx_t_7);
24131   __Pyx_XDECREF(__pyx_t_8);
24132   __Pyx_XDECREF(__pyx_t_9);
24133   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.build_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
24134   __pyx_r = 0;
24135   __pyx_L0:;
24136   __Pyx_XDECREF(__pyx_v_c1tpn);
24137   __Pyx_XDECREF(__pyx_v_c1cpn);
24138   __Pyx_XDECREF(__pyx_v_c2tpn);
24139   __Pyx_XDECREF(__pyx_v_c2cpn);
24140   __Pyx_XDECREF(__pyx_v_c1tvn);
24141   __Pyx_XDECREF(__pyx_v_c1cvn);
24142   __Pyx_XDECREF(__pyx_v_c2tvn);
24143   __Pyx_XDECREF(__pyx_v_c2cvn);
24144   __Pyx_XDECREF(__pyx_v_pre_p);
24145   __Pyx_XDECREF(__pyx_v_c1tp);
24146   __Pyx_XDECREF(__pyx_v_c1tv);
24147   __Pyx_XDECREF(__pyx_v_c1cp);
24148   __Pyx_XDECREF(__pyx_v_c1cv);
24149   __Pyx_XDECREF(__pyx_v_c2tp);
24150   __Pyx_XDECREF(__pyx_v_c2tv);
24151   __Pyx_XDECREF(__pyx_v_c2cp);
24152   __Pyx_XDECREF(__pyx_v_c2cv);
24153   __Pyx_XDECREF(__pyx_v_minp);
24154   __Pyx_XGIVEREF(__pyx_r);
24155   __Pyx_TraceReturn(__pyx_r, 0);
24156   __Pyx_RefNannyFinishContext();
24157   return __pyx_r;
24158 }
24159 
24160 /* "MACS2/IO/ScoreTrack.pyx":1432
24161  *             pass
24162  *
24163  *     def get_common_chrs ( self ):             # <<<<<<<<<<<<<<
24164  *         t1chrs = self.t1bdg.get_chr_names()
24165  *         c1chrs = self.c1bdg.get_chr_names()
24166  */
24167 
24168 /* Python wrapper */
24169 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_7get_common_chrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_7get_common_chrs(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)24170 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_7get_common_chrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
24171   PyObject *__pyx_r = 0;
24172   __Pyx_RefNannyDeclarations
24173   __Pyx_RefNannySetupContext("get_common_chrs (wrapper)", 0);
24174   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_6get_common_chrs(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self));
24175 
24176   /* function exit code */
24177   __Pyx_RefNannyFinishContext();
24178   return __pyx_r;
24179 }
24180 
24181 /* "MACS2/IO/ScoreTrack.pyx":1437
24182  *         t2chrs = self.t2bdg.get_chr_names()
24183  *         c2chrs = self.c2bdg.get_chr_names()
24184  *         common = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))             # <<<<<<<<<<<<<<
24185  *         return common
24186  *
24187  */
24188 
24189 /* Python wrapper */
24190 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15get_common_chrs_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
24191 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15get_common_chrs_lambda = {"lambda", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15get_common_chrs_lambda, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15get_common_chrs_lambda(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)24192 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15get_common_chrs_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
24193   PyObject *__pyx_v_x = 0;
24194   PyObject *__pyx_v_y = 0;
24195   PyObject *__pyx_r = 0;
24196   __Pyx_RefNannyDeclarations
24197   __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
24198   {
24199     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
24200     PyObject* values[2] = {0,0};
24201     if (unlikely(__pyx_kwds)) {
24202       Py_ssize_t kw_args;
24203       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
24204       switch (pos_args) {
24205         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24206         CYTHON_FALLTHROUGH;
24207         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24208         CYTHON_FALLTHROUGH;
24209         case  0: break;
24210         default: goto __pyx_L5_argtuple_error;
24211       }
24212       kw_args = PyDict_Size(__pyx_kwds);
24213       switch (pos_args) {
24214         case  0:
24215         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
24216         else goto __pyx_L5_argtuple_error;
24217         CYTHON_FALLTHROUGH;
24218         case  1:
24219         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
24220         else {
24221           __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, 1); __PYX_ERR(0, 1437, __pyx_L3_error)
24222         }
24223       }
24224       if (unlikely(kw_args > 0)) {
24225         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(0, 1437, __pyx_L3_error)
24226       }
24227     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
24228       goto __pyx_L5_argtuple_error;
24229     } else {
24230       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24231       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24232     }
24233     __pyx_v_x = values[0];
24234     __pyx_v_y = values[1];
24235   }
24236   goto __pyx_L4_argument_unpacking_done;
24237   __pyx_L5_argtuple_error:;
24238   __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1437, __pyx_L3_error)
24239   __pyx_L3_error:;
24240   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.get_common_chrs.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
24241   __Pyx_RefNannyFinishContext();
24242   return NULL;
24243   __pyx_L4_argument_unpacking_done:;
24244   __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_y);
24245 
24246   /* function exit code */
24247   __Pyx_RefNannyFinishContext();
24248   return __pyx_r;
24249 }
24250 
__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_x,PyObject * __pyx_v_y)24251 static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
24252   PyObject *__pyx_r = NULL;
24253   __Pyx_TraceDeclarations
24254   __Pyx_RefNannyDeclarations
24255   PyObject *__pyx_t_1 = NULL;
24256   PyObject *__pyx_t_2 = NULL;
24257   PyObject *__pyx_t_3 = NULL;
24258   __Pyx_RefNannySetupContext("lambda", 0);
24259   __Pyx_TraceCall("lambda", __pyx_f[0], 1437, 0, __PYX_ERR(0, 1437, __pyx_L1_error));
24260   __Pyx_XDECREF(__pyx_r);
24261   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_intersection); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error)
24262   __Pyx_GOTREF(__pyx_t_2);
24263   __pyx_t_3 = NULL;
24264   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
24265     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
24266     if (likely(__pyx_t_3)) {
24267       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24268       __Pyx_INCREF(__pyx_t_3);
24269       __Pyx_INCREF(function);
24270       __Pyx_DECREF_SET(__pyx_t_2, function);
24271     }
24272   }
24273   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_y) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_y);
24274   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24275   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1437, __pyx_L1_error)
24276   __Pyx_GOTREF(__pyx_t_1);
24277   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24278   __pyx_r = __pyx_t_1;
24279   __pyx_t_1 = 0;
24280   goto __pyx_L0;
24281 
24282   /* function exit code */
24283   __pyx_L1_error:;
24284   __Pyx_XDECREF(__pyx_t_1);
24285   __Pyx_XDECREF(__pyx_t_2);
24286   __Pyx_XDECREF(__pyx_t_3);
24287   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.get_common_chrs.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
24288   __pyx_r = NULL;
24289   __pyx_L0:;
24290   __Pyx_XGIVEREF(__pyx_r);
24291   __Pyx_TraceReturn(__pyx_r, 0);
24292   __Pyx_RefNannyFinishContext();
24293   return __pyx_r;
24294 }
24295 
24296 /* "MACS2/IO/ScoreTrack.pyx":1432
24297  *             pass
24298  *
24299  *     def get_common_chrs ( self ):             # <<<<<<<<<<<<<<
24300  *         t1chrs = self.t1bdg.get_chr_names()
24301  *         c1chrs = self.c1bdg.get_chr_names()
24302  */
24303 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_6get_common_chrs(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self)24304 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_6get_common_chrs(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self) {
24305   PyObject *__pyx_v_t1chrs = NULL;
24306   PyObject *__pyx_v_c1chrs = NULL;
24307   PyObject *__pyx_v_t2chrs = NULL;
24308   PyObject *__pyx_v_c2chrs = NULL;
24309   PyObject *__pyx_v_common = NULL;
24310   PyObject *__pyx_r = NULL;
24311   __Pyx_TraceDeclarations
24312   __Pyx_RefNannyDeclarations
24313   PyObject *__pyx_t_1 = NULL;
24314   PyObject *__pyx_t_2 = NULL;
24315   PyObject *__pyx_t_3 = NULL;
24316   PyObject *__pyx_t_4 = NULL;
24317   PyObject *__pyx_t_5 = NULL;
24318   int __pyx_t_6;
24319   PyObject *__pyx_t_7 = NULL;
24320   __Pyx_RefNannySetupContext("get_common_chrs", 0);
24321   __Pyx_TraceCall("get_common_chrs", __pyx_f[0], 1432, 0, __PYX_ERR(0, 1432, __pyx_L1_error));
24322 
24323   /* "MACS2/IO/ScoreTrack.pyx":1433
24324  *
24325  *     def get_common_chrs ( self ):
24326  *         t1chrs = self.t1bdg.get_chr_names()             # <<<<<<<<<<<<<<
24327  *         c1chrs = self.c1bdg.get_chr_names()
24328  *         t2chrs = self.t2bdg.get_chr_names()
24329  */
24330   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->t1bdg, __pyx_n_s_get_chr_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1433, __pyx_L1_error)
24331   __Pyx_GOTREF(__pyx_t_2);
24332   __pyx_t_3 = NULL;
24333   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
24334     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
24335     if (likely(__pyx_t_3)) {
24336       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24337       __Pyx_INCREF(__pyx_t_3);
24338       __Pyx_INCREF(function);
24339       __Pyx_DECREF_SET(__pyx_t_2, function);
24340     }
24341   }
24342   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
24343   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24344   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error)
24345   __Pyx_GOTREF(__pyx_t_1);
24346   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24347   __pyx_v_t1chrs = __pyx_t_1;
24348   __pyx_t_1 = 0;
24349 
24350   /* "MACS2/IO/ScoreTrack.pyx":1434
24351  *     def get_common_chrs ( self ):
24352  *         t1chrs = self.t1bdg.get_chr_names()
24353  *         c1chrs = self.c1bdg.get_chr_names()             # <<<<<<<<<<<<<<
24354  *         t2chrs = self.t2bdg.get_chr_names()
24355  *         c2chrs = self.c2bdg.get_chr_names()
24356  */
24357   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->c1bdg, __pyx_n_s_get_chr_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
24358   __Pyx_GOTREF(__pyx_t_2);
24359   __pyx_t_3 = NULL;
24360   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
24361     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
24362     if (likely(__pyx_t_3)) {
24363       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24364       __Pyx_INCREF(__pyx_t_3);
24365       __Pyx_INCREF(function);
24366       __Pyx_DECREF_SET(__pyx_t_2, function);
24367     }
24368   }
24369   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
24370   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24371   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
24372   __Pyx_GOTREF(__pyx_t_1);
24373   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24374   __pyx_v_c1chrs = __pyx_t_1;
24375   __pyx_t_1 = 0;
24376 
24377   /* "MACS2/IO/ScoreTrack.pyx":1435
24378  *         t1chrs = self.t1bdg.get_chr_names()
24379  *         c1chrs = self.c1bdg.get_chr_names()
24380  *         t2chrs = self.t2bdg.get_chr_names()             # <<<<<<<<<<<<<<
24381  *         c2chrs = self.c2bdg.get_chr_names()
24382  *         common = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))
24383  */
24384   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->t2bdg, __pyx_n_s_get_chr_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error)
24385   __Pyx_GOTREF(__pyx_t_2);
24386   __pyx_t_3 = NULL;
24387   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
24388     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
24389     if (likely(__pyx_t_3)) {
24390       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24391       __Pyx_INCREF(__pyx_t_3);
24392       __Pyx_INCREF(function);
24393       __Pyx_DECREF_SET(__pyx_t_2, function);
24394     }
24395   }
24396   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
24397   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24398   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
24399   __Pyx_GOTREF(__pyx_t_1);
24400   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24401   __pyx_v_t2chrs = __pyx_t_1;
24402   __pyx_t_1 = 0;
24403 
24404   /* "MACS2/IO/ScoreTrack.pyx":1436
24405  *         c1chrs = self.c1bdg.get_chr_names()
24406  *         t2chrs = self.t2bdg.get_chr_names()
24407  *         c2chrs = self.c2bdg.get_chr_names()             # <<<<<<<<<<<<<<
24408  *         common = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))
24409  *         return common
24410  */
24411   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->c2bdg, __pyx_n_s_get_chr_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error)
24412   __Pyx_GOTREF(__pyx_t_2);
24413   __pyx_t_3 = NULL;
24414   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
24415     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
24416     if (likely(__pyx_t_3)) {
24417       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24418       __Pyx_INCREF(__pyx_t_3);
24419       __Pyx_INCREF(function);
24420       __Pyx_DECREF_SET(__pyx_t_2, function);
24421     }
24422   }
24423   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
24424   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24425   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
24426   __Pyx_GOTREF(__pyx_t_1);
24427   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24428   __pyx_v_c2chrs = __pyx_t_1;
24429   __pyx_t_1 = 0;
24430 
24431   /* "MACS2/IO/ScoreTrack.pyx":1437
24432  *         t2chrs = self.t2bdg.get_chr_names()
24433  *         c2chrs = self.c2bdg.get_chr_names()
24434  *         common = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))             # <<<<<<<<<<<<<<
24435  *         return common
24436  *
24437  */
24438   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reduce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error)
24439   __Pyx_GOTREF(__pyx_t_2);
24440   __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15get_common_chrs_lambda, 0, __pyx_n_s_get_common_chrs_locals_lambda, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1437, __pyx_L1_error)
24441   __Pyx_GOTREF(__pyx_t_3);
24442   __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1437, __pyx_L1_error)
24443   __Pyx_GOTREF(__pyx_t_4);
24444   __Pyx_INCREF(__pyx_v_t1chrs);
24445   __Pyx_GIVEREF(__pyx_v_t1chrs);
24446   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_t1chrs);
24447   __Pyx_INCREF(__pyx_v_c1chrs);
24448   __Pyx_GIVEREF(__pyx_v_c1chrs);
24449   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_c1chrs);
24450   __Pyx_INCREF(__pyx_v_t2chrs);
24451   __Pyx_GIVEREF(__pyx_v_t2chrs);
24452   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_t2chrs);
24453   __Pyx_INCREF(__pyx_v_c2chrs);
24454   __Pyx_GIVEREF(__pyx_v_c2chrs);
24455   PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_c2chrs);
24456   __pyx_t_5 = NULL;
24457   __pyx_t_6 = 0;
24458   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
24459     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
24460     if (likely(__pyx_t_5)) {
24461       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24462       __Pyx_INCREF(__pyx_t_5);
24463       __Pyx_INCREF(function);
24464       __Pyx_DECREF_SET(__pyx_t_2, function);
24465       __pyx_t_6 = 1;
24466     }
24467   }
24468   #if CYTHON_FAST_PYCALL
24469   if (PyFunction_Check(__pyx_t_2)) {
24470     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
24471     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1437, __pyx_L1_error)
24472     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24473     __Pyx_GOTREF(__pyx_t_1);
24474     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24475     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24476   } else
24477   #endif
24478   #if CYTHON_FAST_PYCCALL
24479   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
24480     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
24481     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1437, __pyx_L1_error)
24482     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24483     __Pyx_GOTREF(__pyx_t_1);
24484     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24485     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24486   } else
24487   #endif
24488   {
24489     __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1437, __pyx_L1_error)
24490     __Pyx_GOTREF(__pyx_t_7);
24491     if (__pyx_t_5) {
24492       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
24493     }
24494     __Pyx_GIVEREF(__pyx_t_3);
24495     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
24496     __Pyx_GIVEREF(__pyx_t_4);
24497     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
24498     __pyx_t_3 = 0;
24499     __pyx_t_4 = 0;
24500     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1437, __pyx_L1_error)
24501     __Pyx_GOTREF(__pyx_t_1);
24502     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24503   }
24504   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24505   __pyx_v_common = __pyx_t_1;
24506   __pyx_t_1 = 0;
24507 
24508   /* "MACS2/IO/ScoreTrack.pyx":1438
24509  *         c2chrs = self.c2bdg.get_chr_names()
24510  *         common = reduce(lambda x,y:x.intersection(y), (t1chrs,c1chrs,t2chrs,c2chrs))
24511  *         return common             # <<<<<<<<<<<<<<
24512  *
24513  *     cdef add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):
24514  */
24515   __Pyx_XDECREF(__pyx_r);
24516   __Pyx_INCREF(__pyx_v_common);
24517   __pyx_r = __pyx_v_common;
24518   goto __pyx_L0;
24519 
24520   /* "MACS2/IO/ScoreTrack.pyx":1432
24521  *             pass
24522  *
24523  *     def get_common_chrs ( self ):             # <<<<<<<<<<<<<<
24524  *         t1chrs = self.t1bdg.get_chr_names()
24525  *         c1chrs = self.c1bdg.get_chr_names()
24526  */
24527 
24528   /* function exit code */
24529   __pyx_L1_error:;
24530   __Pyx_XDECREF(__pyx_t_1);
24531   __Pyx_XDECREF(__pyx_t_2);
24532   __Pyx_XDECREF(__pyx_t_3);
24533   __Pyx_XDECREF(__pyx_t_4);
24534   __Pyx_XDECREF(__pyx_t_5);
24535   __Pyx_XDECREF(__pyx_t_7);
24536   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.get_common_chrs", __pyx_clineno, __pyx_lineno, __pyx_filename);
24537   __pyx_r = NULL;
24538   __pyx_L0:;
24539   __Pyx_XDECREF(__pyx_v_t1chrs);
24540   __Pyx_XDECREF(__pyx_v_c1chrs);
24541   __Pyx_XDECREF(__pyx_v_t2chrs);
24542   __Pyx_XDECREF(__pyx_v_c2chrs);
24543   __Pyx_XDECREF(__pyx_v_common);
24544   __Pyx_XGIVEREF(__pyx_r);
24545   __Pyx_TraceReturn(__pyx_r, 0);
24546   __Pyx_RefNannyFinishContext();
24547   return __pyx_r;
24548 }
24549 
24550 /* "MACS2/IO/ScoreTrack.pyx":1440
24551  *         return common
24552  *
24553  *     cdef add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):             # <<<<<<<<<<<<<<
24554  *         """
24555  *         chrom: chromosome name
24556  */
24557 
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_add_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_chrom,__pyx_t_5numpy_int32_t __pyx_v_chrom_max_len)24558 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_add_chromosome(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_5numpy_int32_t __pyx_v_chrom_max_len) {
24559   PyObject *__pyx_r = NULL;
24560   __Pyx_TraceDeclarations
24561   __Pyx_RefNannyDeclarations
24562   int __pyx_t_1;
24563   int __pyx_t_2;
24564   PyObject *__pyx_t_3 = NULL;
24565   PyObject *__pyx_t_4 = NULL;
24566   PyObject *__pyx_t_5 = NULL;
24567   PyObject *__pyx_t_6 = NULL;
24568   PyObject *__pyx_t_7 = NULL;
24569   PyObject *__pyx_t_8 = NULL;
24570   PyObject *__pyx_t_9 = NULL;
24571   __Pyx_RefNannySetupContext("add_chromosome", 0);
24572   __Pyx_TraceCall("add_chromosome", __pyx_f[0], 1440, 0, __PYX_ERR(0, 1440, __pyx_L1_error));
24573 
24574   /* "MACS2/IO/ScoreTrack.pyx":1446
24575  *
24576  *         """
24577  *         if chrom not in self.data:             # <<<<<<<<<<<<<<
24578  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
24579  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1
24580  */
24581   if (unlikely(__pyx_v_self->data == Py_None)) {
24582     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
24583     __PYX_ERR(0, 1446, __pyx_L1_error)
24584   }
24585   __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_chrom, __pyx_v_self->data, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1446, __pyx_L1_error)
24586   __pyx_t_2 = (__pyx_t_1 != 0);
24587   if (__pyx_t_2) {
24588 
24589     /* "MACS2/IO/ScoreTrack.pyx":1447
24590  *         """
24591  *         if chrom not in self.data:
24592  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos             # <<<<<<<<<<<<<<
24593  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1
24594  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t2 vs c2
24595  */
24596     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1447, __pyx_L1_error)
24597     __Pyx_GOTREF(__pyx_t_3);
24598     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1447, __pyx_L1_error)
24599     __Pyx_GOTREF(__pyx_t_4);
24600     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24601     __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1447, __pyx_L1_error)
24602     __Pyx_GOTREF(__pyx_t_3);
24603     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1447, __pyx_L1_error)
24604     __Pyx_GOTREF(__pyx_t_5);
24605     __Pyx_GIVEREF(__pyx_t_3);
24606     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
24607     __pyx_t_3 = 0;
24608     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1447, __pyx_L1_error)
24609     __Pyx_GOTREF(__pyx_t_3);
24610     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_u_int32) < 0) __PYX_ERR(0, 1447, __pyx_L1_error)
24611     __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1447, __pyx_L1_error)
24612     __Pyx_GOTREF(__pyx_t_6);
24613     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24614     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24615     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24616 
24617     /* "MACS2/IO/ScoreTrack.pyx":1448
24618  *         if chrom not in self.data:
24619  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
24620  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1             # <<<<<<<<<<<<<<
24621  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t2 vs c2
24622  *                                  np.zeros( chrom_max_len, dtype="float32" )] # LLR t1 vs t2
24623  */
24624     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1448, __pyx_L1_error)
24625     __Pyx_GOTREF(__pyx_t_3);
24626     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1448, __pyx_L1_error)
24627     __Pyx_GOTREF(__pyx_t_5);
24628     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24629     __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1448, __pyx_L1_error)
24630     __Pyx_GOTREF(__pyx_t_3);
24631     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1448, __pyx_L1_error)
24632     __Pyx_GOTREF(__pyx_t_4);
24633     __Pyx_GIVEREF(__pyx_t_3);
24634     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
24635     __pyx_t_3 = 0;
24636     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1448, __pyx_L1_error)
24637     __Pyx_GOTREF(__pyx_t_3);
24638     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 1448, __pyx_L1_error)
24639     __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1448, __pyx_L1_error)
24640     __Pyx_GOTREF(__pyx_t_7);
24641     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24642     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24643     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24644 
24645     /* "MACS2/IO/ScoreTrack.pyx":1449
24646  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
24647  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1
24648  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t2 vs c2             # <<<<<<<<<<<<<<
24649  *                                  np.zeros( chrom_max_len, dtype="float32" )] # LLR t1 vs t2
24650  *             self.datalength[chrom] = 0
24651  */
24652     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error)
24653     __Pyx_GOTREF(__pyx_t_3);
24654     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1449, __pyx_L1_error)
24655     __Pyx_GOTREF(__pyx_t_4);
24656     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24657     __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error)
24658     __Pyx_GOTREF(__pyx_t_3);
24659     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1449, __pyx_L1_error)
24660     __Pyx_GOTREF(__pyx_t_5);
24661     __Pyx_GIVEREF(__pyx_t_3);
24662     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
24663     __pyx_t_3 = 0;
24664     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error)
24665     __Pyx_GOTREF(__pyx_t_3);
24666     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 1449, __pyx_L1_error)
24667     __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1449, __pyx_L1_error)
24668     __Pyx_GOTREF(__pyx_t_8);
24669     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24670     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24671     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24672 
24673     /* "MACS2/IO/ScoreTrack.pyx":1450
24674  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1
24675  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t2 vs c2
24676  *                                  np.zeros( chrom_max_len, dtype="float32" )] # LLR t1 vs t2             # <<<<<<<<<<<<<<
24677  *             self.datalength[chrom] = 0
24678  *
24679  */
24680     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error)
24681     __Pyx_GOTREF(__pyx_t_3);
24682     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1450, __pyx_L1_error)
24683     __Pyx_GOTREF(__pyx_t_5);
24684     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24685     __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_chrom_max_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error)
24686     __Pyx_GOTREF(__pyx_t_3);
24687     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error)
24688     __Pyx_GOTREF(__pyx_t_4);
24689     __Pyx_GIVEREF(__pyx_t_3);
24690     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
24691     __pyx_t_3 = 0;
24692     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error)
24693     __Pyx_GOTREF(__pyx_t_3);
24694     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 1450, __pyx_L1_error)
24695     __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1450, __pyx_L1_error)
24696     __Pyx_GOTREF(__pyx_t_9);
24697     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24698     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24699     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24700 
24701     /* "MACS2/IO/ScoreTrack.pyx":1447
24702  *         """
24703  *         if chrom not in self.data:
24704  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos             # <<<<<<<<<<<<<<
24705  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1
24706  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t2 vs c2
24707  */
24708     __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1447, __pyx_L1_error)
24709     __Pyx_GOTREF(__pyx_t_3);
24710     __Pyx_GIVEREF(__pyx_t_6);
24711     PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
24712     __Pyx_GIVEREF(__pyx_t_7);
24713     PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
24714     __Pyx_GIVEREF(__pyx_t_8);
24715     PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_8);
24716     __Pyx_GIVEREF(__pyx_t_9);
24717     PyList_SET_ITEM(__pyx_t_3, 3, __pyx_t_9);
24718     __pyx_t_6 = 0;
24719     __pyx_t_7 = 0;
24720     __pyx_t_8 = 0;
24721     __pyx_t_9 = 0;
24722     if (unlikely(__pyx_v_self->data == Py_None)) {
24723       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24724       __PYX_ERR(0, 1447, __pyx_L1_error)
24725     }
24726     if (unlikely(PyDict_SetItem(__pyx_v_self->data, __pyx_v_chrom, __pyx_t_3) < 0)) __PYX_ERR(0, 1447, __pyx_L1_error)
24727     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24728 
24729     /* "MACS2/IO/ScoreTrack.pyx":1451
24730  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t2 vs c2
24731  *                                  np.zeros( chrom_max_len, dtype="float32" )] # LLR t1 vs t2
24732  *             self.datalength[chrom] = 0             # <<<<<<<<<<<<<<
24733  *
24734  *     cdef add (self, bytes chromosome, int32_t endpos, float64_t t1, float64_t c1, float64_t t2, float64_t c2):
24735  */
24736     if (unlikely(__pyx_v_self->datalength == Py_None)) {
24737       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24738       __PYX_ERR(0, 1451, __pyx_L1_error)
24739     }
24740     if (unlikely(PyDict_SetItem(__pyx_v_self->datalength, __pyx_v_chrom, __pyx_int_0) < 0)) __PYX_ERR(0, 1451, __pyx_L1_error)
24741 
24742     /* "MACS2/IO/ScoreTrack.pyx":1446
24743  *
24744  *         """
24745  *         if chrom not in self.data:             # <<<<<<<<<<<<<<
24746  *             self.data[chrom] = [ np.zeros( chrom_max_len, dtype="int32" ), # pos
24747  *                                  np.zeros( chrom_max_len, dtype="float32" ), # LLR t1 vs c1
24748  */
24749   }
24750 
24751   /* "MACS2/IO/ScoreTrack.pyx":1440
24752  *         return common
24753  *
24754  *     cdef add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):             # <<<<<<<<<<<<<<
24755  *         """
24756  *         chrom: chromosome name
24757  */
24758 
24759   /* function exit code */
24760   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24761   goto __pyx_L0;
24762   __pyx_L1_error:;
24763   __Pyx_XDECREF(__pyx_t_3);
24764   __Pyx_XDECREF(__pyx_t_4);
24765   __Pyx_XDECREF(__pyx_t_5);
24766   __Pyx_XDECREF(__pyx_t_6);
24767   __Pyx_XDECREF(__pyx_t_7);
24768   __Pyx_XDECREF(__pyx_t_8);
24769   __Pyx_XDECREF(__pyx_t_9);
24770   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.add_chromosome", __pyx_clineno, __pyx_lineno, __pyx_filename);
24771   __pyx_r = 0;
24772   __pyx_L0:;
24773   __Pyx_XGIVEREF(__pyx_r);
24774   __Pyx_TraceReturn(__pyx_r, 0);
24775   __Pyx_RefNannyFinishContext();
24776   return __pyx_r;
24777 }
24778 
24779 /* "MACS2/IO/ScoreTrack.pyx":1453
24780  *             self.datalength[chrom] = 0
24781  *
24782  *     cdef add (self, bytes chromosome, int32_t endpos, float64_t t1, float64_t c1, float64_t t2, float64_t c2):             # <<<<<<<<<<<<<<
24783  *         """Take chr-endpos-sample1-control1-sample2-control2 and
24784  *         compute logLR for t1 vs c1, t2 vs c2, and t1 vs t2, then save
24785  */
24786 
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_add(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_chromosome,__pyx_t_5numpy_int32_t __pyx_v_endpos,__pyx_t_5numpy_float64_t __pyx_v_t1,__pyx_t_5numpy_float64_t __pyx_v_c1,__pyx_t_5numpy_float64_t __pyx_v_t2,__pyx_t_5numpy_float64_t __pyx_v_c2)24787 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_add(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chromosome, __pyx_t_5numpy_int32_t __pyx_v_endpos, __pyx_t_5numpy_float64_t __pyx_v_t1, __pyx_t_5numpy_float64_t __pyx_v_c1, __pyx_t_5numpy_float64_t __pyx_v_t2, __pyx_t_5numpy_float64_t __pyx_v_c2) {
24788   __pyx_t_5numpy_int32_t __pyx_v_i;
24789   PyObject *__pyx_v_c = NULL;
24790   PyObject *__pyx_r = NULL;
24791   __Pyx_TraceDeclarations
24792   __Pyx_RefNannyDeclarations
24793   PyObject *__pyx_t_1 = NULL;
24794   __pyx_t_5numpy_int32_t __pyx_t_2;
24795   PyObject *__pyx_t_3 = NULL;
24796   PyObject *__pyx_t_4 = NULL;
24797   PyObject *__pyx_t_5 = NULL;
24798   __Pyx_RefNannySetupContext("add", 0);
24799   __Pyx_TraceCall("add", __pyx_f[0], 1453, 0, __PYX_ERR(0, 1453, __pyx_L1_error));
24800 
24801   /* "MACS2/IO/ScoreTrack.pyx":1468
24802  *         """
24803  *         cdef int32_t i
24804  *         i = self.datalength[chromosome]             # <<<<<<<<<<<<<<
24805  *         c = self.data[chromosome]
24806  *         c[0][ i ] = endpos
24807  */
24808   if (unlikely(__pyx_v_self->datalength == Py_None)) {
24809     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24810     __PYX_ERR(0, 1468, __pyx_L1_error)
24811   }
24812   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chromosome); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error)
24813   __Pyx_GOTREF(__pyx_t_1);
24814   __pyx_t_2 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1468, __pyx_L1_error)
24815   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24816   __pyx_v_i = __pyx_t_2;
24817 
24818   /* "MACS2/IO/ScoreTrack.pyx":1469
24819  *         cdef int32_t i
24820  *         i = self.datalength[chromosome]
24821  *         c = self.data[chromosome]             # <<<<<<<<<<<<<<
24822  *         c[0][ i ] = endpos
24823  *         c[1][ i ] = logLR_asym( (t1+self.pseudocount)*self.cond1_factor, (c1+self.pseudocount)*self.cond1_factor )
24824  */
24825   if (unlikely(__pyx_v_self->data == Py_None)) {
24826     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24827     __PYX_ERR(0, 1469, __pyx_L1_error)
24828   }
24829   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chromosome); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error)
24830   __Pyx_GOTREF(__pyx_t_1);
24831   __pyx_v_c = __pyx_t_1;
24832   __pyx_t_1 = 0;
24833 
24834   /* "MACS2/IO/ScoreTrack.pyx":1470
24835  *         i = self.datalength[chromosome]
24836  *         c = self.data[chromosome]
24837  *         c[0][ i ] = endpos             # <<<<<<<<<<<<<<
24838  *         c[1][ i ] = logLR_asym( (t1+self.pseudocount)*self.cond1_factor, (c1+self.pseudocount)*self.cond1_factor )
24839  *         c[2][ i ] = logLR_asym( (t2+self.pseudocount)*self.cond2_factor, (c2+self.pseudocount)*self.cond2_factor )
24840  */
24841   __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_endpos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error)
24842   __Pyx_GOTREF(__pyx_t_1);
24843   __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1470, __pyx_L1_error)
24844   __Pyx_GOTREF(__pyx_t_3);
24845   if (unlikely(__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1) < 0)) __PYX_ERR(0, 1470, __pyx_L1_error)
24846   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24847   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24848 
24849   /* "MACS2/IO/ScoreTrack.pyx":1471
24850  *         c = self.data[chromosome]
24851  *         c[0][ i ] = endpos
24852  *         c[1][ i ] = logLR_asym( (t1+self.pseudocount)*self.cond1_factor, (c1+self.pseudocount)*self.cond1_factor )             # <<<<<<<<<<<<<<
24853  *         c[2][ i ] = logLR_asym( (t2+self.pseudocount)*self.cond2_factor, (c2+self.pseudocount)*self.cond2_factor )
24854  *         c[3][ i ] = logLR_sym( (t1+self.pseudocount)*self.cond1_factor, (t2+self.pseudocount)*self.cond2_factor )
24855  */
24856   __pyx_t_1 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_10ScoreTrack_logLR_asym(((__pyx_v_t1 + __pyx_v_self->pseudocount) * __pyx_v_self->cond1_factor), ((__pyx_v_c1 + __pyx_v_self->pseudocount) * __pyx_v_self->cond1_factor))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
24857   __Pyx_GOTREF(__pyx_t_1);
24858   __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1471, __pyx_L1_error)
24859   __Pyx_GOTREF(__pyx_t_3);
24860   if (unlikely(__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1) < 0)) __PYX_ERR(0, 1471, __pyx_L1_error)
24861   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24862   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24863 
24864   /* "MACS2/IO/ScoreTrack.pyx":1472
24865  *         c[0][ i ] = endpos
24866  *         c[1][ i ] = logLR_asym( (t1+self.pseudocount)*self.cond1_factor, (c1+self.pseudocount)*self.cond1_factor )
24867  *         c[2][ i ] = logLR_asym( (t2+self.pseudocount)*self.cond2_factor, (c2+self.pseudocount)*self.cond2_factor )             # <<<<<<<<<<<<<<
24868  *         c[3][ i ] = logLR_sym( (t1+self.pseudocount)*self.cond1_factor, (t2+self.pseudocount)*self.cond2_factor )
24869  *         self.datalength[chromosome] += 1
24870  */
24871   __pyx_t_1 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_10ScoreTrack_logLR_asym(((__pyx_v_t2 + __pyx_v_self->pseudocount) * __pyx_v_self->cond2_factor), ((__pyx_v_c2 + __pyx_v_self->pseudocount) * __pyx_v_self->cond2_factor))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error)
24872   __Pyx_GOTREF(__pyx_t_1);
24873   __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1472, __pyx_L1_error)
24874   __Pyx_GOTREF(__pyx_t_3);
24875   if (unlikely(__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1) < 0)) __PYX_ERR(0, 1472, __pyx_L1_error)
24876   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24877   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24878 
24879   /* "MACS2/IO/ScoreTrack.pyx":1473
24880  *         c[1][ i ] = logLR_asym( (t1+self.pseudocount)*self.cond1_factor, (c1+self.pseudocount)*self.cond1_factor )
24881  *         c[2][ i ] = logLR_asym( (t2+self.pseudocount)*self.cond2_factor, (c2+self.pseudocount)*self.cond2_factor )
24882  *         c[3][ i ] = logLR_sym( (t1+self.pseudocount)*self.cond1_factor, (t2+self.pseudocount)*self.cond2_factor )             # <<<<<<<<<<<<<<
24883  *         self.datalength[chromosome] += 1
24884  *
24885  */
24886   __pyx_t_1 = PyFloat_FromDouble(__pyx_f_5MACS2_2IO_10ScoreTrack_logLR_sym(((__pyx_v_t1 + __pyx_v_self->pseudocount) * __pyx_v_self->cond1_factor), ((__pyx_v_t2 + __pyx_v_self->pseudocount) * __pyx_v_self->cond2_factor))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
24887   __Pyx_GOTREF(__pyx_t_1);
24888   __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1473, __pyx_L1_error)
24889   __Pyx_GOTREF(__pyx_t_3);
24890   if (unlikely(__Pyx_SetItemInt(__pyx_t_3, __pyx_v_i, __pyx_t_1, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1) < 0)) __PYX_ERR(0, 1473, __pyx_L1_error)
24891   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24892   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24893 
24894   /* "MACS2/IO/ScoreTrack.pyx":1474
24895  *         c[2][ i ] = logLR_asym( (t2+self.pseudocount)*self.cond2_factor, (c2+self.pseudocount)*self.cond2_factor )
24896  *         c[3][ i ] = logLR_sym( (t1+self.pseudocount)*self.cond1_factor, (t2+self.pseudocount)*self.cond2_factor )
24897  *         self.datalength[chromosome] += 1             # <<<<<<<<<<<<<<
24898  *
24899  *     cpdef finalize ( self ):
24900  */
24901   if (unlikely(__pyx_v_self->datalength == Py_None)) {
24902     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24903     __PYX_ERR(0, 1474, __pyx_L1_error)
24904   }
24905   __Pyx_INCREF(__pyx_v_self->datalength);
24906   __pyx_t_4 = __pyx_v_self->datalength;
24907   __Pyx_INCREF(__pyx_v_chromosome);
24908   __pyx_t_5 = __pyx_v_chromosome;
24909   if (unlikely(__pyx_t_4 == Py_None)) {
24910     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24911     __PYX_ERR(0, 1474, __pyx_L1_error)
24912   }
24913   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1474, __pyx_L1_error)
24914   __Pyx_GOTREF(__pyx_t_1);
24915   __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1474, __pyx_L1_error)
24916   __Pyx_GOTREF(__pyx_t_3);
24917   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24918   if (unlikely(__pyx_t_4 == Py_None)) {
24919     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24920     __PYX_ERR(0, 1474, __pyx_L1_error)
24921   }
24922   if (unlikely(PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_t_3) < 0)) __PYX_ERR(0, 1474, __pyx_L1_error)
24923   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24924   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24925   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24926 
24927   /* "MACS2/IO/ScoreTrack.pyx":1453
24928  *             self.datalength[chrom] = 0
24929  *
24930  *     cdef add (self, bytes chromosome, int32_t endpos, float64_t t1, float64_t c1, float64_t t2, float64_t c2):             # <<<<<<<<<<<<<<
24931  *         """Take chr-endpos-sample1-control1-sample2-control2 and
24932  *         compute logLR for t1 vs c1, t2 vs c2, and t1 vs t2, then save
24933  */
24934 
24935   /* function exit code */
24936   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24937   goto __pyx_L0;
24938   __pyx_L1_error:;
24939   __Pyx_XDECREF(__pyx_t_1);
24940   __Pyx_XDECREF(__pyx_t_3);
24941   __Pyx_XDECREF(__pyx_t_4);
24942   __Pyx_XDECREF(__pyx_t_5);
24943   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
24944   __pyx_r = 0;
24945   __pyx_L0:;
24946   __Pyx_XDECREF(__pyx_v_c);
24947   __Pyx_XGIVEREF(__pyx_r);
24948   __Pyx_TraceReturn(__pyx_r, 0);
24949   __Pyx_RefNannyFinishContext();
24950   return __pyx_r;
24951 }
24952 
24953 /* "MACS2/IO/ScoreTrack.pyx":1476
24954  *         self.datalength[chromosome] += 1
24955  *
24956  *     cpdef finalize ( self ):             # <<<<<<<<<<<<<<
24957  *         """
24958  *         Adjust array size of each chromosome.
24959  */
24960 
24961 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_9finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,int __pyx_skip_dispatch)24962 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch) {
24963   PyObject *__pyx_v_chrom = 0;
24964   __pyx_t_5numpy_int32_t __pyx_v_l;
24965   PyObject *__pyx_v_d = NULL;
24966   PyObject *__pyx_r = NULL;
24967   __Pyx_TraceDeclarations
24968   __Pyx_RefNannyDeclarations
24969   PyObject *__pyx_t_1 = NULL;
24970   PyObject *__pyx_t_2 = NULL;
24971   PyObject *__pyx_t_3 = NULL;
24972   PyObject *__pyx_t_4 = NULL;
24973   Py_ssize_t __pyx_t_5;
24974   Py_ssize_t __pyx_t_6;
24975   int __pyx_t_7;
24976   int __pyx_t_8;
24977   __pyx_t_5numpy_int32_t __pyx_t_9;
24978   PyObject *__pyx_t_10 = NULL;
24979   __Pyx_RefNannySetupContext("finalize", 0);
24980   __Pyx_TraceCall("finalize", __pyx_f[0], 1476, 0, __PYX_ERR(0, 1476, __pyx_L1_error));
24981   /* Check if called by wrapper */
24982   if (unlikely(__pyx_skip_dispatch)) ;
24983   /* Check if overridden in Python */
24984   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
24985     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
24986     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
24987     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
24988       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
24989       #endif
24990       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_finalize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error)
24991       __Pyx_GOTREF(__pyx_t_1);
24992       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_9finalize)) {
24993         __Pyx_XDECREF(__pyx_r);
24994         __Pyx_INCREF(__pyx_t_1);
24995         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
24996         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
24997           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
24998           if (likely(__pyx_t_4)) {
24999             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
25000             __Pyx_INCREF(__pyx_t_4);
25001             __Pyx_INCREF(function);
25002             __Pyx_DECREF_SET(__pyx_t_3, function);
25003           }
25004         }
25005         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
25006         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25007         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error)
25008         __Pyx_GOTREF(__pyx_t_2);
25009         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25010         __pyx_r = __pyx_t_2;
25011         __pyx_t_2 = 0;
25012         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25013         goto __pyx_L0;
25014       }
25015       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
25016       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
25017       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
25018       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
25019         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
25020       }
25021       #endif
25022       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25023       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
25024     }
25025     #endif
25026   }
25027 
25028   /* "MACS2/IO/ScoreTrack.pyx":1485
25029  *             int32_t l
25030  *
25031  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
25032  *             d = self.data[chrom]
25033  *             l = self.datalength[chrom]
25034  */
25035   __pyx_t_5 = 0;
25036   if (unlikely(__pyx_v_self->data == Py_None)) {
25037     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
25038     __PYX_ERR(0, 1485, __pyx_L1_error)
25039   }
25040   __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1485, __pyx_L1_error)
25041   __Pyx_GOTREF(__pyx_t_2);
25042   __Pyx_XDECREF(__pyx_t_1);
25043   __pyx_t_1 = __pyx_t_2;
25044   __pyx_t_2 = 0;
25045   while (1) {
25046     __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_2, NULL, NULL, __pyx_t_7);
25047     if (unlikely(__pyx_t_8 == 0)) break;
25048     if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1485, __pyx_L1_error)
25049     __Pyx_GOTREF(__pyx_t_2);
25050     if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1485, __pyx_L1_error)
25051     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_2));
25052     __pyx_t_2 = 0;
25053 
25054     /* "MACS2/IO/ScoreTrack.pyx":1486
25055  *
25056  *         for chrom in self.data.keys():
25057  *             d = self.data[chrom]             # <<<<<<<<<<<<<<
25058  *             l = self.datalength[chrom]
25059  *             d[0].resize( l, refcheck = False )
25060  */
25061     if (unlikely(__pyx_v_self->data == Py_None)) {
25062       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25063       __PYX_ERR(0, 1486, __pyx_L1_error)
25064     }
25065     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L1_error)
25066     __Pyx_GOTREF(__pyx_t_2);
25067     __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_2);
25068     __pyx_t_2 = 0;
25069 
25070     /* "MACS2/IO/ScoreTrack.pyx":1487
25071  *         for chrom in self.data.keys():
25072  *             d = self.data[chrom]
25073  *             l = self.datalength[chrom]             # <<<<<<<<<<<<<<
25074  *             d[0].resize( l, refcheck = False )
25075  *             d[1].resize( l, refcheck = False )
25076  */
25077     if (unlikely(__pyx_v_self->datalength == Py_None)) {
25078       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25079       __PYX_ERR(0, 1487, __pyx_L1_error)
25080     }
25081     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1487, __pyx_L1_error)
25082     __Pyx_GOTREF(__pyx_t_2);
25083     __pyx_t_9 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_9 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1487, __pyx_L1_error)
25084     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25085     __pyx_v_l = __pyx_t_9;
25086 
25087     /* "MACS2/IO/ScoreTrack.pyx":1488
25088  *             d = self.data[chrom]
25089  *             l = self.datalength[chrom]
25090  *             d[0].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
25091  *             d[1].resize( l, refcheck = False )
25092  *             d[2].resize( l, refcheck = False )
25093  */
25094     __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1488, __pyx_L1_error)
25095     __Pyx_GOTREF(__pyx_t_2);
25096     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_resize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1488, __pyx_L1_error)
25097     __Pyx_GOTREF(__pyx_t_3);
25098     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25099     __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1488, __pyx_L1_error)
25100     __Pyx_GOTREF(__pyx_t_2);
25101     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1488, __pyx_L1_error)
25102     __Pyx_GOTREF(__pyx_t_4);
25103     __Pyx_GIVEREF(__pyx_t_2);
25104     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
25105     __pyx_t_2 = 0;
25106     __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1488, __pyx_L1_error)
25107     __Pyx_GOTREF(__pyx_t_2);
25108     if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 1488, __pyx_L1_error)
25109     __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1488, __pyx_L1_error)
25110     __Pyx_GOTREF(__pyx_t_10);
25111     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25112     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25113     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25114     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25115 
25116     /* "MACS2/IO/ScoreTrack.pyx":1489
25117  *             l = self.datalength[chrom]
25118  *             d[0].resize( l, refcheck = False )
25119  *             d[1].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
25120  *             d[2].resize( l, refcheck = False )
25121  *             d[3].resize( l, refcheck = False )
25122  */
25123     __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_d, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1489, __pyx_L1_error)
25124     __Pyx_GOTREF(__pyx_t_10);
25125     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error)
25126     __Pyx_GOTREF(__pyx_t_2);
25127     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25128     __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_l); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1489, __pyx_L1_error)
25129     __Pyx_GOTREF(__pyx_t_10);
25130     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1489, __pyx_L1_error)
25131     __Pyx_GOTREF(__pyx_t_4);
25132     __Pyx_GIVEREF(__pyx_t_10);
25133     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10);
25134     __pyx_t_10 = 0;
25135     __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1489, __pyx_L1_error)
25136     __Pyx_GOTREF(__pyx_t_10);
25137     if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 1489, __pyx_L1_error)
25138     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L1_error)
25139     __Pyx_GOTREF(__pyx_t_3);
25140     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25141     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25142     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25143     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25144 
25145     /* "MACS2/IO/ScoreTrack.pyx":1490
25146  *             d[0].resize( l, refcheck = False )
25147  *             d[1].resize( l, refcheck = False )
25148  *             d[2].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
25149  *             d[3].resize( l, refcheck = False )
25150  *         return
25151  */
25152     __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_d, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1490, __pyx_L1_error)
25153     __Pyx_GOTREF(__pyx_t_3);
25154     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_resize); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1490, __pyx_L1_error)
25155     __Pyx_GOTREF(__pyx_t_10);
25156     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25157     __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_l); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1490, __pyx_L1_error)
25158     __Pyx_GOTREF(__pyx_t_3);
25159     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error)
25160     __Pyx_GOTREF(__pyx_t_4);
25161     __Pyx_GIVEREF(__pyx_t_3);
25162     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
25163     __pyx_t_3 = 0;
25164     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1490, __pyx_L1_error)
25165     __Pyx_GOTREF(__pyx_t_3);
25166     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 1490, __pyx_L1_error)
25167     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error)
25168     __Pyx_GOTREF(__pyx_t_2);
25169     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25170     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25171     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25172     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25173 
25174     /* "MACS2/IO/ScoreTrack.pyx":1491
25175  *             d[1].resize( l, refcheck = False )
25176  *             d[2].resize( l, refcheck = False )
25177  *             d[3].resize( l, refcheck = False )             # <<<<<<<<<<<<<<
25178  *         return
25179  *
25180  */
25181     __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_d, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1491, __pyx_L1_error)
25182     __Pyx_GOTREF(__pyx_t_2);
25183     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_resize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1491, __pyx_L1_error)
25184     __Pyx_GOTREF(__pyx_t_3);
25185     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25186     __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1491, __pyx_L1_error)
25187     __Pyx_GOTREF(__pyx_t_2);
25188     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1491, __pyx_L1_error)
25189     __Pyx_GOTREF(__pyx_t_4);
25190     __Pyx_GIVEREF(__pyx_t_2);
25191     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
25192     __pyx_t_2 = 0;
25193     __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1491, __pyx_L1_error)
25194     __Pyx_GOTREF(__pyx_t_2);
25195     if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 1491, __pyx_L1_error)
25196     __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1491, __pyx_L1_error)
25197     __Pyx_GOTREF(__pyx_t_10);
25198     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25199     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25200     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25201     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25202   }
25203   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25204 
25205   /* "MACS2/IO/ScoreTrack.pyx":1492
25206  *             d[2].resize( l, refcheck = False )
25207  *             d[3].resize( l, refcheck = False )
25208  *         return             # <<<<<<<<<<<<<<
25209  *
25210  *     cpdef get_data_by_chr (self, bytes chromosome):
25211  */
25212   __Pyx_XDECREF(__pyx_r);
25213   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25214   goto __pyx_L0;
25215 
25216   /* "MACS2/IO/ScoreTrack.pyx":1476
25217  *         self.datalength[chromosome] += 1
25218  *
25219  *     cpdef finalize ( self ):             # <<<<<<<<<<<<<<
25220  *         """
25221  *         Adjust array size of each chromosome.
25222  */
25223 
25224   /* function exit code */
25225   __pyx_L1_error:;
25226   __Pyx_XDECREF(__pyx_t_1);
25227   __Pyx_XDECREF(__pyx_t_2);
25228   __Pyx_XDECREF(__pyx_t_3);
25229   __Pyx_XDECREF(__pyx_t_4);
25230   __Pyx_XDECREF(__pyx_t_10);
25231   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
25232   __pyx_r = 0;
25233   __pyx_L0:;
25234   __Pyx_XDECREF(__pyx_v_chrom);
25235   __Pyx_XDECREF(__pyx_v_d);
25236   __Pyx_XGIVEREF(__pyx_r);
25237   __Pyx_TraceReturn(__pyx_r, 0);
25238   __Pyx_RefNannyFinishContext();
25239   return __pyx_r;
25240 }
25241 
25242 /* Python wrapper */
25243 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_9finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
25244 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_8finalize[] = "\n        Adjust array size of each chromosome.\n\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_9finalize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)25245 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_9finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
25246   PyObject *__pyx_r = 0;
25247   __Pyx_RefNannyDeclarations
25248   __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
25249   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_8finalize(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self));
25250 
25251   /* function exit code */
25252   __Pyx_RefNannyFinishContext();
25253   return __pyx_r;
25254 }
25255 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_8finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self)25256 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_8finalize(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self) {
25257   PyObject *__pyx_r = NULL;
25258   __Pyx_TraceDeclarations
25259   __Pyx_RefNannyDeclarations
25260   PyObject *__pyx_t_1 = NULL;
25261   __Pyx_RefNannySetupContext("finalize", 0);
25262   __Pyx_TraceCall("finalize (wrapper)", __pyx_f[0], 1476, 0, __PYX_ERR(0, 1476, __pyx_L1_error));
25263   __Pyx_XDECREF(__pyx_r);
25264   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_finalize(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error)
25265   __Pyx_GOTREF(__pyx_t_1);
25266   __pyx_r = __pyx_t_1;
25267   __pyx_t_1 = 0;
25268   goto __pyx_L0;
25269 
25270   /* function exit code */
25271   __pyx_L1_error:;
25272   __Pyx_XDECREF(__pyx_t_1);
25273   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
25274   __pyx_r = NULL;
25275   __pyx_L0:;
25276   __Pyx_XGIVEREF(__pyx_r);
25277   __Pyx_TraceReturn(__pyx_r, 0);
25278   __Pyx_RefNannyFinishContext();
25279   return __pyx_r;
25280 }
25281 
25282 /* "MACS2/IO/ScoreTrack.pyx":1494
25283  *         return
25284  *
25285  *     cpdef get_data_by_chr (self, bytes chromosome):             # <<<<<<<<<<<<<<
25286  *         """Return array of counts by chromosome.
25287  *
25288  */
25289 
25290 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_11get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_chromosome,int __pyx_skip_dispatch)25291 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chromosome, int __pyx_skip_dispatch) {
25292   PyObject *__pyx_r = NULL;
25293   __Pyx_TraceDeclarations
25294   __Pyx_RefNannyDeclarations
25295   PyObject *__pyx_t_1 = NULL;
25296   PyObject *__pyx_t_2 = NULL;
25297   PyObject *__pyx_t_3 = NULL;
25298   PyObject *__pyx_t_4 = NULL;
25299   int __pyx_t_5;
25300   int __pyx_t_6;
25301   __Pyx_RefNannySetupContext("get_data_by_chr", 0);
25302   __Pyx_TraceCall("get_data_by_chr", __pyx_f[0], 1494, 0, __PYX_ERR(0, 1494, __pyx_L1_error));
25303   /* Check if called by wrapper */
25304   if (unlikely(__pyx_skip_dispatch)) ;
25305   /* Check if overridden in Python */
25306   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
25307     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
25308     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
25309     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
25310       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
25311       #endif
25312       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_data_by_chr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error)
25313       __Pyx_GOTREF(__pyx_t_1);
25314       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_11get_data_by_chr)) {
25315         __Pyx_XDECREF(__pyx_r);
25316         __Pyx_INCREF(__pyx_t_1);
25317         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
25318         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
25319           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
25320           if (likely(__pyx_t_4)) {
25321             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
25322             __Pyx_INCREF(__pyx_t_4);
25323             __Pyx_INCREF(function);
25324             __Pyx_DECREF_SET(__pyx_t_3, function);
25325           }
25326         }
25327         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_chromosome) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_chromosome);
25328         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25329         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1494, __pyx_L1_error)
25330         __Pyx_GOTREF(__pyx_t_2);
25331         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25332         __pyx_r = __pyx_t_2;
25333         __pyx_t_2 = 0;
25334         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25335         goto __pyx_L0;
25336       }
25337       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
25338       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
25339       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
25340       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
25341         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
25342       }
25343       #endif
25344       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25345       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
25346     }
25347     #endif
25348   }
25349 
25350   /* "MACS2/IO/ScoreTrack.pyx":1500
25351  *         ([end pos],[value])
25352  *         """
25353  *         if chromosome in self.data:             # <<<<<<<<<<<<<<
25354  *             return self.data[chromosome]
25355  *         else:
25356  */
25357   if (unlikely(__pyx_v_self->data == Py_None)) {
25358     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
25359     __PYX_ERR(0, 1500, __pyx_L1_error)
25360   }
25361   __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_chromosome, __pyx_v_self->data, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1500, __pyx_L1_error)
25362   __pyx_t_6 = (__pyx_t_5 != 0);
25363   if (__pyx_t_6) {
25364 
25365     /* "MACS2/IO/ScoreTrack.pyx":1501
25366  *         """
25367  *         if chromosome in self.data:
25368  *             return self.data[chromosome]             # <<<<<<<<<<<<<<
25369  *         else:
25370  *             return None
25371  */
25372     __Pyx_XDECREF(__pyx_r);
25373     if (unlikely(__pyx_v_self->data == Py_None)) {
25374       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25375       __PYX_ERR(0, 1501, __pyx_L1_error)
25376     }
25377     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chromosome); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1501, __pyx_L1_error)
25378     __Pyx_GOTREF(__pyx_t_1);
25379     __pyx_r = __pyx_t_1;
25380     __pyx_t_1 = 0;
25381     goto __pyx_L0;
25382 
25383     /* "MACS2/IO/ScoreTrack.pyx":1500
25384  *         ([end pos],[value])
25385  *         """
25386  *         if chromosome in self.data:             # <<<<<<<<<<<<<<
25387  *             return self.data[chromosome]
25388  *         else:
25389  */
25390   }
25391 
25392   /* "MACS2/IO/ScoreTrack.pyx":1503
25393  *             return self.data[chromosome]
25394  *         else:
25395  *             return None             # <<<<<<<<<<<<<<
25396  *
25397  *     cpdef get_chr_names (self):
25398  */
25399   /*else*/ {
25400     __Pyx_XDECREF(__pyx_r);
25401     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25402     goto __pyx_L0;
25403   }
25404 
25405   /* "MACS2/IO/ScoreTrack.pyx":1494
25406  *         return
25407  *
25408  *     cpdef get_data_by_chr (self, bytes chromosome):             # <<<<<<<<<<<<<<
25409  *         """Return array of counts by chromosome.
25410  *
25411  */
25412 
25413   /* function exit code */
25414   __pyx_L1_error:;
25415   __Pyx_XDECREF(__pyx_t_1);
25416   __Pyx_XDECREF(__pyx_t_2);
25417   __Pyx_XDECREF(__pyx_t_3);
25418   __Pyx_XDECREF(__pyx_t_4);
25419   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
25420   __pyx_r = 0;
25421   __pyx_L0:;
25422   __Pyx_XGIVEREF(__pyx_r);
25423   __Pyx_TraceReturn(__pyx_r, 0);
25424   __Pyx_RefNannyFinishContext();
25425   return __pyx_r;
25426 }
25427 
25428 /* Python wrapper */
25429 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_11get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome); /*proto*/
25430 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_10get_data_by_chr[] = "Return array of counts by chromosome.\n\n        The return value is a tuple:\n        ([end pos],[value])\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_11get_data_by_chr(PyObject * __pyx_v_self,PyObject * __pyx_v_chromosome)25431 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_11get_data_by_chr(PyObject *__pyx_v_self, PyObject *__pyx_v_chromosome) {
25432   PyObject *__pyx_r = 0;
25433   __Pyx_RefNannyDeclarations
25434   __Pyx_RefNannySetupContext("get_data_by_chr (wrapper)", 0);
25435   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chromosome), (&PyBytes_Type), 1, "chromosome", 1))) __PYX_ERR(0, 1494, __pyx_L1_error)
25436   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_10get_data_by_chr(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self), ((PyObject*)__pyx_v_chromosome));
25437 
25438   /* function exit code */
25439   goto __pyx_L0;
25440   __pyx_L1_error:;
25441   __pyx_r = NULL;
25442   __pyx_L0:;
25443   __Pyx_RefNannyFinishContext();
25444   return __pyx_r;
25445 }
25446 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_10get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_chromosome)25447 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_10get_data_by_chr(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_chromosome) {
25448   PyObject *__pyx_r = NULL;
25449   __Pyx_TraceDeclarations
25450   __Pyx_RefNannyDeclarations
25451   PyObject *__pyx_t_1 = NULL;
25452   __Pyx_RefNannySetupContext("get_data_by_chr", 0);
25453   __Pyx_TraceCall("get_data_by_chr (wrapper)", __pyx_f[0], 1494, 0, __PYX_ERR(0, 1494, __pyx_L1_error));
25454   __Pyx_XDECREF(__pyx_r);
25455   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_get_data_by_chr(__pyx_v_self, __pyx_v_chromosome, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error)
25456   __Pyx_GOTREF(__pyx_t_1);
25457   __pyx_r = __pyx_t_1;
25458   __pyx_t_1 = 0;
25459   goto __pyx_L0;
25460 
25461   /* function exit code */
25462   __pyx_L1_error:;
25463   __Pyx_XDECREF(__pyx_t_1);
25464   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.get_data_by_chr", __pyx_clineno, __pyx_lineno, __pyx_filename);
25465   __pyx_r = NULL;
25466   __pyx_L0:;
25467   __Pyx_XGIVEREF(__pyx_r);
25468   __Pyx_TraceReturn(__pyx_r, 0);
25469   __Pyx_RefNannyFinishContext();
25470   return __pyx_r;
25471 }
25472 
25473 /* "MACS2/IO/ScoreTrack.pyx":1505
25474  *             return None
25475  *
25476  *     cpdef get_chr_names (self):             # <<<<<<<<<<<<<<
25477  *         """Return all the chromosome names stored.
25478  *
25479  */
25480 
25481 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_13get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,int __pyx_skip_dispatch)25482 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch) {
25483   PyObject *__pyx_v_l = NULL;
25484   PyObject *__pyx_r = NULL;
25485   __Pyx_TraceDeclarations
25486   __Pyx_RefNannyDeclarations
25487   PyObject *__pyx_t_1 = NULL;
25488   PyObject *__pyx_t_2 = NULL;
25489   PyObject *__pyx_t_3 = NULL;
25490   PyObject *__pyx_t_4 = NULL;
25491   __Pyx_RefNannySetupContext("get_chr_names", 0);
25492   __Pyx_TraceCall("get_chr_names", __pyx_f[0], 1505, 0, __PYX_ERR(0, 1505, __pyx_L1_error));
25493   /* Check if called by wrapper */
25494   if (unlikely(__pyx_skip_dispatch)) ;
25495   /* Check if overridden in Python */
25496   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
25497     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
25498     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
25499     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
25500       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
25501       #endif
25502       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_chr_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1505, __pyx_L1_error)
25503       __Pyx_GOTREF(__pyx_t_1);
25504       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_13get_chr_names)) {
25505         __Pyx_XDECREF(__pyx_r);
25506         __Pyx_INCREF(__pyx_t_1);
25507         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
25508         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
25509           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
25510           if (likely(__pyx_t_4)) {
25511             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
25512             __Pyx_INCREF(__pyx_t_4);
25513             __Pyx_INCREF(function);
25514             __Pyx_DECREF_SET(__pyx_t_3, function);
25515           }
25516         }
25517         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
25518         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25519         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1505, __pyx_L1_error)
25520         __Pyx_GOTREF(__pyx_t_2);
25521         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25522         __pyx_r = __pyx_t_2;
25523         __pyx_t_2 = 0;
25524         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25525         goto __pyx_L0;
25526       }
25527       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
25528       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
25529       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
25530       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
25531         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
25532       }
25533       #endif
25534       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25535       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
25536     }
25537     #endif
25538   }
25539 
25540   /* "MACS2/IO/ScoreTrack.pyx":1509
25541  *
25542  *         """
25543  *         l = set(self.data.keys())             # <<<<<<<<<<<<<<
25544  *         return l
25545  *
25546  */
25547   if (unlikely(__pyx_v_self->data == Py_None)) {
25548     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
25549     __PYX_ERR(0, 1509, __pyx_L1_error)
25550   }
25551   __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_self->data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1509, __pyx_L1_error)
25552   __Pyx_GOTREF(__pyx_t_1);
25553   __pyx_t_2 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1509, __pyx_L1_error)
25554   __Pyx_GOTREF(__pyx_t_2);
25555   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25556   __pyx_v_l = ((PyObject*)__pyx_t_2);
25557   __pyx_t_2 = 0;
25558 
25559   /* "MACS2/IO/ScoreTrack.pyx":1510
25560  *         """
25561  *         l = set(self.data.keys())
25562  *         return l             # <<<<<<<<<<<<<<
25563  *
25564  *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):
25565  */
25566   __Pyx_XDECREF(__pyx_r);
25567   __Pyx_INCREF(__pyx_v_l);
25568   __pyx_r = __pyx_v_l;
25569   goto __pyx_L0;
25570 
25571   /* "MACS2/IO/ScoreTrack.pyx":1505
25572  *             return None
25573  *
25574  *     cpdef get_chr_names (self):             # <<<<<<<<<<<<<<
25575  *         """Return all the chromosome names stored.
25576  *
25577  */
25578 
25579   /* function exit code */
25580   __pyx_L1_error:;
25581   __Pyx_XDECREF(__pyx_t_1);
25582   __Pyx_XDECREF(__pyx_t_2);
25583   __Pyx_XDECREF(__pyx_t_3);
25584   __Pyx_XDECREF(__pyx_t_4);
25585   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
25586   __pyx_r = 0;
25587   __pyx_L0:;
25588   __Pyx_XDECREF(__pyx_v_l);
25589   __Pyx_XGIVEREF(__pyx_r);
25590   __Pyx_TraceReturn(__pyx_r, 0);
25591   __Pyx_RefNannyFinishContext();
25592   return __pyx_r;
25593 }
25594 
25595 /* Python wrapper */
25596 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_13get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
25597 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_12get_chr_names[] = "Return all the chromosome names stored.\n        \n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_13get_chr_names(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)25598 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_13get_chr_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
25599   PyObject *__pyx_r = 0;
25600   __Pyx_RefNannyDeclarations
25601   __Pyx_RefNannySetupContext("get_chr_names (wrapper)", 0);
25602   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_12get_chr_names(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self));
25603 
25604   /* function exit code */
25605   __Pyx_RefNannyFinishContext();
25606   return __pyx_r;
25607 }
25608 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_12get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self)25609 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_12get_chr_names(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self) {
25610   PyObject *__pyx_r = NULL;
25611   __Pyx_TraceDeclarations
25612   __Pyx_RefNannyDeclarations
25613   PyObject *__pyx_t_1 = NULL;
25614   __Pyx_RefNannySetupContext("get_chr_names", 0);
25615   __Pyx_TraceCall("get_chr_names (wrapper)", __pyx_f[0], 1505, 0, __PYX_ERR(0, 1505, __pyx_L1_error));
25616   __Pyx_XDECREF(__pyx_r);
25617   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_get_chr_names(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1505, __pyx_L1_error)
25618   __Pyx_GOTREF(__pyx_t_1);
25619   __pyx_r = __pyx_t_1;
25620   __pyx_t_1 = 0;
25621   goto __pyx_L0;
25622 
25623   /* function exit code */
25624   __pyx_L1_error:;
25625   __Pyx_XDECREF(__pyx_t_1);
25626   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.get_chr_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
25627   __pyx_r = NULL;
25628   __pyx_L0:;
25629   __Pyx_XGIVEREF(__pyx_r);
25630   __Pyx_TraceReturn(__pyx_r, 0);
25631   __Pyx_RefNannyFinishContext();
25632   return __pyx_r;
25633 }
25634 
25635 /* "MACS2/IO/ScoreTrack.pyx":1512
25636  *         return l
25637  *
25638  *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
25639  *         """Write all data to fhd in bedGraph Format.
25640  *
25641  */
25642 
25643 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_fhd,CYTHON_UNUSED PyObject * __pyx_v_name,CYTHON_UNUSED PyObject * __pyx_v_description,int __pyx_skip_dispatch,struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph * __pyx_optional_args)25644 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_description, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph *__pyx_optional_args) {
25645   short __pyx_v_column = ((short)3);
25646   PyObject *__pyx_v_chrom = 0;
25647   __pyx_t_5numpy_int32_t __pyx_v_l;
25648   __pyx_t_5numpy_int32_t __pyx_v_pre;
25649   __pyx_t_5numpy_int32_t __pyx_v_i;
25650   __pyx_t_5numpy_int32_t __pyx_v_p;
25651   __pyx_t_5numpy_float64_t __pyx_v_pre_v;
25652   __pyx_t_5numpy_float64_t __pyx_v_v;
25653   PyArrayObject *__pyx_v_pos = 0;
25654   PyArrayObject *__pyx_v_value = 0;
25655   PyObject *__pyx_v_write = NULL;
25656   PyObject *__pyx_v_chrs = NULL;
25657   PyObject *__pyx_r = NULL;
25658   __Pyx_TraceDeclarations
25659   __Pyx_RefNannyDeclarations
25660   PyObject *__pyx_t_1 = NULL;
25661   PyObject *__pyx_t_2 = NULL;
25662   PyObject *__pyx_t_3 = NULL;
25663   PyObject *__pyx_t_4 = NULL;
25664   PyObject *__pyx_t_5 = NULL;
25665   int __pyx_t_6;
25666   PyObject *__pyx_t_7 = NULL;
25667   int __pyx_t_8;
25668   Py_ssize_t __pyx_t_9;
25669   PyObject *(*__pyx_t_10)(PyObject *);
25670   __pyx_t_5numpy_int32_t __pyx_t_11;
25671   __pyx_t_5numpy_float64_t __pyx_t_12;
25672   __pyx_t_5numpy_int32_t __pyx_t_13;
25673   __pyx_t_5numpy_int32_t __pyx_t_14;
25674   long __pyx_t_15;
25675   __pyx_t_5numpy_int32_t __pyx_t_16;
25676   Py_ssize_t __pyx_t_17;
25677   Py_UCS4 __pyx_t_18;
25678   __Pyx_RefNannySetupContext("write_bedGraph", 0);
25679   __Pyx_TraceCall("write_bedGraph", __pyx_f[0], 1512, 0, __PYX_ERR(0, 1512, __pyx_L1_error));
25680   if (__pyx_optional_args) {
25681     if (__pyx_optional_args->__pyx_n > 0) {
25682       __pyx_v_column = __pyx_optional_args->column;
25683     }
25684   }
25685   /* Check if called by wrapper */
25686   if (unlikely(__pyx_skip_dispatch)) ;
25687   /* Check if overridden in Python */
25688   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
25689     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
25690     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
25691     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
25692       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
25693       #endif
25694       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_bedGraph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error)
25695       __Pyx_GOTREF(__pyx_t_1);
25696       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15write_bedGraph)) {
25697         __Pyx_XDECREF(__pyx_r);
25698         __pyx_t_3 = __Pyx_PyInt_From_short(__pyx_v_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1512, __pyx_L1_error)
25699         __Pyx_GOTREF(__pyx_t_3);
25700         __Pyx_INCREF(__pyx_t_1);
25701         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
25702         __pyx_t_6 = 0;
25703         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
25704           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
25705           if (likely(__pyx_t_5)) {
25706             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
25707             __Pyx_INCREF(__pyx_t_5);
25708             __Pyx_INCREF(function);
25709             __Pyx_DECREF_SET(__pyx_t_4, function);
25710             __pyx_t_6 = 1;
25711           }
25712         }
25713         #if CYTHON_FAST_PYCALL
25714         if (PyFunction_Check(__pyx_t_4)) {
25715           PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_t_3};
25716           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1512, __pyx_L1_error)
25717           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25718           __Pyx_GOTREF(__pyx_t_2);
25719           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25720         } else
25721         #endif
25722         #if CYTHON_FAST_PYCCALL
25723         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
25724           PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_t_3};
25725           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1512, __pyx_L1_error)
25726           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25727           __Pyx_GOTREF(__pyx_t_2);
25728           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25729         } else
25730         #endif
25731         {
25732           __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1512, __pyx_L1_error)
25733           __Pyx_GOTREF(__pyx_t_7);
25734           if (__pyx_t_5) {
25735             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
25736           }
25737           __Pyx_INCREF(__pyx_v_fhd);
25738           __Pyx_GIVEREF(__pyx_v_fhd);
25739           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_fhd);
25740           __Pyx_INCREF(__pyx_v_name);
25741           __Pyx_GIVEREF(__pyx_v_name);
25742           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name);
25743           __Pyx_INCREF(__pyx_v_description);
25744           __Pyx_GIVEREF(__pyx_v_description);
25745           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_description);
25746           __Pyx_GIVEREF(__pyx_t_3);
25747           PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_t_3);
25748           __pyx_t_3 = 0;
25749           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1512, __pyx_L1_error)
25750           __Pyx_GOTREF(__pyx_t_2);
25751           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25752         }
25753         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25754         __pyx_r = __pyx_t_2;
25755         __pyx_t_2 = 0;
25756         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25757         goto __pyx_L0;
25758       }
25759       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
25760       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
25761       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
25762       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
25763         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
25764       }
25765       #endif
25766       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25767       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
25768     }
25769     #endif
25770   }
25771 
25772   /* "MACS2/IO/ScoreTrack.pyx":1528
25773  *             np.ndarray pos, value
25774  *
25775  *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."             # <<<<<<<<<<<<<<
25776  *
25777  *         write = fhd.write
25778  */
25779   #ifndef CYTHON_WITHOUT_ASSERTIONS
25780   if (unlikely(!Py_OptimizeFlag)) {
25781     __pyx_t_1 = __Pyx_PyInt_From_short(__pyx_v_column); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __pyx_L1_error)
25782     __Pyx_GOTREF(__pyx_t_1);
25783     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1528, __pyx_L1_error)
25784     __Pyx_GOTREF(__pyx_t_2);
25785     __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1528, __pyx_L1_error)
25786     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25787     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25788     if (unlikely(!(__pyx_t_8 != 0))) {
25789       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_column_should_be_between_1_2_or);
25790       __PYX_ERR(0, 1528, __pyx_L1_error)
25791     }
25792   }
25793   #endif
25794 
25795   /* "MACS2/IO/ScoreTrack.pyx":1530
25796  *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."
25797  *
25798  *         write = fhd.write             # <<<<<<<<<<<<<<
25799  *
25800  *         #if self.trackline:
25801  */
25802   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fhd, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1530, __pyx_L1_error)
25803   __Pyx_GOTREF(__pyx_t_2);
25804   __pyx_v_write = __pyx_t_2;
25805   __pyx_t_2 = 0;
25806 
25807   /* "MACS2/IO/ScoreTrack.pyx":1536
25808  *         #    write( "track type=bedGraph name=\"%s\" description=\"%s\"\n" % ( name.decode(), description ) )
25809  *
25810  *         chrs = self.get_chr_names()             # <<<<<<<<<<<<<<
25811  *         for chrom in chrs:
25812  *             pos = self.data[ chrom ][ 0 ]
25813  */
25814   __pyx_t_2 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1536, __pyx_L1_error)
25815   __Pyx_GOTREF(__pyx_t_2);
25816   __pyx_v_chrs = __pyx_t_2;
25817   __pyx_t_2 = 0;
25818 
25819   /* "MACS2/IO/ScoreTrack.pyx":1537
25820  *
25821  *         chrs = self.get_chr_names()
25822  *         for chrom in chrs:             # <<<<<<<<<<<<<<
25823  *             pos = self.data[ chrom ][ 0 ]
25824  *             value = self.data[ chrom ][ column ]
25825  */
25826   if (likely(PyList_CheckExact(__pyx_v_chrs)) || PyTuple_CheckExact(__pyx_v_chrs)) {
25827     __pyx_t_2 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
25828     __pyx_t_10 = NULL;
25829   } else {
25830     __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1537, __pyx_L1_error)
25831     __Pyx_GOTREF(__pyx_t_2);
25832     __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1537, __pyx_L1_error)
25833   }
25834   for (;;) {
25835     if (likely(!__pyx_t_10)) {
25836       if (likely(PyList_CheckExact(__pyx_t_2))) {
25837         if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break;
25838         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25839         __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1537, __pyx_L1_error)
25840         #else
25841         __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1537, __pyx_L1_error)
25842         __Pyx_GOTREF(__pyx_t_1);
25843         #endif
25844       } else {
25845         if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
25846         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25847         __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1537, __pyx_L1_error)
25848         #else
25849         __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1537, __pyx_L1_error)
25850         __Pyx_GOTREF(__pyx_t_1);
25851         #endif
25852       }
25853     } else {
25854       __pyx_t_1 = __pyx_t_10(__pyx_t_2);
25855       if (unlikely(!__pyx_t_1)) {
25856         PyObject* exc_type = PyErr_Occurred();
25857         if (exc_type) {
25858           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
25859           else __PYX_ERR(0, 1537, __pyx_L1_error)
25860         }
25861         break;
25862       }
25863       __Pyx_GOTREF(__pyx_t_1);
25864     }
25865     if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1537, __pyx_L1_error)
25866     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_1));
25867     __pyx_t_1 = 0;
25868 
25869     /* "MACS2/IO/ScoreTrack.pyx":1538
25870  *         chrs = self.get_chr_names()
25871  *         for chrom in chrs:
25872  *             pos = self.data[ chrom ][ 0 ]             # <<<<<<<<<<<<<<
25873  *             value = self.data[ chrom ][ column ]
25874  *             l = self.datalength[ chrom ]
25875  */
25876     if (unlikely(__pyx_v_self->data == Py_None)) {
25877       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25878       __PYX_ERR(0, 1538, __pyx_L1_error)
25879     }
25880     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error)
25881     __Pyx_GOTREF(__pyx_t_1);
25882     __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1538, __pyx_L1_error)
25883     __Pyx_GOTREF(__pyx_t_4);
25884     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25885     if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1538, __pyx_L1_error)
25886     __Pyx_XDECREF_SET(__pyx_v_pos, ((PyArrayObject *)__pyx_t_4));
25887     __pyx_t_4 = 0;
25888 
25889     /* "MACS2/IO/ScoreTrack.pyx":1539
25890  *         for chrom in chrs:
25891  *             pos = self.data[ chrom ][ 0 ]
25892  *             value = self.data[ chrom ][ column ]             # <<<<<<<<<<<<<<
25893  *             l = self.datalength[ chrom ]
25894  *             pre = 0
25895  */
25896     if (unlikely(__pyx_v_self->data == Py_None)) {
25897       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25898       __PYX_ERR(0, 1539, __pyx_L1_error)
25899     }
25900     __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1539, __pyx_L1_error)
25901     __Pyx_GOTREF(__pyx_t_4);
25902     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_column, short, 1, __Pyx_PyInt_From_short, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error)
25903     __Pyx_GOTREF(__pyx_t_1);
25904     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25905     if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1539, __pyx_L1_error)
25906     __Pyx_XDECREF_SET(__pyx_v_value, ((PyArrayObject *)__pyx_t_1));
25907     __pyx_t_1 = 0;
25908 
25909     /* "MACS2/IO/ScoreTrack.pyx":1540
25910  *             pos = self.data[ chrom ][ 0 ]
25911  *             value = self.data[ chrom ][ column ]
25912  *             l = self.datalength[ chrom ]             # <<<<<<<<<<<<<<
25913  *             pre = 0
25914  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
25915  */
25916     if (unlikely(__pyx_v_self->datalength == Py_None)) {
25917       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25918       __PYX_ERR(0, 1540, __pyx_L1_error)
25919     }
25920     __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error)
25921     __Pyx_GOTREF(__pyx_t_1);
25922     __pyx_t_11 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_11 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1540, __pyx_L1_error)
25923     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25924     __pyx_v_l = __pyx_t_11;
25925 
25926     /* "MACS2/IO/ScoreTrack.pyx":1541
25927  *             value = self.data[ chrom ][ column ]
25928  *             l = self.datalength[ chrom ]
25929  *             pre = 0             # <<<<<<<<<<<<<<
25930  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
25931  *             pre_v = value[ 0 ]
25932  */
25933     __pyx_v_pre = 0;
25934 
25935     /* "MACS2/IO/ScoreTrack.pyx":1542
25936  *             l = self.datalength[ chrom ]
25937  *             pre = 0
25938  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data             # <<<<<<<<<<<<<<
25939  *             pre_v = value[ 0 ]
25940  *             for i in range( 1, l ):
25941  */
25942     __pyx_t_8 = (((__pyx_v_pos->dimensions[0]) == 0) != 0);
25943     if (__pyx_t_8) {
25944       goto __pyx_L3_continue;
25945     }
25946 
25947     /* "MACS2/IO/ScoreTrack.pyx":1543
25948  *             pre = 0
25949  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
25950  *             pre_v = value[ 0 ]             # <<<<<<<<<<<<<<
25951  *             for i in range( 1, l ):
25952  *                 v = value[ i ]
25953  */
25954     __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
25955     __Pyx_GOTREF(__pyx_t_1);
25956     __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1543, __pyx_L1_error)
25957     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25958     __pyx_v_pre_v = __pyx_t_12;
25959 
25960     /* "MACS2/IO/ScoreTrack.pyx":1544
25961  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
25962  *             pre_v = value[ 0 ]
25963  *             for i in range( 1, l ):             # <<<<<<<<<<<<<<
25964  *                 v = value[ i ]
25965  *                 p = pos[ i-1 ]
25966  */
25967     __pyx_t_11 = __pyx_v_l;
25968     __pyx_t_13 = __pyx_t_11;
25969     for (__pyx_t_14 = 1; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
25970       __pyx_v_i = __pyx_t_14;
25971 
25972       /* "MACS2/IO/ScoreTrack.pyx":1545
25973  *             pre_v = value[ 0 ]
25974  *             for i in range( 1, l ):
25975  *                 v = value[ i ]             # <<<<<<<<<<<<<<
25976  *                 p = pos[ i-1 ]
25977  *                 if abs(pre_v - v)>=1e-6:
25978  */
25979       __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __pyx_L1_error)
25980       __Pyx_GOTREF(__pyx_t_1);
25981       __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1545, __pyx_L1_error)
25982       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25983       __pyx_v_v = __pyx_t_12;
25984 
25985       /* "MACS2/IO/ScoreTrack.pyx":1546
25986  *             for i in range( 1, l ):
25987  *                 v = value[ i ]
25988  *                 p = pos[ i-1 ]             # <<<<<<<<<<<<<<
25989  *                 if abs(pre_v - v)>=1e-6:
25990  *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
25991  */
25992       __pyx_t_15 = (__pyx_v_i - 1);
25993       __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), __pyx_t_15, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1546, __pyx_L1_error)
25994       __Pyx_GOTREF(__pyx_t_1);
25995       __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1546, __pyx_L1_error)
25996       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25997       __pyx_v_p = __pyx_t_16;
25998 
25999       /* "MACS2/IO/ScoreTrack.pyx":1547
26000  *                 v = value[ i ]
26001  *                 p = pos[ i-1 ]
26002  *                 if abs(pre_v - v)>=1e-6:             # <<<<<<<<<<<<<<
26003  *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
26004  *                     pre_v = v
26005  */
26006       __pyx_t_8 = ((fabs((__pyx_v_pre_v - __pyx_v_v)) >= 1e-6) != 0);
26007       if (__pyx_t_8) {
26008 
26009         /* "MACS2/IO/ScoreTrack.pyx":1548
26010  *                 p = pos[ i-1 ]
26011  *                 if abs(pre_v - v)>=1e-6:
26012  *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )             # <<<<<<<<<<<<<<
26013  *                     pre_v = v
26014  *                     pre = p
26015  */
26016         __pyx_t_4 = PyTuple_New(8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1548, __pyx_L1_error)
26017         __Pyx_GOTREF(__pyx_t_4);
26018         __pyx_t_17 = 0;
26019         __pyx_t_18 = 127;
26020         if (unlikely(__pyx_v_chrom == Py_None)) {
26021           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
26022           __PYX_ERR(0, 1548, __pyx_L1_error)
26023         }
26024         __pyx_t_7 = __Pyx_decode_bytes(__pyx_v_chrom, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1548, __pyx_L1_error)
26025         __Pyx_GOTREF(__pyx_t_7);
26026         __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_18;
26027         __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
26028         __Pyx_GIVEREF(__pyx_t_7);
26029         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
26030         __pyx_t_7 = 0;
26031         __Pyx_INCREF(__pyx_kp_u__11);
26032         __pyx_t_17 += 1;
26033         __Pyx_GIVEREF(__pyx_kp_u__11);
26034         PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u__11);
26035         __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_pre); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1548, __pyx_L1_error)
26036         __Pyx_GOTREF(__pyx_t_7);
26037         __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_7, __pyx_n_u_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error)
26038         __Pyx_GOTREF(__pyx_t_3);
26039         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26040         __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_18;
26041         __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
26042         __Pyx_GIVEREF(__pyx_t_3);
26043         PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
26044         __pyx_t_3 = 0;
26045         __Pyx_INCREF(__pyx_kp_u__11);
26046         __pyx_t_17 += 1;
26047         __Pyx_GIVEREF(__pyx_kp_u__11);
26048         PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_kp_u__11);
26049         __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error)
26050         __Pyx_GOTREF(__pyx_t_3);
26051         __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1548, __pyx_L1_error)
26052         __Pyx_GOTREF(__pyx_t_7);
26053         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26054         __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_18;
26055         __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
26056         __Pyx_GIVEREF(__pyx_t_7);
26057         PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_7);
26058         __pyx_t_7 = 0;
26059         __Pyx_INCREF(__pyx_kp_u__11);
26060         __pyx_t_17 += 1;
26061         __Pyx_GIVEREF(__pyx_kp_u__11);
26062         PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_kp_u__11);
26063         __pyx_t_7 = PyFloat_FromDouble(__pyx_v_pre_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1548, __pyx_L1_error)
26064         __Pyx_GOTREF(__pyx_t_7);
26065         __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_7, __pyx_kp_u_5f); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error)
26066         __Pyx_GOTREF(__pyx_t_3);
26067         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26068         __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_18;
26069         __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
26070         __Pyx_GIVEREF(__pyx_t_3);
26071         PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_3);
26072         __pyx_t_3 = 0;
26073         __Pyx_INCREF(__pyx_kp_u__12);
26074         __pyx_t_17 += 1;
26075         __Pyx_GIVEREF(__pyx_kp_u__12);
26076         PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_kp_u__12);
26077         __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 8, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error)
26078         __Pyx_GOTREF(__pyx_t_3);
26079         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26080         __Pyx_INCREF(__pyx_v_write);
26081         __pyx_t_4 = __pyx_v_write; __pyx_t_7 = NULL;
26082         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
26083           __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
26084           if (likely(__pyx_t_7)) {
26085             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
26086             __Pyx_INCREF(__pyx_t_7);
26087             __Pyx_INCREF(function);
26088             __Pyx_DECREF_SET(__pyx_t_4, function);
26089           }
26090         }
26091         __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
26092         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
26093         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26094         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1548, __pyx_L1_error)
26095         __Pyx_GOTREF(__pyx_t_1);
26096         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26097         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26098 
26099         /* "MACS2/IO/ScoreTrack.pyx":1549
26100  *                 if abs(pre_v - v)>=1e-6:
26101  *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
26102  *                     pre_v = v             # <<<<<<<<<<<<<<
26103  *                     pre = p
26104  *             p = pos[ -1 ]
26105  */
26106         __pyx_v_pre_v = __pyx_v_v;
26107 
26108         /* "MACS2/IO/ScoreTrack.pyx":1550
26109  *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
26110  *                     pre_v = v
26111  *                     pre = p             # <<<<<<<<<<<<<<
26112  *             p = pos[ -1 ]
26113  *             # last one
26114  */
26115         __pyx_v_pre = __pyx_v_p;
26116 
26117         /* "MACS2/IO/ScoreTrack.pyx":1547
26118  *                 v = value[ i ]
26119  *                 p = pos[ i-1 ]
26120  *                 if abs(pre_v - v)>=1e-6:             # <<<<<<<<<<<<<<
26121  *                     write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
26122  *                     pre_v = v
26123  */
26124       }
26125     }
26126 
26127     /* "MACS2/IO/ScoreTrack.pyx":1551
26128  *                     pre_v = v
26129  *                     pre = p
26130  *             p = pos[ -1 ]             # <<<<<<<<<<<<<<
26131  *             # last one
26132  *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
26133  */
26134     __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __pyx_L1_error)
26135     __Pyx_GOTREF(__pyx_t_1);
26136     __pyx_t_11 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_11 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1551, __pyx_L1_error)
26137     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26138     __pyx_v_p = __pyx_t_11;
26139 
26140     /* "MACS2/IO/ScoreTrack.pyx":1553
26141  *             p = pos[ -1 ]
26142  *             # last one
26143  *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )             # <<<<<<<<<<<<<<
26144  *
26145  *         return True
26146  */
26147     __pyx_t_4 = PyTuple_New(8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1553, __pyx_L1_error)
26148     __Pyx_GOTREF(__pyx_t_4);
26149     __pyx_t_17 = 0;
26150     __pyx_t_18 = 127;
26151     if (unlikely(__pyx_v_chrom == Py_None)) {
26152       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
26153       __PYX_ERR(0, 1553, __pyx_L1_error)
26154     }
26155     __pyx_t_3 = __Pyx_decode_bytes(__pyx_v_chrom, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1553, __pyx_L1_error)
26156     __Pyx_GOTREF(__pyx_t_3);
26157     __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_18;
26158     __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
26159     __Pyx_GIVEREF(__pyx_t_3);
26160     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
26161     __pyx_t_3 = 0;
26162     __Pyx_INCREF(__pyx_kp_u__11);
26163     __pyx_t_17 += 1;
26164     __Pyx_GIVEREF(__pyx_kp_u__11);
26165     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u__11);
26166     __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_pre); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1553, __pyx_L1_error)
26167     __Pyx_GOTREF(__pyx_t_3);
26168     __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1553, __pyx_L1_error)
26169     __Pyx_GOTREF(__pyx_t_7);
26170     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26171     __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_18;
26172     __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
26173     __Pyx_GIVEREF(__pyx_t_7);
26174     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_7);
26175     __pyx_t_7 = 0;
26176     __Pyx_INCREF(__pyx_kp_u__11);
26177     __pyx_t_17 += 1;
26178     __Pyx_GIVEREF(__pyx_kp_u__11);
26179     PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_kp_u__11);
26180     __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_p); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1553, __pyx_L1_error)
26181     __Pyx_GOTREF(__pyx_t_7);
26182     __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_7, __pyx_n_u_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1553, __pyx_L1_error)
26183     __Pyx_GOTREF(__pyx_t_3);
26184     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26185     __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_18;
26186     __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
26187     __Pyx_GIVEREF(__pyx_t_3);
26188     PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_3);
26189     __pyx_t_3 = 0;
26190     __Pyx_INCREF(__pyx_kp_u__11);
26191     __pyx_t_17 += 1;
26192     __Pyx_GIVEREF(__pyx_kp_u__11);
26193     PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_kp_u__11);
26194     __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pre_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1553, __pyx_L1_error)
26195     __Pyx_GOTREF(__pyx_t_3);
26196     __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_kp_u_5f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1553, __pyx_L1_error)
26197     __Pyx_GOTREF(__pyx_t_7);
26198     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26199     __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_18;
26200     __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
26201     __Pyx_GIVEREF(__pyx_t_7);
26202     PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_7);
26203     __pyx_t_7 = 0;
26204     __Pyx_INCREF(__pyx_kp_u__12);
26205     __pyx_t_17 += 1;
26206     __Pyx_GIVEREF(__pyx_kp_u__12);
26207     PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_kp_u__12);
26208     __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 8, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1553, __pyx_L1_error)
26209     __Pyx_GOTREF(__pyx_t_7);
26210     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26211     __Pyx_INCREF(__pyx_v_write);
26212     __pyx_t_4 = __pyx_v_write; __pyx_t_3 = NULL;
26213     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
26214       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
26215       if (likely(__pyx_t_3)) {
26216         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
26217         __Pyx_INCREF(__pyx_t_3);
26218         __Pyx_INCREF(function);
26219         __Pyx_DECREF_SET(__pyx_t_4, function);
26220       }
26221     }
26222     __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7);
26223     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26224     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26225     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __pyx_L1_error)
26226     __Pyx_GOTREF(__pyx_t_1);
26227     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26228     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26229 
26230     /* "MACS2/IO/ScoreTrack.pyx":1537
26231  *
26232  *         chrs = self.get_chr_names()
26233  *         for chrom in chrs:             # <<<<<<<<<<<<<<
26234  *             pos = self.data[ chrom ][ 0 ]
26235  *             value = self.data[ chrom ][ column ]
26236  */
26237     __pyx_L3_continue:;
26238   }
26239   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26240 
26241   /* "MACS2/IO/ScoreTrack.pyx":1555
26242  *             write( "%s\t%d\t%d\t%.5f\n" % ( chrom.decode(), pre, p, pre_v ) )
26243  *
26244  *         return True             # <<<<<<<<<<<<<<
26245  *
26246  *     cpdef write_matrix ( self, fhd, str name, str description ):
26247  */
26248   __Pyx_XDECREF(__pyx_r);
26249   __Pyx_INCREF(Py_True);
26250   __pyx_r = Py_True;
26251   goto __pyx_L0;
26252 
26253   /* "MACS2/IO/ScoreTrack.pyx":1512
26254  *         return l
26255  *
26256  *     cpdef write_bedGraph ( self, fhd, str name, str description, short column = 3):             # <<<<<<<<<<<<<<
26257  *         """Write all data to fhd in bedGraph Format.
26258  *
26259  */
26260 
26261   /* function exit code */
26262   __pyx_L1_error:;
26263   __Pyx_XDECREF(__pyx_t_1);
26264   __Pyx_XDECREF(__pyx_t_2);
26265   __Pyx_XDECREF(__pyx_t_3);
26266   __Pyx_XDECREF(__pyx_t_4);
26267   __Pyx_XDECREF(__pyx_t_5);
26268   __Pyx_XDECREF(__pyx_t_7);
26269   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
26270   __pyx_r = 0;
26271   __pyx_L0:;
26272   __Pyx_XDECREF(__pyx_v_chrom);
26273   __Pyx_XDECREF((PyObject *)__pyx_v_pos);
26274   __Pyx_XDECREF((PyObject *)__pyx_v_value);
26275   __Pyx_XDECREF(__pyx_v_write);
26276   __Pyx_XDECREF(__pyx_v_chrs);
26277   __Pyx_XGIVEREF(__pyx_r);
26278   __Pyx_TraceReturn(__pyx_r, 0);
26279   __Pyx_RefNannyFinishContext();
26280   return __pyx_r;
26281 }
26282 
26283 /* Python wrapper */
26284 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26285 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_14write_bedGraph[] = "Write all data to fhd in bedGraph Format.\n\n        fhd: a filehandler to save bedGraph.\n\n        name/description: the name and description in track line.\n\n        colname: can be 1: cond1 chip vs cond1 ctrl, 2: cond2 chip vs cond2 ctrl, 3: cond1 chip vs cond2 chip\n\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15write_bedGraph(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)26286 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15write_bedGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26287   PyObject *__pyx_v_fhd = 0;
26288   PyObject *__pyx_v_name = 0;
26289   PyObject *__pyx_v_description = 0;
26290   short __pyx_v_column;
26291   PyObject *__pyx_r = 0;
26292   __Pyx_RefNannyDeclarations
26293   __Pyx_RefNannySetupContext("write_bedGraph (wrapper)", 0);
26294   {
26295     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fhd,&__pyx_n_s_name,&__pyx_n_s_description,&__pyx_n_s_column,0};
26296     PyObject* values[4] = {0,0,0,0};
26297     if (unlikely(__pyx_kwds)) {
26298       Py_ssize_t kw_args;
26299       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26300       switch (pos_args) {
26301         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
26302         CYTHON_FALLTHROUGH;
26303         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26304         CYTHON_FALLTHROUGH;
26305         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26306         CYTHON_FALLTHROUGH;
26307         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26308         CYTHON_FALLTHROUGH;
26309         case  0: break;
26310         default: goto __pyx_L5_argtuple_error;
26311       }
26312       kw_args = PyDict_Size(__pyx_kwds);
26313       switch (pos_args) {
26314         case  0:
26315         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fhd)) != 0)) kw_args--;
26316         else goto __pyx_L5_argtuple_error;
26317         CYTHON_FALLTHROUGH;
26318         case  1:
26319         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
26320         else {
26321           __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, 1); __PYX_ERR(0, 1512, __pyx_L3_error)
26322         }
26323         CYTHON_FALLTHROUGH;
26324         case  2:
26325         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_description)) != 0)) kw_args--;
26326         else {
26327           __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, 2); __PYX_ERR(0, 1512, __pyx_L3_error)
26328         }
26329         CYTHON_FALLTHROUGH;
26330         case  3:
26331         if (kw_args > 0) {
26332           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column);
26333           if (value) { values[3] = value; kw_args--; }
26334         }
26335       }
26336       if (unlikely(kw_args > 0)) {
26337         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bedGraph") < 0)) __PYX_ERR(0, 1512, __pyx_L3_error)
26338       }
26339     } else {
26340       switch (PyTuple_GET_SIZE(__pyx_args)) {
26341         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
26342         CYTHON_FALLTHROUGH;
26343         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26344         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26345         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26346         break;
26347         default: goto __pyx_L5_argtuple_error;
26348       }
26349     }
26350     __pyx_v_fhd = values[0];
26351     __pyx_v_name = ((PyObject*)values[1]);
26352     __pyx_v_description = ((PyObject*)values[2]);
26353     if (values[3]) {
26354       __pyx_v_column = __Pyx_PyInt_As_short(values[3]); if (unlikely((__pyx_v_column == (short)-1) && PyErr_Occurred())) __PYX_ERR(0, 1512, __pyx_L3_error)
26355     } else {
26356       __pyx_v_column = ((short)3);
26357     }
26358   }
26359   goto __pyx_L4_argument_unpacking_done;
26360   __pyx_L5_argtuple_error:;
26361   __Pyx_RaiseArgtupleInvalid("write_bedGraph", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1512, __pyx_L3_error)
26362   __pyx_L3_error:;
26363   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
26364   __Pyx_RefNannyFinishContext();
26365   return NULL;
26366   __pyx_L4_argument_unpacking_done:;
26367   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 1512, __pyx_L1_error)
26368   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_description), (&PyUnicode_Type), 1, "description", 1))) __PYX_ERR(0, 1512, __pyx_L1_error)
26369   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_14write_bedGraph(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self), __pyx_v_fhd, __pyx_v_name, __pyx_v_description, __pyx_v_column);
26370 
26371   /* function exit code */
26372   goto __pyx_L0;
26373   __pyx_L1_error:;
26374   __pyx_r = NULL;
26375   __pyx_L0:;
26376   __Pyx_RefNannyFinishContext();
26377   return __pyx_r;
26378 }
26379 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_14write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_fhd,PyObject * __pyx_v_name,PyObject * __pyx_v_description,short __pyx_v_column)26380 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_14write_bedGraph(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description, short __pyx_v_column) {
26381   PyObject *__pyx_r = NULL;
26382   __Pyx_TraceDeclarations
26383   __Pyx_RefNannyDeclarations
26384   PyObject *__pyx_t_1 = NULL;
26385   struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph __pyx_t_2;
26386   __Pyx_RefNannySetupContext("write_bedGraph", 0);
26387   __Pyx_TraceCall("write_bedGraph (wrapper)", __pyx_f[0], 1512, 0, __PYX_ERR(0, 1512, __pyx_L1_error));
26388   __Pyx_XDECREF(__pyx_r);
26389   __pyx_t_2.__pyx_n = 1;
26390   __pyx_t_2.column = __pyx_v_column;
26391   __pyx_t_1 = __pyx_vtabptr_5MACS2_2IO_10ScoreTrack_TwoConditionScores->write_bedGraph(__pyx_v_self, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error)
26392   __Pyx_GOTREF(__pyx_t_1);
26393   __pyx_r = __pyx_t_1;
26394   __pyx_t_1 = 0;
26395   goto __pyx_L0;
26396 
26397   /* function exit code */
26398   __pyx_L1_error:;
26399   __Pyx_XDECREF(__pyx_t_1);
26400   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.write_bedGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
26401   __pyx_r = NULL;
26402   __pyx_L0:;
26403   __Pyx_XGIVEREF(__pyx_r);
26404   __Pyx_TraceReturn(__pyx_r, 0);
26405   __Pyx_RefNannyFinishContext();
26406   return __pyx_r;
26407 }
26408 
26409 /* "MACS2/IO/ScoreTrack.pyx":1557
26410  *         return True
26411  *
26412  *     cpdef write_matrix ( self, fhd, str name, str description ):             # <<<<<<<<<<<<<<
26413  *         """Write all data to fhd into five columns Format:
26414  *
26415  */
26416 
26417 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_17write_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_matrix(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_fhd,CYTHON_UNUSED PyObject * __pyx_v_name,CYTHON_UNUSED PyObject * __pyx_v_description,int __pyx_skip_dispatch)26418 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_matrix(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_description, int __pyx_skip_dispatch) {
26419   PyObject *__pyx_v_chrom = 0;
26420   __pyx_t_5numpy_int32_t __pyx_v_l;
26421   __pyx_t_5numpy_int32_t __pyx_v_pre;
26422   __pyx_t_5numpy_int32_t __pyx_v_i;
26423   __pyx_t_5numpy_int32_t __pyx_v_p;
26424   __pyx_t_5numpy_float64_t __pyx_v_v1;
26425   __pyx_t_5numpy_float64_t __pyx_v_v2;
26426   __pyx_t_5numpy_float64_t __pyx_v_v3;
26427   PyArrayObject *__pyx_v_pos = 0;
26428   PyArrayObject *__pyx_v_value1 = 0;
26429   PyArrayObject *__pyx_v_value2 = 0;
26430   PyArrayObject *__pyx_v_value3 = 0;
26431   PyObject *__pyx_v_write = NULL;
26432   PyObject *__pyx_v_chrs = NULL;
26433   PyObject *__pyx_r = NULL;
26434   __Pyx_TraceDeclarations
26435   __Pyx_RefNannyDeclarations
26436   PyObject *__pyx_t_1 = NULL;
26437   PyObject *__pyx_t_2 = NULL;
26438   PyObject *__pyx_t_3 = NULL;
26439   PyObject *__pyx_t_4 = NULL;
26440   int __pyx_t_5;
26441   PyObject *__pyx_t_6 = NULL;
26442   Py_ssize_t __pyx_t_7;
26443   PyObject *(*__pyx_t_8)(PyObject *);
26444   PyObject *__pyx_t_9 = NULL;
26445   PyObject *__pyx_t_10 = NULL;
26446   PyObject *(*__pyx_t_11)(PyObject *);
26447   __pyx_t_5numpy_int32_t __pyx_t_12;
26448   int __pyx_t_13;
26449   __pyx_t_5numpy_int32_t __pyx_t_14;
26450   __pyx_t_5numpy_int32_t __pyx_t_15;
26451   __pyx_t_5numpy_float64_t __pyx_t_16;
26452   __pyx_t_5numpy_int32_t __pyx_t_17;
26453   Py_ssize_t __pyx_t_18;
26454   Py_UCS4 __pyx_t_19;
26455   __Pyx_RefNannySetupContext("write_matrix", 0);
26456   __Pyx_TraceCall("write_matrix", __pyx_f[0], 1557, 0, __PYX_ERR(0, 1557, __pyx_L1_error));
26457   /* Check if called by wrapper */
26458   if (unlikely(__pyx_skip_dispatch)) ;
26459   /* Check if overridden in Python */
26460   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
26461     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
26462     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
26463     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
26464       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
26465       #endif
26466       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1557, __pyx_L1_error)
26467       __Pyx_GOTREF(__pyx_t_1);
26468       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_17write_matrix)) {
26469         __Pyx_XDECREF(__pyx_r);
26470         __Pyx_INCREF(__pyx_t_1);
26471         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
26472         __pyx_t_5 = 0;
26473         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
26474           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
26475           if (likely(__pyx_t_4)) {
26476             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
26477             __Pyx_INCREF(__pyx_t_4);
26478             __Pyx_INCREF(function);
26479             __Pyx_DECREF_SET(__pyx_t_3, function);
26480             __pyx_t_5 = 1;
26481           }
26482         }
26483         #if CYTHON_FAST_PYCALL
26484         if (PyFunction_Check(__pyx_t_3)) {
26485           PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_fhd, __pyx_v_name, __pyx_v_description};
26486           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error)
26487           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26488           __Pyx_GOTREF(__pyx_t_2);
26489         } else
26490         #endif
26491         #if CYTHON_FAST_PYCCALL
26492         if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
26493           PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_fhd, __pyx_v_name, __pyx_v_description};
26494           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error)
26495           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26496           __Pyx_GOTREF(__pyx_t_2);
26497         } else
26498         #endif
26499         {
26500           __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1557, __pyx_L1_error)
26501           __Pyx_GOTREF(__pyx_t_6);
26502           if (__pyx_t_4) {
26503             __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
26504           }
26505           __Pyx_INCREF(__pyx_v_fhd);
26506           __Pyx_GIVEREF(__pyx_v_fhd);
26507           PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_fhd);
26508           __Pyx_INCREF(__pyx_v_name);
26509           __Pyx_GIVEREF(__pyx_v_name);
26510           PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_name);
26511           __Pyx_INCREF(__pyx_v_description);
26512           __Pyx_GIVEREF(__pyx_v_description);
26513           PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_description);
26514           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error)
26515           __Pyx_GOTREF(__pyx_t_2);
26516           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26517         }
26518         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26519         __pyx_r = __pyx_t_2;
26520         __pyx_t_2 = 0;
26521         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26522         goto __pyx_L0;
26523       }
26524       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
26525       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
26526       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
26527       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
26528         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
26529       }
26530       #endif
26531       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26532       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
26533     }
26534     #endif
26535   }
26536 
26537   /* "MACS2/IO/ScoreTrack.pyx":1574
26538  *             np.ndarray pos, value1, value2, value3
26539  *
26540  *         write = fhd.write             # <<<<<<<<<<<<<<
26541  *
26542  *         chrs = self.get_chr_names()
26543  */
26544   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fhd, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error)
26545   __Pyx_GOTREF(__pyx_t_1);
26546   __pyx_v_write = __pyx_t_1;
26547   __pyx_t_1 = 0;
26548 
26549   /* "MACS2/IO/ScoreTrack.pyx":1576
26550  *         write = fhd.write
26551  *
26552  *         chrs = self.get_chr_names()             # <<<<<<<<<<<<<<
26553  *         for chrom in chrs:
26554  *             [ pos, value1, value2, value3 ] = self.data[ chrom ]
26555  */
26556   __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1576, __pyx_L1_error)
26557   __Pyx_GOTREF(__pyx_t_1);
26558   __pyx_v_chrs = __pyx_t_1;
26559   __pyx_t_1 = 0;
26560 
26561   /* "MACS2/IO/ScoreTrack.pyx":1577
26562  *
26563  *         chrs = self.get_chr_names()
26564  *         for chrom in chrs:             # <<<<<<<<<<<<<<
26565  *             [ pos, value1, value2, value3 ] = self.data[ chrom ]
26566  *             l = self.datalength[ chrom ]
26567  */
26568   if (likely(PyList_CheckExact(__pyx_v_chrs)) || PyTuple_CheckExact(__pyx_v_chrs)) {
26569     __pyx_t_1 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
26570     __pyx_t_8 = NULL;
26571   } else {
26572     __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1577, __pyx_L1_error)
26573     __Pyx_GOTREF(__pyx_t_1);
26574     __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1577, __pyx_L1_error)
26575   }
26576   for (;;) {
26577     if (likely(!__pyx_t_8)) {
26578       if (likely(PyList_CheckExact(__pyx_t_1))) {
26579         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
26580         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26581         __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1577, __pyx_L1_error)
26582         #else
26583         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1577, __pyx_L1_error)
26584         __Pyx_GOTREF(__pyx_t_2);
26585         #endif
26586       } else {
26587         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
26588         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26589         __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1577, __pyx_L1_error)
26590         #else
26591         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1577, __pyx_L1_error)
26592         __Pyx_GOTREF(__pyx_t_2);
26593         #endif
26594       }
26595     } else {
26596       __pyx_t_2 = __pyx_t_8(__pyx_t_1);
26597       if (unlikely(!__pyx_t_2)) {
26598         PyObject* exc_type = PyErr_Occurred();
26599         if (exc_type) {
26600           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
26601           else __PYX_ERR(0, 1577, __pyx_L1_error)
26602         }
26603         break;
26604       }
26605       __Pyx_GOTREF(__pyx_t_2);
26606     }
26607     if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1577, __pyx_L1_error)
26608     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_2));
26609     __pyx_t_2 = 0;
26610 
26611     /* "MACS2/IO/ScoreTrack.pyx":1578
26612  *         chrs = self.get_chr_names()
26613  *         for chrom in chrs:
26614  *             [ pos, value1, value2, value3 ] = self.data[ chrom ]             # <<<<<<<<<<<<<<
26615  *             l = self.datalength[ chrom ]
26616  *             pre = 0
26617  */
26618     if (unlikely(__pyx_v_self->data == Py_None)) {
26619       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
26620       __PYX_ERR(0, 1578, __pyx_L1_error)
26621     }
26622     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1578, __pyx_L1_error)
26623     __Pyx_GOTREF(__pyx_t_2);
26624     if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
26625       PyObject* sequence = __pyx_t_2;
26626       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
26627       if (unlikely(size != 4)) {
26628         if (size > 4) __Pyx_RaiseTooManyValuesError(4);
26629         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
26630         __PYX_ERR(0, 1578, __pyx_L1_error)
26631       }
26632       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26633       if (likely(PyTuple_CheckExact(sequence))) {
26634         __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
26635         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
26636         __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
26637         __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3);
26638       } else {
26639         __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
26640         __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
26641         __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
26642         __pyx_t_9 = PyList_GET_ITEM(sequence, 3);
26643       }
26644       __Pyx_INCREF(__pyx_t_3);
26645       __Pyx_INCREF(__pyx_t_6);
26646       __Pyx_INCREF(__pyx_t_4);
26647       __Pyx_INCREF(__pyx_t_9);
26648       #else
26649       {
26650         Py_ssize_t i;
26651         PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_6,&__pyx_t_4,&__pyx_t_9};
26652         for (i=0; i < 4; i++) {
26653           PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1578, __pyx_L1_error)
26654           __Pyx_GOTREF(item);
26655           *(temps[i]) = item;
26656         }
26657       }
26658       #endif
26659       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26660     } else {
26661       Py_ssize_t index = -1;
26662       PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_6,&__pyx_t_4,&__pyx_t_9};
26663       __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1578, __pyx_L1_error)
26664       __Pyx_GOTREF(__pyx_t_10);
26665       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26666       __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
26667       for (index=0; index < 4; index++) {
26668         PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
26669         __Pyx_GOTREF(item);
26670         *(temps[index]) = item;
26671       }
26672       if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 4) < 0) __PYX_ERR(0, 1578, __pyx_L1_error)
26673       __pyx_t_11 = NULL;
26674       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
26675       goto __pyx_L6_unpacking_done;
26676       __pyx_L5_unpacking_failed:;
26677       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
26678       __pyx_t_11 = NULL;
26679       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
26680       __PYX_ERR(0, 1578, __pyx_L1_error)
26681       __pyx_L6_unpacking_done:;
26682     }
26683     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1578, __pyx_L1_error)
26684     if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1578, __pyx_L1_error)
26685     if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1578, __pyx_L1_error)
26686     if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1578, __pyx_L1_error)
26687     __Pyx_XDECREF_SET(__pyx_v_pos, ((PyArrayObject *)__pyx_t_3));
26688     __pyx_t_3 = 0;
26689     __Pyx_XDECREF_SET(__pyx_v_value1, ((PyArrayObject *)__pyx_t_6));
26690     __pyx_t_6 = 0;
26691     __Pyx_XDECREF_SET(__pyx_v_value2, ((PyArrayObject *)__pyx_t_4));
26692     __pyx_t_4 = 0;
26693     __Pyx_XDECREF_SET(__pyx_v_value3, ((PyArrayObject *)__pyx_t_9));
26694     __pyx_t_9 = 0;
26695 
26696     /* "MACS2/IO/ScoreTrack.pyx":1579
26697  *         for chrom in chrs:
26698  *             [ pos, value1, value2, value3 ] = self.data[ chrom ]
26699  *             l = self.datalength[ chrom ]             # <<<<<<<<<<<<<<
26700  *             pre = 0
26701  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
26702  */
26703     if (unlikely(__pyx_v_self->datalength == Py_None)) {
26704       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
26705       __PYX_ERR(0, 1579, __pyx_L1_error)
26706     }
26707     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
26708     __Pyx_GOTREF(__pyx_t_2);
26709     __pyx_t_12 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_12 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1579, __pyx_L1_error)
26710     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26711     __pyx_v_l = __pyx_t_12;
26712 
26713     /* "MACS2/IO/ScoreTrack.pyx":1580
26714  *             [ pos, value1, value2, value3 ] = self.data[ chrom ]
26715  *             l = self.datalength[ chrom ]
26716  *             pre = 0             # <<<<<<<<<<<<<<
26717  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
26718  *             for i in range( 0, l ):
26719  */
26720     __pyx_v_pre = 0;
26721 
26722     /* "MACS2/IO/ScoreTrack.pyx":1581
26723  *             l = self.datalength[ chrom ]
26724  *             pre = 0
26725  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data             # <<<<<<<<<<<<<<
26726  *             for i in range( 0, l ):
26727  *                 v1 = value1[ i ]
26728  */
26729     __pyx_t_13 = (((__pyx_v_pos->dimensions[0]) == 0) != 0);
26730     if (__pyx_t_13) {
26731       goto __pyx_L3_continue;
26732     }
26733 
26734     /* "MACS2/IO/ScoreTrack.pyx":1582
26735  *             pre = 0
26736  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
26737  *             for i in range( 0, l ):             # <<<<<<<<<<<<<<
26738  *                 v1 = value1[ i ]
26739  *                 v2 = value2[ i ]
26740  */
26741     __pyx_t_12 = __pyx_v_l;
26742     __pyx_t_14 = __pyx_t_12;
26743     for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
26744       __pyx_v_i = __pyx_t_15;
26745 
26746       /* "MACS2/IO/ScoreTrack.pyx":1583
26747  *             if pos.shape[ 0 ] == 0: continue # skip if there's no data
26748  *             for i in range( 0, l ):
26749  *                 v1 = value1[ i ]             # <<<<<<<<<<<<<<
26750  *                 v2 = value2[ i ]
26751  *                 v3 = value3[ i ]
26752  */
26753       __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value1), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1583, __pyx_L1_error)
26754       __Pyx_GOTREF(__pyx_t_2);
26755       __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_16 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1583, __pyx_L1_error)
26756       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26757       __pyx_v_v1 = __pyx_t_16;
26758 
26759       /* "MACS2/IO/ScoreTrack.pyx":1584
26760  *             for i in range( 0, l ):
26761  *                 v1 = value1[ i ]
26762  *                 v2 = value2[ i ]             # <<<<<<<<<<<<<<
26763  *                 v3 = value3[ i ]
26764  *                 p = pos[ i ]
26765  */
26766       __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value2), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1584, __pyx_L1_error)
26767       __Pyx_GOTREF(__pyx_t_2);
26768       __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_16 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1584, __pyx_L1_error)
26769       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26770       __pyx_v_v2 = __pyx_t_16;
26771 
26772       /* "MACS2/IO/ScoreTrack.pyx":1585
26773  *                 v1 = value1[ i ]
26774  *                 v2 = value2[ i ]
26775  *                 v3 = value3[ i ]             # <<<<<<<<<<<<<<
26776  *                 p = pos[ i ]
26777  *                 write( "%s:%d_%d\t%.5f\t%.5f\t%.5f\n" % ( chrom.decode(), pre, p, v1, v2, v3 ) )
26778  */
26779       __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value3), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1585, __pyx_L1_error)
26780       __Pyx_GOTREF(__pyx_t_2);
26781       __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_16 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1585, __pyx_L1_error)
26782       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26783       __pyx_v_v3 = __pyx_t_16;
26784 
26785       /* "MACS2/IO/ScoreTrack.pyx":1586
26786  *                 v2 = value2[ i ]
26787  *                 v3 = value3[ i ]
26788  *                 p = pos[ i ]             # <<<<<<<<<<<<<<
26789  *                 write( "%s:%d_%d\t%.5f\t%.5f\t%.5f\n" % ( chrom.decode(), pre, p, v1, v2, v3 ) )
26790  *                 pre = p
26791  */
26792       __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_pos), __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error)
26793       __Pyx_GOTREF(__pyx_t_2);
26794       __pyx_t_17 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_17 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1586, __pyx_L1_error)
26795       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26796       __pyx_v_p = __pyx_t_17;
26797 
26798       /* "MACS2/IO/ScoreTrack.pyx":1587
26799  *                 v3 = value3[ i ]
26800  *                 p = pos[ i ]
26801  *                 write( "%s:%d_%d\t%.5f\t%.5f\t%.5f\n" % ( chrom.decode(), pre, p, v1, v2, v3 ) )             # <<<<<<<<<<<<<<
26802  *                 pre = p
26803  *
26804  */
26805       __pyx_t_9 = PyTuple_New(12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1587, __pyx_L1_error)
26806       __Pyx_GOTREF(__pyx_t_9);
26807       __pyx_t_18 = 0;
26808       __pyx_t_19 = 127;
26809       if (unlikely(__pyx_v_chrom == Py_None)) {
26810         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
26811         __PYX_ERR(0, 1587, __pyx_L1_error)
26812       }
26813       __pyx_t_4 = __Pyx_decode_bytes(__pyx_v_chrom, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1587, __pyx_L1_error)
26814       __Pyx_GOTREF(__pyx_t_4);
26815       __pyx_t_19 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_19) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_19;
26816       __pyx_t_18 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
26817       __Pyx_GIVEREF(__pyx_t_4);
26818       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
26819       __pyx_t_4 = 0;
26820       __Pyx_INCREF(__pyx_kp_u__21);
26821       __pyx_t_18 += 1;
26822       __Pyx_GIVEREF(__pyx_kp_u__21);
26823       PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_kp_u__21);
26824       __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_pre); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1587, __pyx_L1_error)
26825       __Pyx_GOTREF(__pyx_t_4);
26826       __pyx_t_6 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1587, __pyx_L1_error)
26827       __Pyx_GOTREF(__pyx_t_6);
26828       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26829       __pyx_t_19 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_19) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_19;
26830       __pyx_t_18 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
26831       __Pyx_GIVEREF(__pyx_t_6);
26832       PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_6);
26833       __pyx_t_6 = 0;
26834       __Pyx_INCREF(__pyx_n_u__22);
26835       __pyx_t_18 += 1;
26836       __Pyx_GIVEREF(__pyx_n_u__22);
26837       PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_n_u__22);
26838       __pyx_t_6 = __Pyx_PyInt_From_npy_int32(__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1587, __pyx_L1_error)
26839       __Pyx_GOTREF(__pyx_t_6);
26840       __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1587, __pyx_L1_error)
26841       __Pyx_GOTREF(__pyx_t_4);
26842       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26843       __pyx_t_19 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_19) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_19;
26844       __pyx_t_18 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
26845       __Pyx_GIVEREF(__pyx_t_4);
26846       PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_4);
26847       __pyx_t_4 = 0;
26848       __Pyx_INCREF(__pyx_kp_u__11);
26849       __pyx_t_18 += 1;
26850       __Pyx_GIVEREF(__pyx_kp_u__11);
26851       PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_kp_u__11);
26852       __pyx_t_4 = PyFloat_FromDouble(__pyx_v_v1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1587, __pyx_L1_error)
26853       __Pyx_GOTREF(__pyx_t_4);
26854       __pyx_t_6 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_kp_u_5f); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1587, __pyx_L1_error)
26855       __Pyx_GOTREF(__pyx_t_6);
26856       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26857       __pyx_t_19 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_19) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_19;
26858       __pyx_t_18 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
26859       __Pyx_GIVEREF(__pyx_t_6);
26860       PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_6);
26861       __pyx_t_6 = 0;
26862       __Pyx_INCREF(__pyx_kp_u__11);
26863       __pyx_t_18 += 1;
26864       __Pyx_GIVEREF(__pyx_kp_u__11);
26865       PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_kp_u__11);
26866       __pyx_t_6 = PyFloat_FromDouble(__pyx_v_v2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1587, __pyx_L1_error)
26867       __Pyx_GOTREF(__pyx_t_6);
26868       __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_6, __pyx_kp_u_5f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1587, __pyx_L1_error)
26869       __Pyx_GOTREF(__pyx_t_4);
26870       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26871       __pyx_t_19 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_19) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_19;
26872       __pyx_t_18 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
26873       __Pyx_GIVEREF(__pyx_t_4);
26874       PyTuple_SET_ITEM(__pyx_t_9, 8, __pyx_t_4);
26875       __pyx_t_4 = 0;
26876       __Pyx_INCREF(__pyx_kp_u__11);
26877       __pyx_t_18 += 1;
26878       __Pyx_GIVEREF(__pyx_kp_u__11);
26879       PyTuple_SET_ITEM(__pyx_t_9, 9, __pyx_kp_u__11);
26880       __pyx_t_4 = PyFloat_FromDouble(__pyx_v_v3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1587, __pyx_L1_error)
26881       __Pyx_GOTREF(__pyx_t_4);
26882       __pyx_t_6 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_kp_u_5f); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1587, __pyx_L1_error)
26883       __Pyx_GOTREF(__pyx_t_6);
26884       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26885       __pyx_t_19 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_19) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_19;
26886       __pyx_t_18 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
26887       __Pyx_GIVEREF(__pyx_t_6);
26888       PyTuple_SET_ITEM(__pyx_t_9, 10, __pyx_t_6);
26889       __pyx_t_6 = 0;
26890       __Pyx_INCREF(__pyx_kp_u__12);
26891       __pyx_t_18 += 1;
26892       __Pyx_GIVEREF(__pyx_kp_u__12);
26893       PyTuple_SET_ITEM(__pyx_t_9, 11, __pyx_kp_u__12);
26894       __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_9, 12, __pyx_t_18, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1587, __pyx_L1_error)
26895       __Pyx_GOTREF(__pyx_t_6);
26896       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26897       __Pyx_INCREF(__pyx_v_write);
26898       __pyx_t_9 = __pyx_v_write; __pyx_t_4 = NULL;
26899       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
26900         __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
26901         if (likely(__pyx_t_4)) {
26902           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
26903           __Pyx_INCREF(__pyx_t_4);
26904           __Pyx_INCREF(function);
26905           __Pyx_DECREF_SET(__pyx_t_9, function);
26906         }
26907       }
26908       __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6);
26909       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26910       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26911       if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1587, __pyx_L1_error)
26912       __Pyx_GOTREF(__pyx_t_2);
26913       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26914       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26915 
26916       /* "MACS2/IO/ScoreTrack.pyx":1588
26917  *                 p = pos[ i ]
26918  *                 write( "%s:%d_%d\t%.5f\t%.5f\t%.5f\n" % ( chrom.decode(), pre, p, v1, v2, v3 ) )
26919  *                 pre = p             # <<<<<<<<<<<<<<
26920  *
26921  *         return True
26922  */
26923       __pyx_v_pre = __pyx_v_p;
26924     }
26925 
26926     /* "MACS2/IO/ScoreTrack.pyx":1577
26927  *
26928  *         chrs = self.get_chr_names()
26929  *         for chrom in chrs:             # <<<<<<<<<<<<<<
26930  *             [ pos, value1, value2, value3 ] = self.data[ chrom ]
26931  *             l = self.datalength[ chrom ]
26932  */
26933     __pyx_L3_continue:;
26934   }
26935   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26936 
26937   /* "MACS2/IO/ScoreTrack.pyx":1590
26938  *                 pre = p
26939  *
26940  *         return True             # <<<<<<<<<<<<<<
26941  *
26942  *     cpdef tuple call_peaks (self, float64_t cutoff=3, int32_t min_length=200, int32_t max_gap = 100,
26943  */
26944   __Pyx_XDECREF(__pyx_r);
26945   __Pyx_INCREF(Py_True);
26946   __pyx_r = Py_True;
26947   goto __pyx_L0;
26948 
26949   /* "MACS2/IO/ScoreTrack.pyx":1557
26950  *         return True
26951  *
26952  *     cpdef write_matrix ( self, fhd, str name, str description ):             # <<<<<<<<<<<<<<
26953  *         """Write all data to fhd into five columns Format:
26954  *
26955  */
26956 
26957   /* function exit code */
26958   __pyx_L1_error:;
26959   __Pyx_XDECREF(__pyx_t_1);
26960   __Pyx_XDECREF(__pyx_t_2);
26961   __Pyx_XDECREF(__pyx_t_3);
26962   __Pyx_XDECREF(__pyx_t_4);
26963   __Pyx_XDECREF(__pyx_t_6);
26964   __Pyx_XDECREF(__pyx_t_9);
26965   __Pyx_XDECREF(__pyx_t_10);
26966   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.write_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
26967   __pyx_r = 0;
26968   __pyx_L0:;
26969   __Pyx_XDECREF(__pyx_v_chrom);
26970   __Pyx_XDECREF((PyObject *)__pyx_v_pos);
26971   __Pyx_XDECREF((PyObject *)__pyx_v_value1);
26972   __Pyx_XDECREF((PyObject *)__pyx_v_value2);
26973   __Pyx_XDECREF((PyObject *)__pyx_v_value3);
26974   __Pyx_XDECREF(__pyx_v_write);
26975   __Pyx_XDECREF(__pyx_v_chrs);
26976   __Pyx_XGIVEREF(__pyx_r);
26977   __Pyx_TraceReturn(__pyx_r, 0);
26978   __Pyx_RefNannyFinishContext();
26979   return __pyx_r;
26980 }
26981 
26982 /* Python wrapper */
26983 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_17write_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26984 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_16write_matrix[] = "Write all data to fhd into five columns Format:\n\n        col1: chr_start_end\n        col2: t1 vs c1\n        col3: t2 vs c2\n        col4: t1 vs t2\n\n        fhd: a filehandler to save the matrix.\n\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_17write_matrix(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)26985 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_17write_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26986   PyObject *__pyx_v_fhd = 0;
26987   PyObject *__pyx_v_name = 0;
26988   PyObject *__pyx_v_description = 0;
26989   PyObject *__pyx_r = 0;
26990   __Pyx_RefNannyDeclarations
26991   __Pyx_RefNannySetupContext("write_matrix (wrapper)", 0);
26992   {
26993     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fhd,&__pyx_n_s_name,&__pyx_n_s_description,0};
26994     PyObject* values[3] = {0,0,0};
26995     if (unlikely(__pyx_kwds)) {
26996       Py_ssize_t kw_args;
26997       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26998       switch (pos_args) {
26999         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
27000         CYTHON_FALLTHROUGH;
27001         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
27002         CYTHON_FALLTHROUGH;
27003         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
27004         CYTHON_FALLTHROUGH;
27005         case  0: break;
27006         default: goto __pyx_L5_argtuple_error;
27007       }
27008       kw_args = PyDict_Size(__pyx_kwds);
27009       switch (pos_args) {
27010         case  0:
27011         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fhd)) != 0)) kw_args--;
27012         else goto __pyx_L5_argtuple_error;
27013         CYTHON_FALLTHROUGH;
27014         case  1:
27015         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
27016         else {
27017           __Pyx_RaiseArgtupleInvalid("write_matrix", 1, 3, 3, 1); __PYX_ERR(0, 1557, __pyx_L3_error)
27018         }
27019         CYTHON_FALLTHROUGH;
27020         case  2:
27021         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_description)) != 0)) kw_args--;
27022         else {
27023           __Pyx_RaiseArgtupleInvalid("write_matrix", 1, 3, 3, 2); __PYX_ERR(0, 1557, __pyx_L3_error)
27024         }
27025       }
27026       if (unlikely(kw_args > 0)) {
27027         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_matrix") < 0)) __PYX_ERR(0, 1557, __pyx_L3_error)
27028       }
27029     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
27030       goto __pyx_L5_argtuple_error;
27031     } else {
27032       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
27033       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
27034       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
27035     }
27036     __pyx_v_fhd = values[0];
27037     __pyx_v_name = ((PyObject*)values[1]);
27038     __pyx_v_description = ((PyObject*)values[2]);
27039   }
27040   goto __pyx_L4_argument_unpacking_done;
27041   __pyx_L5_argtuple_error:;
27042   __Pyx_RaiseArgtupleInvalid("write_matrix", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1557, __pyx_L3_error)
27043   __pyx_L3_error:;
27044   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.write_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
27045   __Pyx_RefNannyFinishContext();
27046   return NULL;
27047   __pyx_L4_argument_unpacking_done:;
27048   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 1557, __pyx_L1_error)
27049   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_description), (&PyUnicode_Type), 1, "description", 1))) __PYX_ERR(0, 1557, __pyx_L1_error)
27050   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_16write_matrix(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self), __pyx_v_fhd, __pyx_v_name, __pyx_v_description);
27051 
27052   /* function exit code */
27053   goto __pyx_L0;
27054   __pyx_L1_error:;
27055   __pyx_r = NULL;
27056   __pyx_L0:;
27057   __Pyx_RefNannyFinishContext();
27058   return __pyx_r;
27059 }
27060 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_16write_matrix(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_fhd,PyObject * __pyx_v_name,PyObject * __pyx_v_description)27061 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_16write_matrix(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_fhd, PyObject *__pyx_v_name, PyObject *__pyx_v_description) {
27062   PyObject *__pyx_r = NULL;
27063   __Pyx_TraceDeclarations
27064   __Pyx_RefNannyDeclarations
27065   PyObject *__pyx_t_1 = NULL;
27066   __Pyx_RefNannySetupContext("write_matrix", 0);
27067   __Pyx_TraceCall("write_matrix (wrapper)", __pyx_f[0], 1557, 0, __PYX_ERR(0, 1557, __pyx_L1_error));
27068   __Pyx_XDECREF(__pyx_r);
27069   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_matrix(__pyx_v_self, __pyx_v_fhd, __pyx_v_name, __pyx_v_description, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1557, __pyx_L1_error)
27070   __Pyx_GOTREF(__pyx_t_1);
27071   __pyx_r = __pyx_t_1;
27072   __pyx_t_1 = 0;
27073   goto __pyx_L0;
27074 
27075   /* function exit code */
27076   __pyx_L1_error:;
27077   __Pyx_XDECREF(__pyx_t_1);
27078   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.write_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
27079   __pyx_r = NULL;
27080   __pyx_L0:;
27081   __Pyx_XGIVEREF(__pyx_r);
27082   __Pyx_TraceReturn(__pyx_r, 0);
27083   __Pyx_RefNannyFinishContext();
27084   return __pyx_r;
27085 }
27086 
27087 /* "MACS2/IO/ScoreTrack.pyx":1592
27088  *         return True
27089  *
27090  *     cpdef tuple call_peaks (self, float64_t cutoff=3, int32_t min_length=200, int32_t max_gap = 100,             # <<<<<<<<<<<<<<
27091  *                       bool call_summits=False):
27092  *         """This function try to find regions within which, scores
27093  */
27094 
27095 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_19call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,int __pyx_skip_dispatch,struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks * __pyx_optional_args)27096 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks *__pyx_optional_args) {
27097   __pyx_t_5numpy_float64_t __pyx_v_cutoff = ((__pyx_t_5numpy_float64_t)3.0);
27098   __pyx_t_5numpy_int32_t __pyx_v_min_length = ((__pyx_t_5numpy_int32_t)0xC8);
27099   __pyx_t_5numpy_int32_t __pyx_v_max_gap = ((__pyx_t_5numpy_int32_t)0x64);
27100 
27101   /* "MACS2/IO/ScoreTrack.pyx":1593
27102  *
27103  *     cpdef tuple call_peaks (self, float64_t cutoff=3, int32_t min_length=200, int32_t max_gap = 100,
27104  *                       bool call_summits=False):             # <<<<<<<<<<<<<<
27105  *         """This function try to find regions within which, scores
27106  *         are continuously higher than a given cutoff.
27107  */
27108   PyBoolObject *__pyx_v_call_summits = ((PyBoolObject *)Py_False);
27109   PyObject *__pyx_v_chrom = 0;
27110   PyArrayObject *__pyx_v_pos = 0;
27111   PyObject *__pyx_v_chrs = NULL;
27112   PyObject *__pyx_v_cat1_peaks = NULL;
27113   PyObject *__pyx_v_cat2_peaks = NULL;
27114   PyObject *__pyx_v_cat3_peaks = NULL;
27115   PyObject *__pyx_v_t1_vs_c1 = NULL;
27116   PyObject *__pyx_v_t2_vs_c2 = NULL;
27117   PyObject *__pyx_v_t1_vs_t2 = NULL;
27118   PyObject *__pyx_v_and_ = NULL;
27119   PyObject *__pyx_v_cond1_over_cond2 = NULL;
27120   PyObject *__pyx_v_cond2_over_cond1 = NULL;
27121   PyObject *__pyx_v_cond1_equal_cond2 = NULL;
27122   PyObject *__pyx_v_cond1_sig = NULL;
27123   PyObject *__pyx_v_cond2_sig = NULL;
27124   PyObject *__pyx_v_cat1 = NULL;
27125   PyObject *__pyx_v_cat2 = NULL;
27126   PyObject *__pyx_v_cat3 = NULL;
27127   PyObject *__pyx_v_cat1_endpos = NULL;
27128   PyObject *__pyx_v_cat1_startpos = NULL;
27129   PyObject *__pyx_v_cat2_endpos = NULL;
27130   PyObject *__pyx_v_cat2_startpos = NULL;
27131   PyObject *__pyx_v_cat3_endpos = NULL;
27132   PyObject *__pyx_v_cat3_startpos = NULL;
27133   PyObject *__pyx_r = NULL;
27134   __Pyx_TraceDeclarations
27135   __Pyx_RefNannyDeclarations
27136   PyObject *__pyx_t_1 = NULL;
27137   PyObject *__pyx_t_2 = NULL;
27138   PyObject *__pyx_t_3 = NULL;
27139   PyObject *__pyx_t_4 = NULL;
27140   PyObject *__pyx_t_5 = NULL;
27141   PyObject *__pyx_t_6 = NULL;
27142   PyObject *__pyx_t_7 = NULL;
27143   int __pyx_t_8;
27144   PyObject *__pyx_t_9 = NULL;
27145   Py_ssize_t __pyx_t_10;
27146   PyObject *(*__pyx_t_11)(PyObject *);
27147   __Pyx_RefNannySetupContext("call_peaks", 0);
27148   __Pyx_TraceCall("call_peaks", __pyx_f[0], 1592, 0, __PYX_ERR(0, 1592, __pyx_L1_error));
27149   if (__pyx_optional_args) {
27150     if (__pyx_optional_args->__pyx_n > 0) {
27151       __pyx_v_cutoff = __pyx_optional_args->cutoff;
27152       if (__pyx_optional_args->__pyx_n > 1) {
27153         __pyx_v_min_length = __pyx_optional_args->min_length;
27154         if (__pyx_optional_args->__pyx_n > 2) {
27155           __pyx_v_max_gap = __pyx_optional_args->max_gap;
27156           if (__pyx_optional_args->__pyx_n > 3) {
27157             __pyx_v_call_summits = __pyx_optional_args->call_summits;
27158           }
27159         }
27160       }
27161     }
27162   }
27163 
27164   /* "MACS2/IO/ScoreTrack.pyx":1592
27165  *         return True
27166  *
27167  *     cpdef tuple call_peaks (self, float64_t cutoff=3, int32_t min_length=200, int32_t max_gap = 100,             # <<<<<<<<<<<<<<
27168  *                       bool call_summits=False):
27169  *         """This function try to find regions within which, scores
27170  */
27171   /* Check if called by wrapper */
27172   if (unlikely(__pyx_skip_dispatch)) ;
27173   /* Check if overridden in Python */
27174   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
27175     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
27176     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
27177     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
27178       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
27179       #endif
27180       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_call_peaks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
27181       __Pyx_GOTREF(__pyx_t_1);
27182       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_19call_peaks)) {
27183         __Pyx_XDECREF(__pyx_r);
27184         __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1592, __pyx_L1_error)
27185         __Pyx_GOTREF(__pyx_t_3);
27186         __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_min_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1592, __pyx_L1_error)
27187         __Pyx_GOTREF(__pyx_t_4);
27188         __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_max_gap); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1592, __pyx_L1_error)
27189         __Pyx_GOTREF(__pyx_t_5);
27190         __Pyx_INCREF(__pyx_t_1);
27191         __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
27192         __pyx_t_8 = 0;
27193         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
27194           __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
27195           if (likely(__pyx_t_7)) {
27196             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
27197             __Pyx_INCREF(__pyx_t_7);
27198             __Pyx_INCREF(function);
27199             __Pyx_DECREF_SET(__pyx_t_6, function);
27200             __pyx_t_8 = 1;
27201           }
27202         }
27203         #if CYTHON_FAST_PYCALL
27204         if (PyFunction_Check(__pyx_t_6)) {
27205           PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_call_summits)};
27206           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
27207           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27208           __Pyx_GOTREF(__pyx_t_2);
27209           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27210           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27211           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27212         } else
27213         #endif
27214         #if CYTHON_FAST_PYCCALL
27215         if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
27216           PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_call_summits)};
27217           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
27218           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27219           __Pyx_GOTREF(__pyx_t_2);
27220           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27221           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27222           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27223         } else
27224         #endif
27225         {
27226           __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1592, __pyx_L1_error)
27227           __Pyx_GOTREF(__pyx_t_9);
27228           if (__pyx_t_7) {
27229             __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
27230           }
27231           __Pyx_GIVEREF(__pyx_t_3);
27232           PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
27233           __Pyx_GIVEREF(__pyx_t_4);
27234           PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
27235           __Pyx_GIVEREF(__pyx_t_5);
27236           PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
27237           __Pyx_INCREF(((PyObject *)__pyx_v_call_summits));
27238           __Pyx_GIVEREF(((PyObject *)__pyx_v_call_summits));
27239           PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_call_summits));
27240           __pyx_t_3 = 0;
27241           __pyx_t_4 = 0;
27242           __pyx_t_5 = 0;
27243           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
27244           __Pyx_GOTREF(__pyx_t_2);
27245           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27246         }
27247         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27248         if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1592, __pyx_L1_error)
27249         __pyx_r = ((PyObject*)__pyx_t_2);
27250         __pyx_t_2 = 0;
27251         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27252         goto __pyx_L0;
27253       }
27254       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
27255       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
27256       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
27257       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
27258         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
27259       }
27260       #endif
27261       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27262       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
27263     }
27264     #endif
27265   }
27266 
27267   /* "MACS2/IO/ScoreTrack.pyx":1618
27268  *             list peak_content
27269  *
27270  *         chrs  = self.get_chr_names()             # <<<<<<<<<<<<<<
27271  *         cat1_peaks = PeakIO()       # dictionary to save peaks significant at condition 1
27272  *         cat2_peaks = PeakIO()       # dictionary to save peaks significant at condition 2
27273  */
27274   __pyx_t_1 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->get_chr_names(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error)
27275   __Pyx_GOTREF(__pyx_t_1);
27276   __pyx_v_chrs = __pyx_t_1;
27277   __pyx_t_1 = 0;
27278 
27279   /* "MACS2/IO/ScoreTrack.pyx":1619
27280  *
27281  *         chrs  = self.get_chr_names()
27282  *         cat1_peaks = PeakIO()       # dictionary to save peaks significant at condition 1             # <<<<<<<<<<<<<<
27283  *         cat2_peaks = PeakIO()       # dictionary to save peaks significant at condition 2
27284  *         cat3_peaks = PeakIO()       # dictionary to save peaks significant in both conditions
27285  */
27286   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PeakIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1619, __pyx_L1_error)
27287   __Pyx_GOTREF(__pyx_t_2);
27288   __pyx_t_6 = NULL;
27289   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
27290     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
27291     if (likely(__pyx_t_6)) {
27292       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
27293       __Pyx_INCREF(__pyx_t_6);
27294       __Pyx_INCREF(function);
27295       __Pyx_DECREF_SET(__pyx_t_2, function);
27296     }
27297   }
27298   __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
27299   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27300   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
27301   __Pyx_GOTREF(__pyx_t_1);
27302   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27303   __pyx_v_cat1_peaks = __pyx_t_1;
27304   __pyx_t_1 = 0;
27305 
27306   /* "MACS2/IO/ScoreTrack.pyx":1620
27307  *         chrs  = self.get_chr_names()
27308  *         cat1_peaks = PeakIO()       # dictionary to save peaks significant at condition 1
27309  *         cat2_peaks = PeakIO()       # dictionary to save peaks significant at condition 2             # <<<<<<<<<<<<<<
27310  *         cat3_peaks = PeakIO()       # dictionary to save peaks significant in both conditions
27311  *
27312  */
27313   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PeakIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1620, __pyx_L1_error)
27314   __Pyx_GOTREF(__pyx_t_2);
27315   __pyx_t_6 = NULL;
27316   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
27317     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
27318     if (likely(__pyx_t_6)) {
27319       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
27320       __Pyx_INCREF(__pyx_t_6);
27321       __Pyx_INCREF(function);
27322       __Pyx_DECREF_SET(__pyx_t_2, function);
27323     }
27324   }
27325   __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
27326   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27327   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1620, __pyx_L1_error)
27328   __Pyx_GOTREF(__pyx_t_1);
27329   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27330   __pyx_v_cat2_peaks = __pyx_t_1;
27331   __pyx_t_1 = 0;
27332 
27333   /* "MACS2/IO/ScoreTrack.pyx":1621
27334  *         cat1_peaks = PeakIO()       # dictionary to save peaks significant at condition 1
27335  *         cat2_peaks = PeakIO()       # dictionary to save peaks significant at condition 2
27336  *         cat3_peaks = PeakIO()       # dictionary to save peaks significant in both conditions             # <<<<<<<<<<<<<<
27337  *
27338  *         self.cutoff = cutoff
27339  */
27340   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PeakIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __pyx_L1_error)
27341   __Pyx_GOTREF(__pyx_t_2);
27342   __pyx_t_6 = NULL;
27343   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
27344     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
27345     if (likely(__pyx_t_6)) {
27346       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
27347       __Pyx_INCREF(__pyx_t_6);
27348       __Pyx_INCREF(function);
27349       __Pyx_DECREF_SET(__pyx_t_2, function);
27350     }
27351   }
27352   __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
27353   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27354   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1621, __pyx_L1_error)
27355   __Pyx_GOTREF(__pyx_t_1);
27356   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27357   __pyx_v_cat3_peaks = __pyx_t_1;
27358   __pyx_t_1 = 0;
27359 
27360   /* "MACS2/IO/ScoreTrack.pyx":1623
27361  *         cat3_peaks = PeakIO()       # dictionary to save peaks significant in both conditions
27362  *
27363  *         self.cutoff = cutoff             # <<<<<<<<<<<<<<
27364  *
27365  *         for chrom in chrs:
27366  */
27367   __pyx_v_self->cutoff = __pyx_v_cutoff;
27368 
27369   /* "MACS2/IO/ScoreTrack.pyx":1625
27370  *         self.cutoff = cutoff
27371  *
27372  *         for chrom in chrs:             # <<<<<<<<<<<<<<
27373  *             pos = self.data[chrom][ 0 ]
27374  *             t1_vs_c1 = self.data[chrom][ 1 ]
27375  */
27376   if (likely(PyList_CheckExact(__pyx_v_chrs)) || PyTuple_CheckExact(__pyx_v_chrs)) {
27377     __pyx_t_1 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
27378     __pyx_t_11 = NULL;
27379   } else {
27380     __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1625, __pyx_L1_error)
27381     __Pyx_GOTREF(__pyx_t_1);
27382     __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1625, __pyx_L1_error)
27383   }
27384   for (;;) {
27385     if (likely(!__pyx_t_11)) {
27386       if (likely(PyList_CheckExact(__pyx_t_1))) {
27387         if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
27388         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27389         __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1625, __pyx_L1_error)
27390         #else
27391         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1625, __pyx_L1_error)
27392         __Pyx_GOTREF(__pyx_t_2);
27393         #endif
27394       } else {
27395         if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
27396         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27397         __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1625, __pyx_L1_error)
27398         #else
27399         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1625, __pyx_L1_error)
27400         __Pyx_GOTREF(__pyx_t_2);
27401         #endif
27402       }
27403     } else {
27404       __pyx_t_2 = __pyx_t_11(__pyx_t_1);
27405       if (unlikely(!__pyx_t_2)) {
27406         PyObject* exc_type = PyErr_Occurred();
27407         if (exc_type) {
27408           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
27409           else __PYX_ERR(0, 1625, __pyx_L1_error)
27410         }
27411         break;
27412       }
27413       __Pyx_GOTREF(__pyx_t_2);
27414     }
27415     if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1625, __pyx_L1_error)
27416     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_2));
27417     __pyx_t_2 = 0;
27418 
27419     /* "MACS2/IO/ScoreTrack.pyx":1626
27420  *
27421  *         for chrom in chrs:
27422  *             pos = self.data[chrom][ 0 ]             # <<<<<<<<<<<<<<
27423  *             t1_vs_c1 = self.data[chrom][ 1 ]
27424  *             t2_vs_c2 = self.data[chrom][ 2 ]
27425  */
27426     if (unlikely(__pyx_v_self->data == Py_None)) {
27427       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27428       __PYX_ERR(0, 1626, __pyx_L1_error)
27429     }
27430     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1626, __pyx_L1_error)
27431     __Pyx_GOTREF(__pyx_t_2);
27432     __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1626, __pyx_L1_error)
27433     __Pyx_GOTREF(__pyx_t_6);
27434     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27435     if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1626, __pyx_L1_error)
27436     __Pyx_XDECREF_SET(__pyx_v_pos, ((PyArrayObject *)__pyx_t_6));
27437     __pyx_t_6 = 0;
27438 
27439     /* "MACS2/IO/ScoreTrack.pyx":1627
27440  *         for chrom in chrs:
27441  *             pos = self.data[chrom][ 0 ]
27442  *             t1_vs_c1 = self.data[chrom][ 1 ]             # <<<<<<<<<<<<<<
27443  *             t2_vs_c2 = self.data[chrom][ 2 ]
27444  *             t1_vs_t2 = self.data[chrom][ 3 ]
27445  */
27446     if (unlikely(__pyx_v_self->data == Py_None)) {
27447       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27448       __PYX_ERR(0, 1627, __pyx_L1_error)
27449     }
27450     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1627, __pyx_L1_error)
27451     __Pyx_GOTREF(__pyx_t_6);
27452     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1627, __pyx_L1_error)
27453     __Pyx_GOTREF(__pyx_t_2);
27454     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27455     __Pyx_XDECREF_SET(__pyx_v_t1_vs_c1, __pyx_t_2);
27456     __pyx_t_2 = 0;
27457 
27458     /* "MACS2/IO/ScoreTrack.pyx":1628
27459  *             pos = self.data[chrom][ 0 ]
27460  *             t1_vs_c1 = self.data[chrom][ 1 ]
27461  *             t2_vs_c2 = self.data[chrom][ 2 ]             # <<<<<<<<<<<<<<
27462  *             t1_vs_t2 = self.data[chrom][ 3 ]
27463  *             and_ = np.logical_and
27464  */
27465     if (unlikely(__pyx_v_self->data == Py_None)) {
27466       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27467       __PYX_ERR(0, 1628, __pyx_L1_error)
27468     }
27469     __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1628, __pyx_L1_error)
27470     __Pyx_GOTREF(__pyx_t_2);
27471     __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1628, __pyx_L1_error)
27472     __Pyx_GOTREF(__pyx_t_6);
27473     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27474     __Pyx_XDECREF_SET(__pyx_v_t2_vs_c2, __pyx_t_6);
27475     __pyx_t_6 = 0;
27476 
27477     /* "MACS2/IO/ScoreTrack.pyx":1629
27478  *             t1_vs_c1 = self.data[chrom][ 1 ]
27479  *             t2_vs_c2 = self.data[chrom][ 2 ]
27480  *             t1_vs_t2 = self.data[chrom][ 3 ]             # <<<<<<<<<<<<<<
27481  *             and_ = np.logical_and
27482  *             cond1_over_cond2 = t1_vs_t2 >= cutoff # regions with stronger cond1 signals
27483  */
27484     if (unlikely(__pyx_v_self->data == Py_None)) {
27485       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27486       __PYX_ERR(0, 1629, __pyx_L1_error)
27487     }
27488     __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->data, __pyx_v_chrom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1629, __pyx_L1_error)
27489     __Pyx_GOTREF(__pyx_t_6);
27490     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1629, __pyx_L1_error)
27491     __Pyx_GOTREF(__pyx_t_2);
27492     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27493     __Pyx_XDECREF_SET(__pyx_v_t1_vs_t2, __pyx_t_2);
27494     __pyx_t_2 = 0;
27495 
27496     /* "MACS2/IO/ScoreTrack.pyx":1630
27497  *             t2_vs_c2 = self.data[chrom][ 2 ]
27498  *             t1_vs_t2 = self.data[chrom][ 3 ]
27499  *             and_ = np.logical_and             # <<<<<<<<<<<<<<
27500  *             cond1_over_cond2 = t1_vs_t2 >= cutoff # regions with stronger cond1 signals
27501  *             cond2_over_cond1 = t1_vs_t2 <= -1*cutoff # regions with stronger cond2 signals
27502  */
27503     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1630, __pyx_L1_error)
27504     __Pyx_GOTREF(__pyx_t_2);
27505     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logical_and); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1630, __pyx_L1_error)
27506     __Pyx_GOTREF(__pyx_t_6);
27507     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27508     __Pyx_XDECREF_SET(__pyx_v_and_, __pyx_t_6);
27509     __pyx_t_6 = 0;
27510 
27511     /* "MACS2/IO/ScoreTrack.pyx":1631
27512  *             t1_vs_t2 = self.data[chrom][ 3 ]
27513  *             and_ = np.logical_and
27514  *             cond1_over_cond2 = t1_vs_t2 >= cutoff # regions with stronger cond1 signals             # <<<<<<<<<<<<<<
27515  *             cond2_over_cond1 = t1_vs_t2 <= -1*cutoff # regions with stronger cond2 signals
27516  *             cond1_equal_cond2= and_( t1_vs_t2 >= -1*cutoff, t1_vs_t2 <= cutoff )
27517  */
27518     __pyx_t_6 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1631, __pyx_L1_error)
27519     __Pyx_GOTREF(__pyx_t_6);
27520     __pyx_t_2 = PyObject_RichCompare(__pyx_v_t1_vs_t2, __pyx_t_6, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1631, __pyx_L1_error)
27521     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27522     __Pyx_XDECREF_SET(__pyx_v_cond1_over_cond2, __pyx_t_2);
27523     __pyx_t_2 = 0;
27524 
27525     /* "MACS2/IO/ScoreTrack.pyx":1632
27526  *             and_ = np.logical_and
27527  *             cond1_over_cond2 = t1_vs_t2 >= cutoff # regions with stronger cond1 signals
27528  *             cond2_over_cond1 = t1_vs_t2 <= -1*cutoff # regions with stronger cond2 signals             # <<<<<<<<<<<<<<
27529  *             cond1_equal_cond2= and_( t1_vs_t2 >= -1*cutoff, t1_vs_t2 <= cutoff )
27530  *             cond1_sig = t1_vs_c1 >= cutoff # enriched regions in condition 1
27531  */
27532     __pyx_t_2 = PyFloat_FromDouble((-1.0 * __pyx_v_cutoff)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1632, __pyx_L1_error)
27533     __Pyx_GOTREF(__pyx_t_2);
27534     __pyx_t_6 = PyObject_RichCompare(__pyx_v_t1_vs_t2, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1632, __pyx_L1_error)
27535     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27536     __Pyx_XDECREF_SET(__pyx_v_cond2_over_cond1, __pyx_t_6);
27537     __pyx_t_6 = 0;
27538 
27539     /* "MACS2/IO/ScoreTrack.pyx":1633
27540  *             cond1_over_cond2 = t1_vs_t2 >= cutoff # regions with stronger cond1 signals
27541  *             cond2_over_cond1 = t1_vs_t2 <= -1*cutoff # regions with stronger cond2 signals
27542  *             cond1_equal_cond2= and_( t1_vs_t2 >= -1*cutoff, t1_vs_t2 <= cutoff )             # <<<<<<<<<<<<<<
27543  *             cond1_sig = t1_vs_c1 >= cutoff # enriched regions in condition 1
27544  *             cond2_sig = t2_vs_c2 >= cutoff # enriched regions in condition 2
27545  */
27546     __pyx_t_2 = PyFloat_FromDouble((-1.0 * __pyx_v_cutoff)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1633, __pyx_L1_error)
27547     __Pyx_GOTREF(__pyx_t_2);
27548     __pyx_t_9 = PyObject_RichCompare(__pyx_v_t1_vs_t2, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1633, __pyx_L1_error)
27549     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27550     __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1633, __pyx_L1_error)
27551     __Pyx_GOTREF(__pyx_t_2);
27552     __pyx_t_5 = PyObject_RichCompare(__pyx_v_t1_vs_t2, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1633, __pyx_L1_error)
27553     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27554     __Pyx_INCREF(__pyx_v_and_);
27555     __pyx_t_2 = __pyx_v_and_; __pyx_t_4 = NULL;
27556     __pyx_t_8 = 0;
27557     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
27558       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
27559       if (likely(__pyx_t_4)) {
27560         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
27561         __Pyx_INCREF(__pyx_t_4);
27562         __Pyx_INCREF(function);
27563         __Pyx_DECREF_SET(__pyx_t_2, function);
27564         __pyx_t_8 = 1;
27565       }
27566     }
27567     #if CYTHON_FAST_PYCALL
27568     if (PyFunction_Check(__pyx_t_2)) {
27569       PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_9, __pyx_t_5};
27570       __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1633, __pyx_L1_error)
27571       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27572       __Pyx_GOTREF(__pyx_t_6);
27573       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27574       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27575     } else
27576     #endif
27577     #if CYTHON_FAST_PYCCALL
27578     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
27579       PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_9, __pyx_t_5};
27580       __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1633, __pyx_L1_error)
27581       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27582       __Pyx_GOTREF(__pyx_t_6);
27583       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27584       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27585     } else
27586     #endif
27587     {
27588       __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error)
27589       __Pyx_GOTREF(__pyx_t_3);
27590       if (__pyx_t_4) {
27591         __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
27592       }
27593       __Pyx_GIVEREF(__pyx_t_9);
27594       PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_t_9);
27595       __Pyx_GIVEREF(__pyx_t_5);
27596       PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_t_5);
27597       __pyx_t_9 = 0;
27598       __pyx_t_5 = 0;
27599       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1633, __pyx_L1_error)
27600       __Pyx_GOTREF(__pyx_t_6);
27601       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27602     }
27603     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27604     __Pyx_XDECREF_SET(__pyx_v_cond1_equal_cond2, __pyx_t_6);
27605     __pyx_t_6 = 0;
27606 
27607     /* "MACS2/IO/ScoreTrack.pyx":1634
27608  *             cond2_over_cond1 = t1_vs_t2 <= -1*cutoff # regions with stronger cond2 signals
27609  *             cond1_equal_cond2= and_( t1_vs_t2 >= -1*cutoff, t1_vs_t2 <= cutoff )
27610  *             cond1_sig = t1_vs_c1 >= cutoff # enriched regions in condition 1             # <<<<<<<<<<<<<<
27611  *             cond2_sig = t2_vs_c2 >= cutoff # enriched regions in condition 2
27612  *             # indices where score is above cutoff
27613  */
27614     __pyx_t_6 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1634, __pyx_L1_error)
27615     __Pyx_GOTREF(__pyx_t_6);
27616     __pyx_t_2 = PyObject_RichCompare(__pyx_v_t1_vs_c1, __pyx_t_6, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1634, __pyx_L1_error)
27617     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27618     __Pyx_XDECREF_SET(__pyx_v_cond1_sig, __pyx_t_2);
27619     __pyx_t_2 = 0;
27620 
27621     /* "MACS2/IO/ScoreTrack.pyx":1635
27622  *             cond1_equal_cond2= and_( t1_vs_t2 >= -1*cutoff, t1_vs_t2 <= cutoff )
27623  *             cond1_sig = t1_vs_c1 >= cutoff # enriched regions in condition 1
27624  *             cond2_sig = t2_vs_c2 >= cutoff # enriched regions in condition 2             # <<<<<<<<<<<<<<
27625  *             # indices where score is above cutoff
27626  *             cat1 = np.where( and_( cond1_sig, cond1_over_cond2 ) )[ 0 ] # cond1 stronger than cond2, the indices
27627  */
27628     __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cutoff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1635, __pyx_L1_error)
27629     __Pyx_GOTREF(__pyx_t_2);
27630     __pyx_t_6 = PyObject_RichCompare(__pyx_v_t2_vs_c2, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1635, __pyx_L1_error)
27631     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27632     __Pyx_XDECREF_SET(__pyx_v_cond2_sig, __pyx_t_6);
27633     __pyx_t_6 = 0;
27634 
27635     /* "MACS2/IO/ScoreTrack.pyx":1637
27636  *             cond2_sig = t2_vs_c2 >= cutoff # enriched regions in condition 2
27637  *             # indices where score is above cutoff
27638  *             cat1 = np.where( and_( cond1_sig, cond1_over_cond2 ) )[ 0 ] # cond1 stronger than cond2, the indices             # <<<<<<<<<<<<<<
27639  *             cat2 = np.where( and_( cond2_over_cond1, cond2_sig ) )[ 0 ] # cond2 stronger than cond1, the indices
27640  *             cat3 = np.where( and_( and_( cond1_sig, cond2_sig ), # cond1 and cond2 are equal, the indices
27641  */
27642     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1637, __pyx_L1_error)
27643     __Pyx_GOTREF(__pyx_t_2);
27644     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1637, __pyx_L1_error)
27645     __Pyx_GOTREF(__pyx_t_3);
27646     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27647     __Pyx_INCREF(__pyx_v_and_);
27648     __pyx_t_5 = __pyx_v_and_; __pyx_t_9 = NULL;
27649     __pyx_t_8 = 0;
27650     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
27651       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
27652       if (likely(__pyx_t_9)) {
27653         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27654         __Pyx_INCREF(__pyx_t_9);
27655         __Pyx_INCREF(function);
27656         __Pyx_DECREF_SET(__pyx_t_5, function);
27657         __pyx_t_8 = 1;
27658       }
27659     }
27660     #if CYTHON_FAST_PYCALL
27661     if (PyFunction_Check(__pyx_t_5)) {
27662       PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_cond1_sig, __pyx_v_cond1_over_cond2};
27663       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1637, __pyx_L1_error)
27664       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
27665       __Pyx_GOTREF(__pyx_t_2);
27666     } else
27667     #endif
27668     #if CYTHON_FAST_PYCCALL
27669     if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
27670       PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_cond1_sig, __pyx_v_cond1_over_cond2};
27671       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1637, __pyx_L1_error)
27672       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
27673       __Pyx_GOTREF(__pyx_t_2);
27674     } else
27675     #endif
27676     {
27677       __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1637, __pyx_L1_error)
27678       __Pyx_GOTREF(__pyx_t_4);
27679       if (__pyx_t_9) {
27680         __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = NULL;
27681       }
27682       __Pyx_INCREF(__pyx_v_cond1_sig);
27683       __Pyx_GIVEREF(__pyx_v_cond1_sig);
27684       PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_v_cond1_sig);
27685       __Pyx_INCREF(__pyx_v_cond1_over_cond2);
27686       __Pyx_GIVEREF(__pyx_v_cond1_over_cond2);
27687       PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_v_cond1_over_cond2);
27688       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1637, __pyx_L1_error)
27689       __Pyx_GOTREF(__pyx_t_2);
27690       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27691     }
27692     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27693     __pyx_t_5 = NULL;
27694     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
27695       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
27696       if (likely(__pyx_t_5)) {
27697         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
27698         __Pyx_INCREF(__pyx_t_5);
27699         __Pyx_INCREF(function);
27700         __Pyx_DECREF_SET(__pyx_t_3, function);
27701       }
27702     }
27703     __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
27704     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27705     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27706     if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1637, __pyx_L1_error)
27707     __Pyx_GOTREF(__pyx_t_6);
27708     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27709     __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1637, __pyx_L1_error)
27710     __Pyx_GOTREF(__pyx_t_3);
27711     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27712     __Pyx_XDECREF_SET(__pyx_v_cat1, __pyx_t_3);
27713     __pyx_t_3 = 0;
27714 
27715     /* "MACS2/IO/ScoreTrack.pyx":1638
27716  *             # indices where score is above cutoff
27717  *             cat1 = np.where( and_( cond1_sig, cond1_over_cond2 ) )[ 0 ] # cond1 stronger than cond2, the indices
27718  *             cat2 = np.where( and_( cond2_over_cond1, cond2_sig ) )[ 0 ] # cond2 stronger than cond1, the indices             # <<<<<<<<<<<<<<
27719  *             cat3 = np.where( and_( and_( cond1_sig, cond2_sig ), # cond1 and cond2 are equal, the indices
27720  *                                    cond1_equal_cond2 ) ) [ 0 ]
27721  */
27722     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1638, __pyx_L1_error)
27723     __Pyx_GOTREF(__pyx_t_6);
27724     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_where); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1638, __pyx_L1_error)
27725     __Pyx_GOTREF(__pyx_t_2);
27726     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27727     __Pyx_INCREF(__pyx_v_and_);
27728     __pyx_t_5 = __pyx_v_and_; __pyx_t_4 = NULL;
27729     __pyx_t_8 = 0;
27730     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
27731       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
27732       if (likely(__pyx_t_4)) {
27733         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27734         __Pyx_INCREF(__pyx_t_4);
27735         __Pyx_INCREF(function);
27736         __Pyx_DECREF_SET(__pyx_t_5, function);
27737         __pyx_t_8 = 1;
27738       }
27739     }
27740     #if CYTHON_FAST_PYCALL
27741     if (PyFunction_Check(__pyx_t_5)) {
27742       PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_cond2_over_cond1, __pyx_v_cond2_sig};
27743       __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1638, __pyx_L1_error)
27744       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27745       __Pyx_GOTREF(__pyx_t_6);
27746     } else
27747     #endif
27748     #if CYTHON_FAST_PYCCALL
27749     if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
27750       PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_cond2_over_cond1, __pyx_v_cond2_sig};
27751       __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1638, __pyx_L1_error)
27752       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27753       __Pyx_GOTREF(__pyx_t_6);
27754     } else
27755     #endif
27756     {
27757       __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1638, __pyx_L1_error)
27758       __Pyx_GOTREF(__pyx_t_9);
27759       if (__pyx_t_4) {
27760         __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
27761       }
27762       __Pyx_INCREF(__pyx_v_cond2_over_cond1);
27763       __Pyx_GIVEREF(__pyx_v_cond2_over_cond1);
27764       PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_cond2_over_cond1);
27765       __Pyx_INCREF(__pyx_v_cond2_sig);
27766       __Pyx_GIVEREF(__pyx_v_cond2_sig);
27767       PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_cond2_sig);
27768       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1638, __pyx_L1_error)
27769       __Pyx_GOTREF(__pyx_t_6);
27770       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27771     }
27772     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27773     __pyx_t_5 = NULL;
27774     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
27775       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
27776       if (likely(__pyx_t_5)) {
27777         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
27778         __Pyx_INCREF(__pyx_t_5);
27779         __Pyx_INCREF(function);
27780         __Pyx_DECREF_SET(__pyx_t_2, function);
27781       }
27782     }
27783     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
27784     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27785     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27786     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L1_error)
27787     __Pyx_GOTREF(__pyx_t_3);
27788     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27789     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1638, __pyx_L1_error)
27790     __Pyx_GOTREF(__pyx_t_2);
27791     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27792     __Pyx_XDECREF_SET(__pyx_v_cat2, __pyx_t_2);
27793     __pyx_t_2 = 0;
27794 
27795     /* "MACS2/IO/ScoreTrack.pyx":1639
27796  *             cat1 = np.where( and_( cond1_sig, cond1_over_cond2 ) )[ 0 ] # cond1 stronger than cond2, the indices
27797  *             cat2 = np.where( and_( cond2_over_cond1, cond2_sig ) )[ 0 ] # cond2 stronger than cond1, the indices
27798  *             cat3 = np.where( and_( and_( cond1_sig, cond2_sig ), # cond1 and cond2 are equal, the indices             # <<<<<<<<<<<<<<
27799  *                                    cond1_equal_cond2 ) ) [ 0 ]
27800  *
27801  */
27802     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1639, __pyx_L1_error)
27803     __Pyx_GOTREF(__pyx_t_3);
27804     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_where); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1639, __pyx_L1_error)
27805     __Pyx_GOTREF(__pyx_t_6);
27806     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27807     __Pyx_INCREF(__pyx_v_and_);
27808     __pyx_t_9 = __pyx_v_and_; __pyx_t_4 = NULL;
27809     __pyx_t_8 = 0;
27810     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
27811       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
27812       if (likely(__pyx_t_4)) {
27813         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
27814         __Pyx_INCREF(__pyx_t_4);
27815         __Pyx_INCREF(function);
27816         __Pyx_DECREF_SET(__pyx_t_9, function);
27817         __pyx_t_8 = 1;
27818       }
27819     }
27820     #if CYTHON_FAST_PYCALL
27821     if (PyFunction_Check(__pyx_t_9)) {
27822       PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_cond1_sig, __pyx_v_cond2_sig};
27823       __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1639, __pyx_L1_error)
27824       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27825       __Pyx_GOTREF(__pyx_t_5);
27826     } else
27827     #endif
27828     #if CYTHON_FAST_PYCCALL
27829     if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
27830       PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_cond1_sig, __pyx_v_cond2_sig};
27831       __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1639, __pyx_L1_error)
27832       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27833       __Pyx_GOTREF(__pyx_t_5);
27834     } else
27835     #endif
27836     {
27837       __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1639, __pyx_L1_error)
27838       __Pyx_GOTREF(__pyx_t_7);
27839       if (__pyx_t_4) {
27840         __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
27841       }
27842       __Pyx_INCREF(__pyx_v_cond1_sig);
27843       __Pyx_GIVEREF(__pyx_v_cond1_sig);
27844       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_cond1_sig);
27845       __Pyx_INCREF(__pyx_v_cond2_sig);
27846       __Pyx_GIVEREF(__pyx_v_cond2_sig);
27847       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_cond2_sig);
27848       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1639, __pyx_L1_error)
27849       __Pyx_GOTREF(__pyx_t_5);
27850       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27851     }
27852     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27853 
27854     /* "MACS2/IO/ScoreTrack.pyx":1640
27855  *             cat2 = np.where( and_( cond2_over_cond1, cond2_sig ) )[ 0 ] # cond2 stronger than cond1, the indices
27856  *             cat3 = np.where( and_( and_( cond1_sig, cond2_sig ), # cond1 and cond2 are equal, the indices
27857  *                                    cond1_equal_cond2 ) ) [ 0 ]             # <<<<<<<<<<<<<<
27858  *
27859  *             cat1_endpos = pos[cat1] # end positions of regions where score is above cutoff
27860  */
27861     __Pyx_INCREF(__pyx_v_and_);
27862     __pyx_t_9 = __pyx_v_and_; __pyx_t_7 = NULL;
27863     __pyx_t_8 = 0;
27864     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
27865       __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
27866       if (likely(__pyx_t_7)) {
27867         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
27868         __Pyx_INCREF(__pyx_t_7);
27869         __Pyx_INCREF(function);
27870         __Pyx_DECREF_SET(__pyx_t_9, function);
27871         __pyx_t_8 = 1;
27872       }
27873     }
27874     #if CYTHON_FAST_PYCALL
27875     if (PyFunction_Check(__pyx_t_9)) {
27876       PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_v_cond1_equal_cond2};
27877       __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1639, __pyx_L1_error)
27878       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27879       __Pyx_GOTREF(__pyx_t_3);
27880       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27881     } else
27882     #endif
27883     #if CYTHON_FAST_PYCCALL
27884     if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
27885       PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_v_cond1_equal_cond2};
27886       __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1639, __pyx_L1_error)
27887       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27888       __Pyx_GOTREF(__pyx_t_3);
27889       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27890     } else
27891     #endif
27892     {
27893       __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1639, __pyx_L1_error)
27894       __Pyx_GOTREF(__pyx_t_4);
27895       if (__pyx_t_7) {
27896         __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
27897       }
27898       __Pyx_GIVEREF(__pyx_t_5);
27899       PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_5);
27900       __Pyx_INCREF(__pyx_v_cond1_equal_cond2);
27901       __Pyx_GIVEREF(__pyx_v_cond1_equal_cond2);
27902       PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_v_cond1_equal_cond2);
27903       __pyx_t_5 = 0;
27904       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1639, __pyx_L1_error)
27905       __Pyx_GOTREF(__pyx_t_3);
27906       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27907     }
27908     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27909     __pyx_t_9 = NULL;
27910     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
27911       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
27912       if (likely(__pyx_t_9)) {
27913         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
27914         __Pyx_INCREF(__pyx_t_9);
27915         __Pyx_INCREF(function);
27916         __Pyx_DECREF_SET(__pyx_t_6, function);
27917       }
27918     }
27919     __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
27920     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
27921     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27922     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1639, __pyx_L1_error)
27923     __Pyx_GOTREF(__pyx_t_2);
27924     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27925     __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1640, __pyx_L1_error)
27926     __Pyx_GOTREF(__pyx_t_6);
27927     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27928     __Pyx_XDECREF_SET(__pyx_v_cat3, __pyx_t_6);
27929     __pyx_t_6 = 0;
27930 
27931     /* "MACS2/IO/ScoreTrack.pyx":1642
27932  *                                    cond1_equal_cond2 ) ) [ 0 ]
27933  *
27934  *             cat1_endpos = pos[cat1] # end positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
27935  *             cat1_startpos = pos[cat1-1] # start positions of regions where score is above cutoff
27936  *             cat2_endpos = pos[cat2] # end positions of regions where score is above cutoff
27937  */
27938     __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_v_cat1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1642, __pyx_L1_error)
27939     __Pyx_GOTREF(__pyx_t_6);
27940     __Pyx_XDECREF_SET(__pyx_v_cat1_endpos, __pyx_t_6);
27941     __pyx_t_6 = 0;
27942 
27943     /* "MACS2/IO/ScoreTrack.pyx":1643
27944  *
27945  *             cat1_endpos = pos[cat1] # end positions of regions where score is above cutoff
27946  *             cat1_startpos = pos[cat1-1] # start positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
27947  *             cat2_endpos = pos[cat2] # end positions of regions where score is above cutoff
27948  *             cat2_startpos = pos[cat2-1] # start positions of regions where score is above cutoff
27949  */
27950     __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_cat1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1643, __pyx_L1_error)
27951     __Pyx_GOTREF(__pyx_t_6);
27952     __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1643, __pyx_L1_error)
27953     __Pyx_GOTREF(__pyx_t_2);
27954     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27955     __Pyx_XDECREF_SET(__pyx_v_cat1_startpos, __pyx_t_2);
27956     __pyx_t_2 = 0;
27957 
27958     /* "MACS2/IO/ScoreTrack.pyx":1644
27959  *             cat1_endpos = pos[cat1] # end positions of regions where score is above cutoff
27960  *             cat1_startpos = pos[cat1-1] # start positions of regions where score is above cutoff
27961  *             cat2_endpos = pos[cat2] # end positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
27962  *             cat2_startpos = pos[cat2-1] # start positions of regions where score is above cutoff
27963  *             cat3_endpos = pos[cat3] # end positions of regions where score is above cutoff
27964  */
27965     __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_v_cat2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1644, __pyx_L1_error)
27966     __Pyx_GOTREF(__pyx_t_2);
27967     __Pyx_XDECREF_SET(__pyx_v_cat2_endpos, __pyx_t_2);
27968     __pyx_t_2 = 0;
27969 
27970     /* "MACS2/IO/ScoreTrack.pyx":1645
27971  *             cat1_startpos = pos[cat1-1] # start positions of regions where score is above cutoff
27972  *             cat2_endpos = pos[cat2] # end positions of regions where score is above cutoff
27973  *             cat2_startpos = pos[cat2-1] # start positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
27974  *             cat3_endpos = pos[cat3] # end positions of regions where score is above cutoff
27975  *             cat3_startpos = pos[cat3-1] # start positions of regions where score is above cutoff
27976  */
27977     __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_cat2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1645, __pyx_L1_error)
27978     __Pyx_GOTREF(__pyx_t_2);
27979     __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1645, __pyx_L1_error)
27980     __Pyx_GOTREF(__pyx_t_6);
27981     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27982     __Pyx_XDECREF_SET(__pyx_v_cat2_startpos, __pyx_t_6);
27983     __pyx_t_6 = 0;
27984 
27985     /* "MACS2/IO/ScoreTrack.pyx":1646
27986  *             cat2_endpos = pos[cat2] # end positions of regions where score is above cutoff
27987  *             cat2_startpos = pos[cat2-1] # start positions of regions where score is above cutoff
27988  *             cat3_endpos = pos[cat3] # end positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
27989  *             cat3_startpos = pos[cat3-1] # start positions of regions where score is above cutoff
27990  *
27991  */
27992     __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_v_cat3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1646, __pyx_L1_error)
27993     __Pyx_GOTREF(__pyx_t_6);
27994     __Pyx_XDECREF_SET(__pyx_v_cat3_endpos, __pyx_t_6);
27995     __pyx_t_6 = 0;
27996 
27997     /* "MACS2/IO/ScoreTrack.pyx":1647
27998  *             cat2_startpos = pos[cat2-1] # start positions of regions where score is above cutoff
27999  *             cat3_endpos = pos[cat3] # end positions of regions where score is above cutoff
28000  *             cat3_startpos = pos[cat3-1] # start positions of regions where score is above cutoff             # <<<<<<<<<<<<<<
28001  *
28002  *             # for cat1: condition 1 stronger regions
28003  */
28004     __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_cat3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1647, __pyx_L1_error)
28005     __Pyx_GOTREF(__pyx_t_6);
28006     __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1647, __pyx_L1_error)
28007     __Pyx_GOTREF(__pyx_t_2);
28008     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28009     __Pyx_XDECREF_SET(__pyx_v_cat3_startpos, __pyx_t_2);
28010     __pyx_t_2 = 0;
28011 
28012     /* "MACS2/IO/ScoreTrack.pyx":1650
28013  *
28014  *             # for cat1: condition 1 stronger regions
28015  *             self.__add_a_peak ( cat1_peaks, chrom, cat1, cat1_startpos, cat1_endpos, t1_vs_t2, max_gap, min_length )             # <<<<<<<<<<<<<<
28016  *             # for cat2: condition 2 stronger regions
28017  *             self.__add_a_peak ( cat2_peaks, chrom, cat2, cat2_startpos, cat2_endpos, -1 * t1_vs_t2, max_gap, min_length )
28018  */
28019     if (!(likely(((__pyx_v_cat1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cat1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1650, __pyx_L1_error)
28020     if (!(likely(((__pyx_v_cat1_startpos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cat1_startpos, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1650, __pyx_L1_error)
28021     if (!(likely(((__pyx_v_cat1_endpos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cat1_endpos, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1650, __pyx_L1_error)
28022     if (!(likely(((__pyx_v_t1_vs_t2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t1_vs_t2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1650, __pyx_L1_error)
28023     __pyx_t_2 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->__pyx___add_a_peak(__pyx_v_self, __pyx_v_cat1_peaks, __pyx_v_chrom, ((PyArrayObject *)__pyx_v_cat1), ((PyArrayObject *)__pyx_v_cat1_startpos), ((PyArrayObject *)__pyx_v_cat1_endpos), ((PyArrayObject *)__pyx_v_t1_vs_t2), __pyx_v_max_gap, __pyx_v_min_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1650, __pyx_L1_error)
28024     __Pyx_GOTREF(__pyx_t_2);
28025     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28026 
28027     /* "MACS2/IO/ScoreTrack.pyx":1652
28028  *             self.__add_a_peak ( cat1_peaks, chrom, cat1, cat1_startpos, cat1_endpos, t1_vs_t2, max_gap, min_length )
28029  *             # for cat2: condition 2 stronger regions
28030  *             self.__add_a_peak ( cat2_peaks, chrom, cat2, cat2_startpos, cat2_endpos, -1 * t1_vs_t2, max_gap, min_length )             # <<<<<<<<<<<<<<
28031  *             # for cat3: commonly strong regions
28032  *             self.__add_a_peak ( cat3_peaks, chrom, cat3, cat3_startpos, cat3_endpos, abs(t1_vs_t2), max_gap, min_length )
28033  */
28034     if (!(likely(((__pyx_v_cat2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cat2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1652, __pyx_L1_error)
28035     if (!(likely(((__pyx_v_cat2_startpos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cat2_startpos, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1652, __pyx_L1_error)
28036     if (!(likely(((__pyx_v_cat2_endpos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cat2_endpos, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1652, __pyx_L1_error)
28037     __pyx_t_2 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_v_t1_vs_t2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1652, __pyx_L1_error)
28038     __Pyx_GOTREF(__pyx_t_2);
28039     if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1652, __pyx_L1_error)
28040     __pyx_t_6 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->__pyx___add_a_peak(__pyx_v_self, __pyx_v_cat2_peaks, __pyx_v_chrom, ((PyArrayObject *)__pyx_v_cat2), ((PyArrayObject *)__pyx_v_cat2_startpos), ((PyArrayObject *)__pyx_v_cat2_endpos), ((PyArrayObject *)__pyx_t_2), __pyx_v_max_gap, __pyx_v_min_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1652, __pyx_L1_error)
28041     __Pyx_GOTREF(__pyx_t_6);
28042     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28043     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28044 
28045     /* "MACS2/IO/ScoreTrack.pyx":1654
28046  *             self.__add_a_peak ( cat2_peaks, chrom, cat2, cat2_startpos, cat2_endpos, -1 * t1_vs_t2, max_gap, min_length )
28047  *             # for cat3: commonly strong regions
28048  *             self.__add_a_peak ( cat3_peaks, chrom, cat3, cat3_startpos, cat3_endpos, abs(t1_vs_t2), max_gap, min_length )             # <<<<<<<<<<<<<<
28049  *
28050  *         return (cat1_peaks, cat2_peaks, cat3_peaks)
28051  */
28052     if (!(likely(((__pyx_v_cat3) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cat3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1654, __pyx_L1_error)
28053     if (!(likely(((__pyx_v_cat3_startpos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cat3_startpos, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1654, __pyx_L1_error)
28054     if (!(likely(((__pyx_v_cat3_endpos) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cat3_endpos, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1654, __pyx_L1_error)
28055     __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_v_t1_vs_t2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1654, __pyx_L1_error)
28056     __Pyx_GOTREF(__pyx_t_6);
28057     if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1654, __pyx_L1_error)
28058     __pyx_t_2 = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->__pyx___add_a_peak(__pyx_v_self, __pyx_v_cat3_peaks, __pyx_v_chrom, ((PyArrayObject *)__pyx_v_cat3), ((PyArrayObject *)__pyx_v_cat3_startpos), ((PyArrayObject *)__pyx_v_cat3_endpos), ((PyArrayObject *)__pyx_t_6), __pyx_v_max_gap, __pyx_v_min_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1654, __pyx_L1_error)
28059     __Pyx_GOTREF(__pyx_t_2);
28060     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28061     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28062 
28063     /* "MACS2/IO/ScoreTrack.pyx":1625
28064  *         self.cutoff = cutoff
28065  *
28066  *         for chrom in chrs:             # <<<<<<<<<<<<<<
28067  *             pos = self.data[chrom][ 0 ]
28068  *             t1_vs_c1 = self.data[chrom][ 1 ]
28069  */
28070   }
28071   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28072 
28073   /* "MACS2/IO/ScoreTrack.pyx":1656
28074  *             self.__add_a_peak ( cat3_peaks, chrom, cat3, cat3_startpos, cat3_endpos, abs(t1_vs_t2), max_gap, min_length )
28075  *
28076  *         return (cat1_peaks, cat2_peaks, cat3_peaks)             # <<<<<<<<<<<<<<
28077  *
28078  *     cdef object __add_a_peak ( self, object peaks, bytes chrom, np.ndarray indices, np.ndarray startpos, np.ndarray endpos,
28079  */
28080   __Pyx_XDECREF(__pyx_r);
28081   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1656, __pyx_L1_error)
28082   __Pyx_GOTREF(__pyx_t_1);
28083   __Pyx_INCREF(__pyx_v_cat1_peaks);
28084   __Pyx_GIVEREF(__pyx_v_cat1_peaks);
28085   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cat1_peaks);
28086   __Pyx_INCREF(__pyx_v_cat2_peaks);
28087   __Pyx_GIVEREF(__pyx_v_cat2_peaks);
28088   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_cat2_peaks);
28089   __Pyx_INCREF(__pyx_v_cat3_peaks);
28090   __Pyx_GIVEREF(__pyx_v_cat3_peaks);
28091   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_cat3_peaks);
28092   __pyx_r = ((PyObject*)__pyx_t_1);
28093   __pyx_t_1 = 0;
28094   goto __pyx_L0;
28095 
28096   /* "MACS2/IO/ScoreTrack.pyx":1592
28097  *         return True
28098  *
28099  *     cpdef tuple call_peaks (self, float64_t cutoff=3, int32_t min_length=200, int32_t max_gap = 100,             # <<<<<<<<<<<<<<
28100  *                       bool call_summits=False):
28101  *         """This function try to find regions within which, scores
28102  */
28103 
28104   /* function exit code */
28105   __pyx_L1_error:;
28106   __Pyx_XDECREF(__pyx_t_1);
28107   __Pyx_XDECREF(__pyx_t_2);
28108   __Pyx_XDECREF(__pyx_t_3);
28109   __Pyx_XDECREF(__pyx_t_4);
28110   __Pyx_XDECREF(__pyx_t_5);
28111   __Pyx_XDECREF(__pyx_t_6);
28112   __Pyx_XDECREF(__pyx_t_7);
28113   __Pyx_XDECREF(__pyx_t_9);
28114   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
28115   __pyx_r = 0;
28116   __pyx_L0:;
28117   __Pyx_XDECREF(__pyx_v_chrom);
28118   __Pyx_XDECREF((PyObject *)__pyx_v_pos);
28119   __Pyx_XDECREF(__pyx_v_chrs);
28120   __Pyx_XDECREF(__pyx_v_cat1_peaks);
28121   __Pyx_XDECREF(__pyx_v_cat2_peaks);
28122   __Pyx_XDECREF(__pyx_v_cat3_peaks);
28123   __Pyx_XDECREF(__pyx_v_t1_vs_c1);
28124   __Pyx_XDECREF(__pyx_v_t2_vs_c2);
28125   __Pyx_XDECREF(__pyx_v_t1_vs_t2);
28126   __Pyx_XDECREF(__pyx_v_and_);
28127   __Pyx_XDECREF(__pyx_v_cond1_over_cond2);
28128   __Pyx_XDECREF(__pyx_v_cond2_over_cond1);
28129   __Pyx_XDECREF(__pyx_v_cond1_equal_cond2);
28130   __Pyx_XDECREF(__pyx_v_cond1_sig);
28131   __Pyx_XDECREF(__pyx_v_cond2_sig);
28132   __Pyx_XDECREF(__pyx_v_cat1);
28133   __Pyx_XDECREF(__pyx_v_cat2);
28134   __Pyx_XDECREF(__pyx_v_cat3);
28135   __Pyx_XDECREF(__pyx_v_cat1_endpos);
28136   __Pyx_XDECREF(__pyx_v_cat1_startpos);
28137   __Pyx_XDECREF(__pyx_v_cat2_endpos);
28138   __Pyx_XDECREF(__pyx_v_cat2_startpos);
28139   __Pyx_XDECREF(__pyx_v_cat3_endpos);
28140   __Pyx_XDECREF(__pyx_v_cat3_startpos);
28141   __Pyx_XGIVEREF(__pyx_r);
28142   __Pyx_TraceReturn(__pyx_r, 0);
28143   __Pyx_RefNannyFinishContext();
28144   return __pyx_r;
28145 }
28146 
28147 /* Python wrapper */
28148 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_19call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28149 static char __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_18call_peaks[] = "This function try to find regions within which, scores\n        are continuously higher than a given cutoff.\n\n        For bdgdiff.\n\n        This function is NOT using sliding-windows. Instead, any\n        regions in bedGraph above certain cutoff will be detected,\n        then merged if the gap between nearby two regions are below\n        max_gap. After this, peak is reported if its length is above\n        min_length.\n\n        cutoff:  cutoff of value, default 3. For log10 LR, it means 1000 or -1000.\n        min_length :  minimum peak length, default 200.\n        max_gap   :  maximum gap to merge nearby peaks, default 100.\n        ptrack:  an optional track for pileup heights. If it's not None, use it to find summits. Otherwise, use self/scoreTrack.\n        ";
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_19call_peaks(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)28150 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_19call_peaks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28151   __pyx_t_5numpy_float64_t __pyx_v_cutoff;
28152   __pyx_t_5numpy_int32_t __pyx_v_min_length;
28153   __pyx_t_5numpy_int32_t __pyx_v_max_gap;
28154   PyBoolObject *__pyx_v_call_summits = 0;
28155   PyObject *__pyx_r = 0;
28156   __Pyx_RefNannyDeclarations
28157   __Pyx_RefNannySetupContext("call_peaks (wrapper)", 0);
28158   {
28159     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cutoff,&__pyx_n_s_min_length,&__pyx_n_s_max_gap,&__pyx_n_s_call_summits,0};
28160     PyObject* values[4] = {0,0,0,0};
28161 
28162     /* "MACS2/IO/ScoreTrack.pyx":1593
28163  *
28164  *     cpdef tuple call_peaks (self, float64_t cutoff=3, int32_t min_length=200, int32_t max_gap = 100,
28165  *                       bool call_summits=False):             # <<<<<<<<<<<<<<
28166  *         """This function try to find regions within which, scores
28167  *         are continuously higher than a given cutoff.
28168  */
28169     values[3] = (PyObject *)((PyBoolObject *)Py_False);
28170     if (unlikely(__pyx_kwds)) {
28171       Py_ssize_t kw_args;
28172       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28173       switch (pos_args) {
28174         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
28175         CYTHON_FALLTHROUGH;
28176         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
28177         CYTHON_FALLTHROUGH;
28178         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28179         CYTHON_FALLTHROUGH;
28180         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28181         CYTHON_FALLTHROUGH;
28182         case  0: break;
28183         default: goto __pyx_L5_argtuple_error;
28184       }
28185       kw_args = PyDict_Size(__pyx_kwds);
28186       switch (pos_args) {
28187         case  0:
28188         if (kw_args > 0) {
28189           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff);
28190           if (value) { values[0] = value; kw_args--; }
28191         }
28192         CYTHON_FALLTHROUGH;
28193         case  1:
28194         if (kw_args > 0) {
28195           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_length);
28196           if (value) { values[1] = value; kw_args--; }
28197         }
28198         CYTHON_FALLTHROUGH;
28199         case  2:
28200         if (kw_args > 0) {
28201           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_gap);
28202           if (value) { values[2] = value; kw_args--; }
28203         }
28204         CYTHON_FALLTHROUGH;
28205         case  3:
28206         if (kw_args > 0) {
28207           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_call_summits);
28208           if (value) { values[3] = value; kw_args--; }
28209         }
28210       }
28211       if (unlikely(kw_args > 0)) {
28212         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "call_peaks") < 0)) __PYX_ERR(0, 1592, __pyx_L3_error)
28213       }
28214     } else {
28215       switch (PyTuple_GET_SIZE(__pyx_args)) {
28216         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
28217         CYTHON_FALLTHROUGH;
28218         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
28219         CYTHON_FALLTHROUGH;
28220         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28221         CYTHON_FALLTHROUGH;
28222         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28223         CYTHON_FALLTHROUGH;
28224         case  0: break;
28225         default: goto __pyx_L5_argtuple_error;
28226       }
28227     }
28228     if (values[0]) {
28229       __pyx_v_cutoff = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_cutoff == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1592, __pyx_L3_error)
28230     } else {
28231       __pyx_v_cutoff = ((__pyx_t_5numpy_float64_t)3.0);
28232     }
28233     if (values[1]) {
28234       __pyx_v_min_length = __Pyx_PyInt_As_npy_int32(values[1]); if (unlikely((__pyx_v_min_length == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1592, __pyx_L3_error)
28235     } else {
28236       __pyx_v_min_length = ((__pyx_t_5numpy_int32_t)0xC8);
28237     }
28238     if (values[2]) {
28239       __pyx_v_max_gap = __Pyx_PyInt_As_npy_int32(values[2]); if (unlikely((__pyx_v_max_gap == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1592, __pyx_L3_error)
28240     } else {
28241       __pyx_v_max_gap = ((__pyx_t_5numpy_int32_t)0x64);
28242     }
28243     __pyx_v_call_summits = ((PyBoolObject *)values[3]);
28244   }
28245   goto __pyx_L4_argument_unpacking_done;
28246   __pyx_L5_argtuple_error:;
28247   __Pyx_RaiseArgtupleInvalid("call_peaks", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1592, __pyx_L3_error)
28248   __pyx_L3_error:;
28249   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
28250   __Pyx_RefNannyFinishContext();
28251   return NULL;
28252   __pyx_L4_argument_unpacking_done:;
28253   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_call_summits), __pyx_ptype_7cpython_4bool_bool, 1, "call_summits", 0))) __PYX_ERR(0, 1593, __pyx_L1_error)
28254   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_18call_peaks(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_min_length, __pyx_v_max_gap, __pyx_v_call_summits);
28255 
28256   /* "MACS2/IO/ScoreTrack.pyx":1592
28257  *         return True
28258  *
28259  *     cpdef tuple call_peaks (self, float64_t cutoff=3, int32_t min_length=200, int32_t max_gap = 100,             # <<<<<<<<<<<<<<
28260  *                       bool call_summits=False):
28261  *         """This function try to find regions within which, scores
28262  */
28263 
28264   /* function exit code */
28265   goto __pyx_L0;
28266   __pyx_L1_error:;
28267   __pyx_r = NULL;
28268   __pyx_L0:;
28269   __Pyx_RefNannyFinishContext();
28270   return __pyx_r;
28271 }
28272 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_18call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,__pyx_t_5numpy_float64_t __pyx_v_cutoff,__pyx_t_5numpy_int32_t __pyx_v_min_length,__pyx_t_5numpy_int32_t __pyx_v_max_gap,PyBoolObject * __pyx_v_call_summits)28273 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_18call_peaks(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_cutoff, __pyx_t_5numpy_int32_t __pyx_v_min_length, __pyx_t_5numpy_int32_t __pyx_v_max_gap, PyBoolObject *__pyx_v_call_summits) {
28274   PyObject *__pyx_r = NULL;
28275   __Pyx_TraceDeclarations
28276   __Pyx_RefNannyDeclarations
28277   PyObject *__pyx_t_1 = NULL;
28278   struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks __pyx_t_2;
28279   __Pyx_RefNannySetupContext("call_peaks", 0);
28280   __Pyx_TraceCall("call_peaks (wrapper)", __pyx_f[0], 1592, 0, __PYX_ERR(0, 1592, __pyx_L1_error));
28281   __Pyx_XDECREF(__pyx_r);
28282   __pyx_t_2.__pyx_n = 4;
28283   __pyx_t_2.cutoff = __pyx_v_cutoff;
28284   __pyx_t_2.min_length = __pyx_v_min_length;
28285   __pyx_t_2.max_gap = __pyx_v_max_gap;
28286   __pyx_t_2.call_summits = __pyx_v_call_summits;
28287   __pyx_t_1 = __pyx_vtabptr_5MACS2_2IO_10ScoreTrack_TwoConditionScores->call_peaks(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
28288   __Pyx_GOTREF(__pyx_t_1);
28289   __pyx_r = __pyx_t_1;
28290   __pyx_t_1 = 0;
28291   goto __pyx_L0;
28292 
28293   /* function exit code */
28294   __pyx_L1_error:;
28295   __Pyx_XDECREF(__pyx_t_1);
28296   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
28297   __pyx_r = NULL;
28298   __pyx_L0:;
28299   __Pyx_XGIVEREF(__pyx_r);
28300   __Pyx_TraceReturn(__pyx_r, 0);
28301   __Pyx_RefNannyFinishContext();
28302   return __pyx_r;
28303 }
28304 
28305 /* "MACS2/IO/ScoreTrack.pyx":1658
28306  *         return (cat1_peaks, cat2_peaks, cat3_peaks)
28307  *
28308  *     cdef object __add_a_peak ( self, object peaks, bytes chrom, np.ndarray indices, np.ndarray startpos, np.ndarray endpos,             # <<<<<<<<<<<<<<
28309  *                                np.ndarray score, int32_t max_gap, int32_t min_length ):
28310  *          """For a given chromosome, merge nearby significant regions,
28311  */
28312 
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___add_a_peak(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_peaks,PyObject * __pyx_v_chrom,PyArrayObject * __pyx_v_indices,PyArrayObject * __pyx_v_startpos,PyArrayObject * __pyx_v_endpos,PyArrayObject * __pyx_v_score,__pyx_t_5numpy_int32_t __pyx_v_max_gap,__pyx_t_5numpy_int32_t __pyx_v_min_length)28313 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___add_a_peak(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_peaks, PyObject *__pyx_v_chrom, PyArrayObject *__pyx_v_indices, PyArrayObject *__pyx_v_startpos, PyArrayObject *__pyx_v_endpos, PyArrayObject *__pyx_v_score, __pyx_t_5numpy_int32_t __pyx_v_max_gap, __pyx_t_5numpy_int32_t __pyx_v_min_length) {
28314   PyObject *__pyx_v_peak_content = 0;
28315   __pyx_t_5numpy_float32_t __pyx_v_mean_logLR;
28316   PyObject *__pyx_v_i = NULL;
28317   PyObject *__pyx_r = NULL;
28318   __Pyx_TraceDeclarations
28319   __Pyx_RefNannyDeclarations
28320   PyObject *__pyx_t_1 = NULL;
28321   PyObject *__pyx_t_2 = NULL;
28322   int __pyx_t_3;
28323   PyObject *__pyx_t_4 = NULL;
28324   PyObject *__pyx_t_5 = NULL;
28325   int __pyx_t_6;
28326   Py_ssize_t __pyx_t_7;
28327   PyObject *(*__pyx_t_8)(PyObject *);
28328   PyObject *__pyx_t_9 = NULL;
28329   __Pyx_RefNannySetupContext("__add_a_peak", 0);
28330   __Pyx_TraceCall("__add_a_peak", __pyx_f[0], 1658, 0, __PYX_ERR(0, 1658, __pyx_L1_error));
28331 
28332   /* "MACS2/IO/ScoreTrack.pyx":1669
28333  *              float32_t mean_logLR
28334  *
28335  *          if startpos.size > 0:             # <<<<<<<<<<<<<<
28336  *              # if it is not empty
28337  *              peak_content = []
28338  */
28339   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_startpos), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1669, __pyx_L1_error)
28340   __Pyx_GOTREF(__pyx_t_1);
28341   __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1669, __pyx_L1_error)
28342   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28343   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1669, __pyx_L1_error)
28344   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28345   if (__pyx_t_3) {
28346 
28347     /* "MACS2/IO/ScoreTrack.pyx":1671
28348  *          if startpos.size > 0:
28349  *              # if it is not empty
28350  *              peak_content = []             # <<<<<<<<<<<<<<
28351  *              if indices[0] == 0:
28352  *                  # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
28353  */
28354     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1671, __pyx_L1_error)
28355     __Pyx_GOTREF(__pyx_t_2);
28356     __pyx_v_peak_content = ((PyObject*)__pyx_t_2);
28357     __pyx_t_2 = 0;
28358 
28359     /* "MACS2/IO/ScoreTrack.pyx":1672
28360  *              # if it is not empty
28361  *              peak_content = []
28362  *              if indices[0] == 0:             # <<<<<<<<<<<<<<
28363  *                  # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
28364  *                  startpos[0] = 0
28365  */
28366     __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_indices), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1672, __pyx_L1_error)
28367     __Pyx_GOTREF(__pyx_t_2);
28368     __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1672, __pyx_L1_error)
28369     __Pyx_GOTREF(__pyx_t_1);
28370     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28371     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1672, __pyx_L1_error)
28372     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28373     if (__pyx_t_3) {
28374 
28375       /* "MACS2/IO/ScoreTrack.pyx":1674
28376  *              if indices[0] == 0:
28377  *                  # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
28378  *                  startpos[0] = 0             # <<<<<<<<<<<<<<
28379  *              # first bit of region above cutoff
28380  *              peak_content.append( (startpos[0], endpos[0], score[indices[ 0 ]]) )
28381  */
28382       if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_startpos), 0, __pyx_int_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1674, __pyx_L1_error)
28383 
28384       /* "MACS2/IO/ScoreTrack.pyx":1672
28385  *              # if it is not empty
28386  *              peak_content = []
28387  *              if indices[0] == 0:             # <<<<<<<<<<<<<<
28388  *                  # first element > cutoff, fix the first point as 0. otherwise it would be the last item in data[chrom]['pos']
28389  *                  startpos[0] = 0
28390  */
28391     }
28392 
28393     /* "MACS2/IO/ScoreTrack.pyx":1676
28394  *                  startpos[0] = 0
28395  *              # first bit of region above cutoff
28396  *              peak_content.append( (startpos[0], endpos[0], score[indices[ 0 ]]) )             # <<<<<<<<<<<<<<
28397  *              for i in range( 1, startpos.size ):
28398  *                  if startpos[i] - peak_content[-1][1] <= max_gap:
28399  */
28400     __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_startpos), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __pyx_L1_error)
28401     __Pyx_GOTREF(__pyx_t_1);
28402     __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_endpos), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1676, __pyx_L1_error)
28403     __Pyx_GOTREF(__pyx_t_2);
28404     __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_indices), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L1_error)
28405     __Pyx_GOTREF(__pyx_t_4);
28406     __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_score), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1676, __pyx_L1_error)
28407     __Pyx_GOTREF(__pyx_t_5);
28408     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28409     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L1_error)
28410     __Pyx_GOTREF(__pyx_t_4);
28411     __Pyx_GIVEREF(__pyx_t_1);
28412     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
28413     __Pyx_GIVEREF(__pyx_t_2);
28414     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
28415     __Pyx_GIVEREF(__pyx_t_5);
28416     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5);
28417     __pyx_t_1 = 0;
28418     __pyx_t_2 = 0;
28419     __pyx_t_5 = 0;
28420     __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_peak_content, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1676, __pyx_L1_error)
28421     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28422 
28423     /* "MACS2/IO/ScoreTrack.pyx":1677
28424  *              # first bit of region above cutoff
28425  *              peak_content.append( (startpos[0], endpos[0], score[indices[ 0 ]]) )
28426  *              for i in range( 1, startpos.size ):             # <<<<<<<<<<<<<<
28427  *                  if startpos[i] - peak_content[-1][1] <= max_gap:
28428  *                      # append
28429  */
28430     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_startpos), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L1_error)
28431     __Pyx_GOTREF(__pyx_t_4);
28432     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1677, __pyx_L1_error)
28433     __Pyx_GOTREF(__pyx_t_5);
28434     __Pyx_INCREF(__pyx_int_1);
28435     __Pyx_GIVEREF(__pyx_int_1);
28436     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_1);
28437     __Pyx_GIVEREF(__pyx_t_4);
28438     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
28439     __pyx_t_4 = 0;
28440     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L1_error)
28441     __Pyx_GOTREF(__pyx_t_4);
28442     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28443     if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
28444       __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
28445       __pyx_t_8 = NULL;
28446     } else {
28447       __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1677, __pyx_L1_error)
28448       __Pyx_GOTREF(__pyx_t_5);
28449       __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1677, __pyx_L1_error)
28450     }
28451     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28452     for (;;) {
28453       if (likely(!__pyx_t_8)) {
28454         if (likely(PyList_CheckExact(__pyx_t_5))) {
28455           if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
28456           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28457           __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1677, __pyx_L1_error)
28458           #else
28459           __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L1_error)
28460           __Pyx_GOTREF(__pyx_t_4);
28461           #endif
28462         } else {
28463           if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
28464           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28465           __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1677, __pyx_L1_error)
28466           #else
28467           __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L1_error)
28468           __Pyx_GOTREF(__pyx_t_4);
28469           #endif
28470         }
28471       } else {
28472         __pyx_t_4 = __pyx_t_8(__pyx_t_5);
28473         if (unlikely(!__pyx_t_4)) {
28474           PyObject* exc_type = PyErr_Occurred();
28475           if (exc_type) {
28476             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
28477             else __PYX_ERR(0, 1677, __pyx_L1_error)
28478           }
28479           break;
28480         }
28481         __Pyx_GOTREF(__pyx_t_4);
28482       }
28483       __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
28484       __pyx_t_4 = 0;
28485 
28486       /* "MACS2/IO/ScoreTrack.pyx":1678
28487  *              peak_content.append( (startpos[0], endpos[0], score[indices[ 0 ]]) )
28488  *              for i in range( 1, startpos.size ):
28489  *                  if startpos[i] - peak_content[-1][1] <= max_gap:             # <<<<<<<<<<<<<<
28490  *                      # append
28491  *                      peak_content.append( ( startpos[i], endpos[i], score[indices[ i ]] ) )
28492  */
28493       __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_startpos), __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1678, __pyx_L1_error)
28494       __Pyx_GOTREF(__pyx_t_4);
28495       __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_peak_content, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1678, __pyx_L1_error)
28496       __Pyx_GOTREF(__pyx_t_2);
28497       __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1678, __pyx_L1_error)
28498       __Pyx_GOTREF(__pyx_t_1);
28499       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28500       __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1678, __pyx_L1_error)
28501       __Pyx_GOTREF(__pyx_t_2);
28502       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28503       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28504       __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_max_gap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1678, __pyx_L1_error)
28505       __Pyx_GOTREF(__pyx_t_1);
28506       __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1678, __pyx_L1_error)
28507       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28508       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28509       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1678, __pyx_L1_error)
28510       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28511       if (__pyx_t_3) {
28512 
28513         /* "MACS2/IO/ScoreTrack.pyx":1680
28514  *                  if startpos[i] - peak_content[-1][1] <= max_gap:
28515  *                      # append
28516  *                      peak_content.append( ( startpos[i], endpos[i], score[indices[ i ]] ) )             # <<<<<<<<<<<<<<
28517  *                  else:
28518  *                      # close
28519  */
28520         __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_startpos), __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1680, __pyx_L1_error)
28521         __Pyx_GOTREF(__pyx_t_4);
28522         __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_endpos), __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1680, __pyx_L1_error)
28523         __Pyx_GOTREF(__pyx_t_1);
28524         __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_indices), __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1680, __pyx_L1_error)
28525         __Pyx_GOTREF(__pyx_t_2);
28526         __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_score), __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1680, __pyx_L1_error)
28527         __Pyx_GOTREF(__pyx_t_9);
28528         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28529         __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1680, __pyx_L1_error)
28530         __Pyx_GOTREF(__pyx_t_2);
28531         __Pyx_GIVEREF(__pyx_t_4);
28532         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
28533         __Pyx_GIVEREF(__pyx_t_1);
28534         PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
28535         __Pyx_GIVEREF(__pyx_t_9);
28536         PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_9);
28537         __pyx_t_4 = 0;
28538         __pyx_t_1 = 0;
28539         __pyx_t_9 = 0;
28540         __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_peak_content, __pyx_t_2); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1680, __pyx_L1_error)
28541         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28542 
28543         /* "MACS2/IO/ScoreTrack.pyx":1678
28544  *              peak_content.append( (startpos[0], endpos[0], score[indices[ 0 ]]) )
28545  *              for i in range( 1, startpos.size ):
28546  *                  if startpos[i] - peak_content[-1][1] <= max_gap:             # <<<<<<<<<<<<<<
28547  *                      # append
28548  *                      peak_content.append( ( startpos[i], endpos[i], score[indices[ i ]] ) )
28549  */
28550         goto __pyx_L7;
28551       }
28552 
28553       /* "MACS2/IO/ScoreTrack.pyx":1683
28554  *                  else:
28555  *                      # close
28556  *                      if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:             # <<<<<<<<<<<<<<
28557  *                          mean_logLR = self.mean_from_peakcontent( peak_content )
28558  *                          peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
28559  */
28560       /*else*/ {
28561         __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_peak_content, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1683, __pyx_L1_error)
28562         __Pyx_GOTREF(__pyx_t_2);
28563         __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1683, __pyx_L1_error)
28564         __Pyx_GOTREF(__pyx_t_9);
28565         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28566         __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_peak_content, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1683, __pyx_L1_error)
28567         __Pyx_GOTREF(__pyx_t_2);
28568         __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1683, __pyx_L1_error)
28569         __Pyx_GOTREF(__pyx_t_1);
28570         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28571         __pyx_t_2 = PyNumber_Subtract(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1683, __pyx_L1_error)
28572         __Pyx_GOTREF(__pyx_t_2);
28573         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28574         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28575         __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_min_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1683, __pyx_L1_error)
28576         __Pyx_GOTREF(__pyx_t_1);
28577         __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1683, __pyx_L1_error)
28578         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28579         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28580         __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1683, __pyx_L1_error)
28581         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28582         if (__pyx_t_3) {
28583 
28584           /* "MACS2/IO/ScoreTrack.pyx":1684
28585  *                      # close
28586  *                      if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
28587  *                          mean_logLR = self.mean_from_peakcontent( peak_content )             # <<<<<<<<<<<<<<
28588  *                          peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
28589  *                                     summit = -1, peak_score  = mean_logLR, pileup = 0, pscore = 0,
28590  */
28591           __pyx_v_mean_logLR = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->mean_from_peakcontent(__pyx_v_self, __pyx_v_peak_content);
28592 
28593           /* "MACS2/IO/ScoreTrack.pyx":1685
28594  *                      if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
28595  *                          mean_logLR = self.mean_from_peakcontent( peak_content )
28596  *                          peaks.add( chrom, peak_content[0][0], peak_content[-1][1],             # <<<<<<<<<<<<<<
28597  *                                     summit = -1, peak_score  = mean_logLR, pileup = 0, pscore = 0,
28598  *                                     fold_change = 0, qscore = 0,
28599  */
28600           __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_peaks, __pyx_n_s_add); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1685, __pyx_L1_error)
28601           __Pyx_GOTREF(__pyx_t_9);
28602           __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_peak_content, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1685, __pyx_L1_error)
28603           __Pyx_GOTREF(__pyx_t_1);
28604           __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error)
28605           __Pyx_GOTREF(__pyx_t_2);
28606           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28607           __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_peak_content, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1685, __pyx_L1_error)
28608           __Pyx_GOTREF(__pyx_t_1);
28609           __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1685, __pyx_L1_error)
28610           __Pyx_GOTREF(__pyx_t_4);
28611           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28612           __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1685, __pyx_L1_error)
28613           __Pyx_GOTREF(__pyx_t_1);
28614           __Pyx_INCREF(__pyx_v_chrom);
28615           __Pyx_GIVEREF(__pyx_v_chrom);
28616           PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
28617           __Pyx_GIVEREF(__pyx_t_2);
28618           PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
28619           __Pyx_GIVEREF(__pyx_t_4);
28620           PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
28621           __pyx_t_2 = 0;
28622           __pyx_t_4 = 0;
28623 
28624           /* "MACS2/IO/ScoreTrack.pyx":1686
28625  *                          mean_logLR = self.mean_from_peakcontent( peak_content )
28626  *                          peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
28627  *                                     summit = -1, peak_score  = mean_logLR, pileup = 0, pscore = 0,             # <<<<<<<<<<<<<<
28628  *                                     fold_change = 0, qscore = 0,
28629  *                                     )
28630  */
28631           __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1686, __pyx_L1_error)
28632           __Pyx_GOTREF(__pyx_t_4);
28633           if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_summit, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1686, __pyx_L1_error)
28634           __pyx_t_2 = PyFloat_FromDouble(__pyx_v_mean_logLR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1686, __pyx_L1_error)
28635           __Pyx_GOTREF(__pyx_t_2);
28636           if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_peak_score, __pyx_t_2) < 0) __PYX_ERR(0, 1686, __pyx_L1_error)
28637           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28638           if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pileup, __pyx_int_0) < 0) __PYX_ERR(0, 1686, __pyx_L1_error)
28639           if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pscore, __pyx_int_0) < 0) __PYX_ERR(0, 1686, __pyx_L1_error)
28640           if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fold_change, __pyx_int_0) < 0) __PYX_ERR(0, 1686, __pyx_L1_error)
28641           if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_qscore, __pyx_int_0) < 0) __PYX_ERR(0, 1686, __pyx_L1_error)
28642 
28643           /* "MACS2/IO/ScoreTrack.pyx":1685
28644  *                      if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
28645  *                          mean_logLR = self.mean_from_peakcontent( peak_content )
28646  *                          peaks.add( chrom, peak_content[0][0], peak_content[-1][1],             # <<<<<<<<<<<<<<
28647  *                                     summit = -1, peak_score  = mean_logLR, pileup = 0, pscore = 0,
28648  *                                     fold_change = 0, qscore = 0,
28649  */
28650           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error)
28651           __Pyx_GOTREF(__pyx_t_2);
28652           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28653           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28654           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28655           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28656 
28657           /* "MACS2/IO/ScoreTrack.pyx":1683
28658  *                  else:
28659  *                      # close
28660  *                      if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:             # <<<<<<<<<<<<<<
28661  *                          mean_logLR = self.mean_from_peakcontent( peak_content )
28662  *                          peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
28663  */
28664         }
28665 
28666         /* "MACS2/IO/ScoreTrack.pyx":1689
28667  *                                     fold_change = 0, qscore = 0,
28668  *                                     )
28669  *                      peak_content = [(startpos[i], endpos[i], score[ indices[ i ] ]),]             # <<<<<<<<<<<<<<
28670  *
28671  *              # save the last peak
28672  */
28673         __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_startpos), __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1689, __pyx_L1_error)
28674         __Pyx_GOTREF(__pyx_t_2);
28675         __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_endpos), __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1689, __pyx_L1_error)
28676         __Pyx_GOTREF(__pyx_t_4);
28677         __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_indices), __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1689, __pyx_L1_error)
28678         __Pyx_GOTREF(__pyx_t_1);
28679         __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_score), __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1689, __pyx_L1_error)
28680         __Pyx_GOTREF(__pyx_t_9);
28681         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28682         __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1689, __pyx_L1_error)
28683         __Pyx_GOTREF(__pyx_t_1);
28684         __Pyx_GIVEREF(__pyx_t_2);
28685         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
28686         __Pyx_GIVEREF(__pyx_t_4);
28687         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
28688         __Pyx_GIVEREF(__pyx_t_9);
28689         PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_9);
28690         __pyx_t_2 = 0;
28691         __pyx_t_4 = 0;
28692         __pyx_t_9 = 0;
28693         __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1689, __pyx_L1_error)
28694         __Pyx_GOTREF(__pyx_t_9);
28695         __Pyx_GIVEREF(__pyx_t_1);
28696         PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
28697         __pyx_t_1 = 0;
28698         __Pyx_DECREF_SET(__pyx_v_peak_content, ((PyObject*)__pyx_t_9));
28699         __pyx_t_9 = 0;
28700       }
28701       __pyx_L7:;
28702 
28703       /* "MACS2/IO/ScoreTrack.pyx":1677
28704  *              # first bit of region above cutoff
28705  *              peak_content.append( (startpos[0], endpos[0], score[indices[ 0 ]]) )
28706  *              for i in range( 1, startpos.size ):             # <<<<<<<<<<<<<<
28707  *                  if startpos[i] - peak_content[-1][1] <= max_gap:
28708  *                      # append
28709  */
28710     }
28711     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28712 
28713     /* "MACS2/IO/ScoreTrack.pyx":1692
28714  *
28715  *              # save the last peak
28716  *              if peak_content:             # <<<<<<<<<<<<<<
28717  *                  if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
28718  *                      mean_logLR = self.mean_from_peakcontent( peak_content )
28719  */
28720     __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_peak_content) != 0);
28721     if (__pyx_t_3) {
28722 
28723       /* "MACS2/IO/ScoreTrack.pyx":1693
28724  *              # save the last peak
28725  *              if peak_content:
28726  *                  if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:             # <<<<<<<<<<<<<<
28727  *                      mean_logLR = self.mean_from_peakcontent( peak_content )
28728  *                      peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
28729  */
28730       __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_peak_content, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1693, __pyx_L1_error)
28731       __Pyx_GOTREF(__pyx_t_5);
28732       __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1693, __pyx_L1_error)
28733       __Pyx_GOTREF(__pyx_t_9);
28734       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28735       __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_peak_content, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1693, __pyx_L1_error)
28736       __Pyx_GOTREF(__pyx_t_5);
28737       __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1693, __pyx_L1_error)
28738       __Pyx_GOTREF(__pyx_t_1);
28739       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28740       __pyx_t_5 = PyNumber_Subtract(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1693, __pyx_L1_error)
28741       __Pyx_GOTREF(__pyx_t_5);
28742       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28743       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28744       __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_min_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1693, __pyx_L1_error)
28745       __Pyx_GOTREF(__pyx_t_1);
28746       __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1693, __pyx_L1_error)
28747       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28748       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28749       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1693, __pyx_L1_error)
28750       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28751       if (__pyx_t_3) {
28752 
28753         /* "MACS2/IO/ScoreTrack.pyx":1694
28754  *              if peak_content:
28755  *                  if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
28756  *                      mean_logLR = self.mean_from_peakcontent( peak_content )             # <<<<<<<<<<<<<<
28757  *                      peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
28758  *                                 summit = -1, peak_score  = mean_logLR, pileup = 0, pscore = 0,
28759  */
28760         __pyx_v_mean_logLR = ((struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self->__pyx_vtab)->mean_from_peakcontent(__pyx_v_self, __pyx_v_peak_content);
28761 
28762         /* "MACS2/IO/ScoreTrack.pyx":1695
28763  *                  if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
28764  *                      mean_logLR = self.mean_from_peakcontent( peak_content )
28765  *                      peaks.add( chrom, peak_content[0][0], peak_content[-1][1],             # <<<<<<<<<<<<<<
28766  *                                 summit = -1, peak_score  = mean_logLR, pileup = 0, pscore = 0,
28767  *                                 fold_change = 0, qscore = 0,
28768  */
28769         __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_peaks, __pyx_n_s_add); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1695, __pyx_L1_error)
28770         __Pyx_GOTREF(__pyx_t_9);
28771         __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_peak_content, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1695, __pyx_L1_error)
28772         __Pyx_GOTREF(__pyx_t_1);
28773         __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1695, __pyx_L1_error)
28774         __Pyx_GOTREF(__pyx_t_5);
28775         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28776         __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_peak_content, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1695, __pyx_L1_error)
28777         __Pyx_GOTREF(__pyx_t_1);
28778         __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1695, __pyx_L1_error)
28779         __Pyx_GOTREF(__pyx_t_4);
28780         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28781         __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1695, __pyx_L1_error)
28782         __Pyx_GOTREF(__pyx_t_1);
28783         __Pyx_INCREF(__pyx_v_chrom);
28784         __Pyx_GIVEREF(__pyx_v_chrom);
28785         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom);
28786         __Pyx_GIVEREF(__pyx_t_5);
28787         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
28788         __Pyx_GIVEREF(__pyx_t_4);
28789         PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
28790         __pyx_t_5 = 0;
28791         __pyx_t_4 = 0;
28792 
28793         /* "MACS2/IO/ScoreTrack.pyx":1696
28794  *                      mean_logLR = self.mean_from_peakcontent( peak_content )
28795  *                      peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
28796  *                                 summit = -1, peak_score  = mean_logLR, pileup = 0, pscore = 0,             # <<<<<<<<<<<<<<
28797  *                                 fold_change = 0, qscore = 0,
28798  *                                 )
28799  */
28800         __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1696, __pyx_L1_error)
28801         __Pyx_GOTREF(__pyx_t_4);
28802         if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_summit, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1696, __pyx_L1_error)
28803         __pyx_t_5 = PyFloat_FromDouble(__pyx_v_mean_logLR); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1696, __pyx_L1_error)
28804         __Pyx_GOTREF(__pyx_t_5);
28805         if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_peak_score, __pyx_t_5) < 0) __PYX_ERR(0, 1696, __pyx_L1_error)
28806         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28807         if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pileup, __pyx_int_0) < 0) __PYX_ERR(0, 1696, __pyx_L1_error)
28808         if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pscore, __pyx_int_0) < 0) __PYX_ERR(0, 1696, __pyx_L1_error)
28809         if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fold_change, __pyx_int_0) < 0) __PYX_ERR(0, 1696, __pyx_L1_error)
28810         if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_qscore, __pyx_int_0) < 0) __PYX_ERR(0, 1696, __pyx_L1_error)
28811 
28812         /* "MACS2/IO/ScoreTrack.pyx":1695
28813  *                  if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
28814  *                      mean_logLR = self.mean_from_peakcontent( peak_content )
28815  *                      peaks.add( chrom, peak_content[0][0], peak_content[-1][1],             # <<<<<<<<<<<<<<
28816  *                                 summit = -1, peak_score  = mean_logLR, pileup = 0, pscore = 0,
28817  *                                 fold_change = 0, qscore = 0,
28818  */
28819         __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1695, __pyx_L1_error)
28820         __Pyx_GOTREF(__pyx_t_5);
28821         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28822         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28823         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28824         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28825 
28826         /* "MACS2/IO/ScoreTrack.pyx":1693
28827  *              # save the last peak
28828  *              if peak_content:
28829  *                  if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:             # <<<<<<<<<<<<<<
28830  *                      mean_logLR = self.mean_from_peakcontent( peak_content )
28831  *                      peaks.add( chrom, peak_content[0][0], peak_content[-1][1],
28832  */
28833       }
28834 
28835       /* "MACS2/IO/ScoreTrack.pyx":1692
28836  *
28837  *              # save the last peak
28838  *              if peak_content:             # <<<<<<<<<<<<<<
28839  *                  if peak_content[ -1 ][ 1 ] - peak_content[ 0 ][ 0 ] >= min_length:
28840  *                      mean_logLR = self.mean_from_peakcontent( peak_content )
28841  */
28842     }
28843 
28844     /* "MACS2/IO/ScoreTrack.pyx":1669
28845  *              float32_t mean_logLR
28846  *
28847  *          if startpos.size > 0:             # <<<<<<<<<<<<<<
28848  *              # if it is not empty
28849  *              peak_content = []
28850  */
28851   }
28852 
28853   /* "MACS2/IO/ScoreTrack.pyx":1700
28854  *                                 )
28855  *
28856  *          return             # <<<<<<<<<<<<<<
28857  *
28858  *     cdef float64_t mean_from_peakcontent ( self, list peakcontent ):
28859  */
28860   __Pyx_XDECREF(__pyx_r);
28861   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28862   goto __pyx_L0;
28863 
28864   /* "MACS2/IO/ScoreTrack.pyx":1658
28865  *         return (cat1_peaks, cat2_peaks, cat3_peaks)
28866  *
28867  *     cdef object __add_a_peak ( self, object peaks, bytes chrom, np.ndarray indices, np.ndarray startpos, np.ndarray endpos,             # <<<<<<<<<<<<<<
28868  *                                np.ndarray score, int32_t max_gap, int32_t min_length ):
28869  *          """For a given chromosome, merge nearby significant regions,
28870  */
28871 
28872   /* function exit code */
28873   __pyx_L1_error:;
28874   __Pyx_XDECREF(__pyx_t_1);
28875   __Pyx_XDECREF(__pyx_t_2);
28876   __Pyx_XDECREF(__pyx_t_4);
28877   __Pyx_XDECREF(__pyx_t_5);
28878   __Pyx_XDECREF(__pyx_t_9);
28879   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.__add_a_peak", __pyx_clineno, __pyx_lineno, __pyx_filename);
28880   __pyx_r = 0;
28881   __pyx_L0:;
28882   __Pyx_XDECREF(__pyx_v_peak_content);
28883   __Pyx_XDECREF(__pyx_v_i);
28884   __Pyx_XGIVEREF(__pyx_r);
28885   __Pyx_TraceReturn(__pyx_r, 0);
28886   __Pyx_RefNannyFinishContext();
28887   return __pyx_r;
28888 }
28889 
28890 /* "MACS2/IO/ScoreTrack.pyx":1702
28891  *          return
28892  *
28893  *     cdef float64_t mean_from_peakcontent ( self, list peakcontent ):             # <<<<<<<<<<<<<<
28894  *         """
28895  *
28896  */
28897 
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_mean_from_peakcontent(CYTHON_UNUSED struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v_peakcontent)28898 static __pyx_t_5numpy_float64_t __pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_mean_from_peakcontent(CYTHON_UNUSED struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v_peakcontent) {
28899   __pyx_t_5numpy_int32_t __pyx_v_tmp_s;
28900   __pyx_t_5numpy_int32_t __pyx_v_tmp_e;
28901   __pyx_t_5numpy_int32_t __pyx_v_l;
28902   __pyx_t_5numpy_float64_t __pyx_v_tmp_v;
28903   __pyx_t_5numpy_float64_t __pyx_v_sum_v;
28904   __pyx_t_5numpy_float64_t __pyx_v_r;
28905   __pyx_t_5numpy_int32_t __pyx_v_i;
28906   __pyx_t_5numpy_float64_t __pyx_r;
28907   __Pyx_TraceDeclarations
28908   __Pyx_RefNannyDeclarations
28909   Py_ssize_t __pyx_t_1;
28910   Py_ssize_t __pyx_t_2;
28911   __pyx_t_5numpy_int32_t __pyx_t_3;
28912   PyObject *__pyx_t_4 = NULL;
28913   PyObject *__pyx_t_5 = NULL;
28914   __pyx_t_5numpy_int32_t __pyx_t_6;
28915   __pyx_t_5numpy_float64_t __pyx_t_7;
28916   __Pyx_RefNannySetupContext("mean_from_peakcontent", 0);
28917   __Pyx_TraceCall("mean_from_peakcontent", __pyx_f[0], 1702, 0, __PYX_ERR(0, 1702, __pyx_L1_error));
28918 
28919   /* "MACS2/IO/ScoreTrack.pyx":1713
28920  *             int32_t i
28921  *
28922  *         l = 0             # <<<<<<<<<<<<<<
28923  *         sum_v = 0                         #initialize sum_v as 0
28924  *         for i in range( len(peakcontent) ):
28925  */
28926   __pyx_v_l = 0;
28927 
28928   /* "MACS2/IO/ScoreTrack.pyx":1714
28929  *
28930  *         l = 0
28931  *         sum_v = 0                         #initialize sum_v as 0             # <<<<<<<<<<<<<<
28932  *         for i in range( len(peakcontent) ):
28933  *             tmp_s = peakcontent[i][0]
28934  */
28935   __pyx_v_sum_v = 0.0;
28936 
28937   /* "MACS2/IO/ScoreTrack.pyx":1715
28938  *         l = 0
28939  *         sum_v = 0                         #initialize sum_v as 0
28940  *         for i in range( len(peakcontent) ):             # <<<<<<<<<<<<<<
28941  *             tmp_s = peakcontent[i][0]
28942  *             tmp_e = peakcontent[i][1]
28943  */
28944   if (unlikely(__pyx_v_peakcontent == Py_None)) {
28945     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
28946     __PYX_ERR(0, 1715, __pyx_L1_error)
28947   }
28948   __pyx_t_1 = PyList_GET_SIZE(__pyx_v_peakcontent); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1715, __pyx_L1_error)
28949   __pyx_t_2 = __pyx_t_1;
28950   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
28951     __pyx_v_i = __pyx_t_3;
28952 
28953     /* "MACS2/IO/ScoreTrack.pyx":1716
28954  *         sum_v = 0                         #initialize sum_v as 0
28955  *         for i in range( len(peakcontent) ):
28956  *             tmp_s = peakcontent[i][0]             # <<<<<<<<<<<<<<
28957  *             tmp_e = peakcontent[i][1]
28958  *             tmp_v = <float64_t> peakcontent[i][2]
28959  */
28960     if (unlikely(__pyx_v_peakcontent == Py_None)) {
28961       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28962       __PYX_ERR(0, 1716, __pyx_L1_error)
28963     }
28964     __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_peakcontent, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1716, __pyx_L1_error)
28965     __Pyx_GOTREF(__pyx_t_4);
28966     __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1716, __pyx_L1_error)
28967     __Pyx_GOTREF(__pyx_t_5);
28968     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28969     __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_t_5); if (unlikely((__pyx_t_6 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1716, __pyx_L1_error)
28970     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28971     __pyx_v_tmp_s = __pyx_t_6;
28972 
28973     /* "MACS2/IO/ScoreTrack.pyx":1717
28974  *         for i in range( len(peakcontent) ):
28975  *             tmp_s = peakcontent[i][0]
28976  *             tmp_e = peakcontent[i][1]             # <<<<<<<<<<<<<<
28977  *             tmp_v = <float64_t> peakcontent[i][2]
28978  *             sum_v += tmp_v * ( tmp_e - tmp_s )
28979  */
28980     if (unlikely(__pyx_v_peakcontent == Py_None)) {
28981       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28982       __PYX_ERR(0, 1717, __pyx_L1_error)
28983     }
28984     __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_peakcontent, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1717, __pyx_L1_error)
28985     __Pyx_GOTREF(__pyx_t_5);
28986     __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1717, __pyx_L1_error)
28987     __Pyx_GOTREF(__pyx_t_4);
28988     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28989     __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_t_4); if (unlikely((__pyx_t_6 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1717, __pyx_L1_error)
28990     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28991     __pyx_v_tmp_e = __pyx_t_6;
28992 
28993     /* "MACS2/IO/ScoreTrack.pyx":1718
28994  *             tmp_s = peakcontent[i][0]
28995  *             tmp_e = peakcontent[i][1]
28996  *             tmp_v = <float64_t> peakcontent[i][2]             # <<<<<<<<<<<<<<
28997  *             sum_v += tmp_v * ( tmp_e - tmp_s )
28998  *             l +=  tmp_e - tmp_s
28999  */
29000     if (unlikely(__pyx_v_peakcontent == Py_None)) {
29001       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29002       __PYX_ERR(0, 1718, __pyx_L1_error)
29003     }
29004     __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_peakcontent, __pyx_v_i, __pyx_t_5numpy_int32_t, 1, __Pyx_PyInt_From_npy_int32, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1718, __pyx_L1_error)
29005     __Pyx_GOTREF(__pyx_t_4);
29006     __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1718, __pyx_L1_error)
29007     __Pyx_GOTREF(__pyx_t_5);
29008     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29009     __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1718, __pyx_L1_error)
29010     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29011     __pyx_v_tmp_v = ((__pyx_t_5numpy_float64_t)__pyx_t_7);
29012 
29013     /* "MACS2/IO/ScoreTrack.pyx":1719
29014  *             tmp_e = peakcontent[i][1]
29015  *             tmp_v = <float64_t> peakcontent[i][2]
29016  *             sum_v += tmp_v * ( tmp_e - tmp_s )             # <<<<<<<<<<<<<<
29017  *             l +=  tmp_e - tmp_s
29018  *
29019  */
29020     __pyx_v_sum_v = (__pyx_v_sum_v + (__pyx_v_tmp_v * (__pyx_v_tmp_e - __pyx_v_tmp_s)));
29021 
29022     /* "MACS2/IO/ScoreTrack.pyx":1720
29023  *             tmp_v = <float64_t> peakcontent[i][2]
29024  *             sum_v += tmp_v * ( tmp_e - tmp_s )
29025  *             l +=  tmp_e - tmp_s             # <<<<<<<<<<<<<<
29026  *
29027  *         r = sum_v / l
29028  */
29029     __pyx_v_l = (__pyx_v_l + (__pyx_v_tmp_e - __pyx_v_tmp_s));
29030   }
29031 
29032   /* "MACS2/IO/ScoreTrack.pyx":1722
29033  *             l +=  tmp_e - tmp_s
29034  *
29035  *         r = sum_v / l             # <<<<<<<<<<<<<<
29036  *         return r
29037  *
29038  */
29039   if (unlikely(__pyx_v_l == 0)) {
29040     PyErr_SetString(PyExc_ZeroDivisionError, "float division");
29041     __PYX_ERR(0, 1722, __pyx_L1_error)
29042   }
29043   __pyx_v_r = (__pyx_v_sum_v / ((__pyx_t_5numpy_float64_t)__pyx_v_l));
29044 
29045   /* "MACS2/IO/ScoreTrack.pyx":1723
29046  *
29047  *         r = sum_v / l
29048  *         return r             # <<<<<<<<<<<<<<
29049  *
29050  *
29051  */
29052   __pyx_r = __pyx_v_r;
29053   goto __pyx_L0;
29054 
29055   /* "MACS2/IO/ScoreTrack.pyx":1702
29056  *          return
29057  *
29058  *     cdef float64_t mean_from_peakcontent ( self, list peakcontent ):             # <<<<<<<<<<<<<<
29059  *         """
29060  *
29061  */
29062 
29063   /* function exit code */
29064   __pyx_L1_error:;
29065   __Pyx_XDECREF(__pyx_t_4);
29066   __Pyx_XDECREF(__pyx_t_5);
29067   __Pyx_WriteUnraisable("MACS2.IO.ScoreTrack.TwoConditionScores.mean_from_peakcontent", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
29068   __pyx_r = 0;
29069   __pyx_L0:;
29070   __Pyx_TraceReturn(Py_None, 0);
29071   __Pyx_RefNannyFinishContext();
29072   return __pyx_r;
29073 }
29074 
29075 /* "MACS2/IO/ScoreTrack.pyx":1726
29076  *
29077  *
29078  *     cdef int64_t total ( self ):             # <<<<<<<<<<<<<<
29079  *         """Return the number of regions in this object.
29080  *
29081  */
29082 
__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_total(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self)29083 static __pyx_t_5numpy_int64_t __pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_total(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self) {
29084   __pyx_t_5numpy_int64_t __pyx_v_t;
29085   PyObject *__pyx_v_chrom = 0;
29086   __pyx_t_5numpy_int64_t __pyx_r;
29087   __Pyx_TraceDeclarations
29088   __Pyx_RefNannyDeclarations
29089   PyObject *__pyx_t_1 = NULL;
29090   Py_ssize_t __pyx_t_2;
29091   Py_ssize_t __pyx_t_3;
29092   int __pyx_t_4;
29093   PyObject *__pyx_t_5 = NULL;
29094   int __pyx_t_6;
29095   PyObject *__pyx_t_7 = NULL;
29096   PyObject *__pyx_t_8 = NULL;
29097   __pyx_t_5numpy_int64_t __pyx_t_9;
29098   __Pyx_RefNannySetupContext("total", 0);
29099   __Pyx_TraceCall("total", __pyx_f[0], 1726, 0, __PYX_ERR(0, 1726, __pyx_L1_error));
29100 
29101   /* "MACS2/IO/ScoreTrack.pyx":1734
29102  *             bytes chrom
29103  *
29104  *         t = 0             # <<<<<<<<<<<<<<
29105  *         for chrom in self.data.keys():
29106  *             t += self.datalength[chrom]
29107  */
29108   __pyx_v_t = 0;
29109 
29110   /* "MACS2/IO/ScoreTrack.pyx":1735
29111  *
29112  *         t = 0
29113  *         for chrom in self.data.keys():             # <<<<<<<<<<<<<<
29114  *             t += self.datalength[chrom]
29115  *         return t
29116  */
29117   __pyx_t_2 = 0;
29118   if (unlikely(__pyx_v_self->data == Py_None)) {
29119     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
29120     __PYX_ERR(0, 1735, __pyx_L1_error)
29121   }
29122   __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->data, 1, __pyx_n_s_keys, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1735, __pyx_L1_error)
29123   __Pyx_GOTREF(__pyx_t_5);
29124   __Pyx_XDECREF(__pyx_t_1);
29125   __pyx_t_1 = __pyx_t_5;
29126   __pyx_t_5 = 0;
29127   while (1) {
29128     __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, NULL, NULL, __pyx_t_4);
29129     if (unlikely(__pyx_t_6 == 0)) break;
29130     if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1735, __pyx_L1_error)
29131     __Pyx_GOTREF(__pyx_t_5);
29132     if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 1735, __pyx_L1_error)
29133     __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_5));
29134     __pyx_t_5 = 0;
29135 
29136     /* "MACS2/IO/ScoreTrack.pyx":1736
29137  *         t = 0
29138  *         for chrom in self.data.keys():
29139  *             t += self.datalength[chrom]             # <<<<<<<<<<<<<<
29140  *         return t
29141  *
29142  */
29143     __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1736, __pyx_L1_error)
29144     __Pyx_GOTREF(__pyx_t_5);
29145     if (unlikely(__pyx_v_self->datalength == Py_None)) {
29146       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29147       __PYX_ERR(0, 1736, __pyx_L1_error)
29148     }
29149     __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->datalength, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1736, __pyx_L1_error)
29150     __Pyx_GOTREF(__pyx_t_7);
29151     __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1736, __pyx_L1_error)
29152     __Pyx_GOTREF(__pyx_t_8);
29153     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29154     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29155     __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_8); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1736, __pyx_L1_error)
29156     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
29157     __pyx_v_t = __pyx_t_9;
29158   }
29159   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29160 
29161   /* "MACS2/IO/ScoreTrack.pyx":1737
29162  *         for chrom in self.data.keys():
29163  *             t += self.datalength[chrom]
29164  *         return t             # <<<<<<<<<<<<<<
29165  *
29166  *
29167  */
29168   __pyx_r = __pyx_v_t;
29169   goto __pyx_L0;
29170 
29171   /* "MACS2/IO/ScoreTrack.pyx":1726
29172  *
29173  *
29174  *     cdef int64_t total ( self ):             # <<<<<<<<<<<<<<
29175  *         """Return the number of regions in this object.
29176  *
29177  */
29178 
29179   /* function exit code */
29180   __pyx_L1_error:;
29181   __Pyx_XDECREF(__pyx_t_1);
29182   __Pyx_XDECREF(__pyx_t_5);
29183   __Pyx_XDECREF(__pyx_t_7);
29184   __Pyx_XDECREF(__pyx_t_8);
29185   __Pyx_WriteUnraisable("MACS2.IO.ScoreTrack.TwoConditionScores.total", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
29186   __pyx_r = 0;
29187   __pyx_L0:;
29188   __Pyx_XDECREF(__pyx_v_chrom);
29189   __Pyx_TraceReturn(Py_None, 0);
29190   __Pyx_RefNannyFinishContext();
29191   return __pyx_r;
29192 }
29193 
29194 /* "(tree fragment)":1
29195  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
29196  *     cdef tuple state
29197  *     cdef object _dict
29198  */
29199 
29200 /* Python wrapper */
29201 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_21__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)29202 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
29203   PyObject *__pyx_r = 0;
29204   __Pyx_RefNannyDeclarations
29205   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
29206   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_20__reduce_cython__(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self));
29207 
29208   /* function exit code */
29209   __Pyx_RefNannyFinishContext();
29210   return __pyx_r;
29211 }
29212 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_20__reduce_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self)29213 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_20__reduce_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self) {
29214   PyObject *__pyx_v_state = 0;
29215   PyObject *__pyx_v__dict = 0;
29216   int __pyx_v_use_setstate;
29217   PyObject *__pyx_r = NULL;
29218   __Pyx_TraceDeclarations
29219   __Pyx_RefNannyDeclarations
29220   PyObject *__pyx_t_1 = NULL;
29221   PyObject *__pyx_t_2 = NULL;
29222   PyObject *__pyx_t_3 = NULL;
29223   PyObject *__pyx_t_4 = NULL;
29224   PyObject *__pyx_t_5 = NULL;
29225   int __pyx_t_6;
29226   int __pyx_t_7;
29227   int __pyx_t_8;
29228   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
29229   __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
29230 
29231   /* "(tree fragment)":5
29232  *     cdef object _dict
29233  *     cdef bint use_setstate
29234  *     state = (self.c1bdg, self.c2bdg, self.cond1_factor, self.cond2_factor, self.cutoff, self.data, self.datalength, self.pseudocount, self.pvalue_stat1, self.pvalue_stat2, self.pvalue_stat3, self.t1bdg, self.t2bdg)             # <<<<<<<<<<<<<<
29235  *     _dict = getattr(self, '__dict__', None)
29236  *     if _dict is not None:
29237  */
29238   __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cond1_factor); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
29239   __Pyx_GOTREF(__pyx_t_1);
29240   __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->cond2_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
29241   __Pyx_GOTREF(__pyx_t_2);
29242   __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
29243   __Pyx_GOTREF(__pyx_t_3);
29244   __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->pseudocount); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
29245   __Pyx_GOTREF(__pyx_t_4);
29246   __pyx_t_5 = PyTuple_New(13); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
29247   __Pyx_GOTREF(__pyx_t_5);
29248   __Pyx_INCREF(__pyx_v_self->c1bdg);
29249   __Pyx_GIVEREF(__pyx_v_self->c1bdg);
29250   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->c1bdg);
29251   __Pyx_INCREF(__pyx_v_self->c2bdg);
29252   __Pyx_GIVEREF(__pyx_v_self->c2bdg);
29253   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->c2bdg);
29254   __Pyx_GIVEREF(__pyx_t_1);
29255   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_1);
29256   __Pyx_GIVEREF(__pyx_t_2);
29257   PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_2);
29258   __Pyx_GIVEREF(__pyx_t_3);
29259   PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_3);
29260   __Pyx_INCREF(__pyx_v_self->data);
29261   __Pyx_GIVEREF(__pyx_v_self->data);
29262   PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_self->data);
29263   __Pyx_INCREF(__pyx_v_self->datalength);
29264   __Pyx_GIVEREF(__pyx_v_self->datalength);
29265   PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_self->datalength);
29266   __Pyx_GIVEREF(__pyx_t_4);
29267   PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_t_4);
29268   __Pyx_INCREF(__pyx_v_self->pvalue_stat1);
29269   __Pyx_GIVEREF(__pyx_v_self->pvalue_stat1);
29270   PyTuple_SET_ITEM(__pyx_t_5, 8, __pyx_v_self->pvalue_stat1);
29271   __Pyx_INCREF(__pyx_v_self->pvalue_stat2);
29272   __Pyx_GIVEREF(__pyx_v_self->pvalue_stat2);
29273   PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_v_self->pvalue_stat2);
29274   __Pyx_INCREF(__pyx_v_self->pvalue_stat3);
29275   __Pyx_GIVEREF(__pyx_v_self->pvalue_stat3);
29276   PyTuple_SET_ITEM(__pyx_t_5, 10, __pyx_v_self->pvalue_stat3);
29277   __Pyx_INCREF(__pyx_v_self->t1bdg);
29278   __Pyx_GIVEREF(__pyx_v_self->t1bdg);
29279   PyTuple_SET_ITEM(__pyx_t_5, 11, __pyx_v_self->t1bdg);
29280   __Pyx_INCREF(__pyx_v_self->t2bdg);
29281   __Pyx_GIVEREF(__pyx_v_self->t2bdg);
29282   PyTuple_SET_ITEM(__pyx_t_5, 12, __pyx_v_self->t2bdg);
29283   __pyx_t_1 = 0;
29284   __pyx_t_2 = 0;
29285   __pyx_t_3 = 0;
29286   __pyx_t_4 = 0;
29287   __pyx_v_state = ((PyObject*)__pyx_t_5);
29288   __pyx_t_5 = 0;
29289 
29290   /* "(tree fragment)":6
29291  *     cdef bint use_setstate
29292  *     state = (self.c1bdg, self.c2bdg, self.cond1_factor, self.cond2_factor, self.cutoff, self.data, self.datalength, self.pseudocount, self.pvalue_stat1, self.pvalue_stat2, self.pvalue_stat3, self.t1bdg, self.t2bdg)
29293  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
29294  *     if _dict is not None:
29295  *         state += (_dict,)
29296  */
29297   __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
29298   __Pyx_GOTREF(__pyx_t_5);
29299   __pyx_v__dict = __pyx_t_5;
29300   __pyx_t_5 = 0;
29301 
29302   /* "(tree fragment)":7
29303  *     state = (self.c1bdg, self.c2bdg, self.cond1_factor, self.cond2_factor, self.cutoff, self.data, self.datalength, self.pseudocount, self.pvalue_stat1, self.pvalue_stat2, self.pvalue_stat3, self.t1bdg, self.t2bdg)
29304  *     _dict = getattr(self, '__dict__', None)
29305  *     if _dict is not None:             # <<<<<<<<<<<<<<
29306  *         state += (_dict,)
29307  *         use_setstate = True
29308  */
29309   __pyx_t_6 = (__pyx_v__dict != Py_None);
29310   __pyx_t_7 = (__pyx_t_6 != 0);
29311   if (__pyx_t_7) {
29312 
29313     /* "(tree fragment)":8
29314  *     _dict = getattr(self, '__dict__', None)
29315  *     if _dict is not None:
29316  *         state += (_dict,)             # <<<<<<<<<<<<<<
29317  *         use_setstate = True
29318  *     else:
29319  */
29320     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error)
29321     __Pyx_GOTREF(__pyx_t_5);
29322     __Pyx_INCREF(__pyx_v__dict);
29323     __Pyx_GIVEREF(__pyx_v__dict);
29324     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict);
29325     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
29326     __Pyx_GOTREF(__pyx_t_4);
29327     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29328     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
29329     __pyx_t_4 = 0;
29330 
29331     /* "(tree fragment)":9
29332  *     if _dict is not None:
29333  *         state += (_dict,)
29334  *         use_setstate = True             # <<<<<<<<<<<<<<
29335  *     else:
29336  *         use_setstate = self.c1bdg is not None or self.c2bdg is not None or self.data is not None or self.datalength is not None or self.pvalue_stat1 is not None or self.pvalue_stat2 is not None or self.pvalue_stat3 is not None or self.t1bdg is not None or self.t2bdg is not None
29337  */
29338     __pyx_v_use_setstate = 1;
29339 
29340     /* "(tree fragment)":7
29341  *     state = (self.c1bdg, self.c2bdg, self.cond1_factor, self.cond2_factor, self.cutoff, self.data, self.datalength, self.pseudocount, self.pvalue_stat1, self.pvalue_stat2, self.pvalue_stat3, self.t1bdg, self.t2bdg)
29342  *     _dict = getattr(self, '__dict__', None)
29343  *     if _dict is not None:             # <<<<<<<<<<<<<<
29344  *         state += (_dict,)
29345  *         use_setstate = True
29346  */
29347     goto __pyx_L3;
29348   }
29349 
29350   /* "(tree fragment)":11
29351  *         use_setstate = True
29352  *     else:
29353  *         use_setstate = self.c1bdg is not None or self.c2bdg is not None or self.data is not None or self.datalength is not None or self.pvalue_stat1 is not None or self.pvalue_stat2 is not None or self.pvalue_stat3 is not None or self.t1bdg is not None or self.t2bdg is not None             # <<<<<<<<<<<<<<
29354  *     if use_setstate:
29355  *         return __pyx_unpickle_TwoConditionScores, (type(self), 0x846cc7b, None), state
29356  */
29357   /*else*/ {
29358     __pyx_t_6 = (__pyx_v_self->c1bdg != Py_None);
29359     __pyx_t_8 = (__pyx_t_6 != 0);
29360     if (!__pyx_t_8) {
29361     } else {
29362       __pyx_t_7 = __pyx_t_8;
29363       goto __pyx_L4_bool_binop_done;
29364     }
29365     __pyx_t_8 = (__pyx_v_self->c2bdg != Py_None);
29366     __pyx_t_6 = (__pyx_t_8 != 0);
29367     if (!__pyx_t_6) {
29368     } else {
29369       __pyx_t_7 = __pyx_t_6;
29370       goto __pyx_L4_bool_binop_done;
29371     }
29372     __pyx_t_6 = (__pyx_v_self->data != ((PyObject*)Py_None));
29373     __pyx_t_8 = (__pyx_t_6 != 0);
29374     if (!__pyx_t_8) {
29375     } else {
29376       __pyx_t_7 = __pyx_t_8;
29377       goto __pyx_L4_bool_binop_done;
29378     }
29379     __pyx_t_8 = (__pyx_v_self->datalength != ((PyObject*)Py_None));
29380     __pyx_t_6 = (__pyx_t_8 != 0);
29381     if (!__pyx_t_6) {
29382     } else {
29383       __pyx_t_7 = __pyx_t_6;
29384       goto __pyx_L4_bool_binop_done;
29385     }
29386     __pyx_t_6 = (__pyx_v_self->pvalue_stat1 != ((PyObject*)Py_None));
29387     __pyx_t_8 = (__pyx_t_6 != 0);
29388     if (!__pyx_t_8) {
29389     } else {
29390       __pyx_t_7 = __pyx_t_8;
29391       goto __pyx_L4_bool_binop_done;
29392     }
29393     __pyx_t_8 = (__pyx_v_self->pvalue_stat2 != ((PyObject*)Py_None));
29394     __pyx_t_6 = (__pyx_t_8 != 0);
29395     if (!__pyx_t_6) {
29396     } else {
29397       __pyx_t_7 = __pyx_t_6;
29398       goto __pyx_L4_bool_binop_done;
29399     }
29400     __pyx_t_6 = (__pyx_v_self->pvalue_stat3 != ((PyObject*)Py_None));
29401     __pyx_t_8 = (__pyx_t_6 != 0);
29402     if (!__pyx_t_8) {
29403     } else {
29404       __pyx_t_7 = __pyx_t_8;
29405       goto __pyx_L4_bool_binop_done;
29406     }
29407     __pyx_t_8 = (__pyx_v_self->t1bdg != Py_None);
29408     __pyx_t_6 = (__pyx_t_8 != 0);
29409     if (!__pyx_t_6) {
29410     } else {
29411       __pyx_t_7 = __pyx_t_6;
29412       goto __pyx_L4_bool_binop_done;
29413     }
29414     __pyx_t_6 = (__pyx_v_self->t2bdg != Py_None);
29415     __pyx_t_8 = (__pyx_t_6 != 0);
29416     __pyx_t_7 = __pyx_t_8;
29417     __pyx_L4_bool_binop_done:;
29418     __pyx_v_use_setstate = __pyx_t_7;
29419   }
29420   __pyx_L3:;
29421 
29422   /* "(tree fragment)":12
29423  *     else:
29424  *         use_setstate = self.c1bdg is not None or self.c2bdg is not None or self.data is not None or self.datalength is not None or self.pvalue_stat1 is not None or self.pvalue_stat2 is not None or self.pvalue_stat3 is not None or self.t1bdg is not None or self.t2bdg is not None
29425  *     if use_setstate:             # <<<<<<<<<<<<<<
29426  *         return __pyx_unpickle_TwoConditionScores, (type(self), 0x846cc7b, None), state
29427  *     else:
29428  */
29429   __pyx_t_7 = (__pyx_v_use_setstate != 0);
29430   if (__pyx_t_7) {
29431 
29432     /* "(tree fragment)":13
29433  *         use_setstate = self.c1bdg is not None or self.c2bdg is not None or self.data is not None or self.datalength is not None or self.pvalue_stat1 is not None or self.pvalue_stat2 is not None or self.pvalue_stat3 is not None or self.t1bdg is not None or self.t2bdg is not None
29434  *     if use_setstate:
29435  *         return __pyx_unpickle_TwoConditionScores, (type(self), 0x846cc7b, None), state             # <<<<<<<<<<<<<<
29436  *     else:
29437  *         return __pyx_unpickle_TwoConditionScores, (type(self), 0x846cc7b, state)
29438  */
29439     __Pyx_XDECREF(__pyx_r);
29440     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_TwoConditionScore); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
29441     __Pyx_GOTREF(__pyx_t_4);
29442     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
29443     __Pyx_GOTREF(__pyx_t_5);
29444     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
29445     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
29446     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
29447     __Pyx_INCREF(__pyx_int_138857595);
29448     __Pyx_GIVEREF(__pyx_int_138857595);
29449     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_138857595);
29450     __Pyx_INCREF(Py_None);
29451     __Pyx_GIVEREF(Py_None);
29452     PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None);
29453     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
29454     __Pyx_GOTREF(__pyx_t_3);
29455     __Pyx_GIVEREF(__pyx_t_4);
29456     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
29457     __Pyx_GIVEREF(__pyx_t_5);
29458     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
29459     __Pyx_INCREF(__pyx_v_state);
29460     __Pyx_GIVEREF(__pyx_v_state);
29461     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
29462     __pyx_t_4 = 0;
29463     __pyx_t_5 = 0;
29464     __pyx_r = __pyx_t_3;
29465     __pyx_t_3 = 0;
29466     goto __pyx_L0;
29467 
29468     /* "(tree fragment)":12
29469  *     else:
29470  *         use_setstate = self.c1bdg is not None or self.c2bdg is not None or self.data is not None or self.datalength is not None or self.pvalue_stat1 is not None or self.pvalue_stat2 is not None or self.pvalue_stat3 is not None or self.t1bdg is not None or self.t2bdg is not None
29471  *     if use_setstate:             # <<<<<<<<<<<<<<
29472  *         return __pyx_unpickle_TwoConditionScores, (type(self), 0x846cc7b, None), state
29473  *     else:
29474  */
29475   }
29476 
29477   /* "(tree fragment)":15
29478  *         return __pyx_unpickle_TwoConditionScores, (type(self), 0x846cc7b, None), state
29479  *     else:
29480  *         return __pyx_unpickle_TwoConditionScores, (type(self), 0x846cc7b, state)             # <<<<<<<<<<<<<<
29481  * def __setstate_cython__(self, __pyx_state):
29482  *     __pyx_unpickle_TwoConditionScores__set_state(self, __pyx_state)
29483  */
29484   /*else*/ {
29485     __Pyx_XDECREF(__pyx_r);
29486     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_TwoConditionScore); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
29487     __Pyx_GOTREF(__pyx_t_3);
29488     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
29489     __Pyx_GOTREF(__pyx_t_5);
29490     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
29491     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
29492     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
29493     __Pyx_INCREF(__pyx_int_138857595);
29494     __Pyx_GIVEREF(__pyx_int_138857595);
29495     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_138857595);
29496     __Pyx_INCREF(__pyx_v_state);
29497     __Pyx_GIVEREF(__pyx_v_state);
29498     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
29499     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
29500     __Pyx_GOTREF(__pyx_t_4);
29501     __Pyx_GIVEREF(__pyx_t_3);
29502     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
29503     __Pyx_GIVEREF(__pyx_t_5);
29504     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
29505     __pyx_t_3 = 0;
29506     __pyx_t_5 = 0;
29507     __pyx_r = __pyx_t_4;
29508     __pyx_t_4 = 0;
29509     goto __pyx_L0;
29510   }
29511 
29512   /* "(tree fragment)":1
29513  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
29514  *     cdef tuple state
29515  *     cdef object _dict
29516  */
29517 
29518   /* function exit code */
29519   __pyx_L1_error:;
29520   __Pyx_XDECREF(__pyx_t_1);
29521   __Pyx_XDECREF(__pyx_t_2);
29522   __Pyx_XDECREF(__pyx_t_3);
29523   __Pyx_XDECREF(__pyx_t_4);
29524   __Pyx_XDECREF(__pyx_t_5);
29525   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
29526   __pyx_r = NULL;
29527   __pyx_L0:;
29528   __Pyx_XDECREF(__pyx_v_state);
29529   __Pyx_XDECREF(__pyx_v__dict);
29530   __Pyx_XGIVEREF(__pyx_r);
29531   __Pyx_TraceReturn(__pyx_r, 0);
29532   __Pyx_RefNannyFinishContext();
29533   return __pyx_r;
29534 }
29535 
29536 /* "(tree fragment)":16
29537  *     else:
29538  *         return __pyx_unpickle_TwoConditionScores, (type(self), 0x846cc7b, state)
29539  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
29540  *     __pyx_unpickle_TwoConditionScores__set_state(self, __pyx_state)
29541  */
29542 
29543 /* Python wrapper */
29544 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_23__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)29545 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
29546   PyObject *__pyx_r = 0;
29547   __Pyx_RefNannyDeclarations
29548   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
29549   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_22__setstate_cython__(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
29550 
29551   /* function exit code */
29552   __Pyx_RefNannyFinishContext();
29553   return __pyx_r;
29554 }
29555 
__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_22__setstate_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v_self,PyObject * __pyx_v___pyx_state)29556 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_22__setstate_cython__(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
29557   PyObject *__pyx_r = NULL;
29558   __Pyx_TraceDeclarations
29559   __Pyx_RefNannyDeclarations
29560   PyObject *__pyx_t_1 = NULL;
29561   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
29562   __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
29563 
29564   /* "(tree fragment)":17
29565  *         return __pyx_unpickle_TwoConditionScores, (type(self), 0x846cc7b, state)
29566  * def __setstate_cython__(self, __pyx_state):
29567  *     __pyx_unpickle_TwoConditionScores__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
29568  */
29569   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
29570   __pyx_t_1 = __pyx_f_5MACS2_2IO_10ScoreTrack___pyx_unpickle_TwoConditionScores__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
29571   __Pyx_GOTREF(__pyx_t_1);
29572   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29573 
29574   /* "(tree fragment)":16
29575  *     else:
29576  *         return __pyx_unpickle_TwoConditionScores, (type(self), 0x846cc7b, state)
29577  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
29578  *     __pyx_unpickle_TwoConditionScores__set_state(self, __pyx_state)
29579  */
29580 
29581   /* function exit code */
29582   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29583   goto __pyx_L0;
29584   __pyx_L1_error:;
29585   __Pyx_XDECREF(__pyx_t_1);
29586   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.TwoConditionScores.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
29587   __pyx_r = NULL;
29588   __pyx_L0:;
29589   __Pyx_XGIVEREF(__pyx_r);
29590   __Pyx_TraceReturn(__pyx_r, 0);
29591   __Pyx_RefNannyFinishContext();
29592   return __pyx_r;
29593 }
29594 
29595 /* "(tree fragment)":1
29596  * def __pyx_unpickle_scoreTrackII(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
29597  *     cdef object __pyx_PickleError
29598  *     cdef object __pyx_result
29599  */
29600 
29601 /* Python wrapper */
29602 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_1__pyx_unpickle_scoreTrackII(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
29603 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_1__pyx_unpickle_scoreTrackII = {"__pyx_unpickle_scoreTrackII", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_1__pyx_unpickle_scoreTrackII, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5MACS2_2IO_10ScoreTrack_1__pyx_unpickle_scoreTrackII(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)29604 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_1__pyx_unpickle_scoreTrackII(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29605   PyObject *__pyx_v___pyx_type = 0;
29606   long __pyx_v___pyx_checksum;
29607   PyObject *__pyx_v___pyx_state = 0;
29608   PyObject *__pyx_r = 0;
29609   __Pyx_RefNannyDeclarations
29610   __Pyx_RefNannySetupContext("__pyx_unpickle_scoreTrackII (wrapper)", 0);
29611   {
29612     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
29613     PyObject* values[3] = {0,0,0};
29614     if (unlikely(__pyx_kwds)) {
29615       Py_ssize_t kw_args;
29616       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
29617       switch (pos_args) {
29618         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
29619         CYTHON_FALLTHROUGH;
29620         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29621         CYTHON_FALLTHROUGH;
29622         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29623         CYTHON_FALLTHROUGH;
29624         case  0: break;
29625         default: goto __pyx_L5_argtuple_error;
29626       }
29627       kw_args = PyDict_Size(__pyx_kwds);
29628       switch (pos_args) {
29629         case  0:
29630         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
29631         else goto __pyx_L5_argtuple_error;
29632         CYTHON_FALLTHROUGH;
29633         case  1:
29634         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
29635         else {
29636           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_scoreTrackII", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
29637         }
29638         CYTHON_FALLTHROUGH;
29639         case  2:
29640         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
29641         else {
29642           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_scoreTrackII", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
29643         }
29644       }
29645       if (unlikely(kw_args > 0)) {
29646         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_scoreTrackII") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
29647       }
29648     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
29649       goto __pyx_L5_argtuple_error;
29650     } else {
29651       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29652       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29653       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
29654     }
29655     __pyx_v___pyx_type = values[0];
29656     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
29657     __pyx_v___pyx_state = values[2];
29658   }
29659   goto __pyx_L4_argument_unpacking_done;
29660   __pyx_L5_argtuple_error:;
29661   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_scoreTrackII", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
29662   __pyx_L3_error:;
29663   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.__pyx_unpickle_scoreTrackII", __pyx_clineno, __pyx_lineno, __pyx_filename);
29664   __Pyx_RefNannyFinishContext();
29665   return NULL;
29666   __pyx_L4_argument_unpacking_done:;
29667   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack___pyx_unpickle_scoreTrackII(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
29668 
29669   /* function exit code */
29670   __Pyx_RefNannyFinishContext();
29671   return __pyx_r;
29672 }
29673 
__pyx_pf_5MACS2_2IO_10ScoreTrack___pyx_unpickle_scoreTrackII(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)29674 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack___pyx_unpickle_scoreTrackII(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
29675   PyObject *__pyx_v___pyx_PickleError = 0;
29676   PyObject *__pyx_v___pyx_result = 0;
29677   PyObject *__pyx_r = NULL;
29678   __Pyx_TraceDeclarations
29679   __Pyx_RefNannyDeclarations
29680   int __pyx_t_1;
29681   PyObject *__pyx_t_2 = NULL;
29682   PyObject *__pyx_t_3 = NULL;
29683   PyObject *__pyx_t_4 = NULL;
29684   PyObject *__pyx_t_5 = NULL;
29685   int __pyx_t_6;
29686   __Pyx_TraceFrameInit(__pyx_codeobj__23)
29687   __Pyx_RefNannySetupContext("__pyx_unpickle_scoreTrackII", 0);
29688   __Pyx_TraceCall("__pyx_unpickle_scoreTrackII", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
29689 
29690   /* "(tree fragment)":4
29691  *     cdef object __pyx_PickleError
29692  *     cdef object __pyx_result
29693  *     if __pyx_checksum != 0x77c358c:             # <<<<<<<<<<<<<<
29694  *         from pickle import PickleError as __pyx_PickleError
29695  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77c358c = (ctrl_edm, cutoff, data, data_stderr, datalength, normalization_method, pseudocount, pvalue_stat, scoring_method, stderr_on, trackline, treat_edm))" % __pyx_checksum)
29696  */
29697   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x77c358c) != 0);
29698   if (__pyx_t_1) {
29699 
29700     /* "(tree fragment)":5
29701  *     cdef object __pyx_result
29702  *     if __pyx_checksum != 0x77c358c:
29703  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
29704  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77c358c = (ctrl_edm, cutoff, data, data_stderr, datalength, normalization_method, pseudocount, pvalue_stat, scoring_method, stderr_on, trackline, treat_edm))" % __pyx_checksum)
29705  *     __pyx_result = scoreTrackII.__new__(__pyx_type)
29706  */
29707     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
29708     __Pyx_GOTREF(__pyx_t_2);
29709     __Pyx_INCREF(__pyx_n_s_PickleError);
29710     __Pyx_GIVEREF(__pyx_n_s_PickleError);
29711     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
29712     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
29713     __Pyx_GOTREF(__pyx_t_3);
29714     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29715     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
29716     __Pyx_GOTREF(__pyx_t_2);
29717     __Pyx_INCREF(__pyx_t_2);
29718     __pyx_v___pyx_PickleError = __pyx_t_2;
29719     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29720     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29721 
29722     /* "(tree fragment)":6
29723  *     if __pyx_checksum != 0x77c358c:
29724  *         from pickle import PickleError as __pyx_PickleError
29725  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77c358c = (ctrl_edm, cutoff, data, data_stderr, datalength, normalization_method, pseudocount, pvalue_stat, scoring_method, stderr_on, trackline, treat_edm))" % __pyx_checksum)             # <<<<<<<<<<<<<<
29726  *     __pyx_result = scoreTrackII.__new__(__pyx_type)
29727  *     if __pyx_state is not None:
29728  */
29729     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
29730     __Pyx_GOTREF(__pyx_t_2);
29731     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
29732     __Pyx_GOTREF(__pyx_t_4);
29733     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29734     __Pyx_INCREF(__pyx_v___pyx_PickleError);
29735     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
29736     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
29737       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
29738       if (likely(__pyx_t_5)) {
29739         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
29740         __Pyx_INCREF(__pyx_t_5);
29741         __Pyx_INCREF(function);
29742         __Pyx_DECREF_SET(__pyx_t_2, function);
29743       }
29744     }
29745     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
29746     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29747     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29748     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
29749     __Pyx_GOTREF(__pyx_t_3);
29750     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29751     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
29752     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29753     __PYX_ERR(1, 6, __pyx_L1_error)
29754 
29755     /* "(tree fragment)":4
29756  *     cdef object __pyx_PickleError
29757  *     cdef object __pyx_result
29758  *     if __pyx_checksum != 0x77c358c:             # <<<<<<<<<<<<<<
29759  *         from pickle import PickleError as __pyx_PickleError
29760  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77c358c = (ctrl_edm, cutoff, data, data_stderr, datalength, normalization_method, pseudocount, pvalue_stat, scoring_method, stderr_on, trackline, treat_edm))" % __pyx_checksum)
29761  */
29762   }
29763 
29764   /* "(tree fragment)":7
29765  *         from pickle import PickleError as __pyx_PickleError
29766  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77c358c = (ctrl_edm, cutoff, data, data_stderr, datalength, normalization_method, pseudocount, pvalue_stat, scoring_method, stderr_on, trackline, treat_edm))" % __pyx_checksum)
29767  *     __pyx_result = scoreTrackII.__new__(__pyx_type)             # <<<<<<<<<<<<<<
29768  *     if __pyx_state is not None:
29769  *         __pyx_unpickle_scoreTrackII__set_state(<scoreTrackII> __pyx_result, __pyx_state)
29770  */
29771   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5MACS2_2IO_10ScoreTrack_scoreTrackII), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
29772   __Pyx_GOTREF(__pyx_t_2);
29773   __pyx_t_4 = NULL;
29774   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
29775     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
29776     if (likely(__pyx_t_4)) {
29777       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
29778       __Pyx_INCREF(__pyx_t_4);
29779       __Pyx_INCREF(function);
29780       __Pyx_DECREF_SET(__pyx_t_2, function);
29781     }
29782   }
29783   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
29784   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29785   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
29786   __Pyx_GOTREF(__pyx_t_3);
29787   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29788   __pyx_v___pyx_result = __pyx_t_3;
29789   __pyx_t_3 = 0;
29790 
29791   /* "(tree fragment)":8
29792  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77c358c = (ctrl_edm, cutoff, data, data_stderr, datalength, normalization_method, pseudocount, pvalue_stat, scoring_method, stderr_on, trackline, treat_edm))" % __pyx_checksum)
29793  *     __pyx_result = scoreTrackII.__new__(__pyx_type)
29794  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
29795  *         __pyx_unpickle_scoreTrackII__set_state(<scoreTrackII> __pyx_result, __pyx_state)
29796  *     return __pyx_result
29797  */
29798   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
29799   __pyx_t_6 = (__pyx_t_1 != 0);
29800   if (__pyx_t_6) {
29801 
29802     /* "(tree fragment)":9
29803  *     __pyx_result = scoreTrackII.__new__(__pyx_type)
29804  *     if __pyx_state is not None:
29805  *         __pyx_unpickle_scoreTrackII__set_state(<scoreTrackII> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
29806  *     return __pyx_result
29807  * cdef __pyx_unpickle_scoreTrackII__set_state(scoreTrackII __pyx_result, tuple __pyx_state):
29808  */
29809     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
29810     __pyx_t_3 = __pyx_f_5MACS2_2IO_10ScoreTrack___pyx_unpickle_scoreTrackII__set_state(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
29811     __Pyx_GOTREF(__pyx_t_3);
29812     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29813 
29814     /* "(tree fragment)":8
29815  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77c358c = (ctrl_edm, cutoff, data, data_stderr, datalength, normalization_method, pseudocount, pvalue_stat, scoring_method, stderr_on, trackline, treat_edm))" % __pyx_checksum)
29816  *     __pyx_result = scoreTrackII.__new__(__pyx_type)
29817  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
29818  *         __pyx_unpickle_scoreTrackII__set_state(<scoreTrackII> __pyx_result, __pyx_state)
29819  *     return __pyx_result
29820  */
29821   }
29822 
29823   /* "(tree fragment)":10
29824  *     if __pyx_state is not None:
29825  *         __pyx_unpickle_scoreTrackII__set_state(<scoreTrackII> __pyx_result, __pyx_state)
29826  *     return __pyx_result             # <<<<<<<<<<<<<<
29827  * cdef __pyx_unpickle_scoreTrackII__set_state(scoreTrackII __pyx_result, tuple __pyx_state):
29828  *     __pyx_result.ctrl_edm = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.data = __pyx_state[2]; __pyx_result.data_stderr = __pyx_state[3]; __pyx_result.datalength = __pyx_state[4]; __pyx_result.normalization_method = __pyx_state[5]; __pyx_result.pseudocount = __pyx_state[6]; __pyx_result.pvalue_stat = __pyx_state[7]; __pyx_result.scoring_method = __pyx_state[8]; __pyx_result.stderr_on = __pyx_state[9]; __pyx_result.trackline = __pyx_state[10]; __pyx_result.treat_edm = __pyx_state[11]
29829  */
29830   __Pyx_XDECREF(__pyx_r);
29831   __Pyx_INCREF(__pyx_v___pyx_result);
29832   __pyx_r = __pyx_v___pyx_result;
29833   goto __pyx_L0;
29834 
29835   /* "(tree fragment)":1
29836  * def __pyx_unpickle_scoreTrackII(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
29837  *     cdef object __pyx_PickleError
29838  *     cdef object __pyx_result
29839  */
29840 
29841   /* function exit code */
29842   __pyx_L1_error:;
29843   __Pyx_XDECREF(__pyx_t_2);
29844   __Pyx_XDECREF(__pyx_t_3);
29845   __Pyx_XDECREF(__pyx_t_4);
29846   __Pyx_XDECREF(__pyx_t_5);
29847   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.__pyx_unpickle_scoreTrackII", __pyx_clineno, __pyx_lineno, __pyx_filename);
29848   __pyx_r = NULL;
29849   __pyx_L0:;
29850   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
29851   __Pyx_XDECREF(__pyx_v___pyx_result);
29852   __Pyx_XGIVEREF(__pyx_r);
29853   __Pyx_TraceReturn(__pyx_r, 0);
29854   __Pyx_RefNannyFinishContext();
29855   return __pyx_r;
29856 }
29857 
29858 /* "(tree fragment)":11
29859  *         __pyx_unpickle_scoreTrackII__set_state(<scoreTrackII> __pyx_result, __pyx_state)
29860  *     return __pyx_result
29861  * cdef __pyx_unpickle_scoreTrackII__set_state(scoreTrackII __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
29862  *     __pyx_result.ctrl_edm = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.data = __pyx_state[2]; __pyx_result.data_stderr = __pyx_state[3]; __pyx_result.datalength = __pyx_state[4]; __pyx_result.normalization_method = __pyx_state[5]; __pyx_result.pseudocount = __pyx_state[6]; __pyx_result.pvalue_stat = __pyx_state[7]; __pyx_result.scoring_method = __pyx_state[8]; __pyx_result.stderr_on = __pyx_state[9]; __pyx_result.trackline = __pyx_state[10]; __pyx_result.treat_edm = __pyx_state[11]
29863  *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):
29864  */
29865 
__pyx_f_5MACS2_2IO_10ScoreTrack___pyx_unpickle_scoreTrackII__set_state(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)29866 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack___pyx_unpickle_scoreTrackII__set_state(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
29867   PyObject *__pyx_r = NULL;
29868   __Pyx_TraceDeclarations
29869   __Pyx_RefNannyDeclarations
29870   PyObject *__pyx_t_1 = NULL;
29871   __pyx_t_5numpy_float64_t __pyx_t_2;
29872   char __pyx_t_3;
29873   int __pyx_t_4;
29874   Py_ssize_t __pyx_t_5;
29875   int __pyx_t_6;
29876   int __pyx_t_7;
29877   PyObject *__pyx_t_8 = NULL;
29878   PyObject *__pyx_t_9 = NULL;
29879   PyObject *__pyx_t_10 = NULL;
29880   __Pyx_RefNannySetupContext("__pyx_unpickle_scoreTrackII__set_state", 0);
29881   __Pyx_TraceCall("__pyx_unpickle_scoreTrackII__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
29882 
29883   /* "(tree fragment)":12
29884  *     return __pyx_result
29885  * cdef __pyx_unpickle_scoreTrackII__set_state(scoreTrackII __pyx_result, tuple __pyx_state):
29886  *     __pyx_result.ctrl_edm = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.data = __pyx_state[2]; __pyx_result.data_stderr = __pyx_state[3]; __pyx_result.datalength = __pyx_state[4]; __pyx_result.normalization_method = __pyx_state[5]; __pyx_result.pseudocount = __pyx_state[6]; __pyx_result.pvalue_stat = __pyx_state[7]; __pyx_result.scoring_method = __pyx_state[8]; __pyx_result.stderr_on = __pyx_state[9]; __pyx_result.trackline = __pyx_state[10]; __pyx_result.treat_edm = __pyx_state[11]             # <<<<<<<<<<<<<<
29887  *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):
29888  *         __pyx_result.__dict__.update(__pyx_state[12])
29889  */
29890   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29891     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29892     __PYX_ERR(1, 12, __pyx_L1_error)
29893   }
29894   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29895   __Pyx_GOTREF(__pyx_t_1);
29896   __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
29897   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29898   __pyx_v___pyx_result->ctrl_edm = __pyx_t_2;
29899   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29900     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29901     __PYX_ERR(1, 12, __pyx_L1_error)
29902   }
29903   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29904   __Pyx_GOTREF(__pyx_t_1);
29905   __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
29906   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29907   __pyx_v___pyx_result->cutoff = __pyx_t_2;
29908   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29909     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29910     __PYX_ERR(1, 12, __pyx_L1_error)
29911   }
29912   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29913   __Pyx_GOTREF(__pyx_t_1);
29914   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
29915   __Pyx_GIVEREF(__pyx_t_1);
29916   __Pyx_GOTREF(__pyx_v___pyx_result->data);
29917   __Pyx_DECREF(__pyx_v___pyx_result->data);
29918   __pyx_v___pyx_result->data = ((PyObject*)__pyx_t_1);
29919   __pyx_t_1 = 0;
29920   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29921     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29922     __PYX_ERR(1, 12, __pyx_L1_error)
29923   }
29924   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29925   __Pyx_GOTREF(__pyx_t_1);
29926   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
29927   __Pyx_GIVEREF(__pyx_t_1);
29928   __Pyx_GOTREF(__pyx_v___pyx_result->data_stderr);
29929   __Pyx_DECREF(__pyx_v___pyx_result->data_stderr);
29930   __pyx_v___pyx_result->data_stderr = ((PyObject*)__pyx_t_1);
29931   __pyx_t_1 = 0;
29932   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29933     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29934     __PYX_ERR(1, 12, __pyx_L1_error)
29935   }
29936   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29937   __Pyx_GOTREF(__pyx_t_1);
29938   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
29939   __Pyx_GIVEREF(__pyx_t_1);
29940   __Pyx_GOTREF(__pyx_v___pyx_result->datalength);
29941   __Pyx_DECREF(__pyx_v___pyx_result->datalength);
29942   __pyx_v___pyx_result->datalength = ((PyObject*)__pyx_t_1);
29943   __pyx_t_1 = 0;
29944   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29945     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29946     __PYX_ERR(1, 12, __pyx_L1_error)
29947   }
29948   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29949   __Pyx_GOTREF(__pyx_t_1);
29950   __pyx_t_3 = __Pyx_PyInt_As_char(__pyx_t_1); if (unlikely((__pyx_t_3 == (char)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
29951   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29952   __pyx_v___pyx_result->normalization_method = __pyx_t_3;
29953   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29954     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29955     __PYX_ERR(1, 12, __pyx_L1_error)
29956   }
29957   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29958   __Pyx_GOTREF(__pyx_t_1);
29959   __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
29960   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29961   __pyx_v___pyx_result->pseudocount = __pyx_t_2;
29962   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29963     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29964     __PYX_ERR(1, 12, __pyx_L1_error)
29965   }
29966   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29967   __Pyx_GOTREF(__pyx_t_1);
29968   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
29969   __Pyx_GIVEREF(__pyx_t_1);
29970   __Pyx_GOTREF(__pyx_v___pyx_result->pvalue_stat);
29971   __Pyx_DECREF(__pyx_v___pyx_result->pvalue_stat);
29972   __pyx_v___pyx_result->pvalue_stat = ((PyObject*)__pyx_t_1);
29973   __pyx_t_1 = 0;
29974   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29975     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29976     __PYX_ERR(1, 12, __pyx_L1_error)
29977   }
29978   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29979   __Pyx_GOTREF(__pyx_t_1);
29980   __pyx_t_3 = __Pyx_PyInt_As_char(__pyx_t_1); if (unlikely((__pyx_t_3 == (char)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
29981   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29982   __pyx_v___pyx_result->scoring_method = __pyx_t_3;
29983   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29984     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29985     __PYX_ERR(1, 12, __pyx_L1_error)
29986   }
29987   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29988   __Pyx_GOTREF(__pyx_t_1);
29989   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(1, 12, __pyx_L1_error)
29990   __Pyx_GIVEREF(__pyx_t_1);
29991   __Pyx_GOTREF(__pyx_v___pyx_result->stderr_on);
29992   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->stderr_on));
29993   __pyx_v___pyx_result->stderr_on = ((PyBoolObject *)__pyx_t_1);
29994   __pyx_t_1 = 0;
29995   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29996     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29997     __PYX_ERR(1, 12, __pyx_L1_error)
29998   }
29999   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30000   __Pyx_GOTREF(__pyx_t_1);
30001   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(1, 12, __pyx_L1_error)
30002   __Pyx_GIVEREF(__pyx_t_1);
30003   __Pyx_GOTREF(__pyx_v___pyx_result->trackline);
30004   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->trackline));
30005   __pyx_v___pyx_result->trackline = ((PyBoolObject *)__pyx_t_1);
30006   __pyx_t_1 = 0;
30007   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30008     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30009     __PYX_ERR(1, 12, __pyx_L1_error)
30010   }
30011   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30012   __Pyx_GOTREF(__pyx_t_1);
30013   __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
30014   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30015   __pyx_v___pyx_result->treat_edm = __pyx_t_2;
30016 
30017   /* "(tree fragment)":13
30018  * cdef __pyx_unpickle_scoreTrackII__set_state(scoreTrackII __pyx_result, tuple __pyx_state):
30019  *     __pyx_result.ctrl_edm = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.data = __pyx_state[2]; __pyx_result.data_stderr = __pyx_state[3]; __pyx_result.datalength = __pyx_state[4]; __pyx_result.normalization_method = __pyx_state[5]; __pyx_result.pseudocount = __pyx_state[6]; __pyx_result.pvalue_stat = __pyx_state[7]; __pyx_result.scoring_method = __pyx_state[8]; __pyx_result.stderr_on = __pyx_state[9]; __pyx_result.trackline = __pyx_state[10]; __pyx_result.treat_edm = __pyx_state[11]
30020  *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
30021  *         __pyx_result.__dict__.update(__pyx_state[12])
30022  */
30023   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30024     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
30025     __PYX_ERR(1, 13, __pyx_L1_error)
30026   }
30027   __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
30028   __pyx_t_6 = ((__pyx_t_5 > 12) != 0);
30029   if (__pyx_t_6) {
30030   } else {
30031     __pyx_t_4 = __pyx_t_6;
30032     goto __pyx_L4_bool_binop_done;
30033   }
30034   __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
30035   __pyx_t_7 = (__pyx_t_6 != 0);
30036   __pyx_t_4 = __pyx_t_7;
30037   __pyx_L4_bool_binop_done:;
30038   if (__pyx_t_4) {
30039 
30040     /* "(tree fragment)":14
30041  *     __pyx_result.ctrl_edm = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.data = __pyx_state[2]; __pyx_result.data_stderr = __pyx_state[3]; __pyx_result.datalength = __pyx_state[4]; __pyx_result.normalization_method = __pyx_state[5]; __pyx_result.pseudocount = __pyx_state[6]; __pyx_result.pvalue_stat = __pyx_state[7]; __pyx_result.scoring_method = __pyx_state[8]; __pyx_result.stderr_on = __pyx_state[9]; __pyx_result.trackline = __pyx_state[10]; __pyx_result.treat_edm = __pyx_state[11]
30042  *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):
30043  *         __pyx_result.__dict__.update(__pyx_state[12])             # <<<<<<<<<<<<<<
30044  */
30045     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
30046     __Pyx_GOTREF(__pyx_t_8);
30047     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
30048     __Pyx_GOTREF(__pyx_t_9);
30049     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30050     if (unlikely(__pyx_v___pyx_state == Py_None)) {
30051       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30052       __PYX_ERR(1, 14, __pyx_L1_error)
30053     }
30054     __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
30055     __Pyx_GOTREF(__pyx_t_8);
30056     __pyx_t_10 = NULL;
30057     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
30058       __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
30059       if (likely(__pyx_t_10)) {
30060         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
30061         __Pyx_INCREF(__pyx_t_10);
30062         __Pyx_INCREF(function);
30063         __Pyx_DECREF_SET(__pyx_t_9, function);
30064       }
30065     }
30066     __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8);
30067     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
30068     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30069     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
30070     __Pyx_GOTREF(__pyx_t_1);
30071     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
30072     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30073 
30074     /* "(tree fragment)":13
30075  * cdef __pyx_unpickle_scoreTrackII__set_state(scoreTrackII __pyx_result, tuple __pyx_state):
30076  *     __pyx_result.ctrl_edm = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.data = __pyx_state[2]; __pyx_result.data_stderr = __pyx_state[3]; __pyx_result.datalength = __pyx_state[4]; __pyx_result.normalization_method = __pyx_state[5]; __pyx_result.pseudocount = __pyx_state[6]; __pyx_result.pvalue_stat = __pyx_state[7]; __pyx_result.scoring_method = __pyx_state[8]; __pyx_result.stderr_on = __pyx_state[9]; __pyx_result.trackline = __pyx_state[10]; __pyx_result.treat_edm = __pyx_state[11]
30077  *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
30078  *         __pyx_result.__dict__.update(__pyx_state[12])
30079  */
30080   }
30081 
30082   /* "(tree fragment)":11
30083  *         __pyx_unpickle_scoreTrackII__set_state(<scoreTrackII> __pyx_result, __pyx_state)
30084  *     return __pyx_result
30085  * cdef __pyx_unpickle_scoreTrackII__set_state(scoreTrackII __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
30086  *     __pyx_result.ctrl_edm = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.data = __pyx_state[2]; __pyx_result.data_stderr = __pyx_state[3]; __pyx_result.datalength = __pyx_state[4]; __pyx_result.normalization_method = __pyx_state[5]; __pyx_result.pseudocount = __pyx_state[6]; __pyx_result.pvalue_stat = __pyx_state[7]; __pyx_result.scoring_method = __pyx_state[8]; __pyx_result.stderr_on = __pyx_state[9]; __pyx_result.trackline = __pyx_state[10]; __pyx_result.treat_edm = __pyx_state[11]
30087  *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):
30088  */
30089 
30090   /* function exit code */
30091   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30092   goto __pyx_L0;
30093   __pyx_L1_error:;
30094   __Pyx_XDECREF(__pyx_t_1);
30095   __Pyx_XDECREF(__pyx_t_8);
30096   __Pyx_XDECREF(__pyx_t_9);
30097   __Pyx_XDECREF(__pyx_t_10);
30098   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.__pyx_unpickle_scoreTrackII__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
30099   __pyx_r = 0;
30100   __pyx_L0:;
30101   __Pyx_XGIVEREF(__pyx_r);
30102   __Pyx_TraceReturn(__pyx_r, 0);
30103   __Pyx_RefNannyFinishContext();
30104   return __pyx_r;
30105 }
30106 
30107 /* "(tree fragment)":1
30108  * def __pyx_unpickle_TwoConditionScores(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
30109  *     cdef object __pyx_PickleError
30110  *     cdef object __pyx_result
30111  */
30112 
30113 /* Python wrapper */
30114 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_3__pyx_unpickle_TwoConditionScores(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
30115 static PyMethodDef __pyx_mdef_5MACS2_2IO_10ScoreTrack_3__pyx_unpickle_TwoConditionScores = {"__pyx_unpickle_TwoConditionScores", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_3__pyx_unpickle_TwoConditionScores, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5MACS2_2IO_10ScoreTrack_3__pyx_unpickle_TwoConditionScores(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)30116 static PyObject *__pyx_pw_5MACS2_2IO_10ScoreTrack_3__pyx_unpickle_TwoConditionScores(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
30117   PyObject *__pyx_v___pyx_type = 0;
30118   long __pyx_v___pyx_checksum;
30119   PyObject *__pyx_v___pyx_state = 0;
30120   PyObject *__pyx_r = 0;
30121   __Pyx_RefNannyDeclarations
30122   __Pyx_RefNannySetupContext("__pyx_unpickle_TwoConditionScores (wrapper)", 0);
30123   {
30124     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
30125     PyObject* values[3] = {0,0,0};
30126     if (unlikely(__pyx_kwds)) {
30127       Py_ssize_t kw_args;
30128       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
30129       switch (pos_args) {
30130         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
30131         CYTHON_FALLTHROUGH;
30132         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
30133         CYTHON_FALLTHROUGH;
30134         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
30135         CYTHON_FALLTHROUGH;
30136         case  0: break;
30137         default: goto __pyx_L5_argtuple_error;
30138       }
30139       kw_args = PyDict_Size(__pyx_kwds);
30140       switch (pos_args) {
30141         case  0:
30142         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
30143         else goto __pyx_L5_argtuple_error;
30144         CYTHON_FALLTHROUGH;
30145         case  1:
30146         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
30147         else {
30148           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TwoConditionScores", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
30149         }
30150         CYTHON_FALLTHROUGH;
30151         case  2:
30152         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
30153         else {
30154           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TwoConditionScores", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
30155         }
30156       }
30157       if (unlikely(kw_args > 0)) {
30158         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_TwoConditionScores") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
30159       }
30160     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
30161       goto __pyx_L5_argtuple_error;
30162     } else {
30163       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
30164       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
30165       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
30166     }
30167     __pyx_v___pyx_type = values[0];
30168     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
30169     __pyx_v___pyx_state = values[2];
30170   }
30171   goto __pyx_L4_argument_unpacking_done;
30172   __pyx_L5_argtuple_error:;
30173   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TwoConditionScores", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
30174   __pyx_L3_error:;
30175   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.__pyx_unpickle_TwoConditionScores", __pyx_clineno, __pyx_lineno, __pyx_filename);
30176   __Pyx_RefNannyFinishContext();
30177   return NULL;
30178   __pyx_L4_argument_unpacking_done:;
30179   __pyx_r = __pyx_pf_5MACS2_2IO_10ScoreTrack_2__pyx_unpickle_TwoConditionScores(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
30180 
30181   /* function exit code */
30182   __Pyx_RefNannyFinishContext();
30183   return __pyx_r;
30184 }
30185 
__pyx_pf_5MACS2_2IO_10ScoreTrack_2__pyx_unpickle_TwoConditionScores(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)30186 static PyObject *__pyx_pf_5MACS2_2IO_10ScoreTrack_2__pyx_unpickle_TwoConditionScores(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
30187   PyObject *__pyx_v___pyx_PickleError = 0;
30188   PyObject *__pyx_v___pyx_result = 0;
30189   PyObject *__pyx_r = NULL;
30190   __Pyx_TraceDeclarations
30191   __Pyx_RefNannyDeclarations
30192   int __pyx_t_1;
30193   PyObject *__pyx_t_2 = NULL;
30194   PyObject *__pyx_t_3 = NULL;
30195   PyObject *__pyx_t_4 = NULL;
30196   PyObject *__pyx_t_5 = NULL;
30197   int __pyx_t_6;
30198   __Pyx_TraceFrameInit(__pyx_codeobj__24)
30199   __Pyx_RefNannySetupContext("__pyx_unpickle_TwoConditionScores", 0);
30200   __Pyx_TraceCall("__pyx_unpickle_TwoConditionScores", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
30201 
30202   /* "(tree fragment)":4
30203  *     cdef object __pyx_PickleError
30204  *     cdef object __pyx_result
30205  *     if __pyx_checksum != 0x846cc7b:             # <<<<<<<<<<<<<<
30206  *         from pickle import PickleError as __pyx_PickleError
30207  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x846cc7b = (c1bdg, c2bdg, cond1_factor, cond2_factor, cutoff, data, datalength, pseudocount, pvalue_stat1, pvalue_stat2, pvalue_stat3, t1bdg, t2bdg))" % __pyx_checksum)
30208  */
30209   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x846cc7b) != 0);
30210   if (__pyx_t_1) {
30211 
30212     /* "(tree fragment)":5
30213  *     cdef object __pyx_result
30214  *     if __pyx_checksum != 0x846cc7b:
30215  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
30216  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x846cc7b = (c1bdg, c2bdg, cond1_factor, cond2_factor, cutoff, data, datalength, pseudocount, pvalue_stat1, pvalue_stat2, pvalue_stat3, t1bdg, t2bdg))" % __pyx_checksum)
30217  *     __pyx_result = TwoConditionScores.__new__(__pyx_type)
30218  */
30219     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
30220     __Pyx_GOTREF(__pyx_t_2);
30221     __Pyx_INCREF(__pyx_n_s_PickleError);
30222     __Pyx_GIVEREF(__pyx_n_s_PickleError);
30223     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
30224     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
30225     __Pyx_GOTREF(__pyx_t_3);
30226     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30227     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
30228     __Pyx_GOTREF(__pyx_t_2);
30229     __Pyx_INCREF(__pyx_t_2);
30230     __pyx_v___pyx_PickleError = __pyx_t_2;
30231     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30232     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30233 
30234     /* "(tree fragment)":6
30235  *     if __pyx_checksum != 0x846cc7b:
30236  *         from pickle import PickleError as __pyx_PickleError
30237  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x846cc7b = (c1bdg, c2bdg, cond1_factor, cond2_factor, cutoff, data, datalength, pseudocount, pvalue_stat1, pvalue_stat2, pvalue_stat3, t1bdg, t2bdg))" % __pyx_checksum)             # <<<<<<<<<<<<<<
30238  *     __pyx_result = TwoConditionScores.__new__(__pyx_type)
30239  *     if __pyx_state is not None:
30240  */
30241     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
30242     __Pyx_GOTREF(__pyx_t_2);
30243     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x84, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
30244     __Pyx_GOTREF(__pyx_t_4);
30245     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30246     __Pyx_INCREF(__pyx_v___pyx_PickleError);
30247     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
30248     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
30249       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
30250       if (likely(__pyx_t_5)) {
30251         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
30252         __Pyx_INCREF(__pyx_t_5);
30253         __Pyx_INCREF(function);
30254         __Pyx_DECREF_SET(__pyx_t_2, function);
30255       }
30256     }
30257     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
30258     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
30259     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30260     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
30261     __Pyx_GOTREF(__pyx_t_3);
30262     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30263     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
30264     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30265     __PYX_ERR(1, 6, __pyx_L1_error)
30266 
30267     /* "(tree fragment)":4
30268  *     cdef object __pyx_PickleError
30269  *     cdef object __pyx_result
30270  *     if __pyx_checksum != 0x846cc7b:             # <<<<<<<<<<<<<<
30271  *         from pickle import PickleError as __pyx_PickleError
30272  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x846cc7b = (c1bdg, c2bdg, cond1_factor, cond2_factor, cutoff, data, datalength, pseudocount, pvalue_stat1, pvalue_stat2, pvalue_stat3, t1bdg, t2bdg))" % __pyx_checksum)
30273  */
30274   }
30275 
30276   /* "(tree fragment)":7
30277  *         from pickle import PickleError as __pyx_PickleError
30278  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x846cc7b = (c1bdg, c2bdg, cond1_factor, cond2_factor, cutoff, data, datalength, pseudocount, pvalue_stat1, pvalue_stat2, pvalue_stat3, t1bdg, t2bdg))" % __pyx_checksum)
30279  *     __pyx_result = TwoConditionScores.__new__(__pyx_type)             # <<<<<<<<<<<<<<
30280  *     if __pyx_state is not None:
30281  *         __pyx_unpickle_TwoConditionScores__set_state(<TwoConditionScores> __pyx_result, __pyx_state)
30282  */
30283   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5MACS2_2IO_10ScoreTrack_TwoConditionScores), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
30284   __Pyx_GOTREF(__pyx_t_2);
30285   __pyx_t_4 = NULL;
30286   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
30287     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
30288     if (likely(__pyx_t_4)) {
30289       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
30290       __Pyx_INCREF(__pyx_t_4);
30291       __Pyx_INCREF(function);
30292       __Pyx_DECREF_SET(__pyx_t_2, function);
30293     }
30294   }
30295   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
30296   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
30297   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
30298   __Pyx_GOTREF(__pyx_t_3);
30299   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30300   __pyx_v___pyx_result = __pyx_t_3;
30301   __pyx_t_3 = 0;
30302 
30303   /* "(tree fragment)":8
30304  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x846cc7b = (c1bdg, c2bdg, cond1_factor, cond2_factor, cutoff, data, datalength, pseudocount, pvalue_stat1, pvalue_stat2, pvalue_stat3, t1bdg, t2bdg))" % __pyx_checksum)
30305  *     __pyx_result = TwoConditionScores.__new__(__pyx_type)
30306  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
30307  *         __pyx_unpickle_TwoConditionScores__set_state(<TwoConditionScores> __pyx_result, __pyx_state)
30308  *     return __pyx_result
30309  */
30310   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
30311   __pyx_t_6 = (__pyx_t_1 != 0);
30312   if (__pyx_t_6) {
30313 
30314     /* "(tree fragment)":9
30315  *     __pyx_result = TwoConditionScores.__new__(__pyx_type)
30316  *     if __pyx_state is not None:
30317  *         __pyx_unpickle_TwoConditionScores__set_state(<TwoConditionScores> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
30318  *     return __pyx_result
30319  * cdef __pyx_unpickle_TwoConditionScores__set_state(TwoConditionScores __pyx_result, tuple __pyx_state):
30320  */
30321     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
30322     __pyx_t_3 = __pyx_f_5MACS2_2IO_10ScoreTrack___pyx_unpickle_TwoConditionScores__set_state(((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
30323     __Pyx_GOTREF(__pyx_t_3);
30324     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30325 
30326     /* "(tree fragment)":8
30327  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x846cc7b = (c1bdg, c2bdg, cond1_factor, cond2_factor, cutoff, data, datalength, pseudocount, pvalue_stat1, pvalue_stat2, pvalue_stat3, t1bdg, t2bdg))" % __pyx_checksum)
30328  *     __pyx_result = TwoConditionScores.__new__(__pyx_type)
30329  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
30330  *         __pyx_unpickle_TwoConditionScores__set_state(<TwoConditionScores> __pyx_result, __pyx_state)
30331  *     return __pyx_result
30332  */
30333   }
30334 
30335   /* "(tree fragment)":10
30336  *     if __pyx_state is not None:
30337  *         __pyx_unpickle_TwoConditionScores__set_state(<TwoConditionScores> __pyx_result, __pyx_state)
30338  *     return __pyx_result             # <<<<<<<<<<<<<<
30339  * cdef __pyx_unpickle_TwoConditionScores__set_state(TwoConditionScores __pyx_result, tuple __pyx_state):
30340  *     __pyx_result.c1bdg = __pyx_state[0]; __pyx_result.c2bdg = __pyx_state[1]; __pyx_result.cond1_factor = __pyx_state[2]; __pyx_result.cond2_factor = __pyx_state[3]; __pyx_result.cutoff = __pyx_state[4]; __pyx_result.data = __pyx_state[5]; __pyx_result.datalength = __pyx_state[6]; __pyx_result.pseudocount = __pyx_state[7]; __pyx_result.pvalue_stat1 = __pyx_state[8]; __pyx_result.pvalue_stat2 = __pyx_state[9]; __pyx_result.pvalue_stat3 = __pyx_state[10]; __pyx_result.t1bdg = __pyx_state[11]; __pyx_result.t2bdg = __pyx_state[12]
30341  */
30342   __Pyx_XDECREF(__pyx_r);
30343   __Pyx_INCREF(__pyx_v___pyx_result);
30344   __pyx_r = __pyx_v___pyx_result;
30345   goto __pyx_L0;
30346 
30347   /* "(tree fragment)":1
30348  * def __pyx_unpickle_TwoConditionScores(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
30349  *     cdef object __pyx_PickleError
30350  *     cdef object __pyx_result
30351  */
30352 
30353   /* function exit code */
30354   __pyx_L1_error:;
30355   __Pyx_XDECREF(__pyx_t_2);
30356   __Pyx_XDECREF(__pyx_t_3);
30357   __Pyx_XDECREF(__pyx_t_4);
30358   __Pyx_XDECREF(__pyx_t_5);
30359   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.__pyx_unpickle_TwoConditionScores", __pyx_clineno, __pyx_lineno, __pyx_filename);
30360   __pyx_r = NULL;
30361   __pyx_L0:;
30362   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
30363   __Pyx_XDECREF(__pyx_v___pyx_result);
30364   __Pyx_XGIVEREF(__pyx_r);
30365   __Pyx_TraceReturn(__pyx_r, 0);
30366   __Pyx_RefNannyFinishContext();
30367   return __pyx_r;
30368 }
30369 
30370 /* "(tree fragment)":11
30371  *         __pyx_unpickle_TwoConditionScores__set_state(<TwoConditionScores> __pyx_result, __pyx_state)
30372  *     return __pyx_result
30373  * cdef __pyx_unpickle_TwoConditionScores__set_state(TwoConditionScores __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
30374  *     __pyx_result.c1bdg = __pyx_state[0]; __pyx_result.c2bdg = __pyx_state[1]; __pyx_result.cond1_factor = __pyx_state[2]; __pyx_result.cond2_factor = __pyx_state[3]; __pyx_result.cutoff = __pyx_state[4]; __pyx_result.data = __pyx_state[5]; __pyx_result.datalength = __pyx_state[6]; __pyx_result.pseudocount = __pyx_state[7]; __pyx_result.pvalue_stat1 = __pyx_state[8]; __pyx_result.pvalue_stat2 = __pyx_state[9]; __pyx_result.pvalue_stat3 = __pyx_state[10]; __pyx_result.t1bdg = __pyx_state[11]; __pyx_result.t2bdg = __pyx_state[12]
30375  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
30376  */
30377 
__pyx_f_5MACS2_2IO_10ScoreTrack___pyx_unpickle_TwoConditionScores__set_state(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)30378 static PyObject *__pyx_f_5MACS2_2IO_10ScoreTrack___pyx_unpickle_TwoConditionScores__set_state(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
30379   PyObject *__pyx_r = NULL;
30380   __Pyx_TraceDeclarations
30381   __Pyx_RefNannyDeclarations
30382   PyObject *__pyx_t_1 = NULL;
30383   __pyx_t_5numpy_float64_t __pyx_t_2;
30384   int __pyx_t_3;
30385   Py_ssize_t __pyx_t_4;
30386   int __pyx_t_5;
30387   int __pyx_t_6;
30388   PyObject *__pyx_t_7 = NULL;
30389   PyObject *__pyx_t_8 = NULL;
30390   PyObject *__pyx_t_9 = NULL;
30391   __Pyx_RefNannySetupContext("__pyx_unpickle_TwoConditionScores__set_state", 0);
30392   __Pyx_TraceCall("__pyx_unpickle_TwoConditionScores__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
30393 
30394   /* "(tree fragment)":12
30395  *     return __pyx_result
30396  * cdef __pyx_unpickle_TwoConditionScores__set_state(TwoConditionScores __pyx_result, tuple __pyx_state):
30397  *     __pyx_result.c1bdg = __pyx_state[0]; __pyx_result.c2bdg = __pyx_state[1]; __pyx_result.cond1_factor = __pyx_state[2]; __pyx_result.cond2_factor = __pyx_state[3]; __pyx_result.cutoff = __pyx_state[4]; __pyx_result.data = __pyx_state[5]; __pyx_result.datalength = __pyx_state[6]; __pyx_result.pseudocount = __pyx_state[7]; __pyx_result.pvalue_stat1 = __pyx_state[8]; __pyx_result.pvalue_stat2 = __pyx_state[9]; __pyx_result.pvalue_stat3 = __pyx_state[10]; __pyx_result.t1bdg = __pyx_state[11]; __pyx_result.t2bdg = __pyx_state[12]             # <<<<<<<<<<<<<<
30398  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
30399  *         __pyx_result.__dict__.update(__pyx_state[13])
30400  */
30401   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30402     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30403     __PYX_ERR(1, 12, __pyx_L1_error)
30404   }
30405   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30406   __Pyx_GOTREF(__pyx_t_1);
30407   __Pyx_GIVEREF(__pyx_t_1);
30408   __Pyx_GOTREF(__pyx_v___pyx_result->c1bdg);
30409   __Pyx_DECREF(__pyx_v___pyx_result->c1bdg);
30410   __pyx_v___pyx_result->c1bdg = __pyx_t_1;
30411   __pyx_t_1 = 0;
30412   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30413     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30414     __PYX_ERR(1, 12, __pyx_L1_error)
30415   }
30416   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30417   __Pyx_GOTREF(__pyx_t_1);
30418   __Pyx_GIVEREF(__pyx_t_1);
30419   __Pyx_GOTREF(__pyx_v___pyx_result->c2bdg);
30420   __Pyx_DECREF(__pyx_v___pyx_result->c2bdg);
30421   __pyx_v___pyx_result->c2bdg = __pyx_t_1;
30422   __pyx_t_1 = 0;
30423   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30424     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30425     __PYX_ERR(1, 12, __pyx_L1_error)
30426   }
30427   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30428   __Pyx_GOTREF(__pyx_t_1);
30429   __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
30430   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30431   __pyx_v___pyx_result->cond1_factor = __pyx_t_2;
30432   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30433     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30434     __PYX_ERR(1, 12, __pyx_L1_error)
30435   }
30436   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30437   __Pyx_GOTREF(__pyx_t_1);
30438   __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
30439   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30440   __pyx_v___pyx_result->cond2_factor = __pyx_t_2;
30441   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30442     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30443     __PYX_ERR(1, 12, __pyx_L1_error)
30444   }
30445   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30446   __Pyx_GOTREF(__pyx_t_1);
30447   __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
30448   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30449   __pyx_v___pyx_result->cutoff = __pyx_t_2;
30450   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30451     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30452     __PYX_ERR(1, 12, __pyx_L1_error)
30453   }
30454   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30455   __Pyx_GOTREF(__pyx_t_1);
30456   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
30457   __Pyx_GIVEREF(__pyx_t_1);
30458   __Pyx_GOTREF(__pyx_v___pyx_result->data);
30459   __Pyx_DECREF(__pyx_v___pyx_result->data);
30460   __pyx_v___pyx_result->data = ((PyObject*)__pyx_t_1);
30461   __pyx_t_1 = 0;
30462   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30463     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30464     __PYX_ERR(1, 12, __pyx_L1_error)
30465   }
30466   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30467   __Pyx_GOTREF(__pyx_t_1);
30468   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
30469   __Pyx_GIVEREF(__pyx_t_1);
30470   __Pyx_GOTREF(__pyx_v___pyx_result->datalength);
30471   __Pyx_DECREF(__pyx_v___pyx_result->datalength);
30472   __pyx_v___pyx_result->datalength = ((PyObject*)__pyx_t_1);
30473   __pyx_t_1 = 0;
30474   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30475     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30476     __PYX_ERR(1, 12, __pyx_L1_error)
30477   }
30478   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30479   __Pyx_GOTREF(__pyx_t_1);
30480   __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
30481   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30482   __pyx_v___pyx_result->pseudocount = __pyx_t_2;
30483   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30484     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30485     __PYX_ERR(1, 12, __pyx_L1_error)
30486   }
30487   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30488   __Pyx_GOTREF(__pyx_t_1);
30489   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
30490   __Pyx_GIVEREF(__pyx_t_1);
30491   __Pyx_GOTREF(__pyx_v___pyx_result->pvalue_stat1);
30492   __Pyx_DECREF(__pyx_v___pyx_result->pvalue_stat1);
30493   __pyx_v___pyx_result->pvalue_stat1 = ((PyObject*)__pyx_t_1);
30494   __pyx_t_1 = 0;
30495   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30496     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30497     __PYX_ERR(1, 12, __pyx_L1_error)
30498   }
30499   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30500   __Pyx_GOTREF(__pyx_t_1);
30501   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
30502   __Pyx_GIVEREF(__pyx_t_1);
30503   __Pyx_GOTREF(__pyx_v___pyx_result->pvalue_stat2);
30504   __Pyx_DECREF(__pyx_v___pyx_result->pvalue_stat2);
30505   __pyx_v___pyx_result->pvalue_stat2 = ((PyObject*)__pyx_t_1);
30506   __pyx_t_1 = 0;
30507   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30508     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30509     __PYX_ERR(1, 12, __pyx_L1_error)
30510   }
30511   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30512   __Pyx_GOTREF(__pyx_t_1);
30513   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
30514   __Pyx_GIVEREF(__pyx_t_1);
30515   __Pyx_GOTREF(__pyx_v___pyx_result->pvalue_stat3);
30516   __Pyx_DECREF(__pyx_v___pyx_result->pvalue_stat3);
30517   __pyx_v___pyx_result->pvalue_stat3 = ((PyObject*)__pyx_t_1);
30518   __pyx_t_1 = 0;
30519   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30520     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30521     __PYX_ERR(1, 12, __pyx_L1_error)
30522   }
30523   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30524   __Pyx_GOTREF(__pyx_t_1);
30525   __Pyx_GIVEREF(__pyx_t_1);
30526   __Pyx_GOTREF(__pyx_v___pyx_result->t1bdg);
30527   __Pyx_DECREF(__pyx_v___pyx_result->t1bdg);
30528   __pyx_v___pyx_result->t1bdg = __pyx_t_1;
30529   __pyx_t_1 = 0;
30530   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30531     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30532     __PYX_ERR(1, 12, __pyx_L1_error)
30533   }
30534   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
30535   __Pyx_GOTREF(__pyx_t_1);
30536   __Pyx_GIVEREF(__pyx_t_1);
30537   __Pyx_GOTREF(__pyx_v___pyx_result->t2bdg);
30538   __Pyx_DECREF(__pyx_v___pyx_result->t2bdg);
30539   __pyx_v___pyx_result->t2bdg = __pyx_t_1;
30540   __pyx_t_1 = 0;
30541 
30542   /* "(tree fragment)":13
30543  * cdef __pyx_unpickle_TwoConditionScores__set_state(TwoConditionScores __pyx_result, tuple __pyx_state):
30544  *     __pyx_result.c1bdg = __pyx_state[0]; __pyx_result.c2bdg = __pyx_state[1]; __pyx_result.cond1_factor = __pyx_state[2]; __pyx_result.cond2_factor = __pyx_state[3]; __pyx_result.cutoff = __pyx_state[4]; __pyx_result.data = __pyx_state[5]; __pyx_result.datalength = __pyx_state[6]; __pyx_result.pseudocount = __pyx_state[7]; __pyx_result.pvalue_stat1 = __pyx_state[8]; __pyx_result.pvalue_stat2 = __pyx_state[9]; __pyx_result.pvalue_stat3 = __pyx_state[10]; __pyx_result.t1bdg = __pyx_state[11]; __pyx_result.t2bdg = __pyx_state[12]
30545  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
30546  *         __pyx_result.__dict__.update(__pyx_state[13])
30547  */
30548   if (unlikely(__pyx_v___pyx_state == Py_None)) {
30549     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
30550     __PYX_ERR(1, 13, __pyx_L1_error)
30551   }
30552   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
30553   __pyx_t_5 = ((__pyx_t_4 > 13) != 0);
30554   if (__pyx_t_5) {
30555   } else {
30556     __pyx_t_3 = __pyx_t_5;
30557     goto __pyx_L4_bool_binop_done;
30558   }
30559   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
30560   __pyx_t_6 = (__pyx_t_5 != 0);
30561   __pyx_t_3 = __pyx_t_6;
30562   __pyx_L4_bool_binop_done:;
30563   if (__pyx_t_3) {
30564 
30565     /* "(tree fragment)":14
30566  *     __pyx_result.c1bdg = __pyx_state[0]; __pyx_result.c2bdg = __pyx_state[1]; __pyx_result.cond1_factor = __pyx_state[2]; __pyx_result.cond2_factor = __pyx_state[3]; __pyx_result.cutoff = __pyx_state[4]; __pyx_result.data = __pyx_state[5]; __pyx_result.datalength = __pyx_state[6]; __pyx_result.pseudocount = __pyx_state[7]; __pyx_result.pvalue_stat1 = __pyx_state[8]; __pyx_result.pvalue_stat2 = __pyx_state[9]; __pyx_result.pvalue_stat3 = __pyx_state[10]; __pyx_result.t1bdg = __pyx_state[11]; __pyx_result.t2bdg = __pyx_state[12]
30567  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
30568  *         __pyx_result.__dict__.update(__pyx_state[13])             # <<<<<<<<<<<<<<
30569  */
30570     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
30571     __Pyx_GOTREF(__pyx_t_7);
30572     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
30573     __Pyx_GOTREF(__pyx_t_8);
30574     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
30575     if (unlikely(__pyx_v___pyx_state == Py_None)) {
30576       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
30577       __PYX_ERR(1, 14, __pyx_L1_error)
30578     }
30579     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
30580     __Pyx_GOTREF(__pyx_t_7);
30581     __pyx_t_9 = NULL;
30582     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
30583       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
30584       if (likely(__pyx_t_9)) {
30585         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
30586         __Pyx_INCREF(__pyx_t_9);
30587         __Pyx_INCREF(function);
30588         __Pyx_DECREF_SET(__pyx_t_8, function);
30589       }
30590     }
30591     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
30592     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
30593     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
30594     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
30595     __Pyx_GOTREF(__pyx_t_1);
30596     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30597     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30598 
30599     /* "(tree fragment)":13
30600  * cdef __pyx_unpickle_TwoConditionScores__set_state(TwoConditionScores __pyx_result, tuple __pyx_state):
30601  *     __pyx_result.c1bdg = __pyx_state[0]; __pyx_result.c2bdg = __pyx_state[1]; __pyx_result.cond1_factor = __pyx_state[2]; __pyx_result.cond2_factor = __pyx_state[3]; __pyx_result.cutoff = __pyx_state[4]; __pyx_result.data = __pyx_state[5]; __pyx_result.datalength = __pyx_state[6]; __pyx_result.pseudocount = __pyx_state[7]; __pyx_result.pvalue_stat1 = __pyx_state[8]; __pyx_result.pvalue_stat2 = __pyx_state[9]; __pyx_result.pvalue_stat3 = __pyx_state[10]; __pyx_result.t1bdg = __pyx_state[11]; __pyx_result.t2bdg = __pyx_state[12]
30602  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
30603  *         __pyx_result.__dict__.update(__pyx_state[13])
30604  */
30605   }
30606 
30607   /* "(tree fragment)":11
30608  *         __pyx_unpickle_TwoConditionScores__set_state(<TwoConditionScores> __pyx_result, __pyx_state)
30609  *     return __pyx_result
30610  * cdef __pyx_unpickle_TwoConditionScores__set_state(TwoConditionScores __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
30611  *     __pyx_result.c1bdg = __pyx_state[0]; __pyx_result.c2bdg = __pyx_state[1]; __pyx_result.cond1_factor = __pyx_state[2]; __pyx_result.cond2_factor = __pyx_state[3]; __pyx_result.cutoff = __pyx_state[4]; __pyx_result.data = __pyx_state[5]; __pyx_result.datalength = __pyx_state[6]; __pyx_result.pseudocount = __pyx_state[7]; __pyx_result.pvalue_stat1 = __pyx_state[8]; __pyx_result.pvalue_stat2 = __pyx_state[9]; __pyx_result.pvalue_stat3 = __pyx_state[10]; __pyx_result.t1bdg = __pyx_state[11]; __pyx_result.t2bdg = __pyx_state[12]
30612  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
30613  */
30614 
30615   /* function exit code */
30616   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30617   goto __pyx_L0;
30618   __pyx_L1_error:;
30619   __Pyx_XDECREF(__pyx_t_1);
30620   __Pyx_XDECREF(__pyx_t_7);
30621   __Pyx_XDECREF(__pyx_t_8);
30622   __Pyx_XDECREF(__pyx_t_9);
30623   __Pyx_AddTraceback("MACS2.IO.ScoreTrack.__pyx_unpickle_TwoConditionScores__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
30624   __pyx_r = 0;
30625   __pyx_L0:;
30626   __Pyx_XGIVEREF(__pyx_r);
30627   __Pyx_TraceReturn(__pyx_r, 0);
30628   __Pyx_RefNannyFinishContext();
30629   return __pyx_r;
30630 }
30631 
30632 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":258
30633  *         # experimental exception made for __getbuffer__ and __releasebuffer__
30634  *         # -- the details of this may change.
30635  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
30636  *             # This implementation of getbuffer is geared towards Cython
30637  *             # requirements, and does not yet fulfill the PEP.
30638  */
30639 
30640 /* Python wrapper */
30641 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)30642 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
30643   int __pyx_r;
30644   __Pyx_RefNannyDeclarations
30645   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
30646   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
30647 
30648   /* function exit code */
30649   __Pyx_RefNannyFinishContext();
30650   return __pyx_r;
30651 }
30652 
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)30653 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
30654   int __pyx_v_i;
30655   int __pyx_v_ndim;
30656   int __pyx_v_endian_detector;
30657   int __pyx_v_little_endian;
30658   int __pyx_v_t;
30659   char *__pyx_v_f;
30660   PyArray_Descr *__pyx_v_descr = 0;
30661   int __pyx_v_offset;
30662   int __pyx_r;
30663   __Pyx_TraceDeclarations
30664   __Pyx_RefNannyDeclarations
30665   int __pyx_t_1;
30666   int __pyx_t_2;
30667   PyObject *__pyx_t_3 = NULL;
30668   int __pyx_t_4;
30669   int __pyx_t_5;
30670   int __pyx_t_6;
30671   PyArray_Descr *__pyx_t_7;
30672   PyObject *__pyx_t_8 = NULL;
30673   char *__pyx_t_9;
30674   if (__pyx_v_info == NULL) {
30675     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
30676     return -1;
30677   }
30678   __Pyx_RefNannySetupContext("__getbuffer__", 0);
30679   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
30680   __Pyx_GIVEREF(__pyx_v_info->obj);
30681   __Pyx_TraceCall("__getbuffer__", __pyx_f[2], 258, 0, __PYX_ERR(2, 258, __pyx_L1_error));
30682 
30683   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":265
30684  *
30685  *             cdef int i, ndim
30686  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
30687  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
30688  *
30689  */
30690   __pyx_v_endian_detector = 1;
30691 
30692   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":266
30693  *             cdef int i, ndim
30694  *             cdef int endian_detector = 1
30695  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
30696  *
30697  *             ndim = PyArray_NDIM(self)
30698  */
30699   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
30700 
30701   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":268
30702  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
30703  *
30704  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
30705  *
30706  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
30707  */
30708   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
30709 
30710   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":270
30711  *             ndim = PyArray_NDIM(self)
30712  *
30713  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
30714  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
30715  *                 raise ValueError(u"ndarray is not C contiguous")
30716  */
30717   __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
30718   if (__pyx_t_2) {
30719   } else {
30720     __pyx_t_1 = __pyx_t_2;
30721     goto __pyx_L4_bool_binop_done;
30722   }
30723 
30724   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":271
30725  *
30726  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
30727  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
30728  *                 raise ValueError(u"ndarray is not C contiguous")
30729  *
30730  */
30731   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
30732   __pyx_t_1 = __pyx_t_2;
30733   __pyx_L4_bool_binop_done:;
30734 
30735   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":270
30736  *             ndim = PyArray_NDIM(self)
30737  *
30738  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
30739  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
30740  *                 raise ValueError(u"ndarray is not C contiguous")
30741  */
30742   if (unlikely(__pyx_t_1)) {
30743 
30744     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":272
30745  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
30746  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
30747  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
30748  *
30749  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
30750  */
30751     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error)
30752     __Pyx_GOTREF(__pyx_t_3);
30753     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
30754     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30755     __PYX_ERR(2, 272, __pyx_L1_error)
30756 
30757     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":270
30758  *             ndim = PyArray_NDIM(self)
30759  *
30760  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
30761  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
30762  *                 raise ValueError(u"ndarray is not C contiguous")
30763  */
30764   }
30765 
30766   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":274
30767  *                 raise ValueError(u"ndarray is not C contiguous")
30768  *
30769  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
30770  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
30771  *                 raise ValueError(u"ndarray is not Fortran contiguous")
30772  */
30773   __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
30774   if (__pyx_t_2) {
30775   } else {
30776     __pyx_t_1 = __pyx_t_2;
30777     goto __pyx_L7_bool_binop_done;
30778   }
30779 
30780   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":275
30781  *
30782  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
30783  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
30784  *                 raise ValueError(u"ndarray is not Fortran contiguous")
30785  *
30786  */
30787   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
30788   __pyx_t_1 = __pyx_t_2;
30789   __pyx_L7_bool_binop_done:;
30790 
30791   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":274
30792  *                 raise ValueError(u"ndarray is not C contiguous")
30793  *
30794  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
30795  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
30796  *                 raise ValueError(u"ndarray is not Fortran contiguous")
30797  */
30798   if (unlikely(__pyx_t_1)) {
30799 
30800     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":276
30801  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
30802  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
30803  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
30804  *
30805  *             info.buf = PyArray_DATA(self)
30806  */
30807     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error)
30808     __Pyx_GOTREF(__pyx_t_3);
30809     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
30810     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30811     __PYX_ERR(2, 276, __pyx_L1_error)
30812 
30813     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":274
30814  *                 raise ValueError(u"ndarray is not C contiguous")
30815  *
30816  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
30817  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
30818  *                 raise ValueError(u"ndarray is not Fortran contiguous")
30819  */
30820   }
30821 
30822   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":278
30823  *                 raise ValueError(u"ndarray is not Fortran contiguous")
30824  *
30825  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
30826  *             info.ndim = ndim
30827  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
30828  */
30829   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
30830 
30831   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":279
30832  *
30833  *             info.buf = PyArray_DATA(self)
30834  *             info.ndim = ndim             # <<<<<<<<<<<<<<
30835  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
30836  *                 # Allocate new buffer for strides and shape info.
30837  */
30838   __pyx_v_info->ndim = __pyx_v_ndim;
30839 
30840   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":280
30841  *             info.buf = PyArray_DATA(self)
30842  *             info.ndim = ndim
30843  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
30844  *                 # Allocate new buffer for strides and shape info.
30845  *                 # This is allocated as one block, strides first.
30846  */
30847   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
30848   if (__pyx_t_1) {
30849 
30850     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":283
30851  *                 # Allocate new buffer for strides and shape info.
30852  *                 # This is allocated as one block, strides first.
30853  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
30854  *                 info.shape = info.strides + ndim
30855  *                 for i in range(ndim):
30856  */
30857     __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
30858 
30859     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":284
30860  *                 # This is allocated as one block, strides first.
30861  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
30862  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
30863  *                 for i in range(ndim):
30864  *                     info.strides[i] = PyArray_STRIDES(self)[i]
30865  */
30866     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
30867 
30868     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":285
30869  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
30870  *                 info.shape = info.strides + ndim
30871  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
30872  *                     info.strides[i] = PyArray_STRIDES(self)[i]
30873  *                     info.shape[i] = PyArray_DIMS(self)[i]
30874  */
30875     __pyx_t_4 = __pyx_v_ndim;
30876     __pyx_t_5 = __pyx_t_4;
30877     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
30878       __pyx_v_i = __pyx_t_6;
30879 
30880       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":286
30881  *                 info.shape = info.strides + ndim
30882  *                 for i in range(ndim):
30883  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
30884  *                     info.shape[i] = PyArray_DIMS(self)[i]
30885  *             else:
30886  */
30887       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
30888 
30889       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":287
30890  *                 for i in range(ndim):
30891  *                     info.strides[i] = PyArray_STRIDES(self)[i]
30892  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
30893  *             else:
30894  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
30895  */
30896       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
30897     }
30898 
30899     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":280
30900  *             info.buf = PyArray_DATA(self)
30901  *             info.ndim = ndim
30902  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
30903  *                 # Allocate new buffer for strides and shape info.
30904  *                 # This is allocated as one block, strides first.
30905  */
30906     goto __pyx_L9;
30907   }
30908 
30909   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":289
30910  *                     info.shape[i] = PyArray_DIMS(self)[i]
30911  *             else:
30912  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
30913  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
30914  *             info.suboffsets = NULL
30915  */
30916   /*else*/ {
30917     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
30918 
30919     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":290
30920  *             else:
30921  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
30922  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
30923  *             info.suboffsets = NULL
30924  *             info.itemsize = PyArray_ITEMSIZE(self)
30925  */
30926     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
30927   }
30928   __pyx_L9:;
30929 
30930   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":291
30931  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
30932  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
30933  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
30934  *             info.itemsize = PyArray_ITEMSIZE(self)
30935  *             info.readonly = not PyArray_ISWRITEABLE(self)
30936  */
30937   __pyx_v_info->suboffsets = NULL;
30938 
30939   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":292
30940  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
30941  *             info.suboffsets = NULL
30942  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
30943  *             info.readonly = not PyArray_ISWRITEABLE(self)
30944  *
30945  */
30946   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
30947 
30948   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":293
30949  *             info.suboffsets = NULL
30950  *             info.itemsize = PyArray_ITEMSIZE(self)
30951  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
30952  *
30953  *             cdef int t
30954  */
30955   __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
30956 
30957   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":296
30958  *
30959  *             cdef int t
30960  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
30961  *             cdef dtype descr = <dtype>PyArray_DESCR(self)
30962  *             cdef int offset
30963  */
30964   __pyx_v_f = NULL;
30965 
30966   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":297
30967  *             cdef int t
30968  *             cdef char* f = NULL
30969  *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
30970  *             cdef int offset
30971  *
30972  */
30973   __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
30974   __pyx_t_3 = ((PyObject *)__pyx_t_7);
30975   __Pyx_INCREF(__pyx_t_3);
30976   __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
30977   __pyx_t_3 = 0;
30978 
30979   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":300
30980  *             cdef int offset
30981  *
30982  *             info.obj = self             # <<<<<<<<<<<<<<
30983  *
30984  *             if not PyDataType_HASFIELDS(descr):
30985  */
30986   __Pyx_INCREF(((PyObject *)__pyx_v_self));
30987   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
30988   __Pyx_GOTREF(__pyx_v_info->obj);
30989   __Pyx_DECREF(__pyx_v_info->obj);
30990   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
30991 
30992   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":302
30993  *             info.obj = self
30994  *
30995  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
30996  *                 t = descr.type_num
30997  *                 if ((descr.byteorder == c'>' and little_endian) or
30998  */
30999   __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
31000   if (__pyx_t_1) {
31001 
31002     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":303
31003  *
31004  *             if not PyDataType_HASFIELDS(descr):
31005  *                 t = descr.type_num             # <<<<<<<<<<<<<<
31006  *                 if ((descr.byteorder == c'>' and little_endian) or
31007  *                     (descr.byteorder == c'<' and not little_endian)):
31008  */
31009     __pyx_t_4 = __pyx_v_descr->type_num;
31010     __pyx_v_t = __pyx_t_4;
31011 
31012     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":304
31013  *             if not PyDataType_HASFIELDS(descr):
31014  *                 t = descr.type_num
31015  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
31016  *                     (descr.byteorder == c'<' and not little_endian)):
31017  *                     raise ValueError(u"Non-native byte order not supported")
31018  */
31019     __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
31020     if (!__pyx_t_2) {
31021       goto __pyx_L15_next_or;
31022     } else {
31023     }
31024     __pyx_t_2 = (__pyx_v_little_endian != 0);
31025     if (!__pyx_t_2) {
31026     } else {
31027       __pyx_t_1 = __pyx_t_2;
31028       goto __pyx_L14_bool_binop_done;
31029     }
31030     __pyx_L15_next_or:;
31031 
31032     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":305
31033  *                 t = descr.type_num
31034  *                 if ((descr.byteorder == c'>' and little_endian) or
31035  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
31036  *                     raise ValueError(u"Non-native byte order not supported")
31037  *                 if   t == NPY_BYTE:        f = "b"
31038  */
31039     __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
31040     if (__pyx_t_2) {
31041     } else {
31042       __pyx_t_1 = __pyx_t_2;
31043       goto __pyx_L14_bool_binop_done;
31044     }
31045     __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
31046     __pyx_t_1 = __pyx_t_2;
31047     __pyx_L14_bool_binop_done:;
31048 
31049     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":304
31050  *             if not PyDataType_HASFIELDS(descr):
31051  *                 t = descr.type_num
31052  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
31053  *                     (descr.byteorder == c'<' and not little_endian)):
31054  *                     raise ValueError(u"Non-native byte order not supported")
31055  */
31056     if (unlikely(__pyx_t_1)) {
31057 
31058       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":306
31059  *                 if ((descr.byteorder == c'>' and little_endian) or
31060  *                     (descr.byteorder == c'<' and not little_endian)):
31061  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
31062  *                 if   t == NPY_BYTE:        f = "b"
31063  *                 elif t == NPY_UBYTE:       f = "B"
31064  */
31065       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error)
31066       __Pyx_GOTREF(__pyx_t_3);
31067       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
31068       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31069       __PYX_ERR(2, 306, __pyx_L1_error)
31070 
31071       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":304
31072  *             if not PyDataType_HASFIELDS(descr):
31073  *                 t = descr.type_num
31074  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
31075  *                     (descr.byteorder == c'<' and not little_endian)):
31076  *                     raise ValueError(u"Non-native byte order not supported")
31077  */
31078     }
31079 
31080     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":307
31081  *                     (descr.byteorder == c'<' and not little_endian)):
31082  *                     raise ValueError(u"Non-native byte order not supported")
31083  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
31084  *                 elif t == NPY_UBYTE:       f = "B"
31085  *                 elif t == NPY_SHORT:       f = "h"
31086  */
31087     switch (__pyx_v_t) {
31088       case NPY_BYTE:
31089       __pyx_v_f = ((char *)"b");
31090       break;
31091       case NPY_UBYTE:
31092 
31093       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":308
31094  *                     raise ValueError(u"Non-native byte order not supported")
31095  *                 if   t == NPY_BYTE:        f = "b"
31096  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
31097  *                 elif t == NPY_SHORT:       f = "h"
31098  *                 elif t == NPY_USHORT:      f = "H"
31099  */
31100       __pyx_v_f = ((char *)"B");
31101       break;
31102       case NPY_SHORT:
31103 
31104       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":309
31105  *                 if   t == NPY_BYTE:        f = "b"
31106  *                 elif t == NPY_UBYTE:       f = "B"
31107  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
31108  *                 elif t == NPY_USHORT:      f = "H"
31109  *                 elif t == NPY_INT:         f = "i"
31110  */
31111       __pyx_v_f = ((char *)"h");
31112       break;
31113       case NPY_USHORT:
31114 
31115       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":310
31116  *                 elif t == NPY_UBYTE:       f = "B"
31117  *                 elif t == NPY_SHORT:       f = "h"
31118  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
31119  *                 elif t == NPY_INT:         f = "i"
31120  *                 elif t == NPY_UINT:        f = "I"
31121  */
31122       __pyx_v_f = ((char *)"H");
31123       break;
31124       case NPY_INT:
31125 
31126       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":311
31127  *                 elif t == NPY_SHORT:       f = "h"
31128  *                 elif t == NPY_USHORT:      f = "H"
31129  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
31130  *                 elif t == NPY_UINT:        f = "I"
31131  *                 elif t == NPY_LONG:        f = "l"
31132  */
31133       __pyx_v_f = ((char *)"i");
31134       break;
31135       case NPY_UINT:
31136 
31137       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":312
31138  *                 elif t == NPY_USHORT:      f = "H"
31139  *                 elif t == NPY_INT:         f = "i"
31140  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
31141  *                 elif t == NPY_LONG:        f = "l"
31142  *                 elif t == NPY_ULONG:       f = "L"
31143  */
31144       __pyx_v_f = ((char *)"I");
31145       break;
31146       case NPY_LONG:
31147 
31148       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":313
31149  *                 elif t == NPY_INT:         f = "i"
31150  *                 elif t == NPY_UINT:        f = "I"
31151  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
31152  *                 elif t == NPY_ULONG:       f = "L"
31153  *                 elif t == NPY_LONGLONG:    f = "q"
31154  */
31155       __pyx_v_f = ((char *)"l");
31156       break;
31157       case NPY_ULONG:
31158 
31159       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":314
31160  *                 elif t == NPY_UINT:        f = "I"
31161  *                 elif t == NPY_LONG:        f = "l"
31162  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
31163  *                 elif t == NPY_LONGLONG:    f = "q"
31164  *                 elif t == NPY_ULONGLONG:   f = "Q"
31165  */
31166       __pyx_v_f = ((char *)"L");
31167       break;
31168       case NPY_LONGLONG:
31169 
31170       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":315
31171  *                 elif t == NPY_LONG:        f = "l"
31172  *                 elif t == NPY_ULONG:       f = "L"
31173  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
31174  *                 elif t == NPY_ULONGLONG:   f = "Q"
31175  *                 elif t == NPY_FLOAT:       f = "f"
31176  */
31177       __pyx_v_f = ((char *)"q");
31178       break;
31179       case NPY_ULONGLONG:
31180 
31181       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":316
31182  *                 elif t == NPY_ULONG:       f = "L"
31183  *                 elif t == NPY_LONGLONG:    f = "q"
31184  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
31185  *                 elif t == NPY_FLOAT:       f = "f"
31186  *                 elif t == NPY_DOUBLE:      f = "d"
31187  */
31188       __pyx_v_f = ((char *)"Q");
31189       break;
31190       case NPY_FLOAT:
31191 
31192       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":317
31193  *                 elif t == NPY_LONGLONG:    f = "q"
31194  *                 elif t == NPY_ULONGLONG:   f = "Q"
31195  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
31196  *                 elif t == NPY_DOUBLE:      f = "d"
31197  *                 elif t == NPY_LONGDOUBLE:  f = "g"
31198  */
31199       __pyx_v_f = ((char *)"f");
31200       break;
31201       case NPY_DOUBLE:
31202 
31203       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":318
31204  *                 elif t == NPY_ULONGLONG:   f = "Q"
31205  *                 elif t == NPY_FLOAT:       f = "f"
31206  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
31207  *                 elif t == NPY_LONGDOUBLE:  f = "g"
31208  *                 elif t == NPY_CFLOAT:      f = "Zf"
31209  */
31210       __pyx_v_f = ((char *)"d");
31211       break;
31212       case NPY_LONGDOUBLE:
31213 
31214       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":319
31215  *                 elif t == NPY_FLOAT:       f = "f"
31216  *                 elif t == NPY_DOUBLE:      f = "d"
31217  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
31218  *                 elif t == NPY_CFLOAT:      f = "Zf"
31219  *                 elif t == NPY_CDOUBLE:     f = "Zd"
31220  */
31221       __pyx_v_f = ((char *)"g");
31222       break;
31223       case NPY_CFLOAT:
31224 
31225       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":320
31226  *                 elif t == NPY_DOUBLE:      f = "d"
31227  *                 elif t == NPY_LONGDOUBLE:  f = "g"
31228  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
31229  *                 elif t == NPY_CDOUBLE:     f = "Zd"
31230  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
31231  */
31232       __pyx_v_f = ((char *)"Zf");
31233       break;
31234       case NPY_CDOUBLE:
31235 
31236       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":321
31237  *                 elif t == NPY_LONGDOUBLE:  f = "g"
31238  *                 elif t == NPY_CFLOAT:      f = "Zf"
31239  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
31240  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
31241  *                 elif t == NPY_OBJECT:      f = "O"
31242  */
31243       __pyx_v_f = ((char *)"Zd");
31244       break;
31245       case NPY_CLONGDOUBLE:
31246 
31247       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":322
31248  *                 elif t == NPY_CFLOAT:      f = "Zf"
31249  *                 elif t == NPY_CDOUBLE:     f = "Zd"
31250  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
31251  *                 elif t == NPY_OBJECT:      f = "O"
31252  *                 else:
31253  */
31254       __pyx_v_f = ((char *)"Zg");
31255       break;
31256       case NPY_OBJECT:
31257 
31258       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":323
31259  *                 elif t == NPY_CDOUBLE:     f = "Zd"
31260  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
31261  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
31262  *                 else:
31263  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
31264  */
31265       __pyx_v_f = ((char *)"O");
31266       break;
31267       default:
31268 
31269       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":325
31270  *                 elif t == NPY_OBJECT:      f = "O"
31271  *                 else:
31272  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
31273  *                 info.format = f
31274  *                 return
31275  */
31276       __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
31277       __Pyx_GOTREF(__pyx_t_3);
31278       __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 325, __pyx_L1_error)
31279       __Pyx_GOTREF(__pyx_t_8);
31280       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31281       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
31282       __Pyx_GOTREF(__pyx_t_3);
31283       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31284       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
31285       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31286       __PYX_ERR(2, 325, __pyx_L1_error)
31287       break;
31288     }
31289 
31290     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":326
31291  *                 else:
31292  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
31293  *                 info.format = f             # <<<<<<<<<<<<<<
31294  *                 return
31295  *             else:
31296  */
31297     __pyx_v_info->format = __pyx_v_f;
31298 
31299     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":327
31300  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
31301  *                 info.format = f
31302  *                 return             # <<<<<<<<<<<<<<
31303  *             else:
31304  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
31305  */
31306     __pyx_r = 0;
31307     goto __pyx_L0;
31308 
31309     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":302
31310  *             info.obj = self
31311  *
31312  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
31313  *                 t = descr.type_num
31314  *                 if ((descr.byteorder == c'>' and little_endian) or
31315  */
31316   }
31317 
31318   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":329
31319  *                 return
31320  *             else:
31321  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
31322  *                 info.format[0] = c'^' # Native data types, manual alignment
31323  *                 offset = 0
31324  */
31325   /*else*/ {
31326     __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
31327 
31328     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":330
31329  *             else:
31330  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
31331  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
31332  *                 offset = 0
31333  *                 f = _util_dtypestring(descr, info.format + 1,
31334  */
31335     (__pyx_v_info->format[0]) = '^';
31336 
31337     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":331
31338  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
31339  *                 info.format[0] = c'^' # Native data types, manual alignment
31340  *                 offset = 0             # <<<<<<<<<<<<<<
31341  *                 f = _util_dtypestring(descr, info.format + 1,
31342  *                                       info.format + _buffer_format_string_len,
31343  */
31344     __pyx_v_offset = 0;
31345 
31346     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":332
31347  *                 info.format[0] = c'^' # Native data types, manual alignment
31348  *                 offset = 0
31349  *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
31350  *                                       info.format + _buffer_format_string_len,
31351  *                                       &offset)
31352  */
31353     __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 332, __pyx_L1_error)
31354     __pyx_v_f = __pyx_t_9;
31355 
31356     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":335
31357  *                                       info.format + _buffer_format_string_len,
31358  *                                       &offset)
31359  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
31360  *
31361  *         def __releasebuffer__(ndarray self, Py_buffer* info):
31362  */
31363     (__pyx_v_f[0]) = '\x00';
31364   }
31365 
31366   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":258
31367  *         # experimental exception made for __getbuffer__ and __releasebuffer__
31368  *         # -- the details of this may change.
31369  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
31370  *             # This implementation of getbuffer is geared towards Cython
31371  *             # requirements, and does not yet fulfill the PEP.
31372  */
31373 
31374   /* function exit code */
31375   __pyx_r = 0;
31376   goto __pyx_L0;
31377   __pyx_L1_error:;
31378   __Pyx_XDECREF(__pyx_t_3);
31379   __Pyx_XDECREF(__pyx_t_8);
31380   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31381   __pyx_r = -1;
31382   if (__pyx_v_info->obj != NULL) {
31383     __Pyx_GOTREF(__pyx_v_info->obj);
31384     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
31385   }
31386   goto __pyx_L2;
31387   __pyx_L0:;
31388   if (__pyx_v_info->obj == Py_None) {
31389     __Pyx_GOTREF(__pyx_v_info->obj);
31390     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
31391   }
31392   __pyx_L2:;
31393   __Pyx_XDECREF((PyObject *)__pyx_v_descr);
31394   __Pyx_TraceReturn(Py_None, 0);
31395   __Pyx_RefNannyFinishContext();
31396   return __pyx_r;
31397 }
31398 
31399 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":337
31400  *                 f[0] = c'\0' # Terminate format string
31401  *
31402  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
31403  *             if PyArray_HASFIELDS(self):
31404  *                 PyObject_Free(info.format)
31405  */
31406 
31407 /* Python wrapper */
31408 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
__pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info)31409 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
31410   __Pyx_RefNannyDeclarations
31411   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
31412   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
31413 
31414   /* function exit code */
31415   __Pyx_RefNannyFinishContext();
31416 }
31417 
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)31418 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
31419   __Pyx_TraceDeclarations
31420   __Pyx_RefNannyDeclarations
31421   int __pyx_t_1;
31422   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
31423   __Pyx_TraceCall("__releasebuffer__", __pyx_f[2], 337, 0, __PYX_ERR(2, 337, __pyx_L1_error));
31424 
31425   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":338
31426  *
31427  *         def __releasebuffer__(ndarray self, Py_buffer* info):
31428  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
31429  *                 PyObject_Free(info.format)
31430  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
31431  */
31432   __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
31433   if (__pyx_t_1) {
31434 
31435     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":339
31436  *         def __releasebuffer__(ndarray self, Py_buffer* info):
31437  *             if PyArray_HASFIELDS(self):
31438  *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
31439  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
31440  *                 PyObject_Free(info.strides)
31441  */
31442     PyObject_Free(__pyx_v_info->format);
31443 
31444     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":338
31445  *
31446  *         def __releasebuffer__(ndarray self, Py_buffer* info):
31447  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
31448  *                 PyObject_Free(info.format)
31449  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
31450  */
31451   }
31452 
31453   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":340
31454  *             if PyArray_HASFIELDS(self):
31455  *                 PyObject_Free(info.format)
31456  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
31457  *                 PyObject_Free(info.strides)
31458  *                 # info.shape was stored after info.strides in the same block
31459  */
31460   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
31461   if (__pyx_t_1) {
31462 
31463     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":341
31464  *                 PyObject_Free(info.format)
31465  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
31466  *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
31467  *                 # info.shape was stored after info.strides in the same block
31468  *
31469  */
31470     PyObject_Free(__pyx_v_info->strides);
31471 
31472     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":340
31473  *             if PyArray_HASFIELDS(self):
31474  *                 PyObject_Free(info.format)
31475  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
31476  *                 PyObject_Free(info.strides)
31477  *                 # info.shape was stored after info.strides in the same block
31478  */
31479   }
31480 
31481   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":337
31482  *                 f[0] = c'\0' # Terminate format string
31483  *
31484  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
31485  *             if PyArray_HASFIELDS(self):
31486  *                 PyObject_Free(info.format)
31487  */
31488 
31489   /* function exit code */
31490   goto __pyx_L0;
31491   __pyx_L1_error:;
31492   __Pyx_WriteUnraisable("numpy.ndarray.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
31493   __pyx_L0:;
31494   __Pyx_TraceReturn(Py_None, 0);
31495   __Pyx_RefNannyFinishContext();
31496 }
31497 
31498 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":821
31499  * ctypedef npy_cdouble     complex_t
31500  *
31501  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
31502  *     return PyArray_MultiIterNew(1, <void*>a)
31503  *
31504  */
31505 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)31506 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
31507   PyObject *__pyx_r = NULL;
31508   __Pyx_TraceDeclarations
31509   __Pyx_RefNannyDeclarations
31510   PyObject *__pyx_t_1 = NULL;
31511   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
31512   __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[2], 821, 0, __PYX_ERR(2, 821, __pyx_L1_error));
31513 
31514   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":822
31515  *
31516  * cdef inline object PyArray_MultiIterNew1(a):
31517  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
31518  *
31519  * cdef inline object PyArray_MultiIterNew2(a, b):
31520  */
31521   __Pyx_XDECREF(__pyx_r);
31522   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
31523   __Pyx_GOTREF(__pyx_t_1);
31524   __pyx_r = __pyx_t_1;
31525   __pyx_t_1 = 0;
31526   goto __pyx_L0;
31527 
31528   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":821
31529  * ctypedef npy_cdouble     complex_t
31530  *
31531  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
31532  *     return PyArray_MultiIterNew(1, <void*>a)
31533  *
31534  */
31535 
31536   /* function exit code */
31537   __pyx_L1_error:;
31538   __Pyx_XDECREF(__pyx_t_1);
31539   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
31540   __pyx_r = 0;
31541   __pyx_L0:;
31542   __Pyx_XGIVEREF(__pyx_r);
31543   __Pyx_TraceReturn(__pyx_r, 0);
31544   __Pyx_RefNannyFinishContext();
31545   return __pyx_r;
31546 }
31547 
31548 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":824
31549  *     return PyArray_MultiIterNew(1, <void*>a)
31550  *
31551  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
31552  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
31553  *
31554  */
31555 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)31556 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
31557   PyObject *__pyx_r = NULL;
31558   __Pyx_TraceDeclarations
31559   __Pyx_RefNannyDeclarations
31560   PyObject *__pyx_t_1 = NULL;
31561   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
31562   __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[2], 824, 0, __PYX_ERR(2, 824, __pyx_L1_error));
31563 
31564   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":825
31565  *
31566  * cdef inline object PyArray_MultiIterNew2(a, b):
31567  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
31568  *
31569  * cdef inline object PyArray_MultiIterNew3(a, b, c):
31570  */
31571   __Pyx_XDECREF(__pyx_r);
31572   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
31573   __Pyx_GOTREF(__pyx_t_1);
31574   __pyx_r = __pyx_t_1;
31575   __pyx_t_1 = 0;
31576   goto __pyx_L0;
31577 
31578   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":824
31579  *     return PyArray_MultiIterNew(1, <void*>a)
31580  *
31581  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
31582  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
31583  *
31584  */
31585 
31586   /* function exit code */
31587   __pyx_L1_error:;
31588   __Pyx_XDECREF(__pyx_t_1);
31589   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
31590   __pyx_r = 0;
31591   __pyx_L0:;
31592   __Pyx_XGIVEREF(__pyx_r);
31593   __Pyx_TraceReturn(__pyx_r, 0);
31594   __Pyx_RefNannyFinishContext();
31595   return __pyx_r;
31596 }
31597 
31598 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":827
31599  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
31600  *
31601  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
31602  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
31603  *
31604  */
31605 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)31606 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
31607   PyObject *__pyx_r = NULL;
31608   __Pyx_TraceDeclarations
31609   __Pyx_RefNannyDeclarations
31610   PyObject *__pyx_t_1 = NULL;
31611   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
31612   __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[2], 827, 0, __PYX_ERR(2, 827, __pyx_L1_error));
31613 
31614   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":828
31615  *
31616  * cdef inline object PyArray_MultiIterNew3(a, b, c):
31617  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
31618  *
31619  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
31620  */
31621   __Pyx_XDECREF(__pyx_r);
31622   __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 828, __pyx_L1_error)
31623   __Pyx_GOTREF(__pyx_t_1);
31624   __pyx_r = __pyx_t_1;
31625   __pyx_t_1 = 0;
31626   goto __pyx_L0;
31627 
31628   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":827
31629  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
31630  *
31631  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
31632  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
31633  *
31634  */
31635 
31636   /* function exit code */
31637   __pyx_L1_error:;
31638   __Pyx_XDECREF(__pyx_t_1);
31639   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
31640   __pyx_r = 0;
31641   __pyx_L0:;
31642   __Pyx_XGIVEREF(__pyx_r);
31643   __Pyx_TraceReturn(__pyx_r, 0);
31644   __Pyx_RefNannyFinishContext();
31645   return __pyx_r;
31646 }
31647 
31648 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":830
31649  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
31650  *
31651  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
31652  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
31653  *
31654  */
31655 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)31656 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
31657   PyObject *__pyx_r = NULL;
31658   __Pyx_TraceDeclarations
31659   __Pyx_RefNannyDeclarations
31660   PyObject *__pyx_t_1 = NULL;
31661   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
31662   __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[2], 830, 0, __PYX_ERR(2, 830, __pyx_L1_error));
31663 
31664   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":831
31665  *
31666  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
31667  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
31668  *
31669  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
31670  */
31671   __Pyx_XDECREF(__pyx_r);
31672   __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 831, __pyx_L1_error)
31673   __Pyx_GOTREF(__pyx_t_1);
31674   __pyx_r = __pyx_t_1;
31675   __pyx_t_1 = 0;
31676   goto __pyx_L0;
31677 
31678   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":830
31679  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
31680  *
31681  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
31682  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
31683  *
31684  */
31685 
31686   /* function exit code */
31687   __pyx_L1_error:;
31688   __Pyx_XDECREF(__pyx_t_1);
31689   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
31690   __pyx_r = 0;
31691   __pyx_L0:;
31692   __Pyx_XGIVEREF(__pyx_r);
31693   __Pyx_TraceReturn(__pyx_r, 0);
31694   __Pyx_RefNannyFinishContext();
31695   return __pyx_r;
31696 }
31697 
31698 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":833
31699  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
31700  *
31701  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
31702  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
31703  *
31704  */
31705 
__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d,PyObject * __pyx_v_e)31706 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
31707   PyObject *__pyx_r = NULL;
31708   __Pyx_TraceDeclarations
31709   __Pyx_RefNannyDeclarations
31710   PyObject *__pyx_t_1 = NULL;
31711   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
31712   __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[2], 833, 0, __PYX_ERR(2, 833, __pyx_L1_error));
31713 
31714   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":834
31715  *
31716  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
31717  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
31718  *
31719  * cdef inline tuple PyDataType_SHAPE(dtype d):
31720  */
31721   __Pyx_XDECREF(__pyx_r);
31722   __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 834, __pyx_L1_error)
31723   __Pyx_GOTREF(__pyx_t_1);
31724   __pyx_r = __pyx_t_1;
31725   __pyx_t_1 = 0;
31726   goto __pyx_L0;
31727 
31728   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":833
31729  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
31730  *
31731  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
31732  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
31733  *
31734  */
31735 
31736   /* function exit code */
31737   __pyx_L1_error:;
31738   __Pyx_XDECREF(__pyx_t_1);
31739   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
31740   __pyx_r = 0;
31741   __pyx_L0:;
31742   __Pyx_XGIVEREF(__pyx_r);
31743   __Pyx_TraceReturn(__pyx_r, 0);
31744   __Pyx_RefNannyFinishContext();
31745   return __pyx_r;
31746 }
31747 
31748 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":836
31749  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
31750  *
31751  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
31752  *     if PyDataType_HASSUBARRAY(d):
31753  *         return <tuple>d.subarray.shape
31754  */
31755 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)31756 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
31757   PyObject *__pyx_r = NULL;
31758   __Pyx_TraceDeclarations
31759   __Pyx_RefNannyDeclarations
31760   int __pyx_t_1;
31761   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
31762   __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[2], 836, 0, __PYX_ERR(2, 836, __pyx_L1_error));
31763 
31764   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":837
31765  *
31766  * cdef inline tuple PyDataType_SHAPE(dtype d):
31767  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
31768  *         return <tuple>d.subarray.shape
31769  *     else:
31770  */
31771   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
31772   if (__pyx_t_1) {
31773 
31774     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":838
31775  * cdef inline tuple PyDataType_SHAPE(dtype d):
31776  *     if PyDataType_HASSUBARRAY(d):
31777  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
31778  *     else:
31779  *         return ()
31780  */
31781     __Pyx_XDECREF(__pyx_r);
31782     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
31783     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
31784     goto __pyx_L0;
31785 
31786     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":837
31787  *
31788  * cdef inline tuple PyDataType_SHAPE(dtype d):
31789  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
31790  *         return <tuple>d.subarray.shape
31791  *     else:
31792  */
31793   }
31794 
31795   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":840
31796  *         return <tuple>d.subarray.shape
31797  *     else:
31798  *         return ()             # <<<<<<<<<<<<<<
31799  *
31800  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
31801  */
31802   /*else*/ {
31803     __Pyx_XDECREF(__pyx_r);
31804     __Pyx_INCREF(__pyx_empty_tuple);
31805     __pyx_r = __pyx_empty_tuple;
31806     goto __pyx_L0;
31807   }
31808 
31809   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":836
31810  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
31811  *
31812  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
31813  *     if PyDataType_HASSUBARRAY(d):
31814  *         return <tuple>d.subarray.shape
31815  */
31816 
31817   /* function exit code */
31818   __pyx_L1_error:;
31819   __Pyx_AddTraceback("numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
31820   __pyx_r = 0;
31821   __pyx_L0:;
31822   __Pyx_XGIVEREF(__pyx_r);
31823   __Pyx_TraceReturn(__pyx_r, 0);
31824   __Pyx_RefNannyFinishContext();
31825   return __pyx_r;
31826 }
31827 
31828 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":842
31829  *         return ()
31830  *
31831  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
31832  *     # Recursive utility function used in __getbuffer__ to get format
31833  *     # string. The new location in the format string is returned.
31834  */
31835 
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)31836 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
31837   PyArray_Descr *__pyx_v_child = 0;
31838   int __pyx_v_endian_detector;
31839   int __pyx_v_little_endian;
31840   PyObject *__pyx_v_fields = 0;
31841   PyObject *__pyx_v_childname = NULL;
31842   PyObject *__pyx_v_new_offset = NULL;
31843   PyObject *__pyx_v_t = NULL;
31844   char *__pyx_r;
31845   __Pyx_TraceDeclarations
31846   __Pyx_RefNannyDeclarations
31847   PyObject *__pyx_t_1 = NULL;
31848   Py_ssize_t __pyx_t_2;
31849   PyObject *__pyx_t_3 = NULL;
31850   PyObject *__pyx_t_4 = NULL;
31851   int __pyx_t_5;
31852   int __pyx_t_6;
31853   int __pyx_t_7;
31854   long __pyx_t_8;
31855   char *__pyx_t_9;
31856   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
31857   __Pyx_TraceCall("_util_dtypestring", __pyx_f[2], 842, 0, __PYX_ERR(2, 842, __pyx_L1_error));
31858 
31859   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":847
31860  *
31861  *     cdef dtype child
31862  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
31863  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
31864  *     cdef tuple fields
31865  */
31866   __pyx_v_endian_detector = 1;
31867 
31868   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":848
31869  *     cdef dtype child
31870  *     cdef int endian_detector = 1
31871  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
31872  *     cdef tuple fields
31873  *
31874  */
31875   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
31876 
31877   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":851
31878  *     cdef tuple fields
31879  *
31880  *     for childname in descr.names:             # <<<<<<<<<<<<<<
31881  *         fields = descr.fields[childname]
31882  *         child, new_offset = fields
31883  */
31884   if (unlikely(__pyx_v_descr->names == Py_None)) {
31885     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
31886     __PYX_ERR(2, 851, __pyx_L1_error)
31887   }
31888   __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
31889   for (;;) {
31890     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
31891     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31892     __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 851, __pyx_L1_error)
31893     #else
31894     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
31895     __Pyx_GOTREF(__pyx_t_3);
31896     #endif
31897     __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
31898     __pyx_t_3 = 0;
31899 
31900     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":852
31901  *
31902  *     for childname in descr.names:
31903  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
31904  *         child, new_offset = fields
31905  *
31906  */
31907     if (unlikely(__pyx_v_descr->fields == Py_None)) {
31908       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
31909       __PYX_ERR(2, 852, __pyx_L1_error)
31910     }
31911     __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
31912     __Pyx_GOTREF(__pyx_t_3);
31913     if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 852, __pyx_L1_error)
31914     __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
31915     __pyx_t_3 = 0;
31916 
31917     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":853
31918  *     for childname in descr.names:
31919  *         fields = descr.fields[childname]
31920  *         child, new_offset = fields             # <<<<<<<<<<<<<<
31921  *
31922  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
31923  */
31924     if (likely(__pyx_v_fields != Py_None)) {
31925       PyObject* sequence = __pyx_v_fields;
31926       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
31927       if (unlikely(size != 2)) {
31928         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
31929         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
31930         __PYX_ERR(2, 853, __pyx_L1_error)
31931       }
31932       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31933       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
31934       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
31935       __Pyx_INCREF(__pyx_t_3);
31936       __Pyx_INCREF(__pyx_t_4);
31937       #else
31938       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
31939       __Pyx_GOTREF(__pyx_t_3);
31940       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
31941       __Pyx_GOTREF(__pyx_t_4);
31942       #endif
31943     } else {
31944       __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
31945     }
31946     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
31947     __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
31948     __pyx_t_3 = 0;
31949     __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
31950     __pyx_t_4 = 0;
31951 
31952     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":855
31953  *         child, new_offset = fields
31954  *
31955  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
31956  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
31957  *
31958  */
31959     __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
31960     __Pyx_GOTREF(__pyx_t_4);
31961     __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
31962     __Pyx_GOTREF(__pyx_t_3);
31963     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31964     __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 855, __pyx_L1_error)
31965     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31966     __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
31967     if (unlikely(__pyx_t_6)) {
31968 
31969       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":856
31970  *
31971  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
31972  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
31973  *
31974  *         if ((child.byteorder == c'>' and little_endian) or
31975  */
31976       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error)
31977       __Pyx_GOTREF(__pyx_t_3);
31978       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
31979       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31980       __PYX_ERR(2, 856, __pyx_L1_error)
31981 
31982       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":855
31983  *         child, new_offset = fields
31984  *
31985  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
31986  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
31987  *
31988  */
31989     }
31990 
31991     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":858
31992  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
31993  *
31994  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
31995  *             (child.byteorder == c'<' and not little_endian)):
31996  *             raise ValueError(u"Non-native byte order not supported")
31997  */
31998     __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
31999     if (!__pyx_t_7) {
32000       goto __pyx_L8_next_or;
32001     } else {
32002     }
32003     __pyx_t_7 = (__pyx_v_little_endian != 0);
32004     if (!__pyx_t_7) {
32005     } else {
32006       __pyx_t_6 = __pyx_t_7;
32007       goto __pyx_L7_bool_binop_done;
32008     }
32009     __pyx_L8_next_or:;
32010 
32011     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":859
32012  *
32013  *         if ((child.byteorder == c'>' and little_endian) or
32014  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
32015  *             raise ValueError(u"Non-native byte order not supported")
32016  *             # One could encode it in the format string and have Cython
32017  */
32018     __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
32019     if (__pyx_t_7) {
32020     } else {
32021       __pyx_t_6 = __pyx_t_7;
32022       goto __pyx_L7_bool_binop_done;
32023     }
32024     __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
32025     __pyx_t_6 = __pyx_t_7;
32026     __pyx_L7_bool_binop_done:;
32027 
32028     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":858
32029  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
32030  *
32031  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
32032  *             (child.byteorder == c'<' and not little_endian)):
32033  *             raise ValueError(u"Non-native byte order not supported")
32034  */
32035     if (unlikely(__pyx_t_6)) {
32036 
32037       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":860
32038  *         if ((child.byteorder == c'>' and little_endian) or
32039  *             (child.byteorder == c'<' and not little_endian)):
32040  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
32041  *             # One could encode it in the format string and have Cython
32042  *             # complain instead, BUT: < and > in format strings also imply
32043  */
32044       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error)
32045       __Pyx_GOTREF(__pyx_t_3);
32046       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
32047       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32048       __PYX_ERR(2, 860, __pyx_L1_error)
32049 
32050       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":858
32051  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
32052  *
32053  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
32054  *             (child.byteorder == c'<' and not little_endian)):
32055  *             raise ValueError(u"Non-native byte order not supported")
32056  */
32057     }
32058 
32059     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":870
32060  *
32061  *         # Output padding bytes
32062  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
32063  *             f[0] = 120 # "x"; pad byte
32064  *             f += 1
32065  */
32066     while (1) {
32067       __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
32068       __Pyx_GOTREF(__pyx_t_3);
32069       __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 870, __pyx_L1_error)
32070       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32071       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
32072       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32073       if (!__pyx_t_6) break;
32074 
32075       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":871
32076  *         # Output padding bytes
32077  *         while offset[0] < new_offset:
32078  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
32079  *             f += 1
32080  *             offset[0] += 1
32081  */
32082       (__pyx_v_f[0]) = 0x78;
32083 
32084       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":872
32085  *         while offset[0] < new_offset:
32086  *             f[0] = 120 # "x"; pad byte
32087  *             f += 1             # <<<<<<<<<<<<<<
32088  *             offset[0] += 1
32089  *
32090  */
32091       __pyx_v_f = (__pyx_v_f + 1);
32092 
32093       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":873
32094  *             f[0] = 120 # "x"; pad byte
32095  *             f += 1
32096  *             offset[0] += 1             # <<<<<<<<<<<<<<
32097  *
32098  *         offset[0] += child.itemsize
32099  */
32100       __pyx_t_8 = 0;
32101       (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
32102     }
32103 
32104     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":875
32105  *             offset[0] += 1
32106  *
32107  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
32108  *
32109  *         if not PyDataType_HASFIELDS(child):
32110  */
32111     __pyx_t_8 = 0;
32112     (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
32113 
32114     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":877
32115  *         offset[0] += child.itemsize
32116  *
32117  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
32118  *             t = child.type_num
32119  *             if end - f < 5:
32120  */
32121     __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
32122     if (__pyx_t_6) {
32123 
32124       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":878
32125  *
32126  *         if not PyDataType_HASFIELDS(child):
32127  *             t = child.type_num             # <<<<<<<<<<<<<<
32128  *             if end - f < 5:
32129  *                 raise RuntimeError(u"Format string allocated too short.")
32130  */
32131       __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
32132       __Pyx_GOTREF(__pyx_t_4);
32133       __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
32134       __pyx_t_4 = 0;
32135 
32136       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":879
32137  *         if not PyDataType_HASFIELDS(child):
32138  *             t = child.type_num
32139  *             if end - f < 5:             # <<<<<<<<<<<<<<
32140  *                 raise RuntimeError(u"Format string allocated too short.")
32141  *
32142  */
32143       __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
32144       if (unlikely(__pyx_t_6)) {
32145 
32146         /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":880
32147  *             t = child.type_num
32148  *             if end - f < 5:
32149  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
32150  *
32151  *             # Until ticket #99 is fixed, use integers to avoid warnings
32152  */
32153         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error)
32154         __Pyx_GOTREF(__pyx_t_4);
32155         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
32156         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32157         __PYX_ERR(2, 880, __pyx_L1_error)
32158 
32159         /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":879
32160  *         if not PyDataType_HASFIELDS(child):
32161  *             t = child.type_num
32162  *             if end - f < 5:             # <<<<<<<<<<<<<<
32163  *                 raise RuntimeError(u"Format string allocated too short.")
32164  *
32165  */
32166       }
32167 
32168       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":883
32169  *
32170  *             # Until ticket #99 is fixed, use integers to avoid warnings
32171  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
32172  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
32173  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
32174  */
32175       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
32176       __Pyx_GOTREF(__pyx_t_4);
32177       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 883, __pyx_L1_error)
32178       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32179       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
32180       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32181       if (__pyx_t_6) {
32182         (__pyx_v_f[0]) = 98;
32183         goto __pyx_L15;
32184       }
32185 
32186       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":884
32187  *             # Until ticket #99 is fixed, use integers to avoid warnings
32188  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
32189  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
32190  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
32191  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
32192  */
32193       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
32194       __Pyx_GOTREF(__pyx_t_3);
32195       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 884, __pyx_L1_error)
32196       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32197       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
32198       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32199       if (__pyx_t_6) {
32200         (__pyx_v_f[0]) = 66;
32201         goto __pyx_L15;
32202       }
32203 
32204       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":885
32205  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
32206  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
32207  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
32208  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
32209  *             elif t == NPY_INT:         f[0] = 105 #"i"
32210  */
32211       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
32212       __Pyx_GOTREF(__pyx_t_4);
32213       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 885, __pyx_L1_error)
32214       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32215       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
32216       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32217       if (__pyx_t_6) {
32218         (__pyx_v_f[0]) = 0x68;
32219         goto __pyx_L15;
32220       }
32221 
32222       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":886
32223  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
32224  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
32225  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
32226  *             elif t == NPY_INT:         f[0] = 105 #"i"
32227  *             elif t == NPY_UINT:        f[0] =  73 #"I"
32228  */
32229       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
32230       __Pyx_GOTREF(__pyx_t_3);
32231       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 886, __pyx_L1_error)
32232       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32233       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
32234       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32235       if (__pyx_t_6) {
32236         (__pyx_v_f[0]) = 72;
32237         goto __pyx_L15;
32238       }
32239 
32240       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":887
32241  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
32242  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
32243  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
32244  *             elif t == NPY_UINT:        f[0] =  73 #"I"
32245  *             elif t == NPY_LONG:        f[0] = 108 #"l"
32246  */
32247       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
32248       __Pyx_GOTREF(__pyx_t_4);
32249       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 887, __pyx_L1_error)
32250       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32251       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
32252       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32253       if (__pyx_t_6) {
32254         (__pyx_v_f[0]) = 0x69;
32255         goto __pyx_L15;
32256       }
32257 
32258       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":888
32259  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
32260  *             elif t == NPY_INT:         f[0] = 105 #"i"
32261  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
32262  *             elif t == NPY_LONG:        f[0] = 108 #"l"
32263  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
32264  */
32265       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
32266       __Pyx_GOTREF(__pyx_t_3);
32267       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 888, __pyx_L1_error)
32268       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32269       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
32270       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32271       if (__pyx_t_6) {
32272         (__pyx_v_f[0]) = 73;
32273         goto __pyx_L15;
32274       }
32275 
32276       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":889
32277  *             elif t == NPY_INT:         f[0] = 105 #"i"
32278  *             elif t == NPY_UINT:        f[0] =  73 #"I"
32279  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
32280  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
32281  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
32282  */
32283       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
32284       __Pyx_GOTREF(__pyx_t_4);
32285       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 889, __pyx_L1_error)
32286       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32287       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
32288       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32289       if (__pyx_t_6) {
32290         (__pyx_v_f[0]) = 0x6C;
32291         goto __pyx_L15;
32292       }
32293 
32294       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":890
32295  *             elif t == NPY_UINT:        f[0] =  73 #"I"
32296  *             elif t == NPY_LONG:        f[0] = 108 #"l"
32297  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
32298  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
32299  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
32300  */
32301       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
32302       __Pyx_GOTREF(__pyx_t_3);
32303       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 890, __pyx_L1_error)
32304       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32305       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
32306       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32307       if (__pyx_t_6) {
32308         (__pyx_v_f[0]) = 76;
32309         goto __pyx_L15;
32310       }
32311 
32312       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":891
32313  *             elif t == NPY_LONG:        f[0] = 108 #"l"
32314  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
32315  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
32316  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
32317  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
32318  */
32319       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
32320       __Pyx_GOTREF(__pyx_t_4);
32321       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 891, __pyx_L1_error)
32322       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32323       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
32324       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32325       if (__pyx_t_6) {
32326         (__pyx_v_f[0]) = 0x71;
32327         goto __pyx_L15;
32328       }
32329 
32330       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":892
32331  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
32332  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
32333  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
32334  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
32335  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
32336  */
32337       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
32338       __Pyx_GOTREF(__pyx_t_3);
32339       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 892, __pyx_L1_error)
32340       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32341       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
32342       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32343       if (__pyx_t_6) {
32344         (__pyx_v_f[0]) = 81;
32345         goto __pyx_L15;
32346       }
32347 
32348       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":893
32349  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
32350  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
32351  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
32352  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
32353  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
32354  */
32355       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
32356       __Pyx_GOTREF(__pyx_t_4);
32357       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 893, __pyx_L1_error)
32358       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32359       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
32360       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32361       if (__pyx_t_6) {
32362         (__pyx_v_f[0]) = 0x66;
32363         goto __pyx_L15;
32364       }
32365 
32366       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":894
32367  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
32368  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
32369  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
32370  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
32371  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
32372  */
32373       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
32374       __Pyx_GOTREF(__pyx_t_3);
32375       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 894, __pyx_L1_error)
32376       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32377       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
32378       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32379       if (__pyx_t_6) {
32380         (__pyx_v_f[0]) = 0x64;
32381         goto __pyx_L15;
32382       }
32383 
32384       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":895
32385  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
32386  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
32387  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
32388  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
32389  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
32390  */
32391       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
32392       __Pyx_GOTREF(__pyx_t_4);
32393       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 895, __pyx_L1_error)
32394       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32395       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
32396       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32397       if (__pyx_t_6) {
32398         (__pyx_v_f[0]) = 0x67;
32399         goto __pyx_L15;
32400       }
32401 
32402       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":896
32403  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
32404  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
32405  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
32406  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
32407  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
32408  */
32409       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
32410       __Pyx_GOTREF(__pyx_t_3);
32411       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 896, __pyx_L1_error)
32412       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32413       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
32414       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32415       if (__pyx_t_6) {
32416         (__pyx_v_f[0]) = 90;
32417         (__pyx_v_f[1]) = 0x66;
32418         __pyx_v_f = (__pyx_v_f + 1);
32419         goto __pyx_L15;
32420       }
32421 
32422       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":897
32423  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
32424  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
32425  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
32426  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
32427  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
32428  */
32429       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
32430       __Pyx_GOTREF(__pyx_t_4);
32431       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 897, __pyx_L1_error)
32432       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32433       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
32434       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32435       if (__pyx_t_6) {
32436         (__pyx_v_f[0]) = 90;
32437         (__pyx_v_f[1]) = 0x64;
32438         __pyx_v_f = (__pyx_v_f + 1);
32439         goto __pyx_L15;
32440       }
32441 
32442       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":898
32443  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
32444  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
32445  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
32446  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
32447  *             else:
32448  */
32449       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
32450       __Pyx_GOTREF(__pyx_t_3);
32451       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 898, __pyx_L1_error)
32452       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32453       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
32454       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32455       if (__pyx_t_6) {
32456         (__pyx_v_f[0]) = 90;
32457         (__pyx_v_f[1]) = 0x67;
32458         __pyx_v_f = (__pyx_v_f + 1);
32459         goto __pyx_L15;
32460       }
32461 
32462       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":899
32463  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
32464  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
32465  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
32466  *             else:
32467  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
32468  */
32469       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
32470       __Pyx_GOTREF(__pyx_t_4);
32471       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 899, __pyx_L1_error)
32472       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32473       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
32474       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32475       if (likely(__pyx_t_6)) {
32476         (__pyx_v_f[0]) = 79;
32477         goto __pyx_L15;
32478       }
32479 
32480       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":901
32481  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
32482  *             else:
32483  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
32484  *             f += 1
32485  *         else:
32486  */
32487       /*else*/ {
32488         __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 901, __pyx_L1_error)
32489         __Pyx_GOTREF(__pyx_t_3);
32490         __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
32491         __Pyx_GOTREF(__pyx_t_4);
32492         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32493         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
32494         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32495         __PYX_ERR(2, 901, __pyx_L1_error)
32496       }
32497       __pyx_L15:;
32498 
32499       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":902
32500  *             else:
32501  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
32502  *             f += 1             # <<<<<<<<<<<<<<
32503  *         else:
32504  *             # Cython ignores struct boundary information ("T{...}"),
32505  */
32506       __pyx_v_f = (__pyx_v_f + 1);
32507 
32508       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":877
32509  *         offset[0] += child.itemsize
32510  *
32511  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
32512  *             t = child.type_num
32513  *             if end - f < 5:
32514  */
32515       goto __pyx_L13;
32516     }
32517 
32518     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":906
32519  *             # Cython ignores struct boundary information ("T{...}"),
32520  *             # so don't output it
32521  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
32522  *     return f
32523  *
32524  */
32525     /*else*/ {
32526       __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 906, __pyx_L1_error)
32527       __pyx_v_f = __pyx_t_9;
32528     }
32529     __pyx_L13:;
32530 
32531     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":851
32532  *     cdef tuple fields
32533  *
32534  *     for childname in descr.names:             # <<<<<<<<<<<<<<
32535  *         fields = descr.fields[childname]
32536  *         child, new_offset = fields
32537  */
32538   }
32539   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32540 
32541   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":907
32542  *             # so don't output it
32543  *             f = _util_dtypestring(child, f, end, offset)
32544  *     return f             # <<<<<<<<<<<<<<
32545  *
32546  *
32547  */
32548   __pyx_r = __pyx_v_f;
32549   goto __pyx_L0;
32550 
32551   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":842
32552  *         return ()
32553  *
32554  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
32555  *     # Recursive utility function used in __getbuffer__ to get format
32556  *     # string. The new location in the format string is returned.
32557  */
32558 
32559   /* function exit code */
32560   __pyx_L1_error:;
32561   __Pyx_XDECREF(__pyx_t_1);
32562   __Pyx_XDECREF(__pyx_t_3);
32563   __Pyx_XDECREF(__pyx_t_4);
32564   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
32565   __pyx_r = NULL;
32566   __pyx_L0:;
32567   __Pyx_XDECREF((PyObject *)__pyx_v_child);
32568   __Pyx_XDECREF(__pyx_v_fields);
32569   __Pyx_XDECREF(__pyx_v_childname);
32570   __Pyx_XDECREF(__pyx_v_new_offset);
32571   __Pyx_XDECREF(__pyx_v_t);
32572   __Pyx_TraceReturn(Py_None, 0);
32573   __Pyx_RefNannyFinishContext();
32574   return __pyx_r;
32575 }
32576 
32577 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1022
32578  *     int _import_umath() except -1
32579  *
32580  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
32581  *     Py_INCREF(base) # important to do this before stealing the reference below!
32582  *     PyArray_SetBaseObject(arr, base)
32583  */
32584 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)32585 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
32586   __Pyx_TraceDeclarations
32587   __Pyx_RefNannyDeclarations
32588   __Pyx_RefNannySetupContext("set_array_base", 0);
32589   __Pyx_TraceCall("set_array_base", __pyx_f[2], 1022, 0, __PYX_ERR(2, 1022, __pyx_L1_error));
32590 
32591   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1023
32592  *
32593  * cdef inline void set_array_base(ndarray arr, object base):
32594  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
32595  *     PyArray_SetBaseObject(arr, base)
32596  *
32597  */
32598   Py_INCREF(__pyx_v_base);
32599 
32600   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1024
32601  * cdef inline void set_array_base(ndarray arr, object base):
32602  *     Py_INCREF(base) # important to do this before stealing the reference below!
32603  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
32604  *
32605  * cdef inline object get_array_base(ndarray arr):
32606  */
32607   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
32608 
32609   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1022
32610  *     int _import_umath() except -1
32611  *
32612  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
32613  *     Py_INCREF(base) # important to do this before stealing the reference below!
32614  *     PyArray_SetBaseObject(arr, base)
32615  */
32616 
32617   /* function exit code */
32618   goto __pyx_L0;
32619   __pyx_L1_error:;
32620   __Pyx_WriteUnraisable("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
32621   __pyx_L0:;
32622   __Pyx_TraceReturn(Py_None, 0);
32623   __Pyx_RefNannyFinishContext();
32624 }
32625 
32626 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1026
32627  *     PyArray_SetBaseObject(arr, base)
32628  *
32629  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
32630  *     base = PyArray_BASE(arr)
32631  *     if base is NULL:
32632  */
32633 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)32634 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
32635   PyObject *__pyx_v_base;
32636   PyObject *__pyx_r = NULL;
32637   __Pyx_TraceDeclarations
32638   __Pyx_RefNannyDeclarations
32639   int __pyx_t_1;
32640   __Pyx_RefNannySetupContext("get_array_base", 0);
32641   __Pyx_TraceCall("get_array_base", __pyx_f[2], 1026, 0, __PYX_ERR(2, 1026, __pyx_L1_error));
32642 
32643   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1027
32644  *
32645  * cdef inline object get_array_base(ndarray arr):
32646  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
32647  *     if base is NULL:
32648  *         return None
32649  */
32650   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
32651 
32652   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1028
32653  * cdef inline object get_array_base(ndarray arr):
32654  *     base = PyArray_BASE(arr)
32655  *     if base is NULL:             # <<<<<<<<<<<<<<
32656  *         return None
32657  *     return <object>base
32658  */
32659   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
32660   if (__pyx_t_1) {
32661 
32662     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1029
32663  *     base = PyArray_BASE(arr)
32664  *     if base is NULL:
32665  *         return None             # <<<<<<<<<<<<<<
32666  *     return <object>base
32667  *
32668  */
32669     __Pyx_XDECREF(__pyx_r);
32670     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32671     goto __pyx_L0;
32672 
32673     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1028
32674  * cdef inline object get_array_base(ndarray arr):
32675  *     base = PyArray_BASE(arr)
32676  *     if base is NULL:             # <<<<<<<<<<<<<<
32677  *         return None
32678  *     return <object>base
32679  */
32680   }
32681 
32682   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1030
32683  *     if base is NULL:
32684  *         return None
32685  *     return <object>base             # <<<<<<<<<<<<<<
32686  *
32687  * # Versions of the import_* functions which are more suitable for
32688  */
32689   __Pyx_XDECREF(__pyx_r);
32690   __Pyx_INCREF(((PyObject *)__pyx_v_base));
32691   __pyx_r = ((PyObject *)__pyx_v_base);
32692   goto __pyx_L0;
32693 
32694   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1026
32695  *     PyArray_SetBaseObject(arr, base)
32696  *
32697  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
32698  *     base = PyArray_BASE(arr)
32699  *     if base is NULL:
32700  */
32701 
32702   /* function exit code */
32703   __pyx_L1_error:;
32704   __Pyx_AddTraceback("numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
32705   __pyx_r = 0;
32706   __pyx_L0:;
32707   __Pyx_XGIVEREF(__pyx_r);
32708   __Pyx_TraceReturn(__pyx_r, 0);
32709   __Pyx_RefNannyFinishContext();
32710   return __pyx_r;
32711 }
32712 
32713 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1034
32714  * # Versions of the import_* functions which are more suitable for
32715  * # Cython code.
32716  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
32717  *     try:
32718  *         _import_array()
32719  */
32720 
__pyx_f_5numpy_import_array(void)32721 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
32722   int __pyx_r;
32723   __Pyx_TraceDeclarations
32724   __Pyx_RefNannyDeclarations
32725   PyObject *__pyx_t_1 = NULL;
32726   PyObject *__pyx_t_2 = NULL;
32727   PyObject *__pyx_t_3 = NULL;
32728   int __pyx_t_4;
32729   PyObject *__pyx_t_5 = NULL;
32730   PyObject *__pyx_t_6 = NULL;
32731   PyObject *__pyx_t_7 = NULL;
32732   PyObject *__pyx_t_8 = NULL;
32733   __Pyx_RefNannySetupContext("import_array", 0);
32734   __Pyx_TraceCall("import_array", __pyx_f[2], 1034, 0, __PYX_ERR(2, 1034, __pyx_L1_error));
32735 
32736   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1035
32737  * # Cython code.
32738  * cdef inline int import_array() except -1:
32739  *     try:             # <<<<<<<<<<<<<<
32740  *         _import_array()
32741  *     except Exception:
32742  */
32743   {
32744     __Pyx_PyThreadState_declare
32745     __Pyx_PyThreadState_assign
32746     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
32747     __Pyx_XGOTREF(__pyx_t_1);
32748     __Pyx_XGOTREF(__pyx_t_2);
32749     __Pyx_XGOTREF(__pyx_t_3);
32750     /*try:*/ {
32751 
32752       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1036
32753  * cdef inline int import_array() except -1:
32754  *     try:
32755  *         _import_array()             # <<<<<<<<<<<<<<
32756  *     except Exception:
32757  *         raise ImportError("numpy.core.multiarray failed to import")
32758  */
32759       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
32760 
32761       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1035
32762  * # Cython code.
32763  * cdef inline int import_array() except -1:
32764  *     try:             # <<<<<<<<<<<<<<
32765  *         _import_array()
32766  *     except Exception:
32767  */
32768     }
32769     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
32770     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
32771     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
32772     goto __pyx_L8_try_end;
32773     __pyx_L3_error:;
32774 
32775     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1037
32776  *     try:
32777  *         _import_array()
32778  *     except Exception:             # <<<<<<<<<<<<<<
32779  *         raise ImportError("numpy.core.multiarray failed to import")
32780  *
32781  */
32782     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
32783     if (__pyx_t_4) {
32784       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
32785       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
32786       __Pyx_GOTREF(__pyx_t_5);
32787       __Pyx_GOTREF(__pyx_t_6);
32788       __Pyx_GOTREF(__pyx_t_7);
32789 
32790       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1038
32791  *         _import_array()
32792  *     except Exception:
32793  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
32794  *
32795  * cdef inline int import_umath() except -1:
32796  */
32797       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error)
32798       __Pyx_GOTREF(__pyx_t_8);
32799       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
32800       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32801       __PYX_ERR(2, 1038, __pyx_L5_except_error)
32802     }
32803     goto __pyx_L5_except_error;
32804     __pyx_L5_except_error:;
32805 
32806     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1035
32807  * # Cython code.
32808  * cdef inline int import_array() except -1:
32809  *     try:             # <<<<<<<<<<<<<<
32810  *         _import_array()
32811  *     except Exception:
32812  */
32813     __Pyx_XGIVEREF(__pyx_t_1);
32814     __Pyx_XGIVEREF(__pyx_t_2);
32815     __Pyx_XGIVEREF(__pyx_t_3);
32816     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
32817     goto __pyx_L1_error;
32818     __pyx_L8_try_end:;
32819   }
32820 
32821   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1034
32822  * # Versions of the import_* functions which are more suitable for
32823  * # Cython code.
32824  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
32825  *     try:
32826  *         _import_array()
32827  */
32828 
32829   /* function exit code */
32830   __pyx_r = 0;
32831   goto __pyx_L0;
32832   __pyx_L1_error:;
32833   __Pyx_XDECREF(__pyx_t_5);
32834   __Pyx_XDECREF(__pyx_t_6);
32835   __Pyx_XDECREF(__pyx_t_7);
32836   __Pyx_XDECREF(__pyx_t_8);
32837   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
32838   __pyx_r = -1;
32839   __pyx_L0:;
32840   __Pyx_TraceReturn(Py_None, 0);
32841   __Pyx_RefNannyFinishContext();
32842   return __pyx_r;
32843 }
32844 
32845 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1040
32846  *         raise ImportError("numpy.core.multiarray failed to import")
32847  *
32848  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
32849  *     try:
32850  *         _import_umath()
32851  */
32852 
__pyx_f_5numpy_import_umath(void)32853 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
32854   int __pyx_r;
32855   __Pyx_TraceDeclarations
32856   __Pyx_RefNannyDeclarations
32857   PyObject *__pyx_t_1 = NULL;
32858   PyObject *__pyx_t_2 = NULL;
32859   PyObject *__pyx_t_3 = NULL;
32860   int __pyx_t_4;
32861   PyObject *__pyx_t_5 = NULL;
32862   PyObject *__pyx_t_6 = NULL;
32863   PyObject *__pyx_t_7 = NULL;
32864   PyObject *__pyx_t_8 = NULL;
32865   __Pyx_RefNannySetupContext("import_umath", 0);
32866   __Pyx_TraceCall("import_umath", __pyx_f[2], 1040, 0, __PYX_ERR(2, 1040, __pyx_L1_error));
32867 
32868   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1041
32869  *
32870  * cdef inline int import_umath() except -1:
32871  *     try:             # <<<<<<<<<<<<<<
32872  *         _import_umath()
32873  *     except Exception:
32874  */
32875   {
32876     __Pyx_PyThreadState_declare
32877     __Pyx_PyThreadState_assign
32878     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
32879     __Pyx_XGOTREF(__pyx_t_1);
32880     __Pyx_XGOTREF(__pyx_t_2);
32881     __Pyx_XGOTREF(__pyx_t_3);
32882     /*try:*/ {
32883 
32884       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1042
32885  * cdef inline int import_umath() except -1:
32886  *     try:
32887  *         _import_umath()             # <<<<<<<<<<<<<<
32888  *     except Exception:
32889  *         raise ImportError("numpy.core.umath failed to import")
32890  */
32891       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
32892 
32893       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1041
32894  *
32895  * cdef inline int import_umath() except -1:
32896  *     try:             # <<<<<<<<<<<<<<
32897  *         _import_umath()
32898  *     except Exception:
32899  */
32900     }
32901     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
32902     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
32903     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
32904     goto __pyx_L8_try_end;
32905     __pyx_L3_error:;
32906 
32907     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1043
32908  *     try:
32909  *         _import_umath()
32910  *     except Exception:             # <<<<<<<<<<<<<<
32911  *         raise ImportError("numpy.core.umath failed to import")
32912  *
32913  */
32914     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
32915     if (__pyx_t_4) {
32916       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
32917       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
32918       __Pyx_GOTREF(__pyx_t_5);
32919       __Pyx_GOTREF(__pyx_t_6);
32920       __Pyx_GOTREF(__pyx_t_7);
32921 
32922       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1044
32923  *         _import_umath()
32924  *     except Exception:
32925  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
32926  *
32927  * cdef inline int import_ufunc() except -1:
32928  */
32929       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error)
32930       __Pyx_GOTREF(__pyx_t_8);
32931       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
32932       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32933       __PYX_ERR(2, 1044, __pyx_L5_except_error)
32934     }
32935     goto __pyx_L5_except_error;
32936     __pyx_L5_except_error:;
32937 
32938     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1041
32939  *
32940  * cdef inline int import_umath() except -1:
32941  *     try:             # <<<<<<<<<<<<<<
32942  *         _import_umath()
32943  *     except Exception:
32944  */
32945     __Pyx_XGIVEREF(__pyx_t_1);
32946     __Pyx_XGIVEREF(__pyx_t_2);
32947     __Pyx_XGIVEREF(__pyx_t_3);
32948     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
32949     goto __pyx_L1_error;
32950     __pyx_L8_try_end:;
32951   }
32952 
32953   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1040
32954  *         raise ImportError("numpy.core.multiarray failed to import")
32955  *
32956  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
32957  *     try:
32958  *         _import_umath()
32959  */
32960 
32961   /* function exit code */
32962   __pyx_r = 0;
32963   goto __pyx_L0;
32964   __pyx_L1_error:;
32965   __Pyx_XDECREF(__pyx_t_5);
32966   __Pyx_XDECREF(__pyx_t_6);
32967   __Pyx_XDECREF(__pyx_t_7);
32968   __Pyx_XDECREF(__pyx_t_8);
32969   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
32970   __pyx_r = -1;
32971   __pyx_L0:;
32972   __Pyx_TraceReturn(Py_None, 0);
32973   __Pyx_RefNannyFinishContext();
32974   return __pyx_r;
32975 }
32976 
32977 /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1046
32978  *         raise ImportError("numpy.core.umath failed to import")
32979  *
32980  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
32981  *     try:
32982  *         _import_umath()
32983  */
32984 
__pyx_f_5numpy_import_ufunc(void)32985 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
32986   int __pyx_r;
32987   __Pyx_TraceDeclarations
32988   __Pyx_RefNannyDeclarations
32989   PyObject *__pyx_t_1 = NULL;
32990   PyObject *__pyx_t_2 = NULL;
32991   PyObject *__pyx_t_3 = NULL;
32992   int __pyx_t_4;
32993   PyObject *__pyx_t_5 = NULL;
32994   PyObject *__pyx_t_6 = NULL;
32995   PyObject *__pyx_t_7 = NULL;
32996   PyObject *__pyx_t_8 = NULL;
32997   __Pyx_RefNannySetupContext("import_ufunc", 0);
32998   __Pyx_TraceCall("import_ufunc", __pyx_f[2], 1046, 0, __PYX_ERR(2, 1046, __pyx_L1_error));
32999 
33000   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1047
33001  *
33002  * cdef inline int import_ufunc() except -1:
33003  *     try:             # <<<<<<<<<<<<<<
33004  *         _import_umath()
33005  *     except Exception:
33006  */
33007   {
33008     __Pyx_PyThreadState_declare
33009     __Pyx_PyThreadState_assign
33010     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
33011     __Pyx_XGOTREF(__pyx_t_1);
33012     __Pyx_XGOTREF(__pyx_t_2);
33013     __Pyx_XGOTREF(__pyx_t_3);
33014     /*try:*/ {
33015 
33016       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1048
33017  * cdef inline int import_ufunc() except -1:
33018  *     try:
33019  *         _import_umath()             # <<<<<<<<<<<<<<
33020  *     except Exception:
33021  *         raise ImportError("numpy.core.umath failed to import")
33022  */
33023       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
33024 
33025       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1047
33026  *
33027  * cdef inline int import_ufunc() except -1:
33028  *     try:             # <<<<<<<<<<<<<<
33029  *         _import_umath()
33030  *     except Exception:
33031  */
33032     }
33033     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
33034     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
33035     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
33036     goto __pyx_L8_try_end;
33037     __pyx_L3_error:;
33038 
33039     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1049
33040  *     try:
33041  *         _import_umath()
33042  *     except Exception:             # <<<<<<<<<<<<<<
33043  *         raise ImportError("numpy.core.umath failed to import")
33044  */
33045     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
33046     if (__pyx_t_4) {
33047       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
33048       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
33049       __Pyx_GOTREF(__pyx_t_5);
33050       __Pyx_GOTREF(__pyx_t_6);
33051       __Pyx_GOTREF(__pyx_t_7);
33052 
33053       /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1050
33054  *         _import_umath()
33055  *     except Exception:
33056  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
33057  */
33058       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error)
33059       __Pyx_GOTREF(__pyx_t_8);
33060       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
33061       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
33062       __PYX_ERR(2, 1050, __pyx_L5_except_error)
33063     }
33064     goto __pyx_L5_except_error;
33065     __pyx_L5_except_error:;
33066 
33067     /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1047
33068  *
33069  * cdef inline int import_ufunc() except -1:
33070  *     try:             # <<<<<<<<<<<<<<
33071  *         _import_umath()
33072  *     except Exception:
33073  */
33074     __Pyx_XGIVEREF(__pyx_t_1);
33075     __Pyx_XGIVEREF(__pyx_t_2);
33076     __Pyx_XGIVEREF(__pyx_t_3);
33077     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
33078     goto __pyx_L1_error;
33079     __pyx_L8_try_end:;
33080   }
33081 
33082   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1046
33083  *         raise ImportError("numpy.core.umath failed to import")
33084  *
33085  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
33086  *     try:
33087  *         _import_umath()
33088  */
33089 
33090   /* function exit code */
33091   __pyx_r = 0;
33092   goto __pyx_L0;
33093   __pyx_L1_error:;
33094   __Pyx_XDECREF(__pyx_t_5);
33095   __Pyx_XDECREF(__pyx_t_6);
33096   __Pyx_XDECREF(__pyx_t_7);
33097   __Pyx_XDECREF(__pyx_t_8);
33098   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
33099   __pyx_r = -1;
33100   __pyx_L0:;
33101   __Pyx_TraceReturn(Py_None, 0);
33102   __Pyx_RefNannyFinishContext();
33103   return __pyx_r;
33104 }
33105 static struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_scoreTrackII __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII;
33106 
__pyx_tp_new_5MACS2_2IO_10ScoreTrack_scoreTrackII(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)33107 static PyObject *__pyx_tp_new_5MACS2_2IO_10ScoreTrack_scoreTrackII(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
33108   struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *p;
33109   PyObject *o;
33110   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
33111     o = (*t->tp_alloc)(t, 0);
33112   } else {
33113     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
33114   }
33115   if (unlikely(!o)) return 0;
33116   p = ((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)o);
33117   p->__pyx_vtab = __pyx_vtabptr_5MACS2_2IO_10ScoreTrack_scoreTrackII;
33118   p->data = ((PyObject*)Py_None); Py_INCREF(Py_None);
33119   p->data_stderr = ((PyObject*)Py_None); Py_INCREF(Py_None);
33120   p->datalength = ((PyObject*)Py_None); Py_INCREF(Py_None);
33121   p->trackline = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
33122   p->stderr_on = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
33123   p->pvalue_stat = ((PyObject*)Py_None); Py_INCREF(Py_None);
33124   return o;
33125 }
33126 
__pyx_tp_dealloc_5MACS2_2IO_10ScoreTrack_scoreTrackII(PyObject * o)33127 static void __pyx_tp_dealloc_5MACS2_2IO_10ScoreTrack_scoreTrackII(PyObject *o) {
33128   struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *p = (struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)o;
33129   #if CYTHON_USE_TP_FINALIZE
33130   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
33131     if (PyObject_CallFinalizerFromDealloc(o)) return;
33132   }
33133   #endif
33134   PyObject_GC_UnTrack(o);
33135   Py_CLEAR(p->data);
33136   Py_CLEAR(p->data_stderr);
33137   Py_CLEAR(p->datalength);
33138   Py_CLEAR(p->trackline);
33139   Py_CLEAR(p->stderr_on);
33140   Py_CLEAR(p->pvalue_stat);
33141   (*Py_TYPE(o)->tp_free)(o);
33142 }
33143 
__pyx_tp_traverse_5MACS2_2IO_10ScoreTrack_scoreTrackII(PyObject * o,visitproc v,void * a)33144 static int __pyx_tp_traverse_5MACS2_2IO_10ScoreTrack_scoreTrackII(PyObject *o, visitproc v, void *a) {
33145   int e;
33146   struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *p = (struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)o;
33147   if (p->data) {
33148     e = (*v)(p->data, a); if (e) return e;
33149   }
33150   if (p->data_stderr) {
33151     e = (*v)(p->data_stderr, a); if (e) return e;
33152   }
33153   if (p->datalength) {
33154     e = (*v)(p->datalength, a); if (e) return e;
33155   }
33156   if (p->trackline) {
33157     e = (*v)(((PyObject *)p->trackline), a); if (e) return e;
33158   }
33159   if (p->stderr_on) {
33160     e = (*v)(((PyObject *)p->stderr_on), a); if (e) return e;
33161   }
33162   if (p->pvalue_stat) {
33163     e = (*v)(p->pvalue_stat, a); if (e) return e;
33164   }
33165   return 0;
33166 }
33167 
__pyx_tp_clear_5MACS2_2IO_10ScoreTrack_scoreTrackII(PyObject * o)33168 static int __pyx_tp_clear_5MACS2_2IO_10ScoreTrack_scoreTrackII(PyObject *o) {
33169   PyObject* tmp;
33170   struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *p = (struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *)o;
33171   tmp = ((PyObject*)p->data);
33172   p->data = ((PyObject*)Py_None); Py_INCREF(Py_None);
33173   Py_XDECREF(tmp);
33174   tmp = ((PyObject*)p->data_stderr);
33175   p->data_stderr = ((PyObject*)Py_None); Py_INCREF(Py_None);
33176   Py_XDECREF(tmp);
33177   tmp = ((PyObject*)p->datalength);
33178   p->datalength = ((PyObject*)Py_None); Py_INCREF(Py_None);
33179   Py_XDECREF(tmp);
33180   tmp = ((PyObject*)p->trackline);
33181   p->trackline = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
33182   Py_XDECREF(tmp);
33183   tmp = ((PyObject*)p->stderr_on);
33184   p->stderr_on = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
33185   Py_XDECREF(tmp);
33186   tmp = ((PyObject*)p->pvalue_stat);
33187   p->pvalue_stat = ((PyObject*)Py_None); Py_INCREF(Py_None);
33188   Py_XDECREF(tmp);
33189   return 0;
33190 }
33191 
33192 static PyMethodDef __pyx_methods_5MACS2_2IO_10ScoreTrack_scoreTrackII[] = {
33193   {"set_pseudocount", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_3set_pseudocount, METH_O, 0},
33194   {"enable_trackline", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_5enable_trackline, METH_NOARGS, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_4enable_trackline},
33195   {"add_chromosome", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_7add_chromosome, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_6add_chromosome},
33196   {"add", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_9add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_8add},
33197   {"finalize", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_11finalize, METH_NOARGS, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_10finalize},
33198   {"get_data_by_chr", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_13get_data_by_chr, METH_O, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_12get_data_by_chr},
33199   {"get_chr_names", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_15get_chr_names, METH_NOARGS, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_14get_chr_names},
33200   {"change_normalization_method", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_17change_normalization_method, METH_O, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_16change_normalization_method},
33201   {"change_score_method", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_19change_score_method, METH_O, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_18change_score_method},
33202   {"make_pq_table", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_21make_pq_table, METH_NOARGS, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_20make_pq_table},
33203   {"write_bedGraph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_23write_bedGraph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_22write_bedGraph},
33204   {"call_peaks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_25call_peaks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_24call_peaks},
33205   {"call_broadpeaks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_27call_broadpeaks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_26call_broadpeaks},
33206   {"__add_broadpeak", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_29__add_broadpeak, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII_28__add_broadpeak},
33207   {"__reduce_cython__", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_31__reduce_cython__, METH_NOARGS, 0},
33208   {"__setstate_cython__", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_33__setstate_cython__, METH_O, 0},
33209   {0, 0, 0, 0}
33210 };
33211 
33212 static PyTypeObject __pyx_type_5MACS2_2IO_10ScoreTrack_scoreTrackII = {
33213   PyVarObject_HEAD_INIT(0, 0)
33214   "MACS2.IO.ScoreTrack.scoreTrackII", /*tp_name*/
33215   sizeof(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII), /*tp_basicsize*/
33216   0, /*tp_itemsize*/
33217   __pyx_tp_dealloc_5MACS2_2IO_10ScoreTrack_scoreTrackII, /*tp_dealloc*/
33218   #if PY_VERSION_HEX < 0x030800b4
33219   0, /*tp_print*/
33220   #endif
33221   #if PY_VERSION_HEX >= 0x030800b4
33222   0, /*tp_vectorcall_offset*/
33223   #endif
33224   0, /*tp_getattr*/
33225   0, /*tp_setattr*/
33226   #if PY_MAJOR_VERSION < 3
33227   0, /*tp_compare*/
33228   #endif
33229   #if PY_MAJOR_VERSION >= 3
33230   0, /*tp_as_async*/
33231   #endif
33232   0, /*tp_repr*/
33233   0, /*tp_as_number*/
33234   0, /*tp_as_sequence*/
33235   0, /*tp_as_mapping*/
33236   0, /*tp_hash*/
33237   0, /*tp_call*/
33238   0, /*tp_str*/
33239   0, /*tp_getattro*/
33240   0, /*tp_setattro*/
33241   0, /*tp_as_buffer*/
33242   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33243   "Class for scoreGraph type data. Modified from scoreTrackI. The\n    difference is that we store a single score data, not\n    p/q/loglikelihood altogether. Score (the 4th) column is calculated\n    through calling change_method() function. Individual scores for\n    filling PeakIO object are calculated by prepare_peakIO_scores()\n    function.\n\n    I want to save mem and simplify calculation in this new class.\n\n    ", /*tp_doc*/
33244   __pyx_tp_traverse_5MACS2_2IO_10ScoreTrack_scoreTrackII, /*tp_traverse*/
33245   __pyx_tp_clear_5MACS2_2IO_10ScoreTrack_scoreTrackII, /*tp_clear*/
33246   0, /*tp_richcompare*/
33247   0, /*tp_weaklistoffset*/
33248   0, /*tp_iter*/
33249   0, /*tp_iternext*/
33250   __pyx_methods_5MACS2_2IO_10ScoreTrack_scoreTrackII, /*tp_methods*/
33251   0, /*tp_members*/
33252   0, /*tp_getset*/
33253   0, /*tp_base*/
33254   0, /*tp_dict*/
33255   0, /*tp_descr_get*/
33256   0, /*tp_descr_set*/
33257   0, /*tp_dictoffset*/
33258   __pyx_pw_5MACS2_2IO_10ScoreTrack_12scoreTrackII_1__init__, /*tp_init*/
33259   0, /*tp_alloc*/
33260   __pyx_tp_new_5MACS2_2IO_10ScoreTrack_scoreTrackII, /*tp_new*/
33261   0, /*tp_free*/
33262   0, /*tp_is_gc*/
33263   0, /*tp_bases*/
33264   0, /*tp_mro*/
33265   0, /*tp_cache*/
33266   0, /*tp_subclasses*/
33267   0, /*tp_weaklist*/
33268   0, /*tp_del*/
33269   0, /*tp_version_tag*/
33270   #if PY_VERSION_HEX >= 0x030400a1
33271   0, /*tp_finalize*/
33272   #endif
33273   #if PY_VERSION_HEX >= 0x030800b1
33274   0, /*tp_vectorcall*/
33275   #endif
33276   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33277   0, /*tp_print*/
33278   #endif
33279 };
33280 static struct __pyx_vtabstruct_5MACS2_2IO_10ScoreTrack_TwoConditionScores __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores;
33281 
__pyx_tp_new_5MACS2_2IO_10ScoreTrack_TwoConditionScores(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)33282 static PyObject *__pyx_tp_new_5MACS2_2IO_10ScoreTrack_TwoConditionScores(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
33283   struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *p;
33284   PyObject *o;
33285   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
33286     o = (*t->tp_alloc)(t, 0);
33287   } else {
33288     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
33289   }
33290   if (unlikely(!o)) return 0;
33291   p = ((struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)o);
33292   p->__pyx_vtab = __pyx_vtabptr_5MACS2_2IO_10ScoreTrack_TwoConditionScores;
33293   p->data = ((PyObject*)Py_None); Py_INCREF(Py_None);
33294   p->datalength = ((PyObject*)Py_None); Py_INCREF(Py_None);
33295   p->t1bdg = Py_None; Py_INCREF(Py_None);
33296   p->c1bdg = Py_None; Py_INCREF(Py_None);
33297   p->t2bdg = Py_None; Py_INCREF(Py_None);
33298   p->c2bdg = Py_None; Py_INCREF(Py_None);
33299   p->pvalue_stat1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
33300   p->pvalue_stat2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
33301   p->pvalue_stat3 = ((PyObject*)Py_None); Py_INCREF(Py_None);
33302   return o;
33303 }
33304 
__pyx_tp_dealloc_5MACS2_2IO_10ScoreTrack_TwoConditionScores(PyObject * o)33305 static void __pyx_tp_dealloc_5MACS2_2IO_10ScoreTrack_TwoConditionScores(PyObject *o) {
33306   struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *p = (struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)o;
33307   #if CYTHON_USE_TP_FINALIZE
33308   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
33309     if (PyObject_CallFinalizerFromDealloc(o)) return;
33310   }
33311   #endif
33312   PyObject_GC_UnTrack(o);
33313   Py_CLEAR(p->data);
33314   Py_CLEAR(p->datalength);
33315   Py_CLEAR(p->t1bdg);
33316   Py_CLEAR(p->c1bdg);
33317   Py_CLEAR(p->t2bdg);
33318   Py_CLEAR(p->c2bdg);
33319   Py_CLEAR(p->pvalue_stat1);
33320   Py_CLEAR(p->pvalue_stat2);
33321   Py_CLEAR(p->pvalue_stat3);
33322   (*Py_TYPE(o)->tp_free)(o);
33323 }
33324 
__pyx_tp_traverse_5MACS2_2IO_10ScoreTrack_TwoConditionScores(PyObject * o,visitproc v,void * a)33325 static int __pyx_tp_traverse_5MACS2_2IO_10ScoreTrack_TwoConditionScores(PyObject *o, visitproc v, void *a) {
33326   int e;
33327   struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *p = (struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)o;
33328   if (p->data) {
33329     e = (*v)(p->data, a); if (e) return e;
33330   }
33331   if (p->datalength) {
33332     e = (*v)(p->datalength, a); if (e) return e;
33333   }
33334   if (p->t1bdg) {
33335     e = (*v)(p->t1bdg, a); if (e) return e;
33336   }
33337   if (p->c1bdg) {
33338     e = (*v)(p->c1bdg, a); if (e) return e;
33339   }
33340   if (p->t2bdg) {
33341     e = (*v)(p->t2bdg, a); if (e) return e;
33342   }
33343   if (p->c2bdg) {
33344     e = (*v)(p->c2bdg, a); if (e) return e;
33345   }
33346   if (p->pvalue_stat1) {
33347     e = (*v)(p->pvalue_stat1, a); if (e) return e;
33348   }
33349   if (p->pvalue_stat2) {
33350     e = (*v)(p->pvalue_stat2, a); if (e) return e;
33351   }
33352   if (p->pvalue_stat3) {
33353     e = (*v)(p->pvalue_stat3, a); if (e) return e;
33354   }
33355   return 0;
33356 }
33357 
__pyx_tp_clear_5MACS2_2IO_10ScoreTrack_TwoConditionScores(PyObject * o)33358 static int __pyx_tp_clear_5MACS2_2IO_10ScoreTrack_TwoConditionScores(PyObject *o) {
33359   PyObject* tmp;
33360   struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *p = (struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *)o;
33361   tmp = ((PyObject*)p->data);
33362   p->data = ((PyObject*)Py_None); Py_INCREF(Py_None);
33363   Py_XDECREF(tmp);
33364   tmp = ((PyObject*)p->datalength);
33365   p->datalength = ((PyObject*)Py_None); Py_INCREF(Py_None);
33366   Py_XDECREF(tmp);
33367   tmp = ((PyObject*)p->t1bdg);
33368   p->t1bdg = Py_None; Py_INCREF(Py_None);
33369   Py_XDECREF(tmp);
33370   tmp = ((PyObject*)p->c1bdg);
33371   p->c1bdg = Py_None; Py_INCREF(Py_None);
33372   Py_XDECREF(tmp);
33373   tmp = ((PyObject*)p->t2bdg);
33374   p->t2bdg = Py_None; Py_INCREF(Py_None);
33375   Py_XDECREF(tmp);
33376   tmp = ((PyObject*)p->c2bdg);
33377   p->c2bdg = Py_None; Py_INCREF(Py_None);
33378   Py_XDECREF(tmp);
33379   tmp = ((PyObject*)p->pvalue_stat1);
33380   p->pvalue_stat1 = ((PyObject*)Py_None); Py_INCREF(Py_None);
33381   Py_XDECREF(tmp);
33382   tmp = ((PyObject*)p->pvalue_stat2);
33383   p->pvalue_stat2 = ((PyObject*)Py_None); Py_INCREF(Py_None);
33384   Py_XDECREF(tmp);
33385   tmp = ((PyObject*)p->pvalue_stat3);
33386   p->pvalue_stat3 = ((PyObject*)Py_None); Py_INCREF(Py_None);
33387   Py_XDECREF(tmp);
33388   return 0;
33389 }
33390 
33391 static PyMethodDef __pyx_methods_5MACS2_2IO_10ScoreTrack_TwoConditionScores[] = {
33392   {"set_pseudocount", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_3set_pseudocount, METH_O, 0},
33393   {"build", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_5build, METH_NOARGS, __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_4build},
33394   {"get_common_chrs", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_7get_common_chrs, METH_NOARGS, 0},
33395   {"finalize", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_9finalize, METH_NOARGS, __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_8finalize},
33396   {"get_data_by_chr", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_11get_data_by_chr, METH_O, __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_10get_data_by_chr},
33397   {"get_chr_names", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_13get_chr_names, METH_NOARGS, __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_12get_chr_names},
33398   {"write_bedGraph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_15write_bedGraph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_14write_bedGraph},
33399   {"write_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_17write_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_16write_matrix},
33400   {"call_peaks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_19call_peaks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_18call_peaks},
33401   {"__reduce_cython__", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_21__reduce_cython__, METH_NOARGS, 0},
33402   {"__setstate_cython__", (PyCFunction)__pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_23__setstate_cython__, METH_O, 0},
33403   {0, 0, 0, 0}
33404 };
33405 
33406 static PyTypeObject __pyx_type_5MACS2_2IO_10ScoreTrack_TwoConditionScores = {
33407   PyVarObject_HEAD_INIT(0, 0)
33408   "MACS2.IO.ScoreTrack.TwoConditionScores", /*tp_name*/
33409   sizeof(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores), /*tp_basicsize*/
33410   0, /*tp_itemsize*/
33411   __pyx_tp_dealloc_5MACS2_2IO_10ScoreTrack_TwoConditionScores, /*tp_dealloc*/
33412   #if PY_VERSION_HEX < 0x030800b4
33413   0, /*tp_print*/
33414   #endif
33415   #if PY_VERSION_HEX >= 0x030800b4
33416   0, /*tp_vectorcall_offset*/
33417   #endif
33418   0, /*tp_getattr*/
33419   0, /*tp_setattr*/
33420   #if PY_MAJOR_VERSION < 3
33421   0, /*tp_compare*/
33422   #endif
33423   #if PY_MAJOR_VERSION >= 3
33424   0, /*tp_as_async*/
33425   #endif
33426   0, /*tp_repr*/
33427   0, /*tp_as_number*/
33428   0, /*tp_as_sequence*/
33429   0, /*tp_as_mapping*/
33430   0, /*tp_hash*/
33431   0, /*tp_call*/
33432   0, /*tp_str*/
33433   0, /*tp_getattro*/
33434   0, /*tp_setattro*/
33435   0, /*tp_as_buffer*/
33436   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33437   "Class for saving two condition comparison scores.\n    ", /*tp_doc*/
33438   __pyx_tp_traverse_5MACS2_2IO_10ScoreTrack_TwoConditionScores, /*tp_traverse*/
33439   __pyx_tp_clear_5MACS2_2IO_10ScoreTrack_TwoConditionScores, /*tp_clear*/
33440   0, /*tp_richcompare*/
33441   0, /*tp_weaklistoffset*/
33442   0, /*tp_iter*/
33443   0, /*tp_iternext*/
33444   __pyx_methods_5MACS2_2IO_10ScoreTrack_TwoConditionScores, /*tp_methods*/
33445   0, /*tp_members*/
33446   0, /*tp_getset*/
33447   0, /*tp_base*/
33448   0, /*tp_dict*/
33449   0, /*tp_descr_get*/
33450   0, /*tp_descr_set*/
33451   0, /*tp_dictoffset*/
33452   __pyx_pw_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_1__init__, /*tp_init*/
33453   0, /*tp_alloc*/
33454   __pyx_tp_new_5MACS2_2IO_10ScoreTrack_TwoConditionScores, /*tp_new*/
33455   0, /*tp_free*/
33456   0, /*tp_is_gc*/
33457   0, /*tp_bases*/
33458   0, /*tp_mro*/
33459   0, /*tp_cache*/
33460   0, /*tp_subclasses*/
33461   0, /*tp_weaklist*/
33462   0, /*tp_del*/
33463   0, /*tp_version_tag*/
33464   #if PY_VERSION_HEX >= 0x030400a1
33465   0, /*tp_finalize*/
33466   #endif
33467   #if PY_VERSION_HEX >= 0x030800b1
33468   0, /*tp_vectorcall*/
33469   #endif
33470   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33471   0, /*tp_print*/
33472   #endif
33473 };
33474 
33475 static PyMethodDef __pyx_methods[] = {
33476   {0, 0, 0, 0}
33477 };
33478 
33479 #if PY_MAJOR_VERSION >= 3
33480 #if CYTHON_PEP489_MULTI_PHASE_INIT
33481 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
33482 static int __pyx_pymod_exec_ScoreTrack(PyObject* module); /*proto*/
33483 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
33484   {Py_mod_create, (void*)__pyx_pymod_create},
33485   {Py_mod_exec, (void*)__pyx_pymod_exec_ScoreTrack},
33486   {0, NULL}
33487 };
33488 #endif
33489 
33490 static struct PyModuleDef __pyx_moduledef = {
33491     PyModuleDef_HEAD_INIT,
33492     "ScoreTrack",
33493     __pyx_k_Module_for_Feature_IO_classes_Th, /* m_doc */
33494   #if CYTHON_PEP489_MULTI_PHASE_INIT
33495     0, /* m_size */
33496   #else
33497     -1, /* m_size */
33498   #endif
33499     __pyx_methods /* m_methods */,
33500   #if CYTHON_PEP489_MULTI_PHASE_INIT
33501     __pyx_moduledef_slots, /* m_slots */
33502   #else
33503     NULL, /* m_reload */
33504   #endif
33505     NULL, /* m_traverse */
33506     NULL, /* m_clear */
33507     NULL /* m_free */
33508 };
33509 #endif
33510 #ifndef CYTHON_SMALL_CODE
33511 #if defined(__clang__)
33512     #define CYTHON_SMALL_CODE
33513 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
33514     #define CYTHON_SMALL_CODE __attribute__((cold))
33515 #else
33516     #define CYTHON_SMALL_CODE
33517 #endif
33518 #endif
33519 
33520 static __Pyx_StringTabEntry __pyx_string_tab[] = {
33521   {&__pyx_kp_b_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 0, 0},
33522   {&__pyx_kp_b_0_d, __pyx_k_0_d, sizeof(__pyx_k_0_d), 0, 0, 0, 0},
33523   {&__pyx_kp_b_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0, 0},
33524   {&__pyx_kp_b_1_1, __pyx_k_1_1, sizeof(__pyx_k_1_1), 0, 0, 0, 0},
33525   {&__pyx_kp_b_1_2, __pyx_k_1_2, sizeof(__pyx_k_1_2), 0, 0, 0, 0},
33526   {&__pyx_kp_u_5f, __pyx_k_5f, sizeof(__pyx_k_5f), 0, 1, 0, 0},
33527   {&__pyx_n_s_BYTE4, __pyx_k_BYTE4, sizeof(__pyx_k_BYTE4), 0, 0, 1, 1},
33528   {&__pyx_n_s_BroadPeakIO, __pyx_k_BroadPeakIO, sizeof(__pyx_k_BroadPeakIO), 0, 0, 1, 1},
33529   {&__pyx_n_s_CombinedTwoTrack, __pyx_k_CombinedTwoTrack, sizeof(__pyx_k_CombinedTwoTrack), 0, 0, 1, 1},
33530   {&__pyx_n_s_CombinedTwoTrack___init, __pyx_k_CombinedTwoTrack___init, sizeof(__pyx_k_CombinedTwoTrack___init), 0, 0, 1, 1},
33531   {&__pyx_n_s_CombinedTwoTrack_add, __pyx_k_CombinedTwoTrack_add, sizeof(__pyx_k_CombinedTwoTrack_add), 0, 0, 1, 1},
33532   {&__pyx_n_s_CombinedTwoTrack_add_chromosome, __pyx_k_CombinedTwoTrack_add_chromosome, sizeof(__pyx_k_CombinedTwoTrack_add_chromosome), 0, 0, 1, 1},
33533   {&__pyx_n_s_CombinedTwoTrack_extract_average, __pyx_k_CombinedTwoTrack_extract_average, sizeof(__pyx_k_CombinedTwoTrack_extract_average), 0, 0, 1, 1},
33534   {&__pyx_n_s_CombinedTwoTrack_extract_sum, __pyx_k_CombinedTwoTrack_extract_sum, sizeof(__pyx_k_CombinedTwoTrack_extract_sum), 0, 0, 1, 1},
33535   {&__pyx_n_s_CombinedTwoTrack_extract_value, __pyx_k_CombinedTwoTrack_extract_value, sizeof(__pyx_k_CombinedTwoTrack_extract_value), 0, 0, 1, 1},
33536   {&__pyx_n_s_CombinedTwoTrack_finalize, __pyx_k_CombinedTwoTrack_finalize, sizeof(__pyx_k_CombinedTwoTrack_finalize), 0, 0, 1, 1},
33537   {&__pyx_n_s_CombinedTwoTrack_get_chr_names, __pyx_k_CombinedTwoTrack_get_chr_names, sizeof(__pyx_k_CombinedTwoTrack_get_chr_names), 0, 0, 1, 1},
33538   {&__pyx_n_s_CombinedTwoTrack_get_data_by_chr, __pyx_k_CombinedTwoTrack_get_data_by_chr, sizeof(__pyx_k_CombinedTwoTrack_get_data_by_chr), 0, 0, 1, 1},
33539   {&__pyx_n_s_CombinedTwoTrack_total, __pyx_k_CombinedTwoTrack_total, sizeof(__pyx_k_CombinedTwoTrack_total), 0, 0, 1, 1},
33540   {&__pyx_n_s_CombinedTwoTrack_write_bedGraph, __pyx_k_CombinedTwoTrack_write_bedGraph, sizeof(__pyx_k_CombinedTwoTrack_write_bedGraph), 0, 0, 1, 1},
33541   {&__pyx_n_s_FBYTE4, __pyx_k_FBYTE4, sizeof(__pyx_k_FBYTE4), 0, 0, 1, 1},
33542   {&__pyx_kp_s_For_differential_peak_calling, __pyx_k_For_differential_peak_calling, sizeof(__pyx_k_For_differential_peak_calling), 0, 0, 1, 0},
33543   {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
33544   {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
33545   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
33546   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_k_Incompatible_checksums_s_vs_0x77, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x77), 0, 0, 1, 0},
33547   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x84, __pyx_k_Incompatible_checksums_s_vs_0x84, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x84), 0, 0, 1, 0},
33548   {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
33549   {&__pyx_n_s_LOG10_E, __pyx_k_LOG10_E, sizeof(__pyx_k_LOG10_E), 0, 0, 1, 1},
33550   {&__pyx_n_s_MACS2_Constants, __pyx_k_MACS2_Constants, sizeof(__pyx_k_MACS2_Constants), 0, 0, 1, 1},
33551   {&__pyx_n_s_MACS2_IO_PeakIO, __pyx_k_MACS2_IO_PeakIO, sizeof(__pyx_k_MACS2_IO_PeakIO), 0, 0, 1, 1},
33552   {&__pyx_n_s_MACS2_IO_ScoreTrack, __pyx_k_MACS2_IO_ScoreTrack, sizeof(__pyx_k_MACS2_IO_ScoreTrack), 0, 0, 1, 1},
33553   {&__pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_k_MACS2_IO_ScoreTrack_pyx, sizeof(__pyx_k_MACS2_IO_ScoreTrack_pyx), 0, 0, 1, 0},
33554   {&__pyx_n_s_MACS2_Prob, __pyx_k_MACS2_Prob, sizeof(__pyx_k_MACS2_Prob), 0, 0, 1, 1},
33555   {&__pyx_n_s_MACS2_Signal, __pyx_k_MACS2_Signal, sizeof(__pyx_k_MACS2_Signal), 0, 0, 1, 1},
33556   {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
33557   {&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0},
33558   {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
33559   {&__pyx_n_s_PeakIO, __pyx_k_PeakIO, sizeof(__pyx_k_PeakIO), 0, 0, 1, 1},
33560   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
33561   {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
33562   {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
33563   {&__pyx_kp_u_Tao_Liu_vladimir_liu_gmail_com, __pyx_k_Tao_Liu_vladimir_liu_gmail_com, sizeof(__pyx_k_Tao_Liu_vladimir_liu_gmail_com), 0, 1, 0, 0},
33564   {&__pyx_n_s_TwoConditionScores, __pyx_k_TwoConditionScores, sizeof(__pyx_k_TwoConditionScores), 0, 0, 1, 1},
33565   {&__pyx_n_s_V1, __pyx_k_V1, sizeof(__pyx_k_V1), 0, 0, 1, 1},
33566   {&__pyx_n_u_V1, __pyx_k_V1, sizeof(__pyx_k_V1), 0, 1, 0, 1},
33567   {&__pyx_n_s_V2, __pyx_k_V2, sizeof(__pyx_k_V2), 0, 0, 1, 1},
33568   {&__pyx_n_u_V2, __pyx_k_V2, sizeof(__pyx_k_V2), 0, 1, 0, 1},
33569   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
33570   {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
33571   {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
33572   {&__pyx_kp_b__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 0, 0},
33573   {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
33574   {&__pyx_kp_b__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 0, 0},
33575   {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0},
33576   {&__pyx_n_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 1},
33577   {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
33578   {&__pyx_n_s_add_broadpeak, __pyx_k_add_broadpeak, sizeof(__pyx_k_add_broadpeak), 0, 0, 1, 1},
33579   {&__pyx_n_s_add_chromosome, __pyx_k_add_chromosome, sizeof(__pyx_k_add_chromosome), 0, 0, 1, 1},
33580   {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
33581   {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
33582   {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
33583   {&__pyx_n_s_asym_logLR_dict, __pyx_k_asym_logLR_dict, sizeof(__pyx_k_asym_logLR_dict), 0, 0, 1, 1},
33584   {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1},
33585   {&__pyx_n_s_bdgTrack2, __pyx_k_bdgTrack2, sizeof(__pyx_k_bdgTrack2), 0, 0, 1, 1},
33586   {&__pyx_n_s_blockNum, __pyx_k_blockNum, sizeof(__pyx_k_blockNum), 0, 0, 1, 1},
33587   {&__pyx_n_s_blockSizes, __pyx_k_blockSizes, sizeof(__pyx_k_blockSizes), 0, 0, 1, 1},
33588   {&__pyx_n_s_blockStarts, __pyx_k_blockStarts, sizeof(__pyx_k_blockStarts), 0, 0, 1, 1},
33589   {&__pyx_n_s_bpeaks, __pyx_k_bpeaks, sizeof(__pyx_k_bpeaks), 0, 0, 1, 1},
33590   {&__pyx_n_s_build, __pyx_k_build, sizeof(__pyx_k_build), 0, 0, 1, 1},
33591   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
33592   {&__pyx_n_s_c1bdg, __pyx_k_c1bdg, sizeof(__pyx_k_c1bdg), 0, 0, 1, 1},
33593   {&__pyx_n_s_c2bdg, __pyx_k_c2bdg, sizeof(__pyx_k_c2bdg), 0, 0, 1, 1},
33594   {&__pyx_n_s_call_broadpeaks, __pyx_k_call_broadpeaks, sizeof(__pyx_k_call_broadpeaks), 0, 0, 1, 1},
33595   {&__pyx_n_s_call_peaks, __pyx_k_call_peaks, sizeof(__pyx_k_call_peaks), 0, 0, 1, 1},
33596   {&__pyx_n_s_call_summits, __pyx_k_call_summits, sizeof(__pyx_k_call_summits), 0, 0, 1, 1},
33597   {&__pyx_n_s_change_normalization_method, __pyx_k_change_normalization_method, sizeof(__pyx_k_change_normalization_method), 0, 0, 1, 1},
33598   {&__pyx_n_s_change_score_method, __pyx_k_change_score_method, sizeof(__pyx_k_change_score_method), 0, 0, 1, 1},
33599   {&__pyx_n_s_chip, __pyx_k_chip, sizeof(__pyx_k_chip), 0, 0, 1, 1},
33600   {&__pyx_n_s_chr1, __pyx_k_chr1, sizeof(__pyx_k_chr1), 0, 0, 1, 1},
33601   {&__pyx_n_s_chr2, __pyx_k_chr2, sizeof(__pyx_k_chr2), 0, 0, 1, 1},
33602   {&__pyx_n_s_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 0, 0, 1, 1},
33603   {&__pyx_n_s_chrom_data, __pyx_k_chrom_data, sizeof(__pyx_k_chrom_data), 0, 0, 1, 1},
33604   {&__pyx_n_s_chrom_max_len, __pyx_k_chrom_max_len, sizeof(__pyx_k_chrom_max_len), 0, 0, 1, 1},
33605   {&__pyx_n_s_chromosome, __pyx_k_chromosome, sizeof(__pyx_k_chromosome), 0, 0, 1, 1},
33606   {&__pyx_n_s_chrs, __pyx_k_chrs, sizeof(__pyx_k_chrs), 0, 0, 1, 1},
33607   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
33608   {&__pyx_n_s_colname, __pyx_k_colname, sizeof(__pyx_k_colname), 0, 0, 1, 1},
33609   {&__pyx_n_s_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 0, 1, 1},
33610   {&__pyx_kp_u_column_should_be_between_1_2_or, __pyx_k_column_should_be_between_1_2_or, sizeof(__pyx_k_column_should_be_between_1_2_or), 0, 1, 0, 0},
33611   {&__pyx_n_s_common_chr, __pyx_k_common_chr, sizeof(__pyx_k_common_chr), 0, 0, 1, 1},
33612   {&__pyx_n_s_cond1_factor, __pyx_k_cond1_factor, sizeof(__pyx_k_cond1_factor), 0, 0, 1, 1},
33613   {&__pyx_n_s_cond2_factor, __pyx_k_cond2_factor, sizeof(__pyx_k_cond2_factor), 0, 0, 1, 1},
33614   {&__pyx_n_s_control, __pyx_k_control, sizeof(__pyx_k_control), 0, 0, 1, 1},
33615   {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
33616   {&__pyx_n_s_ctrl_depth, __pyx_k_ctrl_depth, sizeof(__pyx_k_ctrl_depth), 0, 0, 1, 1},
33617   {&__pyx_n_s_cur_region, __pyx_k_cur_region, sizeof(__pyx_k_cur_region), 0, 0, 1, 1},
33618   {&__pyx_n_s_cutoff, __pyx_k_cutoff, sizeof(__pyx_k_cutoff), 0, 0, 1, 1},
33619   {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
33620   {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
33621   {&__pyx_kp_b_d_2, __pyx_k_d_2, sizeof(__pyx_k_d_2), 0, 0, 0, 0},
33622   {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
33623   {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
33624   {&__pyx_n_s_description, __pyx_k_description, sizeof(__pyx_k_description), 0, 0, 1, 1},
33625   {&__pyx_kp_u_description_2, __pyx_k_description_2, sizeof(__pyx_k_description_2), 0, 1, 0, 0},
33626   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
33627   {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
33628   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
33629   {&__pyx_n_s_enable_trackline, __pyx_k_enable_trackline, sizeof(__pyx_k_enable_trackline), 0, 0, 1, 1},
33630   {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
33631   {&__pyx_n_u_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 1, 0, 1},
33632   {&__pyx_n_s_endpos, __pyx_k_endpos, sizeof(__pyx_k_endpos), 0, 0, 1, 1},
33633   {&__pyx_n_s_enforce_peakyness, __pyx_k_enforce_peakyness, sizeof(__pyx_k_enforce_peakyness), 0, 0, 1, 1},
33634   {&__pyx_n_s_enforce_valleys, __pyx_k_enforce_valleys, sizeof(__pyx_k_enforce_valleys), 0, 0, 1, 1},
33635   {&__pyx_n_s_extract_average, __pyx_k_extract_average, sizeof(__pyx_k_extract_average), 0, 0, 1, 1},
33636   {&__pyx_n_s_extract_sum, __pyx_k_extract_sum, sizeof(__pyx_k_extract_sum), 0, 0, 1, 1},
33637   {&__pyx_n_s_extract_value, __pyx_k_extract_value, sizeof(__pyx_k_extract_value), 0, 0, 1, 1},
33638   {&__pyx_n_u_fc, __pyx_k_fc, sizeof(__pyx_k_fc), 0, 1, 0, 1},
33639   {&__pyx_n_s_fhd, __pyx_k_fhd, sizeof(__pyx_k_fhd), 0, 0, 1, 1},
33640   {&__pyx_n_s_finalize, __pyx_k_finalize, sizeof(__pyx_k_finalize), 0, 0, 1, 1},
33641   {&__pyx_n_s_flat, __pyx_k_flat, sizeof(__pyx_k_flat), 0, 0, 1, 1},
33642   {&__pyx_n_u_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 1, 0, 1},
33643   {&__pyx_n_s_fold_change, __pyx_k_fold_change, sizeof(__pyx_k_fold_change), 0, 0, 1, 1},
33644   {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1},
33645   {&__pyx_n_s_get_chr_names, __pyx_k_get_chr_names, sizeof(__pyx_k_get_chr_names), 0, 0, 1, 1},
33646   {&__pyx_n_s_get_common_chrs, __pyx_k_get_common_chrs, sizeof(__pyx_k_get_common_chrs), 0, 0, 1, 1},
33647   {&__pyx_n_s_get_common_chrs_locals_lambda, __pyx_k_get_common_chrs_locals_lambda, sizeof(__pyx_k_get_common_chrs_locals_lambda), 0, 0, 1, 1},
33648   {&__pyx_n_s_get_data_by_chr, __pyx_k_get_data_by_chr, sizeof(__pyx_k_get_data_by_chr), 0, 0, 1, 1},
33649   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
33650   {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
33651   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
33652   {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
33653   {&__pyx_n_u_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 1, 0, 1},
33654   {&__pyx_n_s_intersection, __pyx_k_intersection, sizeof(__pyx_k_intersection), 0, 0, 1, 1},
33655   {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
33656   {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
33657   {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
33658   {&__pyx_n_s_ladd, __pyx_k_ladd, sizeof(__pyx_k_ladd), 0, 0, 1, 1},
33659   {&__pyx_n_s_larray, __pyx_k_larray, sizeof(__pyx_k_larray), 0, 0, 1, 1},
33660   {&__pyx_n_u_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 1, 0, 1},
33661   {&__pyx_kp_u_level_1_cutoff_should_be_larger, __pyx_k_level_1_cutoff_should_be_larger, sizeof(__pyx_k_level_1_cutoff_should_be_larger), 0, 1, 0, 0},
33662   {&__pyx_kp_u_level_2_maximum_gap_should_be_la, __pyx_k_level_2_maximum_gap_should_be_la, sizeof(__pyx_k_level_2_maximum_gap_should_be_la), 0, 1, 0, 0},
33663   {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
33664   {&__pyx_n_s_logical_and, __pyx_k_logical_and, sizeof(__pyx_k_logical_and), 0, 0, 1, 1},
33665   {&__pyx_n_s_lvl1_cutoff, __pyx_k_lvl1_cutoff, sizeof(__pyx_k_lvl1_cutoff), 0, 0, 1, 1},
33666   {&__pyx_n_s_lvl1_max_gap, __pyx_k_lvl1_max_gap, sizeof(__pyx_k_lvl1_max_gap), 0, 0, 1, 1},
33667   {&__pyx_n_s_lvl1peakset, __pyx_k_lvl1peakset, sizeof(__pyx_k_lvl1peakset), 0, 0, 1, 1},
33668   {&__pyx_n_s_lvl2_cutoff, __pyx_k_lvl2_cutoff, sizeof(__pyx_k_lvl2_cutoff), 0, 0, 1, 1},
33669   {&__pyx_n_s_lvl2_max_gap, __pyx_k_lvl2_max_gap, sizeof(__pyx_k_lvl2_max_gap), 0, 0, 1, 1},
33670   {&__pyx_n_s_lvl2peak, __pyx_k_lvl2peak, sizeof(__pyx_k_lvl2peak), 0, 0, 1, 1},
33671   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
33672   {&__pyx_n_s_make_pq_table, __pyx_k_make_pq_table, sizeof(__pyx_k_make_pq_table), 0, 0, 1, 1},
33673   {&__pyx_n_s_max_gap, __pyx_k_max_gap, sizeof(__pyx_k_max_gap), 0, 0, 1, 1},
33674   {&__pyx_n_s_maxima, __pyx_k_maxima, sizeof(__pyx_k_maxima), 0, 0, 1, 1},
33675   {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
33676   {&__pyx_n_s_min_length, __pyx_k_min_length, sizeof(__pyx_k_min_length), 0, 0, 1, 1},
33677   {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
33678   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
33679   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
33680   {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
33681   {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
33682   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
33683   {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
33684   {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1},
33685   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
33686   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
33687   {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
33688   {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
33689   {&__pyx_n_s_p1, __pyx_k_p1, sizeof(__pyx_k_p1), 0, 0, 1, 1},
33690   {&__pyx_n_s_p1n, __pyx_k_p1n, sizeof(__pyx_k_p1n), 0, 0, 1, 1},
33691   {&__pyx_n_s_p2, __pyx_k_p2, sizeof(__pyx_k_p2), 0, 0, 1, 1},
33692   {&__pyx_n_s_p2n, __pyx_k_p2n, sizeof(__pyx_k_p2n), 0, 0, 1, 1},
33693   {&__pyx_n_s_p2s, __pyx_k_p2s, sizeof(__pyx_k_p2s), 0, 0, 1, 1},
33694   {&__pyx_n_s_parse_peakname, __pyx_k_parse_peakname, sizeof(__pyx_k_parse_peakname), 0, 0, 1, 1},
33695   {&__pyx_n_s_peak_score, __pyx_k_peak_score, sizeof(__pyx_k_peak_score), 0, 0, 1, 1},
33696   {&__pyx_n_s_peaks, __pyx_k_peaks, sizeof(__pyx_k_peaks), 0, 0, 1, 1},
33697   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
33698   {&__pyx_n_s_pileup, __pyx_k_pileup, sizeof(__pyx_k_pileup), 0, 0, 1, 1},
33699   {&__pyx_n_u_pileup, __pyx_k_pileup, sizeof(__pyx_k_pileup), 0, 1, 0, 1},
33700   {&__pyx_n_s_pointer, __pyx_k_pointer, sizeof(__pyx_k_pointer), 0, 0, 1, 1},
33701   {&__pyx_n_s_poisson_cdf, __pyx_k_poisson_cdf, sizeof(__pyx_k_poisson_cdf), 0, 0, 1, 1},
33702   {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
33703   {&__pyx_n_u_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 1, 0, 1},
33704   {&__pyx_n_s_pre, __pyx_k_pre, sizeof(__pyx_k_pre), 0, 0, 1, 1},
33705   {&__pyx_n_s_pre_p, __pyx_k_pre_p, sizeof(__pyx_k_pre_p), 0, 0, 1, 1},
33706   {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
33707   {&__pyx_n_s_proportion_background_empirical, __pyx_k_proportion_background_empirical, sizeof(__pyx_k_proportion_background_empirical), 0, 0, 1, 1},
33708   {&__pyx_n_s_pscore, __pyx_k_pscore, sizeof(__pyx_k_pscore), 0, 0, 1, 1},
33709   {&__pyx_n_u_pscore, __pyx_k_pscore, sizeof(__pyx_k_pscore), 0, 1, 0, 1},
33710   {&__pyx_n_s_pscore_dict, __pyx_k_pscore_dict, sizeof(__pyx_k_pscore_dict), 0, 0, 1, 1},
33711   {&__pyx_n_s_pseudocount, __pyx_k_pseudocount, sizeof(__pyx_k_pseudocount), 0, 0, 1, 1},
33712   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
33713   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
33714   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
33715   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
33716   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
33717   {&__pyx_n_s_pyx_unpickle_TwoConditionScore, __pyx_k_pyx_unpickle_TwoConditionScore, sizeof(__pyx_k_pyx_unpickle_TwoConditionScore), 0, 0, 1, 1},
33718   {&__pyx_n_s_pyx_unpickle_scoreTrackII, __pyx_k_pyx_unpickle_scoreTrackII, sizeof(__pyx_k_pyx_unpickle_scoreTrackII), 0, 0, 1, 1},
33719   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
33720   {&__pyx_n_s_qscore, __pyx_k_qscore, sizeof(__pyx_k_qscore), 0, 0, 1, 1},
33721   {&__pyx_n_u_qscore, __pyx_k_qscore, sizeof(__pyx_k_qscore), 0, 1, 0, 1},
33722   {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
33723   {&__pyx_n_s_radd, __pyx_k_radd, sizeof(__pyx_k_radd), 0, 0, 1, 1},
33724   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
33725   {&__pyx_n_s_rarray, __pyx_k_rarray, sizeof(__pyx_k_rarray), 0, 0, 1, 1},
33726   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
33727   {&__pyx_n_s_reduce_2, __pyx_k_reduce_2, sizeof(__pyx_k_reduce_2), 0, 0, 1, 1},
33728   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
33729   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
33730   {&__pyx_n_s_refcheck, __pyx_k_refcheck, sizeof(__pyx_k_refcheck), 0, 0, 1, 1},
33731   {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1},
33732   {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
33733   {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1},
33734   {&__pyx_n_u_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 1, 0, 1},
33735   {&__pyx_kp_b_s_d_d, __pyx_k_s_d_d, sizeof(__pyx_k_s_d_d), 0, 0, 0, 0},
33736   {&__pyx_kp_u_s_not_supported, __pyx_k_s_not_supported, sizeof(__pyx_k_s_not_supported), 0, 1, 0, 0},
33737   {&__pyx_n_s_score, __pyx_k_score, sizeof(__pyx_k_score), 0, 0, 1, 1},
33738   {&__pyx_n_u_score, __pyx_k_score, sizeof(__pyx_k_score), 0, 1, 0, 1},
33739   {&__pyx_n_s_scoreTrackII, __pyx_k_scoreTrackII, sizeof(__pyx_k_scoreTrackII), 0, 0, 1, 1},
33740   {&__pyx_kp_u_scoreTrackI_Revision, __pyx_k_scoreTrackI_Revision, sizeof(__pyx_k_scoreTrackI_Revision), 0, 1, 0, 0},
33741   {&__pyx_kp_u_scoreTrack_classes, __pyx_k_scoreTrack_classes, sizeof(__pyx_k_scoreTrack_classes), 0, 1, 0, 0},
33742   {&__pyx_n_s_searchsorted, __pyx_k_searchsorted, sizeof(__pyx_k_searchsorted), 0, 0, 1, 1},
33743   {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
33744   {&__pyx_n_s_set_pseudocount, __pyx_k_set_pseudocount, sizeof(__pyx_k_set_pseudocount), 0, 0, 1, 1},
33745   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
33746   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
33747   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
33748   {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1},
33749   {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
33750   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
33751   {&__pyx_n_u_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 1, 0, 1},
33752   {&__pyx_n_s_stderr_on, __pyx_k_stderr_on, sizeof(__pyx_k_stderr_on), 0, 0, 1, 1},
33753   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
33754   {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
33755   {&__pyx_n_s_summit, __pyx_k_summit, sizeof(__pyx_k_summit), 0, 0, 1, 1},
33756   {&__pyx_n_s_sym_logLR_dict, __pyx_k_sym_logLR_dict, sizeof(__pyx_k_sym_logLR_dict), 0, 0, 1, 1},
33757   {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
33758   {&__pyx_n_s_t1bdg, __pyx_k_t1bdg, sizeof(__pyx_k_t1bdg), 0, 0, 1, 1},
33759   {&__pyx_n_s_t2bdg, __pyx_k_t2bdg, sizeof(__pyx_k_t2bdg), 0, 0, 1, 1},
33760   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
33761   {&__pyx_n_s_thickEnd, __pyx_k_thickEnd, sizeof(__pyx_k_thickEnd), 0, 0, 1, 1},
33762   {&__pyx_n_s_thickStart, __pyx_k_thickStart, sizeof(__pyx_k_thickStart), 0, 0, 1, 1},
33763   {&__pyx_n_s_total, __pyx_k_total, sizeof(__pyx_k_total), 0, 0, 1, 1},
33764   {&__pyx_kp_u_track_type_bedGraph_name, __pyx_k_track_type_bedGraph_name, sizeof(__pyx_k_track_type_bedGraph_name), 0, 1, 0, 0},
33765   {&__pyx_n_s_treat_depth, __pyx_k_treat_depth, sizeof(__pyx_k_treat_depth), 0, 0, 1, 1},
33766   {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
33767   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
33768   {&__pyx_n_s_v11, __pyx_k_v11, sizeof(__pyx_k_v11), 0, 0, 1, 1},
33769   {&__pyx_n_s_v11n, __pyx_k_v11n, sizeof(__pyx_k_v11n), 0, 0, 1, 1},
33770   {&__pyx_n_s_v1add, __pyx_k_v1add, sizeof(__pyx_k_v1add), 0, 0, 1, 1},
33771   {&__pyx_n_s_v1array, __pyx_k_v1array, sizeof(__pyx_k_v1array), 0, 0, 1, 1},
33772   {&__pyx_n_s_v2, __pyx_k_v2, sizeof(__pyx_k_v2), 0, 0, 1, 1},
33773   {&__pyx_n_s_v21, __pyx_k_v21, sizeof(__pyx_k_v21), 0, 0, 1, 1},
33774   {&__pyx_n_s_v21n, __pyx_k_v21n, sizeof(__pyx_k_v21n), 0, 0, 1, 1},
33775   {&__pyx_n_s_v2add, __pyx_k_v2add, sizeof(__pyx_k_v2add), 0, 0, 1, 1},
33776   {&__pyx_n_s_v2array, __pyx_k_v2array, sizeof(__pyx_k_v2array), 0, 0, 1, 1},
33777   {&__pyx_n_s_v2n, __pyx_k_v2n, sizeof(__pyx_k_v2n), 0, 0, 1, 1},
33778   {&__pyx_n_s_v2s, __pyx_k_v2s, sizeof(__pyx_k_v2s), 0, 0, 1, 1},
33779   {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
33780   {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
33781   {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
33782   {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
33783   {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
33784   {&__pyx_n_s_write_bedGraph, __pyx_k_write_bedGraph, sizeof(__pyx_k_write_bedGraph), 0, 0, 1, 1},
33785   {&__pyx_n_s_write_matrix, __pyx_k_write_matrix, sizeof(__pyx_k_write_matrix), 0, 0, 1, 1},
33786   {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
33787   {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
33788   {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
33789   {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
33790   {0, 0, 0, 0, 0, 0, 0}
33791 };
__Pyx_InitCachedBuiltins(void)33792 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
33793   __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 71, __pyx_L1_error)
33794   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 227, __pyx_L1_error)
33795   __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 328, __pyx_L1_error)
33796   __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 588, __pyx_L1_error)
33797   __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 758, __pyx_L1_error)
33798   __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 768, __pyx_L1_error)
33799   __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 1159, __pyx_L1_error)
33800   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
33801   __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
33802   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
33803   return 0;
33804   __pyx_L1_error:;
33805   return -1;
33806 }
33807 
__Pyx_InitCachedConstants(void)33808 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
33809   __Pyx_RefNannyDeclarations
33810   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
33811 
33812   /* "MACS2/IO/ScoreTrack.pyx":152
33813  *     def add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):
33814  *         if chrom not in self.data:
33815  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),             # <<<<<<<<<<<<<<
33816  *                                                              ('V1','float32'), # value for the first track
33817  *                                                              ('V2','float32'), # value for the second track
33818  */
33819   __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_u_pos, __pyx_n_u_int32); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 152, __pyx_L1_error)
33820   __Pyx_GOTREF(__pyx_tuple__3);
33821   __Pyx_GIVEREF(__pyx_tuple__3);
33822 
33823   /* "MACS2/IO/ScoreTrack.pyx":153
33824  *         if chrom not in self.data:
33825  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
33826  *                                                              ('V1','float32'), # value for the first track             # <<<<<<<<<<<<<<
33827  *                                                              ('V2','float32'), # value for the second track
33828  *                                                              ])
33829  */
33830   __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_u_V1, __pyx_n_u_float32); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 153, __pyx_L1_error)
33831   __Pyx_GOTREF(__pyx_tuple__4);
33832   __Pyx_GIVEREF(__pyx_tuple__4);
33833 
33834   /* "MACS2/IO/ScoreTrack.pyx":154
33835  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
33836  *                                                              ('V1','float32'), # value for the first track
33837  *                                                              ('V2','float32'), # value for the second track             # <<<<<<<<<<<<<<
33838  *                                                              ])
33839  *             self.pointer[chrom] = 0
33840  */
33841   __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_u_V2, __pyx_n_u_float32); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 154, __pyx_L1_error)
33842   __Pyx_GOTREF(__pyx_tuple__5);
33843   __Pyx_GIVEREF(__pyx_tuple__5);
33844 
33845   /* "MACS2/IO/ScoreTrack.pyx":948
33846  *             np.ndarray pos, value
33847  *
33848  *         assert column in range( 1, 4 ), "column should be between 1, 2 or 3."             # <<<<<<<<<<<<<<
33849  *
33850  *         write = fhd.write
33851  */
33852   __pyx_tuple__18 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_4); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 948, __pyx_L1_error)
33853   __Pyx_GOTREF(__pyx_tuple__18);
33854   __Pyx_GIVEREF(__pyx_tuple__18);
33855 
33856   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":272
33857  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
33858  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
33859  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
33860  *
33861  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
33862  */
33863   __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 272, __pyx_L1_error)
33864   __Pyx_GOTREF(__pyx_tuple__25);
33865   __Pyx_GIVEREF(__pyx_tuple__25);
33866 
33867   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":276
33868  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
33869  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
33870  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
33871  *
33872  *             info.buf = PyArray_DATA(self)
33873  */
33874   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 276, __pyx_L1_error)
33875   __Pyx_GOTREF(__pyx_tuple__26);
33876   __Pyx_GIVEREF(__pyx_tuple__26);
33877 
33878   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":306
33879  *                 if ((descr.byteorder == c'>' and little_endian) or
33880  *                     (descr.byteorder == c'<' and not little_endian)):
33881  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
33882  *                 if   t == NPY_BYTE:        f = "b"
33883  *                 elif t == NPY_UBYTE:       f = "B"
33884  */
33885   __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 306, __pyx_L1_error)
33886   __Pyx_GOTREF(__pyx_tuple__27);
33887   __Pyx_GIVEREF(__pyx_tuple__27);
33888 
33889   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":856
33890  *
33891  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
33892  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
33893  *
33894  *         if ((child.byteorder == c'>' and little_endian) or
33895  */
33896   __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 856, __pyx_L1_error)
33897   __Pyx_GOTREF(__pyx_tuple__28);
33898   __Pyx_GIVEREF(__pyx_tuple__28);
33899 
33900   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":880
33901  *             t = child.type_num
33902  *             if end - f < 5:
33903  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
33904  *
33905  *             # Until ticket #99 is fixed, use integers to avoid warnings
33906  */
33907   __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 880, __pyx_L1_error)
33908   __Pyx_GOTREF(__pyx_tuple__29);
33909   __Pyx_GIVEREF(__pyx_tuple__29);
33910 
33911   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1038
33912  *         _import_array()
33913  *     except Exception:
33914  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
33915  *
33916  * cdef inline int import_umath() except -1:
33917  */
33918   __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 1038, __pyx_L1_error)
33919   __Pyx_GOTREF(__pyx_tuple__30);
33920   __Pyx_GIVEREF(__pyx_tuple__30);
33921 
33922   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1044
33923  *         _import_umath()
33924  *     except Exception:
33925  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
33926  *
33927  * cdef inline int import_ufunc() except -1:
33928  */
33929   __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 1044, __pyx_L1_error)
33930   __Pyx_GOTREF(__pyx_tuple__31);
33931   __Pyx_GIVEREF(__pyx_tuple__31);
33932 
33933   /* "MACS2/IO/ScoreTrack.pyx":142
33934  *
33935  *     """
33936  *     def __init__ (self):             # <<<<<<<<<<<<<<
33937  *         """Different with bedGraphTrackI, missing values are simply
33938  *         replaced with 0.
33939  */
33940   __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 142, __pyx_L1_error)
33941   __Pyx_GOTREF(__pyx_tuple__32);
33942   __Pyx_GIVEREF(__pyx_tuple__32);
33943   __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_n_s_init, 142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 142, __pyx_L1_error)
33944 
33945   /* "MACS2/IO/ScoreTrack.pyx":150
33946  *         self.pointer = {}
33947  *
33948  *     def add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):             # <<<<<<<<<<<<<<
33949  *         if chrom not in self.data:
33950  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
33951  */
33952   __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_chrom, __pyx_n_s_chrom_max_len); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 150, __pyx_L1_error)
33953   __Pyx_GOTREF(__pyx_tuple__33);
33954   __Pyx_GIVEREF(__pyx_tuple__33);
33955   __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_n_s_add_chromosome, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 150, __pyx_L1_error)
33956 
33957   /* "MACS2/IO/ScoreTrack.pyx":158
33958  *             self.pointer[chrom] = 0
33959  *
33960  *     def add ( self, bytes chromosome, int32_t endpos, float64_t V1, float64_t V2 ):             # <<<<<<<<<<<<<<
33961  *         """Add a chr-endpos-sample-control block into data
33962  *         dictionary. At the mean time, calculate pvalues.
33963  */
33964   __pyx_tuple__34 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_chromosome, __pyx_n_s_endpos, __pyx_n_s_V1, __pyx_n_s_V2, __pyx_n_s_c, __pyx_n_s_i); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 158, __pyx_L1_error)
33965   __Pyx_GOTREF(__pyx_tuple__34);
33966   __Pyx_GIVEREF(__pyx_tuple__34);
33967   __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_n_s_add, 158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 158, __pyx_L1_error)
33968 
33969   /* "MACS2/IO/ScoreTrack.pyx":173
33970  *         self.pointer[chromosome] += 1
33971  *
33972  *     def finalize ( self ):             # <<<<<<<<<<<<<<
33973  *         cdef bytes chrom
33974  *
33975  */
33976   __pyx_tuple__35 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_chrom, __pyx_n_s_d, __pyx_n_s_l); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 173, __pyx_L1_error)
33977   __Pyx_GOTREF(__pyx_tuple__35);
33978   __Pyx_GIVEREF(__pyx_tuple__35);
33979   __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_n_s_finalize, 173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 173, __pyx_L1_error)
33980 
33981   /* "MACS2/IO/ScoreTrack.pyx":181
33982  *             d.resize(l,refcheck=False)
33983  *
33984  *     def get_data_by_chr (self, bytes chromosome):             # <<<<<<<<<<<<<<
33985  *         """Return array of counts by chromosome.
33986  *
33987  */
33988   __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_chromosome); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 181, __pyx_L1_error)
33989   __Pyx_GOTREF(__pyx_tuple__36);
33990   __Pyx_GIVEREF(__pyx_tuple__36);
33991   __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_n_s_get_data_by_chr, 181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 181, __pyx_L1_error)
33992 
33993   /* "MACS2/IO/ScoreTrack.pyx":192
33994  *             return None
33995  *
33996  *     def get_chr_names (self):             # <<<<<<<<<<<<<<
33997  *         """Return all the chromosome names stored.
33998  *
33999  */
34000   __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_l); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 192, __pyx_L1_error)
34001   __Pyx_GOTREF(__pyx_tuple__37);
34002   __Pyx_GIVEREF(__pyx_tuple__37);
34003   __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_n_s_get_chr_names, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 192, __pyx_L1_error)
34004 
34005   /* "MACS2/IO/ScoreTrack.pyx":201
34006  *         return l
34007  *
34008  *     def write_bedGraph (self, fhd, str name, str description, str colname):             # <<<<<<<<<<<<<<
34009  *         """Write all data to fhd in Wiggle Format.
34010  *
34011  */
34012   __pyx_tuple__38 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_fhd, __pyx_n_s_name, __pyx_n_s_description, __pyx_n_s_colname, __pyx_n_s_chrom, __pyx_n_s_chrs, __pyx_n_s_pre, __pyx_n_s_i, __pyx_n_s_l, __pyx_n_s_pos, __pyx_n_s_value, __pyx_n_s_write, __pyx_n_s_d); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 201, __pyx_L1_error)
34013   __Pyx_GOTREF(__pyx_tuple__38);
34014   __Pyx_GIVEREF(__pyx_tuple__38);
34015   __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_n_s_write_bedGraph, 201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 201, __pyx_L1_error)
34016 
34017   /* "MACS2/IO/ScoreTrack.pyx":233
34018  *         return True
34019  *
34020  *     def total ( self ):             # <<<<<<<<<<<<<<
34021  *         """Return the number of regions in this object.
34022  *
34023  */
34024   __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_t, __pyx_n_s_chrom); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 233, __pyx_L1_error)
34025   __Pyx_GOTREF(__pyx_tuple__39);
34026   __Pyx_GIVEREF(__pyx_tuple__39);
34027   __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_n_s_total, 233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 233, __pyx_L1_error)
34028 
34029   /* "MACS2/IO/ScoreTrack.pyx":246
34030  *         return t
34031  *
34032  *     def extract_value ( self, bdgTrack2 ):             # <<<<<<<<<<<<<<
34033  *         """It's like overlie function. THe overlapped regions between
34034  *         bdgTrack2 and self, will be recorded. The values from self in
34035  */
34036   __pyx_tuple__40 = PyTuple_Pack(25, __pyx_n_s_self, __pyx_n_s_bdgTrack2, __pyx_n_s_chr1, __pyx_n_s_chr2, __pyx_n_s_common_chr, __pyx_n_s_chrom, __pyx_n_s_pre_p, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_v11, __pyx_n_s_v21, __pyx_n_s_v2, __pyx_n_s_ret, __pyx_n_s_radd, __pyx_n_s_v1add, __pyx_n_s_v2add, __pyx_n_s_ladd, __pyx_n_s_chrom_data, __pyx_n_s_p1n, __pyx_n_s_v11n, __pyx_n_s_v21n, __pyx_n_s_p2s, __pyx_n_s_v2s, __pyx_n_s_p2n, __pyx_n_s_v2n); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 246, __pyx_L1_error)
34037   __Pyx_GOTREF(__pyx_tuple__40);
34038   __Pyx_GIVEREF(__pyx_tuple__40);
34039   __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 25, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_n_s_extract_value, 246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 246, __pyx_L1_error)
34040 
34041   /* "MACS2/IO/ScoreTrack.pyx":337
34042  *         return ret
34043  *
34044  *     def extract_average (self, bdgTrack2):             # <<<<<<<<<<<<<<
34045  *         cdef:
34046  *             int32_t i, l
34047  */
34048   __pyx_tuple__41 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_bdgTrack2, __pyx_n_s_i, __pyx_n_s_l, __pyx_n_s_chrom, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_rarray, __pyx_n_s_v1array, __pyx_n_s_v2array, __pyx_n_s_larray, __pyx_n_s_ret, __pyx_n_s_radd, __pyx_n_s_v1add, __pyx_n_s_v2add, __pyx_n_s_cur_region); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 337, __pyx_L1_error)
34049   __Pyx_GOTREF(__pyx_tuple__41);
34050   __Pyx_GIVEREF(__pyx_tuple__41);
34051   __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_n_s_extract_average, 337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 337, __pyx_L1_error)
34052 
34053   /* "MACS2/IO/ScoreTrack.pyx":367
34054  *         return ret
34055  *
34056  *     def extract_sum (self, bdgTrack2):             # <<<<<<<<<<<<<<
34057  *         """Get sum values in each region defined in bdgTrack2.
34058  *
34059  */
34060   __pyx_tuple__42 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_bdgTrack2, __pyx_n_s_i, __pyx_n_s_chrom, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_rarray, __pyx_n_s_v1array, __pyx_n_s_v2array, __pyx_n_s_larray, __pyx_n_s_ret, __pyx_n_s_radd, __pyx_n_s_v1add, __pyx_n_s_v2add, __pyx_n_s_cur_region); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 367, __pyx_L1_error)
34061   __Pyx_GOTREF(__pyx_tuple__42);
34062   __Pyx_GIVEREF(__pyx_tuple__42);
34063   __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MACS2_IO_ScoreTrack_pyx, __pyx_n_s_extract_sum, 367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 367, __pyx_L1_error)
34064 
34065   /* "(tree fragment)":1
34066  * def __pyx_unpickle_scoreTrackII(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
34067  *     cdef object __pyx_PickleError
34068  *     cdef object __pyx_result
34069  */
34070   __pyx_tuple__43 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 1, __pyx_L1_error)
34071   __Pyx_GOTREF(__pyx_tuple__43);
34072   __Pyx_GIVEREF(__pyx_tuple__43);
34073   __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_scoreTrackII, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 1, __pyx_L1_error)
34074   __pyx_tuple__44 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 1, __pyx_L1_error)
34075   __Pyx_GOTREF(__pyx_tuple__44);
34076   __Pyx_GIVEREF(__pyx_tuple__44);
34077   __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_TwoConditionScore, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 1, __pyx_L1_error)
34078   __Pyx_RefNannyFinishContext();
34079   return 0;
34080   __pyx_L1_error:;
34081   __Pyx_RefNannyFinishContext();
34082   return -1;
34083 }
34084 
__Pyx_InitGlobals(void)34085 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
34086   __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type;
34087   __pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
34088   __pyx_umethod_PySet_Type_intersection.type = (PyObject*)&PySet_Type;
34089   __pyx_umethod_PyUnicode_Type_decode.type = (PyObject*)&PyUnicode_Type;
34090   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
34091   __pyx_float_0_99999 = PyFloat_FromDouble(0.99999); if (unlikely(!__pyx_float_0_99999)) __PYX_ERR(0, 1, __pyx_L1_error)
34092   __pyx_float_0_43429448190325176 = PyFloat_FromDouble(0.43429448190325176); if (unlikely(!__pyx_float_0_43429448190325176)) __PYX_ERR(0, 1, __pyx_L1_error)
34093   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
34094   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
34095   __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
34096   __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
34097   __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
34098   __pyx_int_125580684 = PyInt_FromLong(125580684L); if (unlikely(!__pyx_int_125580684)) __PYX_ERR(0, 1, __pyx_L1_error)
34099   __pyx_int_138857595 = PyInt_FromLong(138857595L); if (unlikely(!__pyx_int_138857595)) __PYX_ERR(0, 1, __pyx_L1_error)
34100   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
34101   return 0;
34102   __pyx_L1_error:;
34103   return -1;
34104 }
34105 
34106 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
34107 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
34108 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
34109 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
34110 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
34111 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
34112 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
34113 
__Pyx_modinit_global_init_code(void)34114 static int __Pyx_modinit_global_init_code(void) {
34115   __Pyx_RefNannyDeclarations
34116   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
34117   /*--- Global init code ---*/
34118   __Pyx_RefNannyFinishContext();
34119   return 0;
34120 }
34121 
__Pyx_modinit_variable_export_code(void)34122 static int __Pyx_modinit_variable_export_code(void) {
34123   __Pyx_RefNannyDeclarations
34124   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
34125   /*--- Variable export code ---*/
34126   __Pyx_RefNannyFinishContext();
34127   return 0;
34128 }
34129 
__Pyx_modinit_function_export_code(void)34130 static int __Pyx_modinit_function_export_code(void) {
34131   __Pyx_RefNannyDeclarations
34132   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
34133   /*--- Function export code ---*/
34134   __Pyx_RefNannyFinishContext();
34135   return 0;
34136 }
34137 
__Pyx_modinit_type_init_code(void)34138 static int __Pyx_modinit_type_init_code(void) {
34139   __Pyx_RefNannyDeclarations
34140   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
34141   /*--- Type init code ---*/
34142   __pyx_vtabptr_5MACS2_2IO_10ScoreTrack_scoreTrackII = &__pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII;
34143   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.set_pseudocount = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_set_pseudocount;
34144   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.enable_trackline = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_enable_trackline;
34145   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.add_chromosome = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, __pyx_t_5numpy_int32_t, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_add_chromosome;
34146   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.add = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_add;
34147   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.finalize = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_finalize;
34148   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.get_data_by_chr = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_get_data_by_chr;
34149   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.get_chr_names = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_get_chr_names;
34150   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.change_normalization_method = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, char, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_change_normalization_method;
34151   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.normalize = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_normalize;
34152   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.change_score_method = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, char, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_change_score_method;
34153   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.compute_pvalue = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_pvalue;
34154   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.compute_qvalue = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_qvalue;
34155   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.make_pq_table = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_make_pq_table;
34156   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.compute_likelihood = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_likelihood;
34157   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.compute_sym_likelihood = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_sym_likelihood;
34158   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.compute_logFE = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_logFE;
34159   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.compute_foldenrichment = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_foldenrichment;
34160   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.compute_subtraction = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_subtraction;
34161   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.compute_SPMR = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_SPMR;
34162   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.compute_max = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_compute_max;
34163   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.write_bedGraph = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph *__pyx_optional_args))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_write_bedGraph;
34164   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.call_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks *__pyx_optional_args))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_peaks;
34165   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.__pyx___close_peak = (PyBoolObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, PyObject *, __pyx_t_5numpy_int32_t, PyObject *, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak *__pyx_optional_args))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak;
34166   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.__pyx___close_peak2 = (PyBoolObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, PyObject *, PyObject *, __pyx_t_5numpy_int32_t, PyObject *, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2 *__pyx_optional_args))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII___close_peak2;
34167   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.total = (__pyx_t_5numpy_int64_t (*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_total;
34168   __pyx_vtable_5MACS2_2IO_10ScoreTrack_scoreTrackII.call_broadpeaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_scoreTrackII *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks *__pyx_optional_args))__pyx_f_5MACS2_2IO_10ScoreTrack_12scoreTrackII_call_broadpeaks;
34169   if (PyType_Ready(&__pyx_type_5MACS2_2IO_10ScoreTrack_scoreTrackII) < 0) __PYX_ERR(0, 399, __pyx_L1_error)
34170   #if PY_VERSION_HEX < 0x030800B1
34171   __pyx_type_5MACS2_2IO_10ScoreTrack_scoreTrackII.tp_print = 0;
34172   #endif
34173   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5MACS2_2IO_10ScoreTrack_scoreTrackII.tp_dictoffset && __pyx_type_5MACS2_2IO_10ScoreTrack_scoreTrackII.tp_getattro == PyObject_GenericGetAttr)) {
34174     __pyx_type_5MACS2_2IO_10ScoreTrack_scoreTrackII.tp_getattro = __Pyx_PyObject_GenericGetAttr;
34175   }
34176   #if CYTHON_COMPILING_IN_CPYTHON
34177   {
34178     PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5MACS2_2IO_10ScoreTrack_scoreTrackII, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 399, __pyx_L1_error)
34179     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
34180       __pyx_wrapperbase_5MACS2_2IO_10ScoreTrack_12scoreTrackII___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
34181       __pyx_wrapperbase_5MACS2_2IO_10ScoreTrack_12scoreTrackII___init__.doc = __pyx_doc_5MACS2_2IO_10ScoreTrack_12scoreTrackII___init__;
34182       ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5MACS2_2IO_10ScoreTrack_12scoreTrackII___init__;
34183     }
34184   }
34185   #endif
34186   if (__Pyx_SetVtable(__pyx_type_5MACS2_2IO_10ScoreTrack_scoreTrackII.tp_dict, __pyx_vtabptr_5MACS2_2IO_10ScoreTrack_scoreTrackII) < 0) __PYX_ERR(0, 399, __pyx_L1_error)
34187   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_scoreTrackII, (PyObject *)&__pyx_type_5MACS2_2IO_10ScoreTrack_scoreTrackII) < 0) __PYX_ERR(0, 399, __pyx_L1_error)
34188   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5MACS2_2IO_10ScoreTrack_scoreTrackII) < 0) __PYX_ERR(0, 399, __pyx_L1_error)
34189   __pyx_ptype_5MACS2_2IO_10ScoreTrack_scoreTrackII = &__pyx_type_5MACS2_2IO_10ScoreTrack_scoreTrackII;
34190   __pyx_vtabptr_5MACS2_2IO_10ScoreTrack_TwoConditionScores = &__pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores;
34191   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.set_pseudocount = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_set_pseudocount;
34192   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.build = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_build;
34193   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.build_chromosome = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_build_chromosome;
34194   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.add_chromosome = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, __pyx_t_5numpy_int32_t))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_add_chromosome;
34195   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.add = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_add;
34196   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.finalize = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_finalize;
34197   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.get_data_by_chr = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_get_data_by_chr;
34198   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.get_chr_names = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_get_chr_names;
34199   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.write_bedGraph = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph *__pyx_optional_args))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_bedGraph;
34200   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.write_matrix = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_write_matrix;
34201   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.call_peaks = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, int __pyx_skip_dispatch, struct __pyx_opt_args_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks *__pyx_optional_args))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_call_peaks;
34202   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.__pyx___add_a_peak = (PyObject *(*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *, PyObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___add_a_peak;
34203   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.mean_from_peakcontent = (__pyx_t_5numpy_float64_t (*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *, PyObject *))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_mean_from_peakcontent;
34204   __pyx_vtable_5MACS2_2IO_10ScoreTrack_TwoConditionScores.total = (__pyx_t_5numpy_int64_t (*)(struct __pyx_obj_5MACS2_2IO_10ScoreTrack_TwoConditionScores *))__pyx_f_5MACS2_2IO_10ScoreTrack_18TwoConditionScores_total;
34205   if (PyType_Ready(&__pyx_type_5MACS2_2IO_10ScoreTrack_TwoConditionScores) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
34206   #if PY_VERSION_HEX < 0x030800B1
34207   __pyx_type_5MACS2_2IO_10ScoreTrack_TwoConditionScores.tp_print = 0;
34208   #endif
34209   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5MACS2_2IO_10ScoreTrack_TwoConditionScores.tp_dictoffset && __pyx_type_5MACS2_2IO_10ScoreTrack_TwoConditionScores.tp_getattro == PyObject_GenericGetAttr)) {
34210     __pyx_type_5MACS2_2IO_10ScoreTrack_TwoConditionScores.tp_getattro = __Pyx_PyObject_GenericGetAttr;
34211   }
34212   #if CYTHON_COMPILING_IN_CPYTHON
34213   {
34214     PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5MACS2_2IO_10ScoreTrack_TwoConditionScores, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1297, __pyx_L1_error)
34215     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
34216       __pyx_wrapperbase_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
34217       __pyx_wrapperbase_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___init__.doc = __pyx_doc_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___init__;
34218       ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5MACS2_2IO_10ScoreTrack_18TwoConditionScores___init__;
34219     }
34220   }
34221   #endif
34222   if (__Pyx_SetVtable(__pyx_type_5MACS2_2IO_10ScoreTrack_TwoConditionScores.tp_dict, __pyx_vtabptr_5MACS2_2IO_10ScoreTrack_TwoConditionScores) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
34223   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TwoConditionScores, (PyObject *)&__pyx_type_5MACS2_2IO_10ScoreTrack_TwoConditionScores) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
34224   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5MACS2_2IO_10ScoreTrack_TwoConditionScores) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
34225   __pyx_ptype_5MACS2_2IO_10ScoreTrack_TwoConditionScores = &__pyx_type_5MACS2_2IO_10ScoreTrack_TwoConditionScores;
34226   __Pyx_RefNannyFinishContext();
34227   return 0;
34228   __pyx_L1_error:;
34229   __Pyx_RefNannyFinishContext();
34230   return -1;
34231 }
34232 
__Pyx_modinit_type_import_code(void)34233 static int __Pyx_modinit_type_import_code(void) {
34234   __Pyx_RefNannyDeclarations
34235   PyObject *__pyx_t_1 = NULL;
34236   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
34237   /*--- Type import code ---*/
34238   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
34239   __Pyx_GOTREF(__pyx_t_1);
34240   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
34241   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
34242   sizeof(PyTypeObject),
34243   #else
34244   sizeof(PyHeapTypeObject),
34245   #endif
34246   __Pyx_ImportType_CheckSize_Warn);
34247    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
34248   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34249   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 8, __pyx_L1_error)
34250   __Pyx_GOTREF(__pyx_t_1);
34251   __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
34252    if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(4, 8, __pyx_L1_error)
34253   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34254   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 15, __pyx_L1_error)
34255   __Pyx_GOTREF(__pyx_t_1);
34256   __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
34257    if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(5, 15, __pyx_L1_error)
34258   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34259   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
34260   __Pyx_GOTREF(__pyx_t_1);
34261   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
34262    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
34263   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
34264    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
34265   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
34266    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
34267   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
34268    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
34269   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
34270    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
34271   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34272   __Pyx_RefNannyFinishContext();
34273   return 0;
34274   __pyx_L1_error:;
34275   __Pyx_XDECREF(__pyx_t_1);
34276   __Pyx_RefNannyFinishContext();
34277   return -1;
34278 }
34279 
__Pyx_modinit_variable_import_code(void)34280 static int __Pyx_modinit_variable_import_code(void) {
34281   __Pyx_RefNannyDeclarations
34282   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
34283   /*--- Variable import code ---*/
34284   __Pyx_RefNannyFinishContext();
34285   return 0;
34286 }
34287 
__Pyx_modinit_function_import_code(void)34288 static int __Pyx_modinit_function_import_code(void) {
34289   __Pyx_RefNannyDeclarations
34290   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
34291   /*--- Function import code ---*/
34292   __Pyx_RefNannyFinishContext();
34293   return 0;
34294 }
34295 
34296 
34297 #if PY_MAJOR_VERSION < 3
34298 #ifdef CYTHON_NO_PYINIT_EXPORT
34299 #define __Pyx_PyMODINIT_FUNC void
34300 #else
34301 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
34302 #endif
34303 #else
34304 #ifdef CYTHON_NO_PYINIT_EXPORT
34305 #define __Pyx_PyMODINIT_FUNC PyObject *
34306 #else
34307 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
34308 #endif
34309 #endif
34310 
34311 
34312 #if PY_MAJOR_VERSION < 3
34313 __Pyx_PyMODINIT_FUNC initScoreTrack(void) CYTHON_SMALL_CODE; /*proto*/
initScoreTrack(void)34314 __Pyx_PyMODINIT_FUNC initScoreTrack(void)
34315 #else
34316 __Pyx_PyMODINIT_FUNC PyInit_ScoreTrack(void) CYTHON_SMALL_CODE; /*proto*/
34317 __Pyx_PyMODINIT_FUNC PyInit_ScoreTrack(void)
34318 #if CYTHON_PEP489_MULTI_PHASE_INIT
34319 {
34320   return PyModuleDef_Init(&__pyx_moduledef);
34321 }
34322 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
34323     #if PY_VERSION_HEX >= 0x030700A1
34324     static PY_INT64_T main_interpreter_id = -1;
34325     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
34326     if (main_interpreter_id == -1) {
34327         main_interpreter_id = current_id;
34328         return (unlikely(current_id == -1)) ? -1 : 0;
34329     } else if (unlikely(main_interpreter_id != current_id))
34330     #else
34331     static PyInterpreterState *main_interpreter = NULL;
34332     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
34333     if (!main_interpreter) {
34334         main_interpreter = current_interpreter;
34335     } else if (unlikely(main_interpreter != current_interpreter))
34336     #endif
34337     {
34338         PyErr_SetString(
34339             PyExc_ImportError,
34340             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
34341         return -1;
34342     }
34343     return 0;
34344 }
34345 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
34346     PyObject *value = PyObject_GetAttrString(spec, from_name);
34347     int result = 0;
34348     if (likely(value)) {
34349         if (allow_none || value != Py_None) {
34350             result = PyDict_SetItemString(moddict, to_name, value);
34351         }
34352         Py_DECREF(value);
34353     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
34354         PyErr_Clear();
34355     } else {
34356         result = -1;
34357     }
34358     return result;
34359 }
34360 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
34361     PyObject *module = NULL, *moddict, *modname;
34362     if (__Pyx_check_single_interpreter())
34363         return NULL;
34364     if (__pyx_m)
34365         return __Pyx_NewRef(__pyx_m);
34366     modname = PyObject_GetAttrString(spec, "name");
34367     if (unlikely(!modname)) goto bad;
34368     module = PyModule_NewObject(modname);
34369     Py_DECREF(modname);
34370     if (unlikely(!module)) goto bad;
34371     moddict = PyModule_GetDict(module);
34372     if (unlikely(!moddict)) goto bad;
34373     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
34374     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
34375     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
34376     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
34377     return module;
34378 bad:
34379     Py_XDECREF(module);
34380     return NULL;
34381 }
34382 
34383 
34384 static CYTHON_SMALL_CODE int __pyx_pymod_exec_ScoreTrack(PyObject *__pyx_pyinit_module)
34385 #endif
34386 #endif
34387 {
34388   __Pyx_TraceDeclarations
34389   PyObject *__pyx_t_1 = NULL;
34390   PyObject *__pyx_t_2 = NULL;
34391   __Pyx_RefNannyDeclarations
34392   #if CYTHON_PEP489_MULTI_PHASE_INIT
34393   if (__pyx_m) {
34394     if (__pyx_m == __pyx_pyinit_module) return 0;
34395     PyErr_SetString(PyExc_RuntimeError, "Module 'ScoreTrack' has already been imported. Re-initialisation is not supported.");
34396     return -1;
34397   }
34398   #elif PY_MAJOR_VERSION >= 3
34399   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
34400   #endif
34401   #if CYTHON_REFNANNY
34402 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
34403 if (!__Pyx_RefNanny) {
34404   PyErr_Clear();
34405   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
34406   if (!__Pyx_RefNanny)
34407       Py_FatalError("failed to import 'refnanny' module");
34408 }
34409 #endif
34410   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_ScoreTrack(void)", 0);
34411   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34412   #ifdef __Pxy_PyFrame_Initialize_Offsets
34413   __Pxy_PyFrame_Initialize_Offsets();
34414   #endif
34415   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
34416   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
34417   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
34418   #ifdef __Pyx_CyFunction_USED
34419   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34420   #endif
34421   #ifdef __Pyx_FusedFunction_USED
34422   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34423   #endif
34424   #ifdef __Pyx_Coroutine_USED
34425   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34426   #endif
34427   #ifdef __Pyx_Generator_USED
34428   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34429   #endif
34430   #ifdef __Pyx_AsyncGen_USED
34431   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34432   #endif
34433   #ifdef __Pyx_StopAsyncIteration_USED
34434   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34435   #endif
34436   /*--- Library function declarations ---*/
34437   /*--- Threads initialization code ---*/
34438   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
34439   #ifdef WITH_THREAD /* Python build with threading support? */
34440   PyEval_InitThreads();
34441   #endif
34442   #endif
34443   /*--- Module creation code ---*/
34444   #if CYTHON_PEP489_MULTI_PHASE_INIT
34445   __pyx_m = __pyx_pyinit_module;
34446   Py_INCREF(__pyx_m);
34447   #else
34448   #if PY_MAJOR_VERSION < 3
34449   __pyx_m = Py_InitModule4("ScoreTrack", __pyx_methods, __pyx_k_Module_for_Feature_IO_classes_Th, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
34450   #else
34451   __pyx_m = PyModule_Create(&__pyx_moduledef);
34452   #endif
34453   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
34454   #endif
34455   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
34456   Py_INCREF(__pyx_d);
34457   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
34458   Py_INCREF(__pyx_b);
34459   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
34460   Py_INCREF(__pyx_cython_runtime);
34461   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
34462   /*--- Initialize various global constants etc. ---*/
34463   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34464   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
34465   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34466   #endif
34467   if (__pyx_module_is_main_MACS2__IO__ScoreTrack) {
34468     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34469   }
34470   #if PY_MAJOR_VERSION >= 3
34471   {
34472     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
34473     if (!PyDict_GetItemString(modules, "MACS2.IO.ScoreTrack")) {
34474       if (unlikely(PyDict_SetItemString(modules, "MACS2.IO.ScoreTrack", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
34475     }
34476   }
34477   #endif
34478   /*--- Builtin init code ---*/
34479   if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
34480   /*--- Constants init code ---*/
34481   if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
34482   /*--- Global type/function init code ---*/
34483   (void)__Pyx_modinit_global_init_code();
34484   (void)__Pyx_modinit_variable_export_code();
34485   (void)__Pyx_modinit_function_export_code();
34486   if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
34487   if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
34488   (void)__Pyx_modinit_variable_import_code();
34489   (void)__Pyx_modinit_function_import_code();
34490   /*--- Execution code ---*/
34491   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
34492   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34493   #endif
34494   __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_ScoreTrack(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
34495 
34496   /* "MACS2/IO/ScoreTrack.pyx":15
34497  * # python modules
34498  * # ------------------------------------
34499  * import numpy as np             # <<<<<<<<<<<<<<
34500  * cimport numpy as np
34501  * from numpy cimport uint8_t, uint16_t, uint32_t, uint64_t, int8_t, int16_t, int32_t, int64_t, float32_t, float64_t
34502  */
34503   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
34504   __Pyx_GOTREF(__pyx_t_1);
34505   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
34506   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34507 
34508   /* "MACS2/IO/ScoreTrack.pyx":26
34509  * #ctypedef np.uint32_t uint32_t
34510  *
34511  * from copy import copy             # <<<<<<<<<<<<<<
34512  * from functools import reduce
34513  *
34514  */
34515   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
34516   __Pyx_GOTREF(__pyx_t_1);
34517   __Pyx_INCREF(__pyx_n_s_copy);
34518   __Pyx_GIVEREF(__pyx_n_s_copy);
34519   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_copy);
34520   __pyx_t_2 = __Pyx_Import(__pyx_n_s_copy, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
34521   __Pyx_GOTREF(__pyx_t_2);
34522   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34523   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
34524   __Pyx_GOTREF(__pyx_t_1);
34525   if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
34526   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34527   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34528 
34529   /* "MACS2/IO/ScoreTrack.pyx":27
34530  *
34531  * from copy import copy
34532  * from functools import reduce             # <<<<<<<<<<<<<<
34533  *
34534  * from cpython cimport bool
34535  */
34536   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
34537   __Pyx_GOTREF(__pyx_t_2);
34538   __Pyx_INCREF(__pyx_n_s_reduce);
34539   __Pyx_GIVEREF(__pyx_n_s_reduce);
34540   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_reduce);
34541   __pyx_t_1 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
34542   __Pyx_GOTREF(__pyx_t_1);
34543   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34544   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_reduce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
34545   __Pyx_GOTREF(__pyx_t_2);
34546   if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
34547   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34548   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34549 
34550   /* "MACS2/IO/ScoreTrack.pyx":31
34551  * from cpython cimport bool
34552  *
34553  * from MACS2.Signal import maxima, enforce_valleys, enforce_peakyness             # <<<<<<<<<<<<<<
34554  *
34555  * cimport cython
34556  */
34557   __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
34558   __Pyx_GOTREF(__pyx_t_1);
34559   __Pyx_INCREF(__pyx_n_s_maxima);
34560   __Pyx_GIVEREF(__pyx_n_s_maxima);
34561   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_maxima);
34562   __Pyx_INCREF(__pyx_n_s_enforce_valleys);
34563   __Pyx_GIVEREF(__pyx_n_s_enforce_valleys);
34564   PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_enforce_valleys);
34565   __Pyx_INCREF(__pyx_n_s_enforce_peakyness);
34566   __Pyx_GIVEREF(__pyx_n_s_enforce_peakyness);
34567   PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_enforce_peakyness);
34568   __pyx_t_2 = __Pyx_Import(__pyx_n_s_MACS2_Signal, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
34569   __Pyx_GOTREF(__pyx_t_2);
34570   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34571   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_maxima); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
34572   __Pyx_GOTREF(__pyx_t_1);
34573   if (PyDict_SetItem(__pyx_d, __pyx_n_s_maxima, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
34574   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34575   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_enforce_valleys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
34576   __Pyx_GOTREF(__pyx_t_1);
34577   if (PyDict_SetItem(__pyx_d, __pyx_n_s_enforce_valleys, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
34578   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34579   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_enforce_peakyness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
34580   __Pyx_GOTREF(__pyx_t_1);
34581   if (PyDict_SetItem(__pyx_d, __pyx_n_s_enforce_peakyness, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
34582   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34583   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34584 
34585   /* "MACS2/IO/ScoreTrack.pyx":37
34586  * from libc.math cimport log10,log, floor, ceil
34587  *
34588  * from MACS2.Constants import BYTE4, FBYTE4, array             # <<<<<<<<<<<<<<
34589  * from MACS2.Prob import poisson_cdf
34590  * from MACS2.IO.PeakIO import PeakIO, BroadPeakIO, parse_peakname
34591  */
34592   __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
34593   __Pyx_GOTREF(__pyx_t_2);
34594   __Pyx_INCREF(__pyx_n_s_BYTE4);
34595   __Pyx_GIVEREF(__pyx_n_s_BYTE4);
34596   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BYTE4);
34597   __Pyx_INCREF(__pyx_n_s_FBYTE4);
34598   __Pyx_GIVEREF(__pyx_n_s_FBYTE4);
34599   PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_FBYTE4);
34600   __Pyx_INCREF(__pyx_n_s_array);
34601   __Pyx_GIVEREF(__pyx_n_s_array);
34602   PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_array);
34603   __pyx_t_1 = __Pyx_Import(__pyx_n_s_MACS2_Constants, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
34604   __Pyx_GOTREF(__pyx_t_1);
34605   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34606   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BYTE4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
34607   __Pyx_GOTREF(__pyx_t_2);
34608   if (PyDict_SetItem(__pyx_d, __pyx_n_s_BYTE4, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
34609   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34610   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_FBYTE4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
34611   __Pyx_GOTREF(__pyx_t_2);
34612   if (PyDict_SetItem(__pyx_d, __pyx_n_s_FBYTE4, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
34613   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34614   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
34615   __Pyx_GOTREF(__pyx_t_2);
34616   if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
34617   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34618   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34619 
34620   /* "MACS2/IO/ScoreTrack.pyx":38
34621  *
34622  * from MACS2.Constants import BYTE4, FBYTE4, array
34623  * from MACS2.Prob import poisson_cdf             # <<<<<<<<<<<<<<
34624  * from MACS2.IO.PeakIO import PeakIO, BroadPeakIO, parse_peakname
34625  *
34626  */
34627   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
34628   __Pyx_GOTREF(__pyx_t_1);
34629   __Pyx_INCREF(__pyx_n_s_poisson_cdf);
34630   __Pyx_GIVEREF(__pyx_n_s_poisson_cdf);
34631   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_poisson_cdf);
34632   __pyx_t_2 = __Pyx_Import(__pyx_n_s_MACS2_Prob, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
34633   __Pyx_GOTREF(__pyx_t_2);
34634   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34635   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_poisson_cdf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
34636   __Pyx_GOTREF(__pyx_t_1);
34637   if (PyDict_SetItem(__pyx_d, __pyx_n_s_poisson_cdf, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
34638   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34639   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34640 
34641   /* "MACS2/IO/ScoreTrack.pyx":39
34642  * from MACS2.Constants import BYTE4, FBYTE4, array
34643  * from MACS2.Prob import poisson_cdf
34644  * from MACS2.IO.PeakIO import PeakIO, BroadPeakIO, parse_peakname             # <<<<<<<<<<<<<<
34645  *
34646  * import logging
34647  */
34648   __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
34649   __Pyx_GOTREF(__pyx_t_2);
34650   __Pyx_INCREF(__pyx_n_s_PeakIO);
34651   __Pyx_GIVEREF(__pyx_n_s_PeakIO);
34652   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PeakIO);
34653   __Pyx_INCREF(__pyx_n_s_BroadPeakIO);
34654   __Pyx_GIVEREF(__pyx_n_s_BroadPeakIO);
34655   PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_BroadPeakIO);
34656   __Pyx_INCREF(__pyx_n_s_parse_peakname);
34657   __Pyx_GIVEREF(__pyx_n_s_parse_peakname);
34658   PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_parse_peakname);
34659   __pyx_t_1 = __Pyx_Import(__pyx_n_s_MACS2_IO_PeakIO, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
34660   __Pyx_GOTREF(__pyx_t_1);
34661   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34662   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PeakIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
34663   __Pyx_GOTREF(__pyx_t_2);
34664   if (PyDict_SetItem(__pyx_d, __pyx_n_s_PeakIO, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
34665   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34666   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BroadPeakIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
34667   __Pyx_GOTREF(__pyx_t_2);
34668   if (PyDict_SetItem(__pyx_d, __pyx_n_s_BroadPeakIO, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
34669   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34670   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_parse_peakname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
34671   __Pyx_GOTREF(__pyx_t_2);
34672   if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_peakname, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
34673   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34674   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34675 
34676   /* "MACS2/IO/ScoreTrack.pyx":41
34677  * from MACS2.IO.PeakIO import PeakIO, BroadPeakIO, parse_peakname
34678  *
34679  * import logging             # <<<<<<<<<<<<<<
34680  *
34681  * # ------------------------------------
34682  */
34683   __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
34684   __Pyx_GOTREF(__pyx_t_1);
34685   if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
34686   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34687 
34688   /* "MACS2/IO/ScoreTrack.pyx":46
34689  * # constants
34690  * # ------------------------------------
34691  * __version__ = "scoreTrackI $Revision$"             # <<<<<<<<<<<<<<
34692  * __author__ = "Tao Liu <vladimir.liu@gmail.com>"
34693  * __doc__ = "scoreTrack classes"
34694  */
34695   if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_u_scoreTrackI_Revision) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
34696 
34697   /* "MACS2/IO/ScoreTrack.pyx":47
34698  * # ------------------------------------
34699  * __version__ = "scoreTrackI $Revision$"
34700  * __author__ = "Tao Liu <vladimir.liu@gmail.com>"             # <<<<<<<<<<<<<<
34701  * __doc__ = "scoreTrack classes"
34702  *
34703  */
34704   if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_u_Tao_Liu_vladimir_liu_gmail_com) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
34705 
34706   /* "MACS2/IO/ScoreTrack.pyx":48
34707  * __version__ = "scoreTrackI $Revision$"
34708  * __author__ = "Tao Liu <vladimir.liu@gmail.com>"
34709  * __doc__ = "scoreTrack classes"             # <<<<<<<<<<<<<<
34710  *
34711  * # ------------------------------------
34712  */
34713   if (PyDict_SetItem(__pyx_d, __pyx_n_s_doc, __pyx_kp_u_scoreTrack_classes) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
34714 
34715   /* "MACS2/IO/ScoreTrack.pyx":56
34716  * cdef inline int32_t int_min(int32_t a, int32_t b): return a if a <= b else b
34717  *
34718  * LOG10_E = 0.43429448190325176             # <<<<<<<<<<<<<<
34719  *
34720  * pscore_dict = dict()
34721  */
34722   if (PyDict_SetItem(__pyx_d, __pyx_n_s_LOG10_E, __pyx_float_0_43429448190325176) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
34723 
34724   /* "MACS2/IO/ScoreTrack.pyx":58
34725  * LOG10_E = 0.43429448190325176
34726  *
34727  * pscore_dict = dict()             # <<<<<<<<<<<<<<
34728  *
34729  * cdef float64_t get_pscore ( int32_t observed, float64_t expectation ):
34730  */
34731   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
34732   __Pyx_GOTREF(__pyx_t_1);
34733   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pscore_dict, __pyx_t_1) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
34734   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34735 
34736   /* "MACS2/IO/ScoreTrack.pyx":76
34737  *         return score
34738  *
34739  * asym_logLR_dict = dict()             # <<<<<<<<<<<<<<
34740  *
34741  * cdef float64_t logLR_asym ( float64_t x, float64_t y ):
34742  */
34743   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
34744   __Pyx_GOTREF(__pyx_t_1);
34745   if (PyDict_SetItem(__pyx_d, __pyx_n_s_asym_logLR_dict, __pyx_t_1) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
34746   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34747 
34748   /* "MACS2/IO/ScoreTrack.pyx":100
34749  *         return s
34750  *
34751  * sym_logLR_dict = dict()             # <<<<<<<<<<<<<<
34752  *
34753  * cdef float64_t logLR_sym ( float64_t x, float64_t y ):
34754  */
34755   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
34756   __Pyx_GOTREF(__pyx_t_1);
34757   if (PyDict_SetItem(__pyx_d, __pyx_n_s_sym_logLR_dict, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
34758   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34759 
34760   /* "MACS2/IO/ScoreTrack.pyx":138
34761  * # ------------------------------------
34762  *
34763  * class CombinedTwoTrack:             # <<<<<<<<<<<<<<
34764  *     """ For differential peak calling.
34765  *
34766  */
34767   __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_CombinedTwoTrack, __pyx_n_s_CombinedTwoTrack, (PyObject *) NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_kp_s_For_differential_peak_calling); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
34768   __Pyx_GOTREF(__pyx_t_1);
34769 
34770   /* "MACS2/IO/ScoreTrack.pyx":142
34771  *
34772  *     """
34773  *     def __init__ (self):             # <<<<<<<<<<<<<<
34774  *         """Different with bedGraphTrackI, missing values are simply
34775  *         replaced with 0.
34776  */
34777   __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_1__init__, 0, __pyx_n_s_CombinedTwoTrack___init, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
34778   __Pyx_GOTREF(__pyx_t_2);
34779   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
34780   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34781 
34782   /* "MACS2/IO/ScoreTrack.pyx":150
34783  *         self.pointer = {}
34784  *
34785  *     def add_chromosome ( self, bytes chrom, int32_t chrom_max_len ):             # <<<<<<<<<<<<<<
34786  *         if chrom not in self.data:
34787  *             self.data[chrom] = np.zeros(chrom_max_len,dtype=[('pos','int32'),
34788  */
34789   __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_3add_chromosome, 0, __pyx_n_s_CombinedTwoTrack_add_chromosome, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
34790   __Pyx_GOTREF(__pyx_t_2);
34791   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_add_chromosome, __pyx_t_2) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
34792   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34793 
34794   /* "MACS2/IO/ScoreTrack.pyx":158
34795  *             self.pointer[chrom] = 0
34796  *
34797  *     def add ( self, bytes chromosome, int32_t endpos, float64_t V1, float64_t V2 ):             # <<<<<<<<<<<<<<
34798  *         """Add a chr-endpos-sample-control block into data
34799  *         dictionary. At the mean time, calculate pvalues.
34800  */
34801   __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_5add, 0, __pyx_n_s_CombinedTwoTrack_add, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
34802   __Pyx_GOTREF(__pyx_t_2);
34803   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_add, __pyx_t_2) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
34804   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34805 
34806   /* "MACS2/IO/ScoreTrack.pyx":173
34807  *         self.pointer[chromosome] += 1
34808  *
34809  *     def finalize ( self ):             # <<<<<<<<<<<<<<
34810  *         cdef bytes chrom
34811  *
34812  */
34813   __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_7finalize, 0, __pyx_n_s_CombinedTwoTrack_finalize, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
34814   __Pyx_GOTREF(__pyx_t_2);
34815   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_finalize, __pyx_t_2) < 0) __PYX_ERR(0, 173, __pyx_L1_error)
34816   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34817 
34818   /* "MACS2/IO/ScoreTrack.pyx":181
34819  *             d.resize(l,refcheck=False)
34820  *
34821  *     def get_data_by_chr (self, bytes chromosome):             # <<<<<<<<<<<<<<
34822  *         """Return array of counts by chromosome.
34823  *
34824  */
34825   __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_9get_data_by_chr, 0, __pyx_n_s_CombinedTwoTrack_get_data_by_chr, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
34826   __Pyx_GOTREF(__pyx_t_2);
34827   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_get_data_by_chr, __pyx_t_2) < 0) __PYX_ERR(0, 181, __pyx_L1_error)
34828   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34829 
34830   /* "MACS2/IO/ScoreTrack.pyx":192
34831  *             return None
34832  *
34833  *     def get_chr_names (self):             # <<<<<<<<<<<<<<
34834  *         """Return all the chromosome names stored.
34835  *
34836  */
34837   __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_11get_chr_names, 0, __pyx_n_s_CombinedTwoTrack_get_chr_names, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
34838   __Pyx_GOTREF(__pyx_t_2);
34839   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_get_chr_names, __pyx_t_2) < 0) __PYX_ERR(0, 192, __pyx_L1_error)
34840   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34841 
34842   /* "MACS2/IO/ScoreTrack.pyx":201
34843  *         return l
34844  *
34845  *     def write_bedGraph (self, fhd, str name, str description, str colname):             # <<<<<<<<<<<<<<
34846  *         """Write all data to fhd in Wiggle Format.
34847  *
34848  */
34849   __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_13write_bedGraph, 0, __pyx_n_s_CombinedTwoTrack_write_bedGraph, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
34850   __Pyx_GOTREF(__pyx_t_2);
34851   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_write_bedGraph, __pyx_t_2) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
34852   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34853 
34854   /* "MACS2/IO/ScoreTrack.pyx":233
34855  *         return True
34856  *
34857  *     def total ( self ):             # <<<<<<<<<<<<<<
34858  *         """Return the number of regions in this object.
34859  *
34860  */
34861   __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_15total, 0, __pyx_n_s_CombinedTwoTrack_total, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
34862   __Pyx_GOTREF(__pyx_t_2);
34863   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_total, __pyx_t_2) < 0) __PYX_ERR(0, 233, __pyx_L1_error)
34864   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34865 
34866   /* "MACS2/IO/ScoreTrack.pyx":246
34867  *         return t
34868  *
34869  *     def extract_value ( self, bdgTrack2 ):             # <<<<<<<<<<<<<<
34870  *         """It's like overlie function. THe overlapped regions between
34871  *         bdgTrack2 and self, will be recorded. The values from self in
34872  */
34873   __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_17extract_value, 0, __pyx_n_s_CombinedTwoTrack_extract_value, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
34874   __Pyx_GOTREF(__pyx_t_2);
34875   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_extract_value, __pyx_t_2) < 0) __PYX_ERR(0, 246, __pyx_L1_error)
34876   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34877 
34878   /* "MACS2/IO/ScoreTrack.pyx":337
34879  *         return ret
34880  *
34881  *     def extract_average (self, bdgTrack2):             # <<<<<<<<<<<<<<
34882  *         cdef:
34883  *             int32_t i, l
34884  */
34885   __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_19extract_average, 0, __pyx_n_s_CombinedTwoTrack_extract_average, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
34886   __Pyx_GOTREF(__pyx_t_2);
34887   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_extract_average, __pyx_t_2) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
34888   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34889 
34890   /* "MACS2/IO/ScoreTrack.pyx":367
34891  *         return ret
34892  *
34893  *     def extract_sum (self, bdgTrack2):             # <<<<<<<<<<<<<<
34894  *         """Get sum values in each region defined in bdgTrack2.
34895  *
34896  */
34897   __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_16CombinedTwoTrack_21extract_sum, 0, __pyx_n_s_CombinedTwoTrack_extract_sum, NULL, __pyx_n_s_MACS2_IO_ScoreTrack, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
34898   __Pyx_GOTREF(__pyx_t_2);
34899   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_extract_sum, __pyx_t_2) < 0) __PYX_ERR(0, 367, __pyx_L1_error)
34900   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34901 
34902   /* "MACS2/IO/ScoreTrack.pyx":138
34903  * # ------------------------------------
34904  *
34905  * class CombinedTwoTrack:             # <<<<<<<<<<<<<<
34906  *     """ For differential peak calling.
34907  *
34908  */
34909   __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_CombinedTwoTrack, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error)
34910   __Pyx_GOTREF(__pyx_t_2);
34911   if (PyDict_SetItem(__pyx_d, __pyx_n_s_CombinedTwoTrack, __pyx_t_2) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
34912   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34913   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34914 
34915   /* "(tree fragment)":1
34916  * def __pyx_unpickle_scoreTrackII(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
34917  *     cdef object __pyx_PickleError
34918  *     cdef object __pyx_result
34919  */
34920   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_1__pyx_unpickle_scoreTrackII, NULL, __pyx_n_s_MACS2_IO_ScoreTrack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
34921   __Pyx_GOTREF(__pyx_t_1);
34922   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_scoreTrackII, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
34923   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34924 
34925   /* "(tree fragment)":11
34926  *         __pyx_unpickle_scoreTrackII__set_state(<scoreTrackII> __pyx_result, __pyx_state)
34927  *     return __pyx_result
34928  * cdef __pyx_unpickle_scoreTrackII__set_state(scoreTrackII __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
34929  *     __pyx_result.ctrl_edm = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.data = __pyx_state[2]; __pyx_result.data_stderr = __pyx_state[3]; __pyx_result.datalength = __pyx_state[4]; __pyx_result.normalization_method = __pyx_state[5]; __pyx_result.pseudocount = __pyx_state[6]; __pyx_result.pvalue_stat = __pyx_state[7]; __pyx_result.scoring_method = __pyx_state[8]; __pyx_result.stderr_on = __pyx_state[9]; __pyx_result.trackline = __pyx_state[10]; __pyx_result.treat_edm = __pyx_state[11]
34930  *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):
34931  */
34932   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5MACS2_2IO_10ScoreTrack_3__pyx_unpickle_TwoConditionScores, NULL, __pyx_n_s_MACS2_IO_ScoreTrack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
34933   __Pyx_GOTREF(__pyx_t_1);
34934   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_TwoConditionScore, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
34935   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34936 
34937   /* "MACS2/IO/ScoreTrack.pyx":1
34938  * # cython: language_level=3             # <<<<<<<<<<<<<<
34939  * # cython: profile=True
34940  * # Time-stamp: <2019-10-30 16:33:06 taoliu>
34941  */
34942   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
34943   __Pyx_GOTREF(__pyx_t_1);
34944   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34945   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34946 
34947   /* "../../../Codes/TLPython3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1046
34948  *         raise ImportError("numpy.core.umath failed to import")
34949  *
34950  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
34951  *     try:
34952  *         _import_umath()
34953  */
34954   __Pyx_TraceReturn(Py_None, 0);
34955 
34956   /*--- Wrapped vars code ---*/
34957 
34958   goto __pyx_L0;
34959   __pyx_L1_error:;
34960   __Pyx_XDECREF(__pyx_t_1);
34961   __Pyx_XDECREF(__pyx_t_2);
34962   if (__pyx_m) {
34963     if (__pyx_d) {
34964       __Pyx_AddTraceback("init MACS2.IO.ScoreTrack", __pyx_clineno, __pyx_lineno, __pyx_filename);
34965     }
34966     Py_CLEAR(__pyx_m);
34967   } else if (!PyErr_Occurred()) {
34968     PyErr_SetString(PyExc_ImportError, "init MACS2.IO.ScoreTrack");
34969   }
34970   __pyx_L0:;
34971   __Pyx_RefNannyFinishContext();
34972   #if CYTHON_PEP489_MULTI_PHASE_INIT
34973   return (__pyx_m != NULL) ? 0 : -1;
34974   #elif PY_MAJOR_VERSION >= 3
34975   return __pyx_m;
34976   #else
34977   return;
34978   #endif
34979 }
34980 
34981 /* --- Runtime support code --- */
34982 /* Refnanny */
34983 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)34984 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
34985     PyObject *m = NULL, *p = NULL;
34986     void *r = NULL;
34987     m = PyImport_ImportModule(modname);
34988     if (!m) goto end;
34989     p = PyObject_GetAttrString(m, "RefNannyAPI");
34990     if (!p) goto end;
34991     r = PyLong_AsVoidPtr(p);
34992 end:
34993     Py_XDECREF(p);
34994     Py_XDECREF(m);
34995     return (__Pyx_RefNannyAPIStruct *)r;
34996 }
34997 #endif
34998 
34999 /* PyObjectGetAttrStr */
35000 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)35001 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
35002     PyTypeObject* tp = Py_TYPE(obj);
35003     if (likely(tp->tp_getattro))
35004         return tp->tp_getattro(obj, attr_name);
35005 #if PY_MAJOR_VERSION < 3
35006     if (likely(tp->tp_getattr))
35007         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
35008 #endif
35009     return PyObject_GetAttr(obj, attr_name);
35010 }
35011 #endif
35012 
35013 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)35014 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
35015     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
35016     if (unlikely(!result)) {
35017         PyErr_Format(PyExc_NameError,
35018 #if PY_MAJOR_VERSION >= 3
35019             "name '%U' is not defined", name);
35020 #else
35021             "name '%.200s' is not defined", PyString_AS_STRING(name));
35022 #endif
35023     }
35024     return result;
35025 }
35026 
35027 /* PyErrFetchRestore */
35028 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)35029 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
35030     PyObject *tmp_type, *tmp_value, *tmp_tb;
35031     tmp_type = tstate->curexc_type;
35032     tmp_value = tstate->curexc_value;
35033     tmp_tb = tstate->curexc_traceback;
35034     tstate->curexc_type = type;
35035     tstate->curexc_value = value;
35036     tstate->curexc_traceback = tb;
35037     Py_XDECREF(tmp_type);
35038     Py_XDECREF(tmp_value);
35039     Py_XDECREF(tmp_tb);
35040 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)35041 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
35042     *type = tstate->curexc_type;
35043     *value = tstate->curexc_value;
35044     *tb = tstate->curexc_traceback;
35045     tstate->curexc_type = 0;
35046     tstate->curexc_value = 0;
35047     tstate->curexc_traceback = 0;
35048 }
35049 #endif
35050 
35051 /* Profile */
35052 #if CYTHON_PROFILE
__Pyx_TraceSetupAndCall(PyCodeObject ** code,PyFrameObject ** frame,PyThreadState * tstate,const char * funcname,const char * srcfile,int firstlineno)35053 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
35054                                    PyFrameObject** frame,
35055                                    PyThreadState* tstate,
35056                                    const char *funcname,
35057                                    const char *srcfile,
35058                                    int firstlineno) {
35059     PyObject *type, *value, *traceback;
35060     int retval;
35061     if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
35062         if (*code == NULL) {
35063             *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
35064             if (*code == NULL) return 0;
35065         }
35066         *frame = PyFrame_New(
35067             tstate,                          /*PyThreadState *tstate*/
35068             *code,                           /*PyCodeObject *code*/
35069             __pyx_d,                  /*PyObject *globals*/
35070             0                                /*PyObject *locals*/
35071         );
35072         if (*frame == NULL) return 0;
35073         if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
35074             Py_INCREF(Py_None);
35075             (*frame)->f_trace = Py_None;
35076         }
35077 #if PY_VERSION_HEX < 0x030400B1
35078     } else {
35079         (*frame)->f_tstate = tstate;
35080 #endif
35081     }
35082       __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
35083     retval = 1;
35084     tstate->tracing++;
35085     tstate->use_tracing = 0;
35086     __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
35087     #if CYTHON_TRACE
35088     if (tstate->c_tracefunc)
35089         retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
35090     if (retval && tstate->c_profilefunc)
35091     #endif
35092         retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
35093     tstate->use_tracing = (tstate->c_profilefunc ||
35094                            (CYTHON_TRACE && tstate->c_tracefunc));
35095     tstate->tracing--;
35096     if (retval) {
35097         __Pyx_ErrRestoreInState(tstate, type, value, traceback);
35098         return tstate->use_tracing && retval;
35099     } else {
35100         Py_XDECREF(type);
35101         Py_XDECREF(value);
35102         Py_XDECREF(traceback);
35103         return -1;
35104     }
35105 }
__Pyx_createFrameCodeObject(const char * funcname,const char * srcfile,int firstlineno)35106 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
35107     PyCodeObject *py_code = 0;
35108 #if PY_MAJOR_VERSION >= 3
35109     py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
35110     if (likely(py_code)) {
35111         py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
35112     }
35113 #else
35114     PyObject *py_srcfile = 0;
35115     PyObject *py_funcname = 0;
35116     py_funcname = PyString_FromString(funcname);
35117     if (unlikely(!py_funcname)) goto bad;
35118     py_srcfile = PyString_FromString(srcfile);
35119     if (unlikely(!py_srcfile)) goto bad;
35120     py_code = PyCode_New(
35121         0,
35122         0,
35123         0,
35124         CO_OPTIMIZED | CO_NEWLOCALS,
35125         __pyx_empty_bytes,     /*PyObject *code,*/
35126         __pyx_empty_tuple,     /*PyObject *consts,*/
35127         __pyx_empty_tuple,     /*PyObject *names,*/
35128         __pyx_empty_tuple,     /*PyObject *varnames,*/
35129         __pyx_empty_tuple,     /*PyObject *freevars,*/
35130         __pyx_empty_tuple,     /*PyObject *cellvars,*/
35131         py_srcfile,       /*PyObject *filename,*/
35132         py_funcname,      /*PyObject *name,*/
35133         firstlineno,
35134         __pyx_empty_bytes      /*PyObject *lnotab*/
35135     );
35136 bad:
35137     Py_XDECREF(py_srcfile);
35138     Py_XDECREF(py_funcname);
35139 #endif
35140     return py_code;
35141 }
35142 #endif
35143 
35144 /* WriteUnraisableException */
__Pyx_WriteUnraisable(const char * name,CYTHON_UNUSED int clineno,CYTHON_UNUSED int lineno,CYTHON_UNUSED const char * filename,int full_traceback,CYTHON_UNUSED int nogil)35145 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
35146                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
35147                                   int full_traceback, CYTHON_UNUSED int nogil) {
35148     PyObject *old_exc, *old_val, *old_tb;
35149     PyObject *ctx;
35150     __Pyx_PyThreadState_declare
35151 #ifdef WITH_THREAD
35152     PyGILState_STATE state;
35153     if (nogil)
35154         state = PyGILState_Ensure();
35155 #ifdef _MSC_VER
35156     else state = (PyGILState_STATE)-1;
35157 #endif
35158 #endif
35159     __Pyx_PyThreadState_assign
35160     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
35161     if (full_traceback) {
35162         Py_XINCREF(old_exc);
35163         Py_XINCREF(old_val);
35164         Py_XINCREF(old_tb);
35165         __Pyx_ErrRestore(old_exc, old_val, old_tb);
35166         PyErr_PrintEx(1);
35167     }
35168     #if PY_MAJOR_VERSION < 3
35169     ctx = PyString_FromString(name);
35170     #else
35171     ctx = PyUnicode_FromString(name);
35172     #endif
35173     __Pyx_ErrRestore(old_exc, old_val, old_tb);
35174     if (!ctx) {
35175         PyErr_WriteUnraisable(Py_None);
35176     } else {
35177         PyErr_WriteUnraisable(ctx);
35178         Py_DECREF(ctx);
35179     }
35180 #ifdef WITH_THREAD
35181     if (nogil)
35182         PyGILState_Release(state);
35183 #endif
35184 }
35185 
35186 /* PyDictVersioning */
35187 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)35188 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
35189     PyObject *dict = Py_TYPE(obj)->tp_dict;
35190     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
35191 }
__Pyx_get_object_dict_version(PyObject * obj)35192 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
35193     PyObject **dictptr = NULL;
35194     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
35195     if (offset) {
35196 #if CYTHON_COMPILING_IN_CPYTHON
35197         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
35198 #else
35199         dictptr = _PyObject_GetDictPtr(obj);
35200 #endif
35201     }
35202     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
35203 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)35204 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
35205     PyObject *dict = Py_TYPE(obj)->tp_dict;
35206     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
35207         return 0;
35208     return obj_dict_version == __Pyx_get_object_dict_version(obj);
35209 }
35210 #endif
35211 
35212 /* GetModuleGlobalName */
35213 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)35214 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
35215 #else
35216 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
35217 #endif
35218 {
35219     PyObject *result;
35220 #if !CYTHON_AVOID_BORROWED_REFS
35221 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
35222     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
35223     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
35224     if (likely(result)) {
35225         return __Pyx_NewRef(result);
35226     } else if (unlikely(PyErr_Occurred())) {
35227         return NULL;
35228     }
35229 #else
35230     result = PyDict_GetItem(__pyx_d, name);
35231     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
35232     if (likely(result)) {
35233         return __Pyx_NewRef(result);
35234     }
35235 #endif
35236 #else
35237     result = PyObject_GetItem(__pyx_d, name);
35238     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
35239     if (likely(result)) {
35240         return __Pyx_NewRef(result);
35241     }
35242     PyErr_Clear();
35243 #endif
35244     return __Pyx_GetBuiltinName(name);
35245 }
35246 
35247 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)35248 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
35249     PyObject *r;
35250     if (!j) return NULL;
35251     r = PyObject_GetItem(o, j);
35252     Py_DECREF(j);
35253     return r;
35254 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)35255 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
35256                                                               CYTHON_NCP_UNUSED int wraparound,
35257                                                               CYTHON_NCP_UNUSED int boundscheck) {
35258 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35259     Py_ssize_t wrapped_i = i;
35260     if (wraparound & unlikely(i < 0)) {
35261         wrapped_i += PyList_GET_SIZE(o);
35262     }
35263     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
35264         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
35265         Py_INCREF(r);
35266         return r;
35267     }
35268     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
35269 #else
35270     return PySequence_GetItem(o, i);
35271 #endif
35272 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)35273 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
35274                                                               CYTHON_NCP_UNUSED int wraparound,
35275                                                               CYTHON_NCP_UNUSED int boundscheck) {
35276 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35277     Py_ssize_t wrapped_i = i;
35278     if (wraparound & unlikely(i < 0)) {
35279         wrapped_i += PyTuple_GET_SIZE(o);
35280     }
35281     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
35282         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
35283         Py_INCREF(r);
35284         return r;
35285     }
35286     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
35287 #else
35288     return PySequence_GetItem(o, i);
35289 #endif
35290 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)35291 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
35292                                                      CYTHON_NCP_UNUSED int wraparound,
35293                                                      CYTHON_NCP_UNUSED int boundscheck) {
35294 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
35295     if (is_list || PyList_CheckExact(o)) {
35296         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
35297         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
35298             PyObject *r = PyList_GET_ITEM(o, n);
35299             Py_INCREF(r);
35300             return r;
35301         }
35302     }
35303     else if (PyTuple_CheckExact(o)) {
35304         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
35305         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
35306             PyObject *r = PyTuple_GET_ITEM(o, n);
35307             Py_INCREF(r);
35308             return r;
35309         }
35310     } else {
35311         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
35312         if (likely(m && m->sq_item)) {
35313             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
35314                 Py_ssize_t l = m->sq_length(o);
35315                 if (likely(l >= 0)) {
35316                     i += l;
35317                 } else {
35318                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
35319                         return NULL;
35320                     PyErr_Clear();
35321                 }
35322             }
35323             return m->sq_item(o, i);
35324         }
35325     }
35326 #else
35327     if (is_list || PySequence_Check(o)) {
35328         return PySequence_GetItem(o, i);
35329     }
35330 #endif
35331     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
35332 }
35333 
35334 /* ObjectGetItem */
35335 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)35336 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
35337     PyObject *runerr;
35338     Py_ssize_t key_value;
35339     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
35340     if (unlikely(!(m && m->sq_item))) {
35341         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
35342         return NULL;
35343     }
35344     key_value = __Pyx_PyIndex_AsSsize_t(index);
35345     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
35346         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
35347     }
35348     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
35349         PyErr_Clear();
35350         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
35351     }
35352     return NULL;
35353 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)35354 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
35355     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
35356     if (likely(m && m->mp_subscript)) {
35357         return m->mp_subscript(obj, key);
35358     }
35359     return __Pyx_PyObject_GetIndex(obj, key);
35360 }
35361 #endif
35362 
35363 /* GetTopmostException */
35364 #if CYTHON_USE_EXC_INFO_STACK
35365 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)35366 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
35367 {
35368     _PyErr_StackItem *exc_info = tstate->exc_info;
35369     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
35370            exc_info->previous_item != NULL)
35371     {
35372         exc_info = exc_info->previous_item;
35373     }
35374     return exc_info;
35375 }
35376 #endif
35377 
35378 /* SaveResetException */
35379 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)35380 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
35381     #if CYTHON_USE_EXC_INFO_STACK
35382     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
35383     *type = exc_info->exc_type;
35384     *value = exc_info->exc_value;
35385     *tb = exc_info->exc_traceback;
35386     #else
35387     *type = tstate->exc_type;
35388     *value = tstate->exc_value;
35389     *tb = tstate->exc_traceback;
35390     #endif
35391     Py_XINCREF(*type);
35392     Py_XINCREF(*value);
35393     Py_XINCREF(*tb);
35394 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)35395 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
35396     PyObject *tmp_type, *tmp_value, *tmp_tb;
35397     #if CYTHON_USE_EXC_INFO_STACK
35398     _PyErr_StackItem *exc_info = tstate->exc_info;
35399     tmp_type = exc_info->exc_type;
35400     tmp_value = exc_info->exc_value;
35401     tmp_tb = exc_info->exc_traceback;
35402     exc_info->exc_type = type;
35403     exc_info->exc_value = value;
35404     exc_info->exc_traceback = tb;
35405     #else
35406     tmp_type = tstate->exc_type;
35407     tmp_value = tstate->exc_value;
35408     tmp_tb = tstate->exc_traceback;
35409     tstate->exc_type = type;
35410     tstate->exc_value = value;
35411     tstate->exc_traceback = tb;
35412     #endif
35413     Py_XDECREF(tmp_type);
35414     Py_XDECREF(tmp_value);
35415     Py_XDECREF(tmp_tb);
35416 }
35417 #endif
35418 
35419 /* PyErrExceptionMatches */
35420 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)35421 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
35422     Py_ssize_t i, n;
35423     n = PyTuple_GET_SIZE(tuple);
35424 #if PY_MAJOR_VERSION >= 3
35425     for (i=0; i<n; i++) {
35426         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
35427     }
35428 #endif
35429     for (i=0; i<n; i++) {
35430         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
35431     }
35432     return 0;
35433 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)35434 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
35435     PyObject *exc_type = tstate->curexc_type;
35436     if (exc_type == err) return 1;
35437     if (unlikely(!exc_type)) return 0;
35438     if (unlikely(PyTuple_Check(err)))
35439         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
35440     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
35441 }
35442 #endif
35443 
35444 /* GetException */
35445 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)35446 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
35447 #else
35448 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
35449 #endif
35450 {
35451     PyObject *local_type, *local_value, *local_tb;
35452 #if CYTHON_FAST_THREAD_STATE
35453     PyObject *tmp_type, *tmp_value, *tmp_tb;
35454     local_type = tstate->curexc_type;
35455     local_value = tstate->curexc_value;
35456     local_tb = tstate->curexc_traceback;
35457     tstate->curexc_type = 0;
35458     tstate->curexc_value = 0;
35459     tstate->curexc_traceback = 0;
35460 #else
35461     PyErr_Fetch(&local_type, &local_value, &local_tb);
35462 #endif
35463     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
35464 #if CYTHON_FAST_THREAD_STATE
35465     if (unlikely(tstate->curexc_type))
35466 #else
35467     if (unlikely(PyErr_Occurred()))
35468 #endif
35469         goto bad;
35470     #if PY_MAJOR_VERSION >= 3
35471     if (local_tb) {
35472         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
35473             goto bad;
35474     }
35475     #endif
35476     Py_XINCREF(local_tb);
35477     Py_XINCREF(local_type);
35478     Py_XINCREF(local_value);
35479     *type = local_type;
35480     *value = local_value;
35481     *tb = local_tb;
35482 #if CYTHON_FAST_THREAD_STATE
35483     #if CYTHON_USE_EXC_INFO_STACK
35484     {
35485         _PyErr_StackItem *exc_info = tstate->exc_info;
35486         tmp_type = exc_info->exc_type;
35487         tmp_value = exc_info->exc_value;
35488         tmp_tb = exc_info->exc_traceback;
35489         exc_info->exc_type = local_type;
35490         exc_info->exc_value = local_value;
35491         exc_info->exc_traceback = local_tb;
35492     }
35493     #else
35494     tmp_type = tstate->exc_type;
35495     tmp_value = tstate->exc_value;
35496     tmp_tb = tstate->exc_traceback;
35497     tstate->exc_type = local_type;
35498     tstate->exc_value = local_value;
35499     tstate->exc_traceback = local_tb;
35500     #endif
35501     Py_XDECREF(tmp_type);
35502     Py_XDECREF(tmp_value);
35503     Py_XDECREF(tmp_tb);
35504 #else
35505     PyErr_SetExcInfo(local_type, local_value, local_tb);
35506 #endif
35507     return 0;
35508 bad:
35509     *type = 0;
35510     *value = 0;
35511     *tb = 0;
35512     Py_XDECREF(local_type);
35513     Py_XDECREF(local_value);
35514     Py_XDECREF(local_tb);
35515     return -1;
35516 }
35517 
35518 /* PyFunctionFastCall */
35519 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)35520 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
35521                                                PyObject *globals) {
35522     PyFrameObject *f;
35523     PyThreadState *tstate = __Pyx_PyThreadState_Current;
35524     PyObject **fastlocals;
35525     Py_ssize_t i;
35526     PyObject *result;
35527     assert(globals != NULL);
35528     /* XXX Perhaps we should create a specialized
35529        PyFrame_New() that doesn't take locals, but does
35530        take builtins without sanity checking them.
35531        */
35532     assert(tstate != NULL);
35533     f = PyFrame_New(tstate, co, globals, NULL);
35534     if (f == NULL) {
35535         return NULL;
35536     }
35537     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
35538     for (i = 0; i < na; i++) {
35539         Py_INCREF(*args);
35540         fastlocals[i] = *args++;
35541     }
35542     result = PyEval_EvalFrameEx(f,0);
35543     ++tstate->recursion_depth;
35544     Py_DECREF(f);
35545     --tstate->recursion_depth;
35546     return result;
35547 }
35548 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)35549 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
35550     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
35551     PyObject *globals = PyFunction_GET_GLOBALS(func);
35552     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
35553     PyObject *closure;
35554 #if PY_MAJOR_VERSION >= 3
35555     PyObject *kwdefs;
35556 #endif
35557     PyObject *kwtuple, **k;
35558     PyObject **d;
35559     Py_ssize_t nd;
35560     Py_ssize_t nk;
35561     PyObject *result;
35562     assert(kwargs == NULL || PyDict_Check(kwargs));
35563     nk = kwargs ? PyDict_Size(kwargs) : 0;
35564     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
35565         return NULL;
35566     }
35567     if (
35568 #if PY_MAJOR_VERSION >= 3
35569             co->co_kwonlyargcount == 0 &&
35570 #endif
35571             likely(kwargs == NULL || nk == 0) &&
35572             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
35573         if (argdefs == NULL && co->co_argcount == nargs) {
35574             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
35575             goto done;
35576         }
35577         else if (nargs == 0 && argdefs != NULL
35578                  && co->co_argcount == Py_SIZE(argdefs)) {
35579             /* function called with no arguments, but all parameters have
35580                a default value: use default values as arguments .*/
35581             args = &PyTuple_GET_ITEM(argdefs, 0);
35582             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
35583             goto done;
35584         }
35585     }
35586     if (kwargs != NULL) {
35587         Py_ssize_t pos, i;
35588         kwtuple = PyTuple_New(2 * nk);
35589         if (kwtuple == NULL) {
35590             result = NULL;
35591             goto done;
35592         }
35593         k = &PyTuple_GET_ITEM(kwtuple, 0);
35594         pos = i = 0;
35595         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
35596             Py_INCREF(k[i]);
35597             Py_INCREF(k[i+1]);
35598             i += 2;
35599         }
35600         nk = i / 2;
35601     }
35602     else {
35603         kwtuple = NULL;
35604         k = NULL;
35605     }
35606     closure = PyFunction_GET_CLOSURE(func);
35607 #if PY_MAJOR_VERSION >= 3
35608     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
35609 #endif
35610     if (argdefs != NULL) {
35611         d = &PyTuple_GET_ITEM(argdefs, 0);
35612         nd = Py_SIZE(argdefs);
35613     }
35614     else {
35615         d = NULL;
35616         nd = 0;
35617     }
35618 #if PY_MAJOR_VERSION >= 3
35619     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
35620                                args, (int)nargs,
35621                                k, (int)nk,
35622                                d, (int)nd, kwdefs, closure);
35623 #else
35624     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
35625                                args, (int)nargs,
35626                                k, (int)nk,
35627                                d, (int)nd, closure);
35628 #endif
35629     Py_XDECREF(kwtuple);
35630 done:
35631     Py_LeaveRecursiveCall();
35632     return result;
35633 }
35634 #endif
35635 #endif
35636 
35637 /* PyCFunctionFastCall */
35638 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)35639 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
35640     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
35641     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
35642     PyObject *self = PyCFunction_GET_SELF(func);
35643     int flags = PyCFunction_GET_FLAGS(func);
35644     assert(PyCFunction_Check(func));
35645     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
35646     assert(nargs >= 0);
35647     assert(nargs == 0 || args != NULL);
35648     /* _PyCFunction_FastCallDict() must not be called with an exception set,
35649        because it may clear it (directly or indirectly) and so the
35650        caller loses its exception */
35651     assert(!PyErr_Occurred());
35652     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
35653         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
35654     } else {
35655         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
35656     }
35657 }
35658 #endif
35659 
35660 /* PyObjectCall */
35661 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)35662 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
35663     PyObject *result;
35664     ternaryfunc call = func->ob_type->tp_call;
35665     if (unlikely(!call))
35666         return PyObject_Call(func, arg, kw);
35667     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
35668         return NULL;
35669     result = (*call)(func, arg, kw);
35670     Py_LeaveRecursiveCall();
35671     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
35672         PyErr_SetString(
35673             PyExc_SystemError,
35674             "NULL result without error in PyObject_Call");
35675     }
35676     return result;
35677 }
35678 #endif
35679 
35680 /* PyObjectSetAttrStr */
35681 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_SetAttrStr(PyObject * obj,PyObject * attr_name,PyObject * value)35682 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
35683     PyTypeObject* tp = Py_TYPE(obj);
35684     if (likely(tp->tp_setattro))
35685         return tp->tp_setattro(obj, attr_name, value);
35686 #if PY_MAJOR_VERSION < 3
35687     if (likely(tp->tp_setattr))
35688         return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
35689 #endif
35690     return PyObject_SetAttr(obj, attr_name, value);
35691 }
35692 #endif
35693 
35694 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)35695 static void __Pyx_RaiseArgtupleInvalid(
35696     const char* func_name,
35697     int exact,
35698     Py_ssize_t num_min,
35699     Py_ssize_t num_max,
35700     Py_ssize_t num_found)
35701 {
35702     Py_ssize_t num_expected;
35703     const char *more_or_less;
35704     if (num_found < num_min) {
35705         num_expected = num_min;
35706         more_or_less = "at least";
35707     } else {
35708         num_expected = num_max;
35709         more_or_less = "at most";
35710     }
35711     if (exact) {
35712         more_or_less = "exactly";
35713     }
35714     PyErr_Format(PyExc_TypeError,
35715                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
35716                  func_name, more_or_less, num_expected,
35717                  (num_expected == 1) ? "" : "s", num_found);
35718 }
35719 
35720 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)35721 static void __Pyx_RaiseDoubleKeywordsError(
35722     const char* func_name,
35723     PyObject* kw_name)
35724 {
35725     PyErr_Format(PyExc_TypeError,
35726         #if PY_MAJOR_VERSION >= 3
35727         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
35728         #else
35729         "%s() got multiple values for keyword argument '%s'", func_name,
35730         PyString_AsString(kw_name));
35731         #endif
35732 }
35733 
35734 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)35735 static int __Pyx_ParseOptionalKeywords(
35736     PyObject *kwds,
35737     PyObject **argnames[],
35738     PyObject *kwds2,
35739     PyObject *values[],
35740     Py_ssize_t num_pos_args,
35741     const char* function_name)
35742 {
35743     PyObject *key = 0, *value = 0;
35744     Py_ssize_t pos = 0;
35745     PyObject*** name;
35746     PyObject*** first_kw_arg = argnames + num_pos_args;
35747     while (PyDict_Next(kwds, &pos, &key, &value)) {
35748         name = first_kw_arg;
35749         while (*name && (**name != key)) name++;
35750         if (*name) {
35751             values[name-argnames] = value;
35752             continue;
35753         }
35754         name = first_kw_arg;
35755         #if PY_MAJOR_VERSION < 3
35756         if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
35757             while (*name) {
35758                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
35759                         && _PyString_Eq(**name, key)) {
35760                     values[name-argnames] = value;
35761                     break;
35762                 }
35763                 name++;
35764             }
35765             if (*name) continue;
35766             else {
35767                 PyObject*** argname = argnames;
35768                 while (argname != first_kw_arg) {
35769                     if ((**argname == key) || (
35770                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
35771                              && _PyString_Eq(**argname, key))) {
35772                         goto arg_passed_twice;
35773                     }
35774                     argname++;
35775                 }
35776             }
35777         } else
35778         #endif
35779         if (likely(PyUnicode_Check(key))) {
35780             while (*name) {
35781                 int cmp = (**name == key) ? 0 :
35782                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
35783                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
35784                 #endif
35785                     PyUnicode_Compare(**name, key);
35786                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
35787                 if (cmp == 0) {
35788                     values[name-argnames] = value;
35789                     break;
35790                 }
35791                 name++;
35792             }
35793             if (*name) continue;
35794             else {
35795                 PyObject*** argname = argnames;
35796                 while (argname != first_kw_arg) {
35797                     int cmp = (**argname == key) ? 0 :
35798                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
35799                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
35800                     #endif
35801                         PyUnicode_Compare(**argname, key);
35802                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
35803                     if (cmp == 0) goto arg_passed_twice;
35804                     argname++;
35805                 }
35806             }
35807         } else
35808             goto invalid_keyword_type;
35809         if (kwds2) {
35810             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
35811         } else {
35812             goto invalid_keyword;
35813         }
35814     }
35815     return 0;
35816 arg_passed_twice:
35817     __Pyx_RaiseDoubleKeywordsError(function_name, key);
35818     goto bad;
35819 invalid_keyword_type:
35820     PyErr_Format(PyExc_TypeError,
35821         "%.200s() keywords must be strings", function_name);
35822     goto bad;
35823 invalid_keyword:
35824     PyErr_Format(PyExc_TypeError,
35825     #if PY_MAJOR_VERSION < 3
35826         "%.200s() got an unexpected keyword argument '%.200s'",
35827         function_name, PyString_AsString(key));
35828     #else
35829         "%s() got an unexpected keyword argument '%U'",
35830         function_name, key);
35831     #endif
35832 bad:
35833     return -1;
35834 }
35835 
35836 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)35837 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
35838 {
35839     if (unlikely(!type)) {
35840         PyErr_SetString(PyExc_SystemError, "Missing type object");
35841         return 0;
35842     }
35843     else if (exact) {
35844         #if PY_MAJOR_VERSION == 2
35845         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
35846         #endif
35847     }
35848     else {
35849         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
35850     }
35851     PyErr_Format(PyExc_TypeError,
35852         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
35853         name, type->tp_name, Py_TYPE(obj)->tp_name);
35854     return 0;
35855 }
35856 
35857 /* SetItemInt */
__Pyx_SetItemInt_Generic(PyObject * o,PyObject * j,PyObject * v)35858 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
35859     int r;
35860     if (!j) return -1;
35861     r = PyObject_SetItem(o, j, v);
35862     Py_DECREF(j);
35863     return r;
35864 }
__Pyx_SetItemInt_Fast(PyObject * o,Py_ssize_t i,PyObject * v,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)35865 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
35866                                                CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
35867 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
35868     if (is_list || PyList_CheckExact(o)) {
35869         Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
35870         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
35871             PyObject* old = PyList_GET_ITEM(o, n);
35872             Py_INCREF(v);
35873             PyList_SET_ITEM(o, n, v);
35874             Py_DECREF(old);
35875             return 1;
35876         }
35877     } else {
35878         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
35879         if (likely(m && m->sq_ass_item)) {
35880             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
35881                 Py_ssize_t l = m->sq_length(o);
35882                 if (likely(l >= 0)) {
35883                     i += l;
35884                 } else {
35885                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
35886                         return -1;
35887                     PyErr_Clear();
35888                 }
35889             }
35890             return m->sq_ass_item(o, i, v);
35891         }
35892     }
35893 #else
35894 #if CYTHON_COMPILING_IN_PYPY
35895     if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
35896 #else
35897     if (is_list || PySequence_Check(o))
35898 #endif
35899     {
35900         return PySequence_SetItem(o, i, v);
35901     }
35902 #endif
35903     return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
35904 }
35905 
35906 /* PyIntBinop */
35907 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AddObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)35908 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
35909     (void)inplace;
35910     (void)zerodivision_check;
35911     #if PY_MAJOR_VERSION < 3
35912     if (likely(PyInt_CheckExact(op1))) {
35913         const long b = intval;
35914         long x;
35915         long a = PyInt_AS_LONG(op1);
35916             x = (long)((unsigned long)a + b);
35917             if (likely((x^a) >= 0 || (x^b) >= 0))
35918                 return PyInt_FromLong(x);
35919             return PyLong_Type.tp_as_number->nb_add(op1, op2);
35920     }
35921     #endif
35922     #if CYTHON_USE_PYLONG_INTERNALS
35923     if (likely(PyLong_CheckExact(op1))) {
35924         const long b = intval;
35925         long a, x;
35926 #ifdef HAVE_LONG_LONG
35927         const PY_LONG_LONG llb = intval;
35928         PY_LONG_LONG lla, llx;
35929 #endif
35930         const digit* digits = ((PyLongObject*)op1)->ob_digit;
35931         const Py_ssize_t size = Py_SIZE(op1);
35932         if (likely(__Pyx_sst_abs(size) <= 1)) {
35933             a = likely(size) ? digits[0] : 0;
35934             if (size == -1) a = -a;
35935         } else {
35936             switch (size) {
35937                 case -2:
35938                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
35939                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35940                         break;
35941 #ifdef HAVE_LONG_LONG
35942                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
35943                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35944                         goto long_long;
35945 #endif
35946                     }
35947                     CYTHON_FALLTHROUGH;
35948                 case 2:
35949                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
35950                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35951                         break;
35952 #ifdef HAVE_LONG_LONG
35953                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
35954                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35955                         goto long_long;
35956 #endif
35957                     }
35958                     CYTHON_FALLTHROUGH;
35959                 case -3:
35960                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
35961                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35962                         break;
35963 #ifdef HAVE_LONG_LONG
35964                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
35965                         lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35966                         goto long_long;
35967 #endif
35968                     }
35969                     CYTHON_FALLTHROUGH;
35970                 case 3:
35971                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
35972                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35973                         break;
35974 #ifdef HAVE_LONG_LONG
35975                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
35976                         lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35977                         goto long_long;
35978 #endif
35979                     }
35980                     CYTHON_FALLTHROUGH;
35981                 case -4:
35982                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
35983                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35984                         break;
35985 #ifdef HAVE_LONG_LONG
35986                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
35987                         lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35988                         goto long_long;
35989 #endif
35990                     }
35991                     CYTHON_FALLTHROUGH;
35992                 case 4:
35993                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
35994                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35995                         break;
35996 #ifdef HAVE_LONG_LONG
35997                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
35998                         lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35999                         goto long_long;
36000 #endif
36001                     }
36002                     CYTHON_FALLTHROUGH;
36003                 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
36004             }
36005         }
36006                 x = a + b;
36007             return PyLong_FromLong(x);
36008 #ifdef HAVE_LONG_LONG
36009         long_long:
36010                 llx = lla + llb;
36011             return PyLong_FromLongLong(llx);
36012 #endif
36013 
36014 
36015     }
36016     #endif
36017     if (PyFloat_CheckExact(op1)) {
36018         const long b = intval;
36019         double a = PyFloat_AS_DOUBLE(op1);
36020             double result;
36021             PyFPE_START_PROTECT("add", return NULL)
36022             result = ((double)a) + (double)b;
36023             PyFPE_END_PROTECT(result)
36024             return PyFloat_FromDouble(result);
36025     }
36026     return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
36027 }
36028 #endif
36029 
36030 /* IterFinish */
__Pyx_IterFinish(void)36031 static CYTHON_INLINE int __Pyx_IterFinish(void) {
36032 #if CYTHON_FAST_THREAD_STATE
36033     PyThreadState *tstate = __Pyx_PyThreadState_Current;
36034     PyObject* exc_type = tstate->curexc_type;
36035     if (unlikely(exc_type)) {
36036         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
36037             PyObject *exc_value, *exc_tb;
36038             exc_value = tstate->curexc_value;
36039             exc_tb = tstate->curexc_traceback;
36040             tstate->curexc_type = 0;
36041             tstate->curexc_value = 0;
36042             tstate->curexc_traceback = 0;
36043             Py_DECREF(exc_type);
36044             Py_XDECREF(exc_value);
36045             Py_XDECREF(exc_tb);
36046             return 0;
36047         } else {
36048             return -1;
36049         }
36050     }
36051     return 0;
36052 #else
36053     if (unlikely(PyErr_Occurred())) {
36054         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
36055             PyErr_Clear();
36056             return 0;
36057         } else {
36058             return -1;
36059         }
36060     }
36061     return 0;
36062 #endif
36063 }
36064 
36065 /* PyObjectCallMethO */
36066 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)36067 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
36068     PyObject *self, *result;
36069     PyCFunction cfunc;
36070     cfunc = PyCFunction_GET_FUNCTION(func);
36071     self = PyCFunction_GET_SELF(func);
36072     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
36073         return NULL;
36074     result = cfunc(self, arg);
36075     Py_LeaveRecursiveCall();
36076     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
36077         PyErr_SetString(
36078             PyExc_SystemError,
36079             "NULL result without error in PyObject_Call");
36080     }
36081     return result;
36082 }
36083 #endif
36084 
36085 /* PyObjectCallNoArg */
36086 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)36087 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
36088 #if CYTHON_FAST_PYCALL
36089     if (PyFunction_Check(func)) {
36090         return __Pyx_PyFunction_FastCall(func, NULL, 0);
36091     }
36092 #endif
36093 #ifdef __Pyx_CyFunction_USED
36094     if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
36095 #else
36096     if (likely(PyCFunction_Check(func)))
36097 #endif
36098     {
36099         if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
36100             return __Pyx_PyObject_CallMethO(func, NULL);
36101         }
36102     }
36103     return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
36104 }
36105 #endif
36106 
36107 /* PyObjectCallOneArg */
36108 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)36109 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
36110     PyObject *result;
36111     PyObject *args = PyTuple_New(1);
36112     if (unlikely(!args)) return NULL;
36113     Py_INCREF(arg);
36114     PyTuple_SET_ITEM(args, 0, arg);
36115     result = __Pyx_PyObject_Call(func, args, NULL);
36116     Py_DECREF(args);
36117     return result;
36118 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)36119 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
36120 #if CYTHON_FAST_PYCALL
36121     if (PyFunction_Check(func)) {
36122         return __Pyx_PyFunction_FastCall(func, &arg, 1);
36123     }
36124 #endif
36125     if (likely(PyCFunction_Check(func))) {
36126         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
36127             return __Pyx_PyObject_CallMethO(func, arg);
36128 #if CYTHON_FAST_PYCCALL
36129         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
36130             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
36131 #endif
36132         }
36133     }
36134     return __Pyx__PyObject_CallOneArg(func, arg);
36135 }
36136 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)36137 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
36138     PyObject *result;
36139     PyObject *args = PyTuple_Pack(1, arg);
36140     if (unlikely(!args)) return NULL;
36141     result = __Pyx_PyObject_Call(func, args, NULL);
36142     Py_DECREF(args);
36143     return result;
36144 }
36145 #endif
36146 
36147 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)36148 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
36149     PyObject *attr;
36150 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
36151     PyTypeObject *tp = Py_TYPE(obj);
36152     PyObject *descr;
36153     descrgetfunc f = NULL;
36154     PyObject **dictptr, *dict;
36155     int meth_found = 0;
36156     assert (*method == NULL);
36157     if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
36158         attr = __Pyx_PyObject_GetAttrStr(obj, name);
36159         goto try_unpack;
36160     }
36161     if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
36162         return 0;
36163     }
36164     descr = _PyType_Lookup(tp, name);
36165     if (likely(descr != NULL)) {
36166         Py_INCREF(descr);
36167 #if PY_MAJOR_VERSION >= 3
36168         #ifdef __Pyx_CyFunction_USED
36169         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
36170         #else
36171         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
36172         #endif
36173 #else
36174         #ifdef __Pyx_CyFunction_USED
36175         if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
36176         #else
36177         if (likely(PyFunction_Check(descr)))
36178         #endif
36179 #endif
36180         {
36181             meth_found = 1;
36182         } else {
36183             f = Py_TYPE(descr)->tp_descr_get;
36184             if (f != NULL && PyDescr_IsData(descr)) {
36185                 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
36186                 Py_DECREF(descr);
36187                 goto try_unpack;
36188             }
36189         }
36190     }
36191     dictptr = _PyObject_GetDictPtr(obj);
36192     if (dictptr != NULL && (dict = *dictptr) != NULL) {
36193         Py_INCREF(dict);
36194         attr = __Pyx_PyDict_GetItemStr(dict, name);
36195         if (attr != NULL) {
36196             Py_INCREF(attr);
36197             Py_DECREF(dict);
36198             Py_XDECREF(descr);
36199             goto try_unpack;
36200         }
36201         Py_DECREF(dict);
36202     }
36203     if (meth_found) {
36204         *method = descr;
36205         return 1;
36206     }
36207     if (f != NULL) {
36208         attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
36209         Py_DECREF(descr);
36210         goto try_unpack;
36211     }
36212     if (descr != NULL) {
36213         *method = descr;
36214         return 0;
36215     }
36216     PyErr_Format(PyExc_AttributeError,
36217 #if PY_MAJOR_VERSION >= 3
36218                  "'%.50s' object has no attribute '%U'",
36219                  tp->tp_name, name);
36220 #else
36221                  "'%.50s' object has no attribute '%.400s'",
36222                  tp->tp_name, PyString_AS_STRING(name));
36223 #endif
36224     return 0;
36225 #else
36226     attr = __Pyx_PyObject_GetAttrStr(obj, name);
36227     goto try_unpack;
36228 #endif
36229 try_unpack:
36230 #if CYTHON_UNPACK_METHODS
36231     if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
36232         PyObject *function = PyMethod_GET_FUNCTION(attr);
36233         Py_INCREF(function);
36234         Py_DECREF(attr);
36235         *method = function;
36236         return 1;
36237     }
36238 #endif
36239     *method = attr;
36240     return 0;
36241 }
36242 
36243 /* PyObjectCallMethod0 */
__Pyx_PyObject_CallMethod0(PyObject * obj,PyObject * method_name)36244 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
36245     PyObject *method = NULL, *result = NULL;
36246     int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
36247     if (likely(is_method)) {
36248         result = __Pyx_PyObject_CallOneArg(method, obj);
36249         Py_DECREF(method);
36250         return result;
36251     }
36252     if (unlikely(!method)) goto bad;
36253     result = __Pyx_PyObject_CallNoArg(method);
36254     Py_DECREF(method);
36255 bad:
36256     return result;
36257 }
36258 
36259 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)36260 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
36261     PyErr_Format(PyExc_ValueError,
36262                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
36263                  index, (index == 1) ? "" : "s");
36264 }
36265 
36266 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)36267 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
36268     PyErr_Format(PyExc_ValueError,
36269                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
36270 }
36271 
36272 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)36273 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
36274     if (unlikely(retval)) {
36275         Py_DECREF(retval);
36276         __Pyx_RaiseTooManyValuesError(expected);
36277         return -1;
36278     } else {
36279         return __Pyx_IterFinish();
36280     }
36281     return 0;
36282 }
36283 
36284 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)36285 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
36286     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
36287 }
36288 
36289 /* UnpackTupleError */
__Pyx_UnpackTupleError(PyObject * t,Py_ssize_t index)36290 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
36291     if (t == Py_None) {
36292       __Pyx_RaiseNoneNotIterableError();
36293     } else if (PyTuple_GET_SIZE(t) < index) {
36294       __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
36295     } else {
36296       __Pyx_RaiseTooManyValuesError(index);
36297     }
36298 }
36299 
36300 /* UnpackTuple2 */
__Pyx_unpack_tuple2_exact(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int decref_tuple)36301 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
36302         PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
36303     PyObject *value1 = NULL, *value2 = NULL;
36304 #if CYTHON_COMPILING_IN_PYPY
36305     value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
36306     value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
36307 #else
36308     value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
36309     value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
36310 #endif
36311     if (decref_tuple) {
36312         Py_DECREF(tuple);
36313     }
36314     *pvalue1 = value1;
36315     *pvalue2 = value2;
36316     return 0;
36317 #if CYTHON_COMPILING_IN_PYPY
36318 bad:
36319     Py_XDECREF(value1);
36320     Py_XDECREF(value2);
36321     if (decref_tuple) { Py_XDECREF(tuple); }
36322     return -1;
36323 #endif
36324 }
__Pyx_unpack_tuple2_generic(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int has_known_size,int decref_tuple)36325 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
36326                                        int has_known_size, int decref_tuple) {
36327     Py_ssize_t index;
36328     PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
36329     iternextfunc iternext;
36330     iter = PyObject_GetIter(tuple);
36331     if (unlikely(!iter)) goto bad;
36332     if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
36333     iternext = Py_TYPE(iter)->tp_iternext;
36334     value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
36335     value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
36336     if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
36337     Py_DECREF(iter);
36338     *pvalue1 = value1;
36339     *pvalue2 = value2;
36340     return 0;
36341 unpacking_failed:
36342     if (!has_known_size && __Pyx_IterFinish() == 0)
36343         __Pyx_RaiseNeedMoreValuesError(index);
36344 bad:
36345     Py_XDECREF(iter);
36346     Py_XDECREF(value1);
36347     Py_XDECREF(value2);
36348     if (decref_tuple) { Py_XDECREF(tuple); }
36349     return -1;
36350 }
36351 
36352 /* dict_iter */
__Pyx_dict_iterator(PyObject * iterable,int is_dict,PyObject * method_name,Py_ssize_t * p_orig_length,int * p_source_is_dict)36353 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
36354                                                    Py_ssize_t* p_orig_length, int* p_source_is_dict) {
36355     is_dict = is_dict || likely(PyDict_CheckExact(iterable));
36356     *p_source_is_dict = is_dict;
36357     if (is_dict) {
36358 #if !CYTHON_COMPILING_IN_PYPY
36359         *p_orig_length = PyDict_Size(iterable);
36360         Py_INCREF(iterable);
36361         return iterable;
36362 #elif PY_MAJOR_VERSION >= 3
36363         static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
36364         PyObject **pp = NULL;
36365         if (method_name) {
36366             const char *name = PyUnicode_AsUTF8(method_name);
36367             if (strcmp(name, "iteritems") == 0) pp = &py_items;
36368             else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
36369             else if (strcmp(name, "itervalues") == 0) pp = &py_values;
36370             if (pp) {
36371                 if (!*pp) {
36372                     *pp = PyUnicode_FromString(name + 4);
36373                     if (!*pp)
36374                         return NULL;
36375                 }
36376                 method_name = *pp;
36377             }
36378         }
36379 #endif
36380     }
36381     *p_orig_length = 0;
36382     if (method_name) {
36383         PyObject* iter;
36384         iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
36385         if (!iterable)
36386             return NULL;
36387 #if !CYTHON_COMPILING_IN_PYPY
36388         if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
36389             return iterable;
36390 #endif
36391         iter = PyObject_GetIter(iterable);
36392         Py_DECREF(iterable);
36393         return iter;
36394     }
36395     return PyObject_GetIter(iterable);
36396 }
__Pyx_dict_iter_next(PyObject * iter_obj,CYTHON_NCP_UNUSED Py_ssize_t orig_length,CYTHON_NCP_UNUSED Py_ssize_t * ppos,PyObject ** pkey,PyObject ** pvalue,PyObject ** pitem,int source_is_dict)36397 static CYTHON_INLINE int __Pyx_dict_iter_next(
36398         PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
36399         PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
36400     PyObject* next_item;
36401 #if !CYTHON_COMPILING_IN_PYPY
36402     if (source_is_dict) {
36403         PyObject *key, *value;
36404         if (unlikely(orig_length != PyDict_Size(iter_obj))) {
36405             PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
36406             return -1;
36407         }
36408         if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
36409             return 0;
36410         }
36411         if (pitem) {
36412             PyObject* tuple = PyTuple_New(2);
36413             if (unlikely(!tuple)) {
36414                 return -1;
36415             }
36416             Py_INCREF(key);
36417             Py_INCREF(value);
36418             PyTuple_SET_ITEM(tuple, 0, key);
36419             PyTuple_SET_ITEM(tuple, 1, value);
36420             *pitem = tuple;
36421         } else {
36422             if (pkey) {
36423                 Py_INCREF(key);
36424                 *pkey = key;
36425             }
36426             if (pvalue) {
36427                 Py_INCREF(value);
36428                 *pvalue = value;
36429             }
36430         }
36431         return 1;
36432     } else if (PyTuple_CheckExact(iter_obj)) {
36433         Py_ssize_t pos = *ppos;
36434         if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
36435         *ppos = pos + 1;
36436         next_item = PyTuple_GET_ITEM(iter_obj, pos);
36437         Py_INCREF(next_item);
36438     } else if (PyList_CheckExact(iter_obj)) {
36439         Py_ssize_t pos = *ppos;
36440         if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
36441         *ppos = pos + 1;
36442         next_item = PyList_GET_ITEM(iter_obj, pos);
36443         Py_INCREF(next_item);
36444     } else
36445 #endif
36446     {
36447         next_item = PyIter_Next(iter_obj);
36448         if (unlikely(!next_item)) {
36449             return __Pyx_IterFinish();
36450         }
36451     }
36452     if (pitem) {
36453         *pitem = next_item;
36454     } else if (pkey && pvalue) {
36455         if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
36456             return -1;
36457     } else if (pkey) {
36458         *pkey = next_item;
36459     } else {
36460         *pvalue = next_item;
36461     }
36462     return 1;
36463 }
36464 
36465 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)36466 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
36467 #if CYTHON_COMPILING_IN_PYPY
36468     return PyObject_RichCompareBool(s1, s2, equals);
36469 #else
36470     if (s1 == s2) {
36471         return (equals == Py_EQ);
36472     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
36473         const char *ps1, *ps2;
36474         Py_ssize_t length = PyBytes_GET_SIZE(s1);
36475         if (length != PyBytes_GET_SIZE(s2))
36476             return (equals == Py_NE);
36477         ps1 = PyBytes_AS_STRING(s1);
36478         ps2 = PyBytes_AS_STRING(s2);
36479         if (ps1[0] != ps2[0]) {
36480             return (equals == Py_NE);
36481         } else if (length == 1) {
36482             return (equals == Py_EQ);
36483         } else {
36484             int result;
36485 #if CYTHON_USE_UNICODE_INTERNALS
36486             Py_hash_t hash1, hash2;
36487             hash1 = ((PyBytesObject*)s1)->ob_shash;
36488             hash2 = ((PyBytesObject*)s2)->ob_shash;
36489             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
36490                 return (equals == Py_NE);
36491             }
36492 #endif
36493             result = memcmp(ps1, ps2, (size_t)length);
36494             return (equals == Py_EQ) ? (result == 0) : (result != 0);
36495         }
36496     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
36497         return (equals == Py_NE);
36498     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
36499         return (equals == Py_NE);
36500     } else {
36501         int result;
36502         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
36503         if (!py_result)
36504             return -1;
36505         result = __Pyx_PyObject_IsTrue(py_result);
36506         Py_DECREF(py_result);
36507         return result;
36508     }
36509 #endif
36510 }
36511 
36512 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)36513 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
36514 #if CYTHON_COMPILING_IN_PYPY
36515     return PyObject_RichCompareBool(s1, s2, equals);
36516 #else
36517 #if PY_MAJOR_VERSION < 3
36518     PyObject* owned_ref = NULL;
36519 #endif
36520     int s1_is_unicode, s2_is_unicode;
36521     if (s1 == s2) {
36522         goto return_eq;
36523     }
36524     s1_is_unicode = PyUnicode_CheckExact(s1);
36525     s2_is_unicode = PyUnicode_CheckExact(s2);
36526 #if PY_MAJOR_VERSION < 3
36527     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
36528         owned_ref = PyUnicode_FromObject(s2);
36529         if (unlikely(!owned_ref))
36530             return -1;
36531         s2 = owned_ref;
36532         s2_is_unicode = 1;
36533     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
36534         owned_ref = PyUnicode_FromObject(s1);
36535         if (unlikely(!owned_ref))
36536             return -1;
36537         s1 = owned_ref;
36538         s1_is_unicode = 1;
36539     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
36540         return __Pyx_PyBytes_Equals(s1, s2, equals);
36541     }
36542 #endif
36543     if (s1_is_unicode & s2_is_unicode) {
36544         Py_ssize_t length;
36545         int kind;
36546         void *data1, *data2;
36547         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
36548             return -1;
36549         length = __Pyx_PyUnicode_GET_LENGTH(s1);
36550         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
36551             goto return_ne;
36552         }
36553 #if CYTHON_USE_UNICODE_INTERNALS
36554         {
36555             Py_hash_t hash1, hash2;
36556         #if CYTHON_PEP393_ENABLED
36557             hash1 = ((PyASCIIObject*)s1)->hash;
36558             hash2 = ((PyASCIIObject*)s2)->hash;
36559         #else
36560             hash1 = ((PyUnicodeObject*)s1)->hash;
36561             hash2 = ((PyUnicodeObject*)s2)->hash;
36562         #endif
36563             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
36564                 goto return_ne;
36565             }
36566         }
36567 #endif
36568         kind = __Pyx_PyUnicode_KIND(s1);
36569         if (kind != __Pyx_PyUnicode_KIND(s2)) {
36570             goto return_ne;
36571         }
36572         data1 = __Pyx_PyUnicode_DATA(s1);
36573         data2 = __Pyx_PyUnicode_DATA(s2);
36574         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
36575             goto return_ne;
36576         } else if (length == 1) {
36577             goto return_eq;
36578         } else {
36579             int result = memcmp(data1, data2, (size_t)(length * kind));
36580             #if PY_MAJOR_VERSION < 3
36581             Py_XDECREF(owned_ref);
36582             #endif
36583             return (equals == Py_EQ) ? (result == 0) : (result != 0);
36584         }
36585     } else if ((s1 == Py_None) & s2_is_unicode) {
36586         goto return_ne;
36587     } else if ((s2 == Py_None) & s1_is_unicode) {
36588         goto return_ne;
36589     } else {
36590         int result;
36591         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
36592         #if PY_MAJOR_VERSION < 3
36593         Py_XDECREF(owned_ref);
36594         #endif
36595         if (!py_result)
36596             return -1;
36597         result = __Pyx_PyObject_IsTrue(py_result);
36598         Py_DECREF(py_result);
36599         return result;
36600     }
36601 return_eq:
36602     #if PY_MAJOR_VERSION < 3
36603     Py_XDECREF(owned_ref);
36604     #endif
36605     return (equals == Py_EQ);
36606 return_ne:
36607     #if PY_MAJOR_VERSION < 3
36608     Py_XDECREF(owned_ref);
36609     #endif
36610     return (equals == Py_NE);
36611 #endif
36612 }
36613 
36614 /* RaiseException */
36615 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)36616 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
36617                         CYTHON_UNUSED PyObject *cause) {
36618     __Pyx_PyThreadState_declare
36619     Py_XINCREF(type);
36620     if (!value || value == Py_None)
36621         value = NULL;
36622     else
36623         Py_INCREF(value);
36624     if (!tb || tb == Py_None)
36625         tb = NULL;
36626     else {
36627         Py_INCREF(tb);
36628         if (!PyTraceBack_Check(tb)) {
36629             PyErr_SetString(PyExc_TypeError,
36630                 "raise: arg 3 must be a traceback or None");
36631             goto raise_error;
36632         }
36633     }
36634     if (PyType_Check(type)) {
36635 #if CYTHON_COMPILING_IN_PYPY
36636         if (!value) {
36637             Py_INCREF(Py_None);
36638             value = Py_None;
36639         }
36640 #endif
36641         PyErr_NormalizeException(&type, &value, &tb);
36642     } else {
36643         if (value) {
36644             PyErr_SetString(PyExc_TypeError,
36645                 "instance exception may not have a separate value");
36646             goto raise_error;
36647         }
36648         value = type;
36649         type = (PyObject*) Py_TYPE(type);
36650         Py_INCREF(type);
36651         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
36652             PyErr_SetString(PyExc_TypeError,
36653                 "raise: exception class must be a subclass of BaseException");
36654             goto raise_error;
36655         }
36656     }
36657     __Pyx_PyThreadState_assign
36658     __Pyx_ErrRestore(type, value, tb);
36659     return;
36660 raise_error:
36661     Py_XDECREF(value);
36662     Py_XDECREF(type);
36663     Py_XDECREF(tb);
36664     return;
36665 }
36666 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)36667 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
36668     PyObject* owned_instance = NULL;
36669     if (tb == Py_None) {
36670         tb = 0;
36671     } else if (tb && !PyTraceBack_Check(tb)) {
36672         PyErr_SetString(PyExc_TypeError,
36673             "raise: arg 3 must be a traceback or None");
36674         goto bad;
36675     }
36676     if (value == Py_None)
36677         value = 0;
36678     if (PyExceptionInstance_Check(type)) {
36679         if (value) {
36680             PyErr_SetString(PyExc_TypeError,
36681                 "instance exception may not have a separate value");
36682             goto bad;
36683         }
36684         value = type;
36685         type = (PyObject*) Py_TYPE(value);
36686     } else if (PyExceptionClass_Check(type)) {
36687         PyObject *instance_class = NULL;
36688         if (value && PyExceptionInstance_Check(value)) {
36689             instance_class = (PyObject*) Py_TYPE(value);
36690             if (instance_class != type) {
36691                 int is_subclass = PyObject_IsSubclass(instance_class, type);
36692                 if (!is_subclass) {
36693                     instance_class = NULL;
36694                 } else if (unlikely(is_subclass == -1)) {
36695                     goto bad;
36696                 } else {
36697                     type = instance_class;
36698                 }
36699             }
36700         }
36701         if (!instance_class) {
36702             PyObject *args;
36703             if (!value)
36704                 args = PyTuple_New(0);
36705             else if (PyTuple_Check(value)) {
36706                 Py_INCREF(value);
36707                 args = value;
36708             } else
36709                 args = PyTuple_Pack(1, value);
36710             if (!args)
36711                 goto bad;
36712             owned_instance = PyObject_Call(type, args, NULL);
36713             Py_DECREF(args);
36714             if (!owned_instance)
36715                 goto bad;
36716             value = owned_instance;
36717             if (!PyExceptionInstance_Check(value)) {
36718                 PyErr_Format(PyExc_TypeError,
36719                              "calling %R should have returned an instance of "
36720                              "BaseException, not %R",
36721                              type, Py_TYPE(value));
36722                 goto bad;
36723             }
36724         }
36725     } else {
36726         PyErr_SetString(PyExc_TypeError,
36727             "raise: exception class must be a subclass of BaseException");
36728         goto bad;
36729     }
36730     if (cause) {
36731         PyObject *fixed_cause;
36732         if (cause == Py_None) {
36733             fixed_cause = NULL;
36734         } else if (PyExceptionClass_Check(cause)) {
36735             fixed_cause = PyObject_CallObject(cause, NULL);
36736             if (fixed_cause == NULL)
36737                 goto bad;
36738         } else if (PyExceptionInstance_Check(cause)) {
36739             fixed_cause = cause;
36740             Py_INCREF(fixed_cause);
36741         } else {
36742             PyErr_SetString(PyExc_TypeError,
36743                             "exception causes must derive from "
36744                             "BaseException");
36745             goto bad;
36746         }
36747         PyException_SetCause(value, fixed_cause);
36748     }
36749     PyErr_SetObject(type, value);
36750     if (tb) {
36751 #if CYTHON_COMPILING_IN_PYPY
36752         PyObject *tmp_type, *tmp_value, *tmp_tb;
36753         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
36754         Py_INCREF(tb);
36755         PyErr_Restore(tmp_type, tmp_value, tb);
36756         Py_XDECREF(tmp_tb);
36757 #else
36758         PyThreadState *tstate = __Pyx_PyThreadState_Current;
36759         PyObject* tmp_tb = tstate->curexc_traceback;
36760         if (tb != tmp_tb) {
36761             Py_INCREF(tb);
36762             tstate->curexc_traceback = tb;
36763             Py_XDECREF(tmp_tb);
36764         }
36765 #endif
36766     }
36767 bad:
36768     Py_XDECREF(owned_instance);
36769     return;
36770 }
36771 #endif
36772 
36773 /* set_iter */
__Pyx_set_iterator(PyObject * iterable,int is_set,Py_ssize_t * p_orig_length,int * p_source_is_set)36774 static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
36775                                                   Py_ssize_t* p_orig_length, int* p_source_is_set) {
36776 #if CYTHON_COMPILING_IN_CPYTHON
36777     is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable));
36778     *p_source_is_set = is_set;
36779     if (likely(is_set)) {
36780         *p_orig_length = PySet_Size(iterable);
36781         Py_INCREF(iterable);
36782         return iterable;
36783     }
36784 #else
36785     (void)is_set;
36786     *p_source_is_set = 0;
36787 #endif
36788     *p_orig_length = 0;
36789     return PyObject_GetIter(iterable);
36790 }
__Pyx_set_iter_next(PyObject * iter_obj,Py_ssize_t orig_length,Py_ssize_t * ppos,PyObject ** value,int source_is_set)36791 static CYTHON_INLINE int __Pyx_set_iter_next(
36792         PyObject* iter_obj, Py_ssize_t orig_length,
36793         Py_ssize_t* ppos, PyObject **value,
36794         int source_is_set) {
36795     if (!CYTHON_COMPILING_IN_CPYTHON || unlikely(!source_is_set)) {
36796         *value = PyIter_Next(iter_obj);
36797         if (unlikely(!*value)) {
36798             return __Pyx_IterFinish();
36799         }
36800         (void)orig_length;
36801         (void)ppos;
36802         return 1;
36803     }
36804 #if CYTHON_COMPILING_IN_CPYTHON
36805     if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) {
36806         PyErr_SetString(
36807             PyExc_RuntimeError,
36808             "set changed size during iteration");
36809         return -1;
36810     }
36811     {
36812         Py_hash_t hash;
36813         int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash);
36814         assert (ret != -1);
36815         if (likely(ret)) {
36816             Py_INCREF(*value);
36817             return 1;
36818         }
36819     }
36820 #endif
36821     return 0;
36822 }
36823 
36824 /* DictGetItem */
36825 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)36826 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
36827     PyObject *value;
36828     value = PyDict_GetItemWithError(d, key);
36829     if (unlikely(!value)) {
36830         if (!PyErr_Occurred()) {
36831             if (unlikely(PyTuple_Check(key))) {
36832                 PyObject* args = PyTuple_Pack(1, key);
36833                 if (likely(args)) {
36834                     PyErr_SetObject(PyExc_KeyError, args);
36835                     Py_DECREF(args);
36836                 }
36837             } else {
36838                 PyErr_SetObject(PyExc_KeyError, key);
36839             }
36840         }
36841         return NULL;
36842     }
36843     Py_INCREF(value);
36844     return value;
36845 }
36846 #endif
36847 
36848 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)36849 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
36850     if (unlikely(!type)) {
36851         PyErr_SetString(PyExc_SystemError, "Missing type object");
36852         return 0;
36853     }
36854     if (likely(__Pyx_TypeCheck(obj, type)))
36855         return 1;
36856     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
36857                  Py_TYPE(obj)->tp_name, type->tp_name);
36858     return 0;
36859 }
36860 
36861 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)36862 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
36863 {
36864   union {
36865     uint32_t u32;
36866     uint8_t u8[4];
36867   } S;
36868   S.u32 = 0x01020304;
36869   return S.u8[0] == 4;
36870 }
36871 
36872 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)36873 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
36874                               __Pyx_BufFmt_StackElem* stack,
36875                               __Pyx_TypeInfo* type) {
36876   stack[0].field = &ctx->root;
36877   stack[0].parent_offset = 0;
36878   ctx->root.type = type;
36879   ctx->root.name = "buffer dtype";
36880   ctx->root.offset = 0;
36881   ctx->head = stack;
36882   ctx->head->field = &ctx->root;
36883   ctx->fmt_offset = 0;
36884   ctx->head->parent_offset = 0;
36885   ctx->new_packmode = '@';
36886   ctx->enc_packmode = '@';
36887   ctx->new_count = 1;
36888   ctx->enc_count = 0;
36889   ctx->enc_type = 0;
36890   ctx->is_complex = 0;
36891   ctx->is_valid_array = 0;
36892   ctx->struct_alignment = 0;
36893   while (type->typegroup == 'S') {
36894     ++ctx->head;
36895     ctx->head->field = type->fields;
36896     ctx->head->parent_offset = 0;
36897     type = type->fields->type;
36898   }
36899 }
__Pyx_BufFmt_ParseNumber(const char ** ts)36900 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
36901     int count;
36902     const char* t = *ts;
36903     if (*t < '0' || *t > '9') {
36904       return -1;
36905     } else {
36906         count = *t++ - '0';
36907         while (*t >= '0' && *t <= '9') {
36908             count *= 10;
36909             count += *t++ - '0';
36910         }
36911     }
36912     *ts = t;
36913     return count;
36914 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)36915 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
36916     int number = __Pyx_BufFmt_ParseNumber(ts);
36917     if (number == -1)
36918         PyErr_Format(PyExc_ValueError,\
36919                      "Does not understand character buffer dtype format string ('%c')", **ts);
36920     return number;
36921 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)36922 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
36923   PyErr_Format(PyExc_ValueError,
36924                "Unexpected format string character: '%c'", ch);
36925 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)36926 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
36927   switch (ch) {
36928     case '?': return "'bool'";
36929     case 'c': return "'char'";
36930     case 'b': return "'signed char'";
36931     case 'B': return "'unsigned char'";
36932     case 'h': return "'short'";
36933     case 'H': return "'unsigned short'";
36934     case 'i': return "'int'";
36935     case 'I': return "'unsigned int'";
36936     case 'l': return "'long'";
36937     case 'L': return "'unsigned long'";
36938     case 'q': return "'long long'";
36939     case 'Q': return "'unsigned long long'";
36940     case 'f': return (is_complex ? "'complex float'" : "'float'");
36941     case 'd': return (is_complex ? "'complex double'" : "'double'");
36942     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
36943     case 'T': return "a struct";
36944     case 'O': return "Python object";
36945     case 'P': return "a pointer";
36946     case 's': case 'p': return "a string";
36947     case 0: return "end";
36948     default: return "unparseable format string";
36949   }
36950 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)36951 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
36952   switch (ch) {
36953     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36954     case 'h': case 'H': return 2;
36955     case 'i': case 'I': case 'l': case 'L': return 4;
36956     case 'q': case 'Q': return 8;
36957     case 'f': return (is_complex ? 8 : 4);
36958     case 'd': return (is_complex ? 16 : 8);
36959     case 'g': {
36960       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
36961       return 0;
36962     }
36963     case 'O': case 'P': return sizeof(void*);
36964     default:
36965       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36966       return 0;
36967     }
36968 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)36969 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
36970   switch (ch) {
36971     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36972     case 'h': case 'H': return sizeof(short);
36973     case 'i': case 'I': return sizeof(int);
36974     case 'l': case 'L': return sizeof(long);
36975     #ifdef HAVE_LONG_LONG
36976     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
36977     #endif
36978     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
36979     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
36980     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
36981     case 'O': case 'P': return sizeof(void*);
36982     default: {
36983       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36984       return 0;
36985     }
36986   }
36987 }
36988 typedef struct { char c; short x; } __Pyx_st_short;
36989 typedef struct { char c; int x; } __Pyx_st_int;
36990 typedef struct { char c; long x; } __Pyx_st_long;
36991 typedef struct { char c; float x; } __Pyx_st_float;
36992 typedef struct { char c; double x; } __Pyx_st_double;
36993 typedef struct { char c; long double x; } __Pyx_st_longdouble;
36994 typedef struct { char c; void *x; } __Pyx_st_void_p;
36995 #ifdef HAVE_LONG_LONG
36996 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
36997 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)36998 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
36999   switch (ch) {
37000     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
37001     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
37002     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
37003     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
37004 #ifdef HAVE_LONG_LONG
37005     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
37006 #endif
37007     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
37008     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
37009     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
37010     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
37011     default:
37012       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
37013       return 0;
37014     }
37015 }
37016 /* These are for computing the padding at the end of the struct to align
37017    on the first member of the struct. This will probably the same as above,
37018    but we don't have any guarantees.
37019  */
37020 typedef struct { short x; char c; } __Pyx_pad_short;
37021 typedef struct { int x; char c; } __Pyx_pad_int;
37022 typedef struct { long x; char c; } __Pyx_pad_long;
37023 typedef struct { float x; char c; } __Pyx_pad_float;
37024 typedef struct { double x; char c; } __Pyx_pad_double;
37025 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
37026 typedef struct { void *x; char c; } __Pyx_pad_void_p;
37027 #ifdef HAVE_LONG_LONG
37028 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
37029 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)37030 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
37031   switch (ch) {
37032     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
37033     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
37034     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
37035     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
37036 #ifdef HAVE_LONG_LONG
37037     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
37038 #endif
37039     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
37040     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
37041     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
37042     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
37043     default:
37044       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
37045       return 0;
37046     }
37047 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)37048 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
37049   switch (ch) {
37050     case 'c':
37051         return 'H';
37052     case 'b': case 'h': case 'i':
37053     case 'l': case 'q': case 's': case 'p':
37054         return 'I';
37055     case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
37056         return 'U';
37057     case 'f': case 'd': case 'g':
37058         return (is_complex ? 'C' : 'R');
37059     case 'O':
37060         return 'O';
37061     case 'P':
37062         return 'P';
37063     default: {
37064       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
37065       return 0;
37066     }
37067   }
37068 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)37069 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
37070   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
37071     const char* expected;
37072     const char* quote;
37073     if (ctx->head == NULL) {
37074       expected = "end";
37075       quote = "";
37076     } else {
37077       expected = ctx->head->field->type->name;
37078       quote = "'";
37079     }
37080     PyErr_Format(PyExc_ValueError,
37081                  "Buffer dtype mismatch, expected %s%s%s but got %s",
37082                  quote, expected, quote,
37083                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
37084   } else {
37085     __Pyx_StructField* field = ctx->head->field;
37086     __Pyx_StructField* parent = (ctx->head - 1)->field;
37087     PyErr_Format(PyExc_ValueError,
37088                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
37089                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
37090                  parent->type->name, field->name);
37091   }
37092 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)37093 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
37094   char group;
37095   size_t size, offset, arraysize = 1;
37096   if (ctx->enc_type == 0) return 0;
37097   if (ctx->head->field->type->arraysize[0]) {
37098     int i, ndim = 0;
37099     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
37100         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
37101         ndim = 1;
37102         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
37103             PyErr_Format(PyExc_ValueError,
37104                          "Expected a dimension of size %zu, got %zu",
37105                          ctx->head->field->type->arraysize[0], ctx->enc_count);
37106             return -1;
37107         }
37108     }
37109     if (!ctx->is_valid_array) {
37110       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
37111                    ctx->head->field->type->ndim, ndim);
37112       return -1;
37113     }
37114     for (i = 0; i < ctx->head->field->type->ndim; i++) {
37115       arraysize *= ctx->head->field->type->arraysize[i];
37116     }
37117     ctx->is_valid_array = 0;
37118     ctx->enc_count = 1;
37119   }
37120   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
37121   do {
37122     __Pyx_StructField* field = ctx->head->field;
37123     __Pyx_TypeInfo* type = field->type;
37124     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
37125       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
37126     } else {
37127       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
37128     }
37129     if (ctx->enc_packmode == '@') {
37130       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
37131       size_t align_mod_offset;
37132       if (align_at == 0) return -1;
37133       align_mod_offset = ctx->fmt_offset % align_at;
37134       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
37135       if (ctx->struct_alignment == 0)
37136           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
37137                                                                  ctx->is_complex);
37138     }
37139     if (type->size != size || type->typegroup != group) {
37140       if (type->typegroup == 'C' && type->fields != NULL) {
37141         size_t parent_offset = ctx->head->parent_offset + field->offset;
37142         ++ctx->head;
37143         ctx->head->field = type->fields;
37144         ctx->head->parent_offset = parent_offset;
37145         continue;
37146       }
37147       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
37148       } else {
37149           __Pyx_BufFmt_RaiseExpected(ctx);
37150           return -1;
37151       }
37152     }
37153     offset = ctx->head->parent_offset + field->offset;
37154     if (ctx->fmt_offset != offset) {
37155       PyErr_Format(PyExc_ValueError,
37156                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
37157                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
37158       return -1;
37159     }
37160     ctx->fmt_offset += size;
37161     if (arraysize)
37162       ctx->fmt_offset += (arraysize - 1) * size;
37163     --ctx->enc_count;
37164     while (1) {
37165       if (field == &ctx->root) {
37166         ctx->head = NULL;
37167         if (ctx->enc_count != 0) {
37168           __Pyx_BufFmt_RaiseExpected(ctx);
37169           return -1;
37170         }
37171         break;
37172       }
37173       ctx->head->field = ++field;
37174       if (field->type == NULL) {
37175         --ctx->head;
37176         field = ctx->head->field;
37177         continue;
37178       } else if (field->type->typegroup == 'S') {
37179         size_t parent_offset = ctx->head->parent_offset + field->offset;
37180         if (field->type->fields->type == NULL) continue;
37181         field = field->type->fields;
37182         ++ctx->head;
37183         ctx->head->field = field;
37184         ctx->head->parent_offset = parent_offset;
37185         break;
37186       } else {
37187         break;
37188       }
37189     }
37190   } while (ctx->enc_count);
37191   ctx->enc_type = 0;
37192   ctx->is_complex = 0;
37193   return 0;
37194 }
37195 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)37196 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
37197 {
37198     const char *ts = *tsp;
37199     int i = 0, number;
37200     int ndim = ctx->head->field->type->ndim;
37201 ;
37202     ++ts;
37203     if (ctx->new_count != 1) {
37204         PyErr_SetString(PyExc_ValueError,
37205                         "Cannot handle repeated arrays in format string");
37206         return NULL;
37207     }
37208     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
37209     while (*ts && *ts != ')') {
37210         switch (*ts) {
37211             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
37212             default:  break;
37213         }
37214         number = __Pyx_BufFmt_ExpectNumber(&ts);
37215         if (number == -1) return NULL;
37216         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
37217             return PyErr_Format(PyExc_ValueError,
37218                         "Expected a dimension of size %zu, got %d",
37219                         ctx->head->field->type->arraysize[i], number);
37220         if (*ts != ',' && *ts != ')')
37221             return PyErr_Format(PyExc_ValueError,
37222                                 "Expected a comma in format string, got '%c'", *ts);
37223         if (*ts == ',') ts++;
37224         i++;
37225     }
37226     if (i != ndim)
37227         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
37228                             ctx->head->field->type->ndim, i);
37229     if (!*ts) {
37230         PyErr_SetString(PyExc_ValueError,
37231                         "Unexpected end of format string, expected ')'");
37232         return NULL;
37233     }
37234     ctx->is_valid_array = 1;
37235     ctx->new_count = 1;
37236     *tsp = ++ts;
37237     return Py_None;
37238 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)37239 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
37240   int got_Z = 0;
37241   while (1) {
37242     switch(*ts) {
37243       case 0:
37244         if (ctx->enc_type != 0 && ctx->head == NULL) {
37245           __Pyx_BufFmt_RaiseExpected(ctx);
37246           return NULL;
37247         }
37248         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
37249         if (ctx->head != NULL) {
37250           __Pyx_BufFmt_RaiseExpected(ctx);
37251           return NULL;
37252         }
37253         return ts;
37254       case ' ':
37255       case '\r':
37256       case '\n':
37257         ++ts;
37258         break;
37259       case '<':
37260         if (!__Pyx_Is_Little_Endian()) {
37261           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
37262           return NULL;
37263         }
37264         ctx->new_packmode = '=';
37265         ++ts;
37266         break;
37267       case '>':
37268       case '!':
37269         if (__Pyx_Is_Little_Endian()) {
37270           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
37271           return NULL;
37272         }
37273         ctx->new_packmode = '=';
37274         ++ts;
37275         break;
37276       case '=':
37277       case '@':
37278       case '^':
37279         ctx->new_packmode = *ts++;
37280         break;
37281       case 'T':
37282         {
37283           const char* ts_after_sub;
37284           size_t i, struct_count = ctx->new_count;
37285           size_t struct_alignment = ctx->struct_alignment;
37286           ctx->new_count = 1;
37287           ++ts;
37288           if (*ts != '{') {
37289             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
37290             return NULL;
37291           }
37292           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
37293           ctx->enc_type = 0;
37294           ctx->enc_count = 0;
37295           ctx->struct_alignment = 0;
37296           ++ts;
37297           ts_after_sub = ts;
37298           for (i = 0; i != struct_count; ++i) {
37299             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
37300             if (!ts_after_sub) return NULL;
37301           }
37302           ts = ts_after_sub;
37303           if (struct_alignment) ctx->struct_alignment = struct_alignment;
37304         }
37305         break;
37306       case '}':
37307         {
37308           size_t alignment = ctx->struct_alignment;
37309           ++ts;
37310           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
37311           ctx->enc_type = 0;
37312           if (alignment && ctx->fmt_offset % alignment) {
37313             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
37314           }
37315         }
37316         return ts;
37317       case 'x':
37318         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
37319         ctx->fmt_offset += ctx->new_count;
37320         ctx->new_count = 1;
37321         ctx->enc_count = 0;
37322         ctx->enc_type = 0;
37323         ctx->enc_packmode = ctx->new_packmode;
37324         ++ts;
37325         break;
37326       case 'Z':
37327         got_Z = 1;
37328         ++ts;
37329         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
37330           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
37331           return NULL;
37332         }
37333         CYTHON_FALLTHROUGH;
37334       case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
37335       case 'l': case 'L': case 'q': case 'Q':
37336       case 'f': case 'd': case 'g':
37337       case 'O': case 'p':
37338         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
37339             ctx->enc_packmode == ctx->new_packmode) {
37340           ctx->enc_count += ctx->new_count;
37341           ctx->new_count = 1;
37342           got_Z = 0;
37343           ++ts;
37344           break;
37345         }
37346         CYTHON_FALLTHROUGH;
37347       case 's':
37348         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
37349         ctx->enc_count = ctx->new_count;
37350         ctx->enc_packmode = ctx->new_packmode;
37351         ctx->enc_type = *ts;
37352         ctx->is_complex = got_Z;
37353         ++ts;
37354         ctx->new_count = 1;
37355         got_Z = 0;
37356         break;
37357       case ':':
37358         ++ts;
37359         while(*ts != ':') ++ts;
37360         ++ts;
37361         break;
37362       case '(':
37363         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
37364         break;
37365       default:
37366         {
37367           int number = __Pyx_BufFmt_ExpectNumber(&ts);
37368           if (number == -1) return NULL;
37369           ctx->new_count = (size_t)number;
37370         }
37371     }
37372   }
37373 }
37374 
37375 /* BufferGetAndValidate */
__Pyx_SafeReleaseBuffer(Py_buffer * info)37376   static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
37377   if (unlikely(info->buf == NULL)) return;
37378   if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
37379   __Pyx_ReleaseBuffer(info);
37380 }
__Pyx_ZeroBuffer(Py_buffer * buf)37381 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
37382   buf->buf = NULL;
37383   buf->obj = NULL;
37384   buf->strides = __Pyx_zeros;
37385   buf->shape = __Pyx_zeros;
37386   buf->suboffsets = __Pyx_minusones;
37387 }
__Pyx__GetBufferAndValidate(Py_buffer * buf,PyObject * obj,__Pyx_TypeInfo * dtype,int flags,int nd,int cast,__Pyx_BufFmt_StackElem * stack)37388 static int __Pyx__GetBufferAndValidate(
37389         Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
37390         int nd, int cast, __Pyx_BufFmt_StackElem* stack)
37391 {
37392   buf->buf = NULL;
37393   if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
37394     __Pyx_ZeroBuffer(buf);
37395     return -1;
37396   }
37397   if (unlikely(buf->ndim != nd)) {
37398     PyErr_Format(PyExc_ValueError,
37399                  "Buffer has wrong number of dimensions (expected %d, got %d)",
37400                  nd, buf->ndim);
37401     goto fail;
37402   }
37403   if (!cast) {
37404     __Pyx_BufFmt_Context ctx;
37405     __Pyx_BufFmt_Init(&ctx, stack, dtype);
37406     if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
37407   }
37408   if (unlikely((size_t)buf->itemsize != dtype->size)) {
37409     PyErr_Format(PyExc_ValueError,
37410       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
37411       buf->itemsize, (buf->itemsize > 1) ? "s" : "",
37412       dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
37413     goto fail;
37414   }
37415   if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
37416   return 0;
37417 fail:;
37418   __Pyx_SafeReleaseBuffer(buf);
37419   return -1;
37420 }
37421 
37422 /* BufferFallbackError */
__Pyx_RaiseBufferFallbackError(void)37423   static void __Pyx_RaiseBufferFallbackError(void) {
37424   PyErr_SetString(PyExc_ValueError,
37425      "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
37426 }
37427 
37428 /* decode_c_bytes */
__Pyx_decode_c_bytes(const char * cstring,Py_ssize_t length,Py_ssize_t start,Py_ssize_t stop,const char * encoding,const char * errors,PyObject * (* decode_func)(const char * s,Py_ssize_t size,const char * errors))37429   static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
37430          const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
37431          const char* encoding, const char* errors,
37432          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
37433     if (unlikely((start < 0) | (stop < 0))) {
37434         if (start < 0) {
37435             start += length;
37436             if (start < 0)
37437                 start = 0;
37438         }
37439         if (stop < 0)
37440             stop += length;
37441     }
37442     if (stop > length)
37443         stop = length;
37444     length = stop - start;
37445     if (unlikely(length <= 0))
37446         return PyUnicode_FromUnicode(NULL, 0);
37447     cstring += start;
37448     if (decode_func) {
37449         return decode_func(cstring, length, errors);
37450     } else {
37451         return PyUnicode_Decode(cstring, length, encoding, errors);
37452     }
37453 }
37454 
37455 /* PyObjectFormat */
37456   #if CYTHON_USE_UNICODE_WRITER
__Pyx_PyObject_Format(PyObject * obj,PyObject * format_spec)37457 static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
37458     int ret;
37459     _PyUnicodeWriter writer;
37460     if (likely(PyFloat_CheckExact(obj))) {
37461 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
37462         _PyUnicodeWriter_Init(&writer, 0);
37463 #else
37464         _PyUnicodeWriter_Init(&writer);
37465 #endif
37466         ret = _PyFloat_FormatAdvancedWriter(
37467             &writer,
37468             obj,
37469             format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
37470     } else if (likely(PyLong_CheckExact(obj))) {
37471 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
37472         _PyUnicodeWriter_Init(&writer, 0);
37473 #else
37474         _PyUnicodeWriter_Init(&writer);
37475 #endif
37476         ret = _PyLong_FormatAdvancedWriter(
37477             &writer,
37478             obj,
37479             format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
37480     } else {
37481         return PyObject_Format(obj, format_spec);
37482     }
37483     if (unlikely(ret == -1)) {
37484         _PyUnicodeWriter_Dealloc(&writer);
37485         return NULL;
37486     }
37487     return _PyUnicodeWriter_Finish(&writer);
37488 }
37489 #endif
37490 
37491 /* BufferIndexError */
__Pyx_RaiseBufferIndexError(int axis)37492   static void __Pyx_RaiseBufferIndexError(int axis) {
37493   PyErr_Format(PyExc_IndexError,
37494      "Out of bounds on buffer access (axis %d)", axis);
37495 }
37496 
37497 /* JoinPyUnicode */
__Pyx_PyUnicode_Join(PyObject * value_tuple,Py_ssize_t value_count,Py_ssize_t result_ulength,CYTHON_UNUSED Py_UCS4 max_char)37498   static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
37499                                       CYTHON_UNUSED Py_UCS4 max_char) {
37500 #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37501     PyObject *result_uval;
37502     int result_ukind;
37503     Py_ssize_t i, char_pos;
37504     void *result_udata;
37505 #if CYTHON_PEP393_ENABLED
37506     result_uval = PyUnicode_New(result_ulength, max_char);
37507     if (unlikely(!result_uval)) return NULL;
37508     result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
37509     result_udata = PyUnicode_DATA(result_uval);
37510 #else
37511     result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
37512     if (unlikely(!result_uval)) return NULL;
37513     result_ukind = sizeof(Py_UNICODE);
37514     result_udata = PyUnicode_AS_UNICODE(result_uval);
37515 #endif
37516     char_pos = 0;
37517     for (i=0; i < value_count; i++) {
37518         int ukind;
37519         Py_ssize_t ulength;
37520         void *udata;
37521         PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
37522         if (unlikely(__Pyx_PyUnicode_READY(uval)))
37523             goto bad;
37524         ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
37525         if (unlikely(!ulength))
37526             continue;
37527         if (unlikely(char_pos + ulength < 0))
37528             goto overflow;
37529         ukind = __Pyx_PyUnicode_KIND(uval);
37530         udata = __Pyx_PyUnicode_DATA(uval);
37531         if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
37532             memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
37533         } else {
37534             #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
37535             _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
37536             #else
37537             Py_ssize_t j;
37538             for (j=0; j < ulength; j++) {
37539                 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
37540                 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
37541             }
37542             #endif
37543         }
37544         char_pos += ulength;
37545     }
37546     return result_uval;
37547 overflow:
37548     PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
37549 bad:
37550     Py_DECREF(result_uval);
37551     return NULL;
37552 #else
37553     result_ulength++;
37554     value_count++;
37555     return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
37556 #endif
37557 }
37558 
37559 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)37560   static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
37561     PyObject *args, *result = NULL;
37562     #if CYTHON_FAST_PYCALL
37563     if (PyFunction_Check(function)) {
37564         PyObject *args[2] = {arg1, arg2};
37565         return __Pyx_PyFunction_FastCall(function, args, 2);
37566     }
37567     #endif
37568     #if CYTHON_FAST_PYCCALL
37569     if (__Pyx_PyFastCFunction_Check(function)) {
37570         PyObject *args[2] = {arg1, arg2};
37571         return __Pyx_PyCFunction_FastCall(function, args, 2);
37572     }
37573     #endif
37574     args = PyTuple_New(2);
37575     if (unlikely(!args)) goto done;
37576     Py_INCREF(arg1);
37577     PyTuple_SET_ITEM(args, 0, arg1);
37578     Py_INCREF(arg2);
37579     PyTuple_SET_ITEM(args, 1, arg2);
37580     Py_INCREF(function);
37581     result = __Pyx_PyObject_Call(function, args, NULL);
37582     Py_DECREF(args);
37583     Py_DECREF(function);
37584 done:
37585     return result;
37586 }
37587 
37588 /* UnpackUnboundCMethod */
__Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction * target)37589   static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
37590     PyObject *method;
37591     method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
37592     if (unlikely(!method))
37593         return -1;
37594     target->method = method;
37595 #if CYTHON_COMPILING_IN_CPYTHON
37596     #if PY_MAJOR_VERSION >= 3
37597     if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
37598     #endif
37599     {
37600         PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
37601         target->func = descr->d_method->ml_meth;
37602         target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
37603     }
37604 #endif
37605     return 0;
37606 }
37607 
37608 /* CallUnboundCMethod1 */
37609   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction * cfunc,PyObject * self,PyObject * arg)37610 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
37611     if (likely(cfunc->func)) {
37612         int flag = cfunc->flag;
37613         if (flag == METH_O) {
37614             return (*(cfunc->func))(self, arg);
37615         } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
37616             if (PY_VERSION_HEX >= 0x030700A0) {
37617                 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
37618             } else {
37619                 return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
37620             }
37621         } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
37622             return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
37623         }
37624     }
37625     return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
37626 }
37627 #endif
__Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction * cfunc,PyObject * self,PyObject * arg)37628 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
37629     PyObject *args, *result = NULL;
37630     if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
37631 #if CYTHON_COMPILING_IN_CPYTHON
37632     if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
37633         args = PyTuple_New(1);
37634         if (unlikely(!args)) goto bad;
37635         Py_INCREF(arg);
37636         PyTuple_SET_ITEM(args, 0, arg);
37637         if (cfunc->flag & METH_KEYWORDS)
37638             result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
37639         else
37640             result = (*cfunc->func)(self, args);
37641     } else {
37642         args = PyTuple_New(2);
37643         if (unlikely(!args)) goto bad;
37644         Py_INCREF(self);
37645         PyTuple_SET_ITEM(args, 0, self);
37646         Py_INCREF(arg);
37647         PyTuple_SET_ITEM(args, 1, arg);
37648         result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
37649     }
37650 #else
37651     args = PyTuple_Pack(2, self, arg);
37652     if (unlikely(!args)) goto bad;
37653     result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
37654 #endif
37655 bad:
37656     Py_XDECREF(args);
37657     return result;
37658 }
37659 
37660 /* CallUnboundCMethod0 */
__Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction * cfunc,PyObject * self)37661   static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
37662     PyObject *args, *result = NULL;
37663     if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
37664 #if CYTHON_ASSUME_SAFE_MACROS
37665     args = PyTuple_New(1);
37666     if (unlikely(!args)) goto bad;
37667     Py_INCREF(self);
37668     PyTuple_SET_ITEM(args, 0, self);
37669 #else
37670     args = PyTuple_Pack(1, self);
37671     if (unlikely(!args)) goto bad;
37672 #endif
37673     result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
37674     Py_DECREF(args);
37675 bad:
37676     return result;
37677 }
37678 
37679 /* py_dict_keys */
__Pyx_PyDict_Keys(PyObject * d)37680   static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
37681     if (PY_MAJOR_VERSION >= 3)
37682         return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d);
37683     else
37684         return PyDict_Keys(d);
37685 }
37686 
37687 /* py_dict_values */
__Pyx_PyDict_Values(PyObject * d)37688   static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
37689     if (PY_MAJOR_VERSION >= 3)
37690         return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
37691     else
37692         return PyDict_Values(d);
37693 }
37694 
37695 /* PyObjectFormatAndDecref */
__Pyx_PyObject_FormatSimpleAndDecref(PyObject * s,PyObject * f)37696   static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
37697     if (unlikely(!s)) return NULL;
37698     if (likely(PyUnicode_CheckExact(s))) return s;
37699     #if PY_MAJOR_VERSION < 3
37700     if (likely(PyString_CheckExact(s))) {
37701         PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
37702         Py_DECREF(s);
37703         return result;
37704     }
37705     #endif
37706     return __Pyx_PyObject_FormatAndDecref(s, f);
37707 }
__Pyx_PyObject_FormatAndDecref(PyObject * s,PyObject * f)37708 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
37709     PyObject *result = PyObject_Format(s, f);
37710     Py_DECREF(s);
37711     return result;
37712 }
37713 
37714 /* PyUnicode_Unicode */
__Pyx_PyUnicode_Unicode(PyObject * obj)37715   static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
37716     if (unlikely(obj == Py_None))
37717         obj = __pyx_kp_u_None;
37718     return __Pyx_NewRef(obj);
37719 }
37720 
37721 /* PyIntCompare */
__Pyx_PyInt_EqObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,CYTHON_UNUSED long inplace)37722   static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
37723     if (op1 == op2) {
37724         Py_RETURN_TRUE;
37725     }
37726     #if PY_MAJOR_VERSION < 3
37727     if (likely(PyInt_CheckExact(op1))) {
37728         const long b = intval;
37729         long a = PyInt_AS_LONG(op1);
37730         if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
37731     }
37732     #endif
37733     #if CYTHON_USE_PYLONG_INTERNALS
37734     if (likely(PyLong_CheckExact(op1))) {
37735         int unequal;
37736         unsigned long uintval;
37737         Py_ssize_t size = Py_SIZE(op1);
37738         const digit* digits = ((PyLongObject*)op1)->ob_digit;
37739         if (intval == 0) {
37740             if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
37741         } else if (intval < 0) {
37742             if (size >= 0)
37743                 Py_RETURN_FALSE;
37744             intval = -intval;
37745             size = -size;
37746         } else {
37747             if (size <= 0)
37748                 Py_RETURN_FALSE;
37749         }
37750         uintval = (unsigned long) intval;
37751 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
37752         if (uintval >> (PyLong_SHIFT * 4)) {
37753             unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
37754                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
37755         } else
37756 #endif
37757 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
37758         if (uintval >> (PyLong_SHIFT * 3)) {
37759             unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
37760                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
37761         } else
37762 #endif
37763 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
37764         if (uintval >> (PyLong_SHIFT * 2)) {
37765             unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
37766                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
37767         } else
37768 #endif
37769 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
37770         if (uintval >> (PyLong_SHIFT * 1)) {
37771             unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
37772                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
37773         } else
37774 #endif
37775             unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
37776         if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
37777     }
37778     #endif
37779     if (PyFloat_CheckExact(op1)) {
37780         const long b = intval;
37781         double a = PyFloat_AS_DOUBLE(op1);
37782         if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
37783     }
37784     return (
37785         PyObject_RichCompare(op1, op2, Py_EQ));
37786 }
37787 
37788 /* None */
__Pyx_div_long(long a,long b)37789   static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
37790     long q = a / b;
37791     long r = a - q*b;
37792     q -= ((r != 0) & ((r ^ b) < 0));
37793     return q;
37794 }
37795 
37796 /* PyIntFromDouble */
37797   #if PY_MAJOR_VERSION < 3
__Pyx_PyInt_FromDouble(double value)37798 static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value) {
37799     if (value >= (double)LONG_MIN && value <= (double)LONG_MAX) {
37800         return PyInt_FromLong((long)value);
37801     }
37802     return PyLong_FromDouble(value);
37803 }
37804 #endif
37805 
37806 /* None */
__Pyx_RaiseUnboundLocalError(const char * varname)37807   static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
37808     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
37809 }
37810 
37811 /* PyIntBinop */
37812   #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_SubtractObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)37813 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
37814     (void)inplace;
37815     (void)zerodivision_check;
37816     #if PY_MAJOR_VERSION < 3
37817     if (likely(PyInt_CheckExact(op1))) {
37818         const long b = intval;
37819         long x;
37820         long a = PyInt_AS_LONG(op1);
37821             x = (long)((unsigned long)a - b);
37822             if (likely((x^a) >= 0 || (x^~b) >= 0))
37823                 return PyInt_FromLong(x);
37824             return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
37825     }
37826     #endif
37827     #if CYTHON_USE_PYLONG_INTERNALS
37828     if (likely(PyLong_CheckExact(op1))) {
37829         const long b = intval;
37830         long a, x;
37831 #ifdef HAVE_LONG_LONG
37832         const PY_LONG_LONG llb = intval;
37833         PY_LONG_LONG lla, llx;
37834 #endif
37835         const digit* digits = ((PyLongObject*)op1)->ob_digit;
37836         const Py_ssize_t size = Py_SIZE(op1);
37837         if (likely(__Pyx_sst_abs(size) <= 1)) {
37838             a = likely(size) ? digits[0] : 0;
37839             if (size == -1) a = -a;
37840         } else {
37841             switch (size) {
37842                 case -2:
37843                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
37844                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37845                         break;
37846 #ifdef HAVE_LONG_LONG
37847                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
37848                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
37849                         goto long_long;
37850 #endif
37851                     }
37852                     CYTHON_FALLTHROUGH;
37853                 case 2:
37854                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
37855                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37856                         break;
37857 #ifdef HAVE_LONG_LONG
37858                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
37859                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
37860                         goto long_long;
37861 #endif
37862                     }
37863                     CYTHON_FALLTHROUGH;
37864                 case -3:
37865                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
37866                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37867                         break;
37868 #ifdef HAVE_LONG_LONG
37869                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
37870                         lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
37871                         goto long_long;
37872 #endif
37873                     }
37874                     CYTHON_FALLTHROUGH;
37875                 case 3:
37876                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
37877                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37878                         break;
37879 #ifdef HAVE_LONG_LONG
37880                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
37881                         lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
37882                         goto long_long;
37883 #endif
37884                     }
37885                     CYTHON_FALLTHROUGH;
37886                 case -4:
37887                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
37888                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37889                         break;
37890 #ifdef HAVE_LONG_LONG
37891                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
37892                         lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
37893                         goto long_long;
37894 #endif
37895                     }
37896                     CYTHON_FALLTHROUGH;
37897                 case 4:
37898                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
37899                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37900                         break;
37901 #ifdef HAVE_LONG_LONG
37902                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
37903                         lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
37904                         goto long_long;
37905 #endif
37906                     }
37907                     CYTHON_FALLTHROUGH;
37908                 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
37909             }
37910         }
37911                 x = a - b;
37912             return PyLong_FromLong(x);
37913 #ifdef HAVE_LONG_LONG
37914         long_long:
37915                 llx = lla - llb;
37916             return PyLong_FromLongLong(llx);
37917 #endif
37918 
37919 
37920     }
37921     #endif
37922     if (PyFloat_CheckExact(op1)) {
37923         const long b = intval;
37924         double a = PyFloat_AS_DOUBLE(op1);
37925             double result;
37926             PyFPE_START_PROTECT("subtract", return NULL)
37927             result = ((double)a) - (double)b;
37928             PyFPE_END_PROTECT(result)
37929             return PyFloat_FromDouble(result);
37930     }
37931     return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
37932 }
37933 #endif
37934 
37935 /* StringJoin */
37936   #if !CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyBytes_Join(PyObject * sep,PyObject * values)37937 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
37938     return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
37939 }
37940 #endif
37941 
37942 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)37943   static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
37944 #if CYTHON_USE_TYPE_SLOTS
37945 #if PY_MAJOR_VERSION >= 3
37946     if (likely(PyUnicode_Check(n)))
37947 #else
37948     if (likely(PyString_Check(n)))
37949 #endif
37950         return __Pyx_PyObject_GetAttrStr(o, n);
37951 #endif
37952     return PyObject_GetAttr(o, n);
37953 }
37954 
37955 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)37956   static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
37957     __Pyx_PyThreadState_declare
37958     __Pyx_PyThreadState_assign
37959     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
37960         return NULL;
37961     __Pyx_PyErr_Clear();
37962     Py_INCREF(d);
37963     return d;
37964 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)37965 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
37966     PyObject *r = __Pyx_GetAttr(o, n);
37967     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
37968 }
37969 
37970 /* FetchCommonType */
__Pyx_FetchCommonType(PyTypeObject * type)37971   static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
37972     PyObject* fake_module;
37973     PyTypeObject* cached_type = NULL;
37974     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
37975     if (!fake_module) return NULL;
37976     Py_INCREF(fake_module);
37977     cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
37978     if (cached_type) {
37979         if (!PyType_Check((PyObject*)cached_type)) {
37980             PyErr_Format(PyExc_TypeError,
37981                 "Shared Cython type %.200s is not a type object",
37982                 type->tp_name);
37983             goto bad;
37984         }
37985         if (cached_type->tp_basicsize != type->tp_basicsize) {
37986             PyErr_Format(PyExc_TypeError,
37987                 "Shared Cython type %.200s has the wrong size, try recompiling",
37988                 type->tp_name);
37989             goto bad;
37990         }
37991     } else {
37992         if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
37993         PyErr_Clear();
37994         if (PyType_Ready(type) < 0) goto bad;
37995         if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
37996             goto bad;
37997         Py_INCREF(type);
37998         cached_type = type;
37999     }
38000 done:
38001     Py_DECREF(fake_module);
38002     return cached_type;
38003 bad:
38004     Py_XDECREF(cached_type);
38005     cached_type = NULL;
38006     goto done;
38007 }
38008 
38009 /* CythonFunction */
38010   #include <structmember.h>
38011 static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * closure)38012 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
38013 {
38014     if (unlikely(op->func_doc == NULL)) {
38015         if (op->func.m_ml->ml_doc) {
38016 #if PY_MAJOR_VERSION >= 3
38017             op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
38018 #else
38019             op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
38020 #endif
38021             if (unlikely(op->func_doc == NULL))
38022                 return NULL;
38023         } else {
38024             Py_INCREF(Py_None);
38025             return Py_None;
38026         }
38027     }
38028     Py_INCREF(op->func_doc);
38029     return op->func_doc;
38030 }
38031 static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)38032 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
38033 {
38034     PyObject *tmp = op->func_doc;
38035     if (value == NULL) {
38036         value = Py_None;
38037     }
38038     Py_INCREF(value);
38039     op->func_doc = value;
38040     Py_XDECREF(tmp);
38041     return 0;
38042 }
38043 static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)38044 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
38045 {
38046     if (unlikely(op->func_name == NULL)) {
38047 #if PY_MAJOR_VERSION >= 3
38048         op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
38049 #else
38050         op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
38051 #endif
38052         if (unlikely(op->func_name == NULL))
38053             return NULL;
38054     }
38055     Py_INCREF(op->func_name);
38056     return op->func_name;
38057 }
38058 static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)38059 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
38060 {
38061     PyObject *tmp;
38062 #if PY_MAJOR_VERSION >= 3
38063     if (unlikely(value == NULL || !PyUnicode_Check(value)))
38064 #else
38065     if (unlikely(value == NULL || !PyString_Check(value)))
38066 #endif
38067     {
38068         PyErr_SetString(PyExc_TypeError,
38069                         "__name__ must be set to a string object");
38070         return -1;
38071     }
38072     tmp = op->func_name;
38073     Py_INCREF(value);
38074     op->func_name = value;
38075     Py_XDECREF(tmp);
38076     return 0;
38077 }
38078 static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)38079 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
38080 {
38081     Py_INCREF(op->func_qualname);
38082     return op->func_qualname;
38083 }
38084 static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)38085 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
38086 {
38087     PyObject *tmp;
38088 #if PY_MAJOR_VERSION >= 3
38089     if (unlikely(value == NULL || !PyUnicode_Check(value)))
38090 #else
38091     if (unlikely(value == NULL || !PyString_Check(value)))
38092 #endif
38093     {
38094         PyErr_SetString(PyExc_TypeError,
38095                         "__qualname__ must be set to a string object");
38096         return -1;
38097     }
38098     tmp = op->func_qualname;
38099     Py_INCREF(value);
38100     op->func_qualname = value;
38101     Py_XDECREF(tmp);
38102     return 0;
38103 }
38104 static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject * m,CYTHON_UNUSED void * closure)38105 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
38106 {
38107     PyObject *self;
38108     self = m->func_closure;
38109     if (self == NULL)
38110         self = Py_None;
38111     Py_INCREF(self);
38112     return self;
38113 }
38114 static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)38115 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
38116 {
38117     if (unlikely(op->func_dict == NULL)) {
38118         op->func_dict = PyDict_New();
38119         if (unlikely(op->func_dict == NULL))
38120             return NULL;
38121     }
38122     Py_INCREF(op->func_dict);
38123     return op->func_dict;
38124 }
38125 static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)38126 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
38127 {
38128     PyObject *tmp;
38129     if (unlikely(value == NULL)) {
38130         PyErr_SetString(PyExc_TypeError,
38131                "function's dictionary may not be deleted");
38132         return -1;
38133     }
38134     if (unlikely(!PyDict_Check(value))) {
38135         PyErr_SetString(PyExc_TypeError,
38136                "setting function's dictionary to a non-dict");
38137         return -1;
38138     }
38139     tmp = op->func_dict;
38140     Py_INCREF(value);
38141     op->func_dict = value;
38142     Py_XDECREF(tmp);
38143     return 0;
38144 }
38145 static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)38146 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
38147 {
38148     Py_INCREF(op->func_globals);
38149     return op->func_globals;
38150 }
38151 static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)38152 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
38153 {
38154     Py_INCREF(Py_None);
38155     return Py_None;
38156 }
38157 static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)38158 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
38159 {
38160     PyObject* result = (op->func_code) ? op->func_code : Py_None;
38161     Py_INCREF(result);
38162     return result;
38163 }
38164 static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject * op)38165 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
38166     int result = 0;
38167     PyObject *res = op->defaults_getter((PyObject *) op);
38168     if (unlikely(!res))
38169         return -1;
38170     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
38171     op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
38172     Py_INCREF(op->defaults_tuple);
38173     op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
38174     Py_INCREF(op->defaults_kwdict);
38175     #else
38176     op->defaults_tuple = PySequence_ITEM(res, 0);
38177     if (unlikely(!op->defaults_tuple)) result = -1;
38178     else {
38179         op->defaults_kwdict = PySequence_ITEM(res, 1);
38180         if (unlikely(!op->defaults_kwdict)) result = -1;
38181     }
38182     #endif
38183     Py_DECREF(res);
38184     return result;
38185 }
38186 static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)38187 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
38188     PyObject* tmp;
38189     if (!value) {
38190         value = Py_None;
38191     } else if (value != Py_None && !PyTuple_Check(value)) {
38192         PyErr_SetString(PyExc_TypeError,
38193                         "__defaults__ must be set to a tuple object");
38194         return -1;
38195     }
38196     Py_INCREF(value);
38197     tmp = op->defaults_tuple;
38198     op->defaults_tuple = value;
38199     Py_XDECREF(tmp);
38200     return 0;
38201 }
38202 static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)38203 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
38204     PyObject* result = op->defaults_tuple;
38205     if (unlikely(!result)) {
38206         if (op->defaults_getter) {
38207             if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
38208             result = op->defaults_tuple;
38209         } else {
38210             result = Py_None;
38211         }
38212     }
38213     Py_INCREF(result);
38214     return result;
38215 }
38216 static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)38217 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
38218     PyObject* tmp;
38219     if (!value) {
38220         value = Py_None;
38221     } else if (value != Py_None && !PyDict_Check(value)) {
38222         PyErr_SetString(PyExc_TypeError,
38223                         "__kwdefaults__ must be set to a dict object");
38224         return -1;
38225     }
38226     Py_INCREF(value);
38227     tmp = op->defaults_kwdict;
38228     op->defaults_kwdict = value;
38229     Py_XDECREF(tmp);
38230     return 0;
38231 }
38232 static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)38233 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
38234     PyObject* result = op->defaults_kwdict;
38235     if (unlikely(!result)) {
38236         if (op->defaults_getter) {
38237             if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
38238             result = op->defaults_kwdict;
38239         } else {
38240             result = Py_None;
38241         }
38242     }
38243     Py_INCREF(result);
38244     return result;
38245 }
38246 static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)38247 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
38248     PyObject* tmp;
38249     if (!value || value == Py_None) {
38250         value = NULL;
38251     } else if (!PyDict_Check(value)) {
38252         PyErr_SetString(PyExc_TypeError,
38253                         "__annotations__ must be set to a dict object");
38254         return -1;
38255     }
38256     Py_XINCREF(value);
38257     tmp = op->func_annotations;
38258     op->func_annotations = value;
38259     Py_XDECREF(tmp);
38260     return 0;
38261 }
38262 static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)38263 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
38264     PyObject* result = op->func_annotations;
38265     if (unlikely(!result)) {
38266         result = PyDict_New();
38267         if (unlikely(!result)) return NULL;
38268         op->func_annotations = result;
38269     }
38270     Py_INCREF(result);
38271     return result;
38272 }
38273 static PyGetSetDef __pyx_CyFunction_getsets[] = {
38274     {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
38275     {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
38276     {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
38277     {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
38278     {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
38279     {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
38280     {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
38281     {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
38282     {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
38283     {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
38284     {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
38285     {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
38286     {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
38287     {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
38288     {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
38289     {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
38290     {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
38291     {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
38292     {0, 0, 0, 0, 0}
38293 };
38294 static PyMemberDef __pyx_CyFunction_members[] = {
38295     {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
38296     {0, 0, 0,  0, 0}
38297 };
38298 static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject * m,CYTHON_UNUSED PyObject * args)38299 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
38300 {
38301 #if PY_MAJOR_VERSION >= 3
38302     return PyUnicode_FromString(m->func.m_ml->ml_name);
38303 #else
38304     return PyString_FromString(m->func.m_ml->ml_name);
38305 #endif
38306 }
38307 static PyMethodDef __pyx_CyFunction_methods[] = {
38308     {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
38309     {0, 0, 0, 0}
38310 };
38311 #if PY_VERSION_HEX < 0x030500A0
38312 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
38313 #else
38314 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
38315 #endif
__Pyx_CyFunction_New(PyTypeObject * type,PyMethodDef * ml,int flags,PyObject * qualname,PyObject * closure,PyObject * module,PyObject * globals,PyObject * code)38316 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
38317                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
38318     __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
38319     if (op == NULL)
38320         return NULL;
38321     op->flags = flags;
38322     __Pyx_CyFunction_weakreflist(op) = NULL;
38323     op->func.m_ml = ml;
38324     op->func.m_self = (PyObject *) op;
38325     Py_XINCREF(closure);
38326     op->func_closure = closure;
38327     Py_XINCREF(module);
38328     op->func.m_module = module;
38329     op->func_dict = NULL;
38330     op->func_name = NULL;
38331     Py_INCREF(qualname);
38332     op->func_qualname = qualname;
38333     op->func_doc = NULL;
38334     op->func_classobj = NULL;
38335     op->func_globals = globals;
38336     Py_INCREF(op->func_globals);
38337     Py_XINCREF(code);
38338     op->func_code = code;
38339     op->defaults_pyobjects = 0;
38340     op->defaults = NULL;
38341     op->defaults_tuple = NULL;
38342     op->defaults_kwdict = NULL;
38343     op->defaults_getter = NULL;
38344     op->func_annotations = NULL;
38345     PyObject_GC_Track(op);
38346     return (PyObject *) op;
38347 }
38348 static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject * m)38349 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
38350 {
38351     Py_CLEAR(m->func_closure);
38352     Py_CLEAR(m->func.m_module);
38353     Py_CLEAR(m->func_dict);
38354     Py_CLEAR(m->func_name);
38355     Py_CLEAR(m->func_qualname);
38356     Py_CLEAR(m->func_doc);
38357     Py_CLEAR(m->func_globals);
38358     Py_CLEAR(m->func_code);
38359     Py_CLEAR(m->func_classobj);
38360     Py_CLEAR(m->defaults_tuple);
38361     Py_CLEAR(m->defaults_kwdict);
38362     Py_CLEAR(m->func_annotations);
38363     if (m->defaults) {
38364         PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
38365         int i;
38366         for (i = 0; i < m->defaults_pyobjects; i++)
38367             Py_XDECREF(pydefaults[i]);
38368         PyObject_Free(m->defaults);
38369         m->defaults = NULL;
38370     }
38371     return 0;
38372 }
__Pyx__CyFunction_dealloc(__pyx_CyFunctionObject * m)38373 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
38374 {
38375     if (__Pyx_CyFunction_weakreflist(m) != NULL)
38376         PyObject_ClearWeakRefs((PyObject *) m);
38377     __Pyx_CyFunction_clear(m);
38378     PyObject_GC_Del(m);
38379 }
__Pyx_CyFunction_dealloc(__pyx_CyFunctionObject * m)38380 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
38381 {
38382     PyObject_GC_UnTrack(m);
38383     __Pyx__CyFunction_dealloc(m);
38384 }
__Pyx_CyFunction_traverse(__pyx_CyFunctionObject * m,visitproc visit,void * arg)38385 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
38386 {
38387     Py_VISIT(m->func_closure);
38388     Py_VISIT(m->func.m_module);
38389     Py_VISIT(m->func_dict);
38390     Py_VISIT(m->func_name);
38391     Py_VISIT(m->func_qualname);
38392     Py_VISIT(m->func_doc);
38393     Py_VISIT(m->func_globals);
38394     Py_VISIT(m->func_code);
38395     Py_VISIT(m->func_classobj);
38396     Py_VISIT(m->defaults_tuple);
38397     Py_VISIT(m->defaults_kwdict);
38398     if (m->defaults) {
38399         PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
38400         int i;
38401         for (i = 0; i < m->defaults_pyobjects; i++)
38402             Py_VISIT(pydefaults[i]);
38403     }
38404     return 0;
38405 }
__Pyx_CyFunction_descr_get(PyObject * func,PyObject * obj,PyObject * type)38406 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
38407 {
38408     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
38409     if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
38410         Py_INCREF(func);
38411         return func;
38412     }
38413     if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
38414         if (type == NULL)
38415             type = (PyObject *)(Py_TYPE(obj));
38416         return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
38417     }
38418     if (obj == Py_None)
38419         obj = NULL;
38420     return __Pyx_PyMethod_New(func, obj, type);
38421 }
38422 static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject * op)38423 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
38424 {
38425 #if PY_MAJOR_VERSION >= 3
38426     return PyUnicode_FromFormat("<cyfunction %U at %p>",
38427                                 op->func_qualname, (void *)op);
38428 #else
38429     return PyString_FromFormat("<cyfunction %s at %p>",
38430                                PyString_AsString(op->func_qualname), (void *)op);
38431 #endif
38432 }
__Pyx_CyFunction_CallMethod(PyObject * func,PyObject * self,PyObject * arg,PyObject * kw)38433 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
38434     PyCFunctionObject* f = (PyCFunctionObject*)func;
38435     PyCFunction meth = f->m_ml->ml_meth;
38436     Py_ssize_t size;
38437     switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
38438     case METH_VARARGS:
38439         if (likely(kw == NULL || PyDict_Size(kw) == 0))
38440             return (*meth)(self, arg);
38441         break;
38442     case METH_VARARGS | METH_KEYWORDS:
38443         return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
38444     case METH_NOARGS:
38445         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
38446             size = PyTuple_GET_SIZE(arg);
38447             if (likely(size == 0))
38448                 return (*meth)(self, NULL);
38449             PyErr_Format(PyExc_TypeError,
38450                 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
38451                 f->m_ml->ml_name, size);
38452             return NULL;
38453         }
38454         break;
38455     case METH_O:
38456         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
38457             size = PyTuple_GET_SIZE(arg);
38458             if (likely(size == 1)) {
38459                 PyObject *result, *arg0;
38460                 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
38461                 arg0 = PyTuple_GET_ITEM(arg, 0);
38462                 #else
38463                 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
38464                 #endif
38465                 result = (*meth)(self, arg0);
38466                 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
38467                 Py_DECREF(arg0);
38468                 #endif
38469                 return result;
38470             }
38471             PyErr_Format(PyExc_TypeError,
38472                 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
38473                 f->m_ml->ml_name, size);
38474             return NULL;
38475         }
38476         break;
38477     default:
38478         PyErr_SetString(PyExc_SystemError, "Bad call flags in "
38479                         "__Pyx_CyFunction_Call. METH_OLDARGS is no "
38480                         "longer supported!");
38481         return NULL;
38482     }
38483     PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
38484                  f->m_ml->ml_name);
38485     return NULL;
38486 }
__Pyx_CyFunction_Call(PyObject * func,PyObject * arg,PyObject * kw)38487 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
38488     return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
38489 }
__Pyx_CyFunction_CallAsMethod(PyObject * func,PyObject * args,PyObject * kw)38490 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
38491     PyObject *result;
38492     __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
38493     if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
38494         Py_ssize_t argc;
38495         PyObject *new_args;
38496         PyObject *self;
38497         argc = PyTuple_GET_SIZE(args);
38498         new_args = PyTuple_GetSlice(args, 1, argc);
38499         if (unlikely(!new_args))
38500             return NULL;
38501         self = PyTuple_GetItem(args, 0);
38502         if (unlikely(!self)) {
38503             Py_DECREF(new_args);
38504             return NULL;
38505         }
38506         result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
38507         Py_DECREF(new_args);
38508     } else {
38509         result = __Pyx_CyFunction_Call(func, args, kw);
38510     }
38511     return result;
38512 }
38513 static PyTypeObject __pyx_CyFunctionType_type = {
38514     PyVarObject_HEAD_INIT(0, 0)
38515     "cython_function_or_method",
38516     sizeof(__pyx_CyFunctionObject),
38517     0,
38518     (destructor) __Pyx_CyFunction_dealloc,
38519     0,
38520     0,
38521     0,
38522 #if PY_MAJOR_VERSION < 3
38523     0,
38524 #else
38525     0,
38526 #endif
38527     (reprfunc) __Pyx_CyFunction_repr,
38528     0,
38529     0,
38530     0,
38531     0,
38532     __Pyx_CyFunction_CallAsMethod,
38533     0,
38534     0,
38535     0,
38536     0,
38537     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
38538     0,
38539     (traverseproc) __Pyx_CyFunction_traverse,
38540     (inquiry) __Pyx_CyFunction_clear,
38541     0,
38542 #if PY_VERSION_HEX < 0x030500A0
38543     offsetof(__pyx_CyFunctionObject, func_weakreflist),
38544 #else
38545     offsetof(PyCFunctionObject, m_weakreflist),
38546 #endif
38547     0,
38548     0,
38549     __pyx_CyFunction_methods,
38550     __pyx_CyFunction_members,
38551     __pyx_CyFunction_getsets,
38552     0,
38553     0,
38554     __Pyx_CyFunction_descr_get,
38555     0,
38556     offsetof(__pyx_CyFunctionObject, func_dict),
38557     0,
38558     0,
38559     0,
38560     0,
38561     0,
38562     0,
38563     0,
38564     0,
38565     0,
38566     0,
38567     0,
38568     0,
38569 #if PY_VERSION_HEX >= 0x030400a1
38570     0,
38571 #endif
38572 #if PY_VERSION_HEX >= 0x030800b1
38573     0,
38574 #endif
38575 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
38576     0,
38577 #endif
38578 };
__pyx_CyFunction_init(void)38579 static int __pyx_CyFunction_init(void) {
38580     __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
38581     if (unlikely(__pyx_CyFunctionType == NULL)) {
38582         return -1;
38583     }
38584     return 0;
38585 }
__Pyx_CyFunction_InitDefaults(PyObject * func,size_t size,int pyobjects)38586 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
38587     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
38588     m->defaults = PyObject_Malloc(size);
38589     if (unlikely(!m->defaults))
38590         return PyErr_NoMemory();
38591     memset(m->defaults, 0, size);
38592     m->defaults_pyobjects = pyobjects;
38593     return m->defaults;
38594 }
__Pyx_CyFunction_SetDefaultsTuple(PyObject * func,PyObject * tuple)38595 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
38596     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
38597     m->defaults_tuple = tuple;
38598     Py_INCREF(tuple);
38599 }
__Pyx_CyFunction_SetDefaultsKwDict(PyObject * func,PyObject * dict)38600 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
38601     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
38602     m->defaults_kwdict = dict;
38603     Py_INCREF(dict);
38604 }
__Pyx_CyFunction_SetAnnotationsDict(PyObject * func,PyObject * dict)38605 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
38606     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
38607     m->func_annotations = dict;
38608     Py_INCREF(dict);
38609 }
38610 
38611 /* py_abs */
38612   #if CYTHON_USE_PYLONG_INTERNALS
__Pyx_PyLong_AbsNeg(PyObject * n)38613 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
38614     if (likely(Py_SIZE(n) == -1)) {
38615         return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
38616     }
38617 #if CYTHON_COMPILING_IN_CPYTHON
38618     {
38619         PyObject *copy = _PyLong_Copy((PyLongObject*)n);
38620         if (likely(copy)) {
38621             Py_SIZE(copy) = -(Py_SIZE(copy));
38622         }
38623         return copy;
38624     }
38625 #else
38626     return PyNumber_Negative(n);
38627 #endif
38628 }
38629 #endif
38630 
38631 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)38632   static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
38633     PyObject *empty_list = 0;
38634     PyObject *module = 0;
38635     PyObject *global_dict = 0;
38636     PyObject *empty_dict = 0;
38637     PyObject *list;
38638     #if PY_MAJOR_VERSION < 3
38639     PyObject *py_import;
38640     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
38641     if (!py_import)
38642         goto bad;
38643     #endif
38644     if (from_list)
38645         list = from_list;
38646     else {
38647         empty_list = PyList_New(0);
38648         if (!empty_list)
38649             goto bad;
38650         list = empty_list;
38651     }
38652     global_dict = PyModule_GetDict(__pyx_m);
38653     if (!global_dict)
38654         goto bad;
38655     empty_dict = PyDict_New();
38656     if (!empty_dict)
38657         goto bad;
38658     {
38659         #if PY_MAJOR_VERSION >= 3
38660         if (level == -1) {
38661             if (strchr(__Pyx_MODULE_NAME, '.')) {
38662                 module = PyImport_ImportModuleLevelObject(
38663                     name, global_dict, empty_dict, list, 1);
38664                 if (!module) {
38665                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
38666                         goto bad;
38667                     PyErr_Clear();
38668                 }
38669             }
38670             level = 0;
38671         }
38672         #endif
38673         if (!module) {
38674             #if PY_MAJOR_VERSION < 3
38675             PyObject *py_level = PyInt_FromLong(level);
38676             if (!py_level)
38677                 goto bad;
38678             module = PyObject_CallFunctionObjArgs(py_import,
38679                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
38680             Py_DECREF(py_level);
38681             #else
38682             module = PyImport_ImportModuleLevelObject(
38683                 name, global_dict, empty_dict, list, level);
38684             #endif
38685         }
38686     }
38687 bad:
38688     #if PY_MAJOR_VERSION < 3
38689     Py_XDECREF(py_import);
38690     #endif
38691     Py_XDECREF(empty_list);
38692     Py_XDECREF(empty_dict);
38693     return module;
38694 }
38695 
38696 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)38697   static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
38698     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
38699     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
38700         PyErr_Format(PyExc_ImportError,
38701         #if PY_MAJOR_VERSION < 3
38702             "cannot import name %.230s", PyString_AS_STRING(name));
38703         #else
38704             "cannot import name %S", name);
38705         #endif
38706     }
38707     return value;
38708 }
38709 
38710 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)38711   static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
38712     PyObject *r;
38713     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
38714         PyErr_SetString(PyExc_TypeError,
38715                         "hasattr(): attribute name must be string");
38716         return -1;
38717     }
38718     r = __Pyx_GetAttr(o, n);
38719     if (unlikely(!r)) {
38720         PyErr_Clear();
38721         return 0;
38722     } else {
38723         Py_DECREF(r);
38724         return 1;
38725     }
38726 }
38727 
38728 /* PyObject_GenericGetAttrNoDict */
38729   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)38730 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
38731     PyErr_Format(PyExc_AttributeError,
38732 #if PY_MAJOR_VERSION >= 3
38733                  "'%.50s' object has no attribute '%U'",
38734                  tp->tp_name, attr_name);
38735 #else
38736                  "'%.50s' object has no attribute '%.400s'",
38737                  tp->tp_name, PyString_AS_STRING(attr_name));
38738 #endif
38739     return NULL;
38740 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)38741 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
38742     PyObject *descr;
38743     PyTypeObject *tp = Py_TYPE(obj);
38744     if (unlikely(!PyString_Check(attr_name))) {
38745         return PyObject_GenericGetAttr(obj, attr_name);
38746     }
38747     assert(!tp->tp_dictoffset);
38748     descr = _PyType_Lookup(tp, attr_name);
38749     if (unlikely(!descr)) {
38750         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
38751     }
38752     Py_INCREF(descr);
38753     #if PY_MAJOR_VERSION < 3
38754     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
38755     #endif
38756     {
38757         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
38758         if (unlikely(f)) {
38759             PyObject *res = f(descr, obj, (PyObject *)tp);
38760             Py_DECREF(descr);
38761             return res;
38762         }
38763     }
38764     return descr;
38765 }
38766 #endif
38767 
38768 /* PyObject_GenericGetAttr */
38769   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)38770 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
38771     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
38772         return PyObject_GenericGetAttr(obj, attr_name);
38773     }
38774     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
38775 }
38776 #endif
38777 
38778 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)38779   static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
38780 #if PY_VERSION_HEX >= 0x02070000
38781     PyObject *ob = PyCapsule_New(vtable, 0, 0);
38782 #else
38783     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
38784 #endif
38785     if (!ob)
38786         goto bad;
38787     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
38788         goto bad;
38789     Py_DECREF(ob);
38790     return 0;
38791 bad:
38792     Py_XDECREF(ob);
38793     return -1;
38794 }
38795 
38796 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)38797   static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
38798   int ret;
38799   PyObject *name_attr;
38800   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
38801   if (likely(name_attr)) {
38802       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
38803   } else {
38804       ret = -1;
38805   }
38806   if (unlikely(ret < 0)) {
38807       PyErr_Clear();
38808       ret = 0;
38809   }
38810   Py_XDECREF(name_attr);
38811   return ret;
38812 }
__Pyx_setup_reduce(PyObject * type_obj)38813 static int __Pyx_setup_reduce(PyObject* type_obj) {
38814     int ret = 0;
38815     PyObject *object_reduce = NULL;
38816     PyObject *object_reduce_ex = NULL;
38817     PyObject *reduce = NULL;
38818     PyObject *reduce_ex = NULL;
38819     PyObject *reduce_cython = NULL;
38820     PyObject *setstate = NULL;
38821     PyObject *setstate_cython = NULL;
38822 #if CYTHON_USE_PYTYPE_LOOKUP
38823     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
38824 #else
38825     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
38826 #endif
38827 #if CYTHON_USE_PYTYPE_LOOKUP
38828     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
38829 #else
38830     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
38831 #endif
38832     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
38833     if (reduce_ex == object_reduce_ex) {
38834 #if CYTHON_USE_PYTYPE_LOOKUP
38835         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_2); if (!object_reduce) goto BAD;
38836 #else
38837         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_2); if (!object_reduce) goto BAD;
38838 #endif
38839         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_2); if (unlikely(!reduce)) goto BAD;
38840         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
38841             reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
38842             ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_2, reduce_cython); if (unlikely(ret < 0)) goto BAD;
38843             ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
38844             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
38845             if (!setstate) PyErr_Clear();
38846             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
38847                 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
38848                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
38849                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
38850             }
38851             PyType_Modified((PyTypeObject*)type_obj);
38852         }
38853     }
38854     goto GOOD;
38855 BAD:
38856     if (!PyErr_Occurred())
38857         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
38858     ret = -1;
38859 GOOD:
38860 #if !CYTHON_USE_PYTYPE_LOOKUP
38861     Py_XDECREF(object_reduce);
38862     Py_XDECREF(object_reduce_ex);
38863 #endif
38864     Py_XDECREF(reduce);
38865     Py_XDECREF(reduce_ex);
38866     Py_XDECREF(reduce_cython);
38867     Py_XDECREF(setstate);
38868     Py_XDECREF(setstate_cython);
38869     return ret;
38870 }
38871 
38872 /* TypeImport */
38873   #ifndef __PYX_HAVE_RT_ImportType
38874 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)38875 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
38876     size_t size, enum __Pyx_ImportType_CheckSize check_size)
38877 {
38878     PyObject *result = 0;
38879     char warning[200];
38880     Py_ssize_t basicsize;
38881 #ifdef Py_LIMITED_API
38882     PyObject *py_basicsize;
38883 #endif
38884     result = PyObject_GetAttrString(module, class_name);
38885     if (!result)
38886         goto bad;
38887     if (!PyType_Check(result)) {
38888         PyErr_Format(PyExc_TypeError,
38889             "%.200s.%.200s is not a type object",
38890             module_name, class_name);
38891         goto bad;
38892     }
38893 #ifndef Py_LIMITED_API
38894     basicsize = ((PyTypeObject *)result)->tp_basicsize;
38895 #else
38896     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
38897     if (!py_basicsize)
38898         goto bad;
38899     basicsize = PyLong_AsSsize_t(py_basicsize);
38900     Py_DECREF(py_basicsize);
38901     py_basicsize = 0;
38902     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
38903         goto bad;
38904 #endif
38905     if ((size_t)basicsize < size) {
38906         PyErr_Format(PyExc_ValueError,
38907             "%.200s.%.200s size changed, may indicate binary incompatibility. "
38908             "Expected %zd from C header, got %zd from PyObject",
38909             module_name, class_name, size, basicsize);
38910         goto bad;
38911     }
38912     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
38913         PyErr_Format(PyExc_ValueError,
38914             "%.200s.%.200s size changed, may indicate binary incompatibility. "
38915             "Expected %zd from C header, got %zd from PyObject",
38916             module_name, class_name, size, basicsize);
38917         goto bad;
38918     }
38919     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
38920         PyOS_snprintf(warning, sizeof(warning),
38921             "%s.%s size changed, may indicate binary incompatibility. "
38922             "Expected %zd from C header, got %zd from PyObject",
38923             module_name, class_name, size, basicsize);
38924         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
38925     }
38926     return (PyTypeObject *)result;
38927 bad:
38928     Py_XDECREF(result);
38929     return NULL;
38930 }
38931 #endif
38932 
38933 /* CalculateMetaclass */
__Pyx_CalculateMetaclass(PyTypeObject * metaclass,PyObject * bases)38934   static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
38935     Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
38936     for (i=0; i < nbases; i++) {
38937         PyTypeObject *tmptype;
38938         PyObject *tmp = PyTuple_GET_ITEM(bases, i);
38939         tmptype = Py_TYPE(tmp);
38940 #if PY_MAJOR_VERSION < 3
38941         if (tmptype == &PyClass_Type)
38942             continue;
38943 #endif
38944         if (!metaclass) {
38945             metaclass = tmptype;
38946             continue;
38947         }
38948         if (PyType_IsSubtype(metaclass, tmptype))
38949             continue;
38950         if (PyType_IsSubtype(tmptype, metaclass)) {
38951             metaclass = tmptype;
38952             continue;
38953         }
38954         PyErr_SetString(PyExc_TypeError,
38955                         "metaclass conflict: "
38956                         "the metaclass of a derived class "
38957                         "must be a (non-strict) subclass "
38958                         "of the metaclasses of all its bases");
38959         return NULL;
38960     }
38961     if (!metaclass) {
38962 #if PY_MAJOR_VERSION < 3
38963         metaclass = &PyClass_Type;
38964 #else
38965         metaclass = &PyType_Type;
38966 #endif
38967     }
38968     Py_INCREF((PyObject*) metaclass);
38969     return (PyObject*) metaclass;
38970 }
38971 
38972 /* Py3ClassCreate */
__Pyx_Py3MetaclassPrepare(PyObject * metaclass,PyObject * bases,PyObject * name,PyObject * qualname,PyObject * mkw,PyObject * modname,PyObject * doc)38973   static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
38974                                            PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
38975     PyObject *ns;
38976     if (metaclass) {
38977         PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
38978         if (prep) {
38979             PyObject *pargs = PyTuple_Pack(2, name, bases);
38980             if (unlikely(!pargs)) {
38981                 Py_DECREF(prep);
38982                 return NULL;
38983             }
38984             ns = PyObject_Call(prep, pargs, mkw);
38985             Py_DECREF(prep);
38986             Py_DECREF(pargs);
38987         } else {
38988             if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
38989                 return NULL;
38990             PyErr_Clear();
38991             ns = PyDict_New();
38992         }
38993     } else {
38994         ns = PyDict_New();
38995     }
38996     if (unlikely(!ns))
38997         return NULL;
38998     if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
38999     if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
39000     if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
39001     return ns;
39002 bad:
39003     Py_DECREF(ns);
39004     return NULL;
39005 }
__Pyx_Py3ClassCreate(PyObject * metaclass,PyObject * name,PyObject * bases,PyObject * dict,PyObject * mkw,int calculate_metaclass,int allow_py2_metaclass)39006 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
39007                                       PyObject *dict, PyObject *mkw,
39008                                       int calculate_metaclass, int allow_py2_metaclass) {
39009     PyObject *result, *margs;
39010     PyObject *owned_metaclass = NULL;
39011     if (allow_py2_metaclass) {
39012         owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
39013         if (owned_metaclass) {
39014             metaclass = owned_metaclass;
39015         } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
39016             PyErr_Clear();
39017         } else {
39018             return NULL;
39019         }
39020     }
39021     if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
39022         metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
39023         Py_XDECREF(owned_metaclass);
39024         if (unlikely(!metaclass))
39025             return NULL;
39026         owned_metaclass = metaclass;
39027     }
39028     margs = PyTuple_Pack(3, name, bases, dict);
39029     if (unlikely(!margs)) {
39030         result = NULL;
39031     } else {
39032         result = PyObject_Call(metaclass, margs, mkw);
39033         Py_DECREF(margs);
39034     }
39035     Py_XDECREF(owned_metaclass);
39036     return result;
39037 }
39038 
39039 /* CLineInTraceback */
39040   #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(PyThreadState * tstate,int c_line)39041 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
39042     PyObject *use_cline;
39043     PyObject *ptype, *pvalue, *ptraceback;
39044 #if CYTHON_COMPILING_IN_CPYTHON
39045     PyObject **cython_runtime_dict;
39046 #endif
39047     if (unlikely(!__pyx_cython_runtime)) {
39048         return c_line;
39049     }
39050     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
39051 #if CYTHON_COMPILING_IN_CPYTHON
39052     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
39053     if (likely(cython_runtime_dict)) {
39054         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
39055             use_cline, *cython_runtime_dict,
39056             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
39057     } else
39058 #endif
39059     {
39060       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
39061       if (use_cline_obj) {
39062         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
39063         Py_DECREF(use_cline_obj);
39064       } else {
39065         PyErr_Clear();
39066         use_cline = NULL;
39067       }
39068     }
39069     if (!use_cline) {
39070         c_line = 0;
39071         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
39072     }
39073     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
39074         c_line = 0;
39075     }
39076     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
39077     return c_line;
39078 }
39079 #endif
39080 
39081 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)39082   static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
39083     int start = 0, mid = 0, end = count - 1;
39084     if (end >= 0 && code_line > entries[end].code_line) {
39085         return count;
39086     }
39087     while (start < end) {
39088         mid = start + (end - start) / 2;
39089         if (code_line < entries[mid].code_line) {
39090             end = mid;
39091         } else if (code_line > entries[mid].code_line) {
39092              start = mid + 1;
39093         } else {
39094             return mid;
39095         }
39096     }
39097     if (code_line <= entries[mid].code_line) {
39098         return mid;
39099     } else {
39100         return mid + 1;
39101     }
39102 }
__pyx_find_code_object(int code_line)39103 static PyCodeObject *__pyx_find_code_object(int code_line) {
39104     PyCodeObject* code_object;
39105     int pos;
39106     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
39107         return NULL;
39108     }
39109     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
39110     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
39111         return NULL;
39112     }
39113     code_object = __pyx_code_cache.entries[pos].code_object;
39114     Py_INCREF(code_object);
39115     return code_object;
39116 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)39117 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
39118     int pos, i;
39119     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
39120     if (unlikely(!code_line)) {
39121         return;
39122     }
39123     if (unlikely(!entries)) {
39124         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
39125         if (likely(entries)) {
39126             __pyx_code_cache.entries = entries;
39127             __pyx_code_cache.max_count = 64;
39128             __pyx_code_cache.count = 1;
39129             entries[0].code_line = code_line;
39130             entries[0].code_object = code_object;
39131             Py_INCREF(code_object);
39132         }
39133         return;
39134     }
39135     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
39136     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
39137         PyCodeObject* tmp = entries[pos].code_object;
39138         entries[pos].code_object = code_object;
39139         Py_DECREF(tmp);
39140         return;
39141     }
39142     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
39143         int new_max = __pyx_code_cache.max_count + 64;
39144         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
39145             __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
39146         if (unlikely(!entries)) {
39147             return;
39148         }
39149         __pyx_code_cache.entries = entries;
39150         __pyx_code_cache.max_count = new_max;
39151     }
39152     for (i=__pyx_code_cache.count; i>pos; i--) {
39153         entries[i] = entries[i-1];
39154     }
39155     entries[pos].code_line = code_line;
39156     entries[pos].code_object = code_object;
39157     __pyx_code_cache.count++;
39158     Py_INCREF(code_object);
39159 }
39160 
39161 /* AddTraceback */
39162   #include "compile.h"
39163 #include "frameobject.h"
39164 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)39165 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
39166             const char *funcname, int c_line,
39167             int py_line, const char *filename) {
39168     PyCodeObject *py_code = 0;
39169     PyObject *py_srcfile = 0;
39170     PyObject *py_funcname = 0;
39171     #if PY_MAJOR_VERSION < 3
39172     py_srcfile = PyString_FromString(filename);
39173     #else
39174     py_srcfile = PyUnicode_FromString(filename);
39175     #endif
39176     if (!py_srcfile) goto bad;
39177     if (c_line) {
39178         #if PY_MAJOR_VERSION < 3
39179         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
39180         #else
39181         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
39182         #endif
39183     }
39184     else {
39185         #if PY_MAJOR_VERSION < 3
39186         py_funcname = PyString_FromString(funcname);
39187         #else
39188         py_funcname = PyUnicode_FromString(funcname);
39189         #endif
39190     }
39191     if (!py_funcname) goto bad;
39192     py_code = __Pyx_PyCode_New(
39193         0,
39194         0,
39195         0,
39196         0,
39197         0,
39198         __pyx_empty_bytes, /*PyObject *code,*/
39199         __pyx_empty_tuple, /*PyObject *consts,*/
39200         __pyx_empty_tuple, /*PyObject *names,*/
39201         __pyx_empty_tuple, /*PyObject *varnames,*/
39202         __pyx_empty_tuple, /*PyObject *freevars,*/
39203         __pyx_empty_tuple, /*PyObject *cellvars,*/
39204         py_srcfile,   /*PyObject *filename,*/
39205         py_funcname,  /*PyObject *name,*/
39206         py_line,
39207         __pyx_empty_bytes  /*PyObject *lnotab*/
39208     );
39209     Py_DECREF(py_srcfile);
39210     Py_DECREF(py_funcname);
39211     return py_code;
39212 bad:
39213     Py_XDECREF(py_srcfile);
39214     Py_XDECREF(py_funcname);
39215     return NULL;
39216 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)39217 static void __Pyx_AddTraceback(const char *funcname, int c_line,
39218                                int py_line, const char *filename) {
39219     PyCodeObject *py_code = 0;
39220     PyFrameObject *py_frame = 0;
39221     PyThreadState *tstate = __Pyx_PyThreadState_Current;
39222     if (c_line) {
39223         c_line = __Pyx_CLineForTraceback(tstate, c_line);
39224     }
39225     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
39226     if (!py_code) {
39227         py_code = __Pyx_CreateCodeObjectForTraceback(
39228             funcname, c_line, py_line, filename);
39229         if (!py_code) goto bad;
39230         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
39231     }
39232     py_frame = PyFrame_New(
39233         tstate,            /*PyThreadState *tstate,*/
39234         py_code,           /*PyCodeObject *code,*/
39235         __pyx_d,    /*PyObject *globals,*/
39236         0                  /*PyObject *locals*/
39237     );
39238     if (!py_frame) goto bad;
39239     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
39240     PyTraceBack_Here(py_frame);
39241 bad:
39242     Py_XDECREF(py_code);
39243     Py_XDECREF(py_frame);
39244 }
39245 
39246 /* CIntToPy */
__Pyx_PyInt_From_char(char value)39247   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
39248     const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
39249     const int is_unsigned = neg_one > const_zero;
39250     if (is_unsigned) {
39251         if (sizeof(char) < sizeof(long)) {
39252             return PyInt_FromLong((long) value);
39253         } else if (sizeof(char) <= sizeof(unsigned long)) {
39254             return PyLong_FromUnsignedLong((unsigned long) value);
39255 #ifdef HAVE_LONG_LONG
39256         } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
39257             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
39258 #endif
39259         }
39260     } else {
39261         if (sizeof(char) <= sizeof(long)) {
39262             return PyInt_FromLong((long) value);
39263 #ifdef HAVE_LONG_LONG
39264         } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
39265             return PyLong_FromLongLong((PY_LONG_LONG) value);
39266 #endif
39267         }
39268     }
39269     {
39270         int one = 1; int little = (int)*(unsigned char *)&one;
39271         unsigned char *bytes = (unsigned char *)&value;
39272         return _PyLong_FromByteArray(bytes, sizeof(char),
39273                                      little, !is_unsigned);
39274     }
39275 }
39276 
39277 /* CIntFromPyVerify */
39278   #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
39279     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
39280 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
39281     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
39282 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
39283     {\
39284         func_type value = func_value;\
39285         if (sizeof(target_type) < sizeof(func_type)) {\
39286             if (unlikely(value != (func_type) (target_type) value)) {\
39287                 func_type zero = 0;\
39288                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
39289                     return (target_type) -1;\
39290                 if (is_unsigned && unlikely(value < zero))\
39291                     goto raise_neg_overflow;\
39292                 else\
39293                     goto raise_overflow;\
39294             }\
39295         }\
39296         return (target_type) value;\
39297     }
39298 
39299 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)39300 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
39301     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
39302         if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
39303     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
39304     return -1;
39305 }
__Pyx_ReleaseBuffer(Py_buffer * view)39306 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
39307     PyObject *obj = view->obj;
39308     if (!obj) return;
39309     if (PyObject_CheckBuffer(obj)) {
39310         PyBuffer_Release(view);
39311         return;
39312     }
39313     if ((0)) {}
39314         else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
39315     view->obj = NULL;
39316     Py_DECREF(obj);
39317 }
39318 #endif
39319 
39320 
39321   /* CIntToPy */
__Pyx_PyInt_From_npy_int32(npy_int32 value)39322   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
39323     const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
39324     const int is_unsigned = neg_one > const_zero;
39325     if (is_unsigned) {
39326         if (sizeof(npy_int32) < sizeof(long)) {
39327             return PyInt_FromLong((long) value);
39328         } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
39329             return PyLong_FromUnsignedLong((unsigned long) value);
39330 #ifdef HAVE_LONG_LONG
39331         } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
39332             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
39333 #endif
39334         }
39335     } else {
39336         if (sizeof(npy_int32) <= sizeof(long)) {
39337             return PyInt_FromLong((long) value);
39338 #ifdef HAVE_LONG_LONG
39339         } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
39340             return PyLong_FromLongLong((PY_LONG_LONG) value);
39341 #endif
39342         }
39343     }
39344     {
39345         int one = 1; int little = (int)*(unsigned char *)&one;
39346         unsigned char *bytes = (unsigned char *)&value;
39347         return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
39348                                      little, !is_unsigned);
39349     }
39350 }
39351 
39352 /* CIntToPy */
__Pyx_PyInt_From_npy_int64(npy_int64 value)39353   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
39354     const npy_int64 neg_one = (npy_int64) ((npy_int64) 0 - (npy_int64) 1), const_zero = (npy_int64) 0;
39355     const int is_unsigned = neg_one > const_zero;
39356     if (is_unsigned) {
39357         if (sizeof(npy_int64) < sizeof(long)) {
39358             return PyInt_FromLong((long) value);
39359         } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
39360             return PyLong_FromUnsignedLong((unsigned long) value);
39361 #ifdef HAVE_LONG_LONG
39362         } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
39363             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
39364 #endif
39365         }
39366     } else {
39367         if (sizeof(npy_int64) <= sizeof(long)) {
39368             return PyInt_FromLong((long) value);
39369 #ifdef HAVE_LONG_LONG
39370         } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
39371             return PyLong_FromLongLong((PY_LONG_LONG) value);
39372 #endif
39373         }
39374     }
39375     {
39376         int one = 1; int little = (int)*(unsigned char *)&one;
39377         unsigned char *bytes = (unsigned char *)&value;
39378         return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
39379                                      little, !is_unsigned);
39380     }
39381 }
39382 
39383 /* CIntToPy */
__Pyx_PyInt_From_long(long value)39384   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
39385     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
39386     const int is_unsigned = neg_one > const_zero;
39387     if (is_unsigned) {
39388         if (sizeof(long) < sizeof(long)) {
39389             return PyInt_FromLong((long) value);
39390         } else if (sizeof(long) <= sizeof(unsigned long)) {
39391             return PyLong_FromUnsignedLong((unsigned long) value);
39392 #ifdef HAVE_LONG_LONG
39393         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
39394             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
39395 #endif
39396         }
39397     } else {
39398         if (sizeof(long) <= sizeof(long)) {
39399             return PyInt_FromLong((long) value);
39400 #ifdef HAVE_LONG_LONG
39401         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
39402             return PyLong_FromLongLong((PY_LONG_LONG) value);
39403 #endif
39404         }
39405     }
39406     {
39407         int one = 1; int little = (int)*(unsigned char *)&one;
39408         unsigned char *bytes = (unsigned char *)&value;
39409         return _PyLong_FromByteArray(bytes, sizeof(long),
39410                                      little, !is_unsigned);
39411     }
39412 }
39413 
39414 /* CIntToPy */
__Pyx_PyInt_From_short(short value)39415   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value) {
39416     const short neg_one = (short) ((short) 0 - (short) 1), const_zero = (short) 0;
39417     const int is_unsigned = neg_one > const_zero;
39418     if (is_unsigned) {
39419         if (sizeof(short) < sizeof(long)) {
39420             return PyInt_FromLong((long) value);
39421         } else if (sizeof(short) <= sizeof(unsigned long)) {
39422             return PyLong_FromUnsignedLong((unsigned long) value);
39423 #ifdef HAVE_LONG_LONG
39424         } else if (sizeof(short) <= sizeof(unsigned PY_LONG_LONG)) {
39425             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
39426 #endif
39427         }
39428     } else {
39429         if (sizeof(short) <= sizeof(long)) {
39430             return PyInt_FromLong((long) value);
39431 #ifdef HAVE_LONG_LONG
39432         } else if (sizeof(short) <= sizeof(PY_LONG_LONG)) {
39433             return PyLong_FromLongLong((PY_LONG_LONG) value);
39434 #endif
39435         }
39436     }
39437     {
39438         int one = 1; int little = (int)*(unsigned char *)&one;
39439         unsigned char *bytes = (unsigned char *)&value;
39440         return _PyLong_FromByteArray(bytes, sizeof(short),
39441                                      little, !is_unsigned);
39442     }
39443 }
39444 
39445 /* Declarations */
39446   #if CYTHON_CCOMPLEX
39447   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)39448     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
39449       return ::std::complex< float >(x, y);
39450     }
39451   #else
__pyx_t_float_complex_from_parts(float x,float y)39452     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
39453       return x + y*(__pyx_t_float_complex)_Complex_I;
39454     }
39455   #endif
39456 #else
__pyx_t_float_complex_from_parts(float x,float y)39457     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
39458       __pyx_t_float_complex z;
39459       z.real = x;
39460       z.imag = y;
39461       return z;
39462     }
39463 #endif
39464 
39465 /* Arithmetic */
39466   #if CYTHON_CCOMPLEX
39467 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)39468     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39469        return (a.real == b.real) && (a.imag == b.imag);
39470     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)39471     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39472         __pyx_t_float_complex z;
39473         z.real = a.real + b.real;
39474         z.imag = a.imag + b.imag;
39475         return z;
39476     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)39477     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39478         __pyx_t_float_complex z;
39479         z.real = a.real - b.real;
39480         z.imag = a.imag - b.imag;
39481         return z;
39482     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)39483     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39484         __pyx_t_float_complex z;
39485         z.real = a.real * b.real - a.imag * b.imag;
39486         z.imag = a.real * b.imag + a.imag * b.real;
39487         return z;
39488     }
39489     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)39490     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39491         if (b.imag == 0) {
39492             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
39493         } else if (fabsf(b.real) >= fabsf(b.imag)) {
39494             if (b.real == 0 && b.imag == 0) {
39495                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
39496             } else {
39497                 float r = b.imag / b.real;
39498                 float s = (float)(1.0) / (b.real + b.imag * r);
39499                 return __pyx_t_float_complex_from_parts(
39500                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
39501             }
39502         } else {
39503             float r = b.real / b.imag;
39504             float s = (float)(1.0) / (b.imag + b.real * r);
39505             return __pyx_t_float_complex_from_parts(
39506                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
39507         }
39508     }
39509     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)39510     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39511         if (b.imag == 0) {
39512             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
39513         } else {
39514             float denom = b.real * b.real + b.imag * b.imag;
39515             return __pyx_t_float_complex_from_parts(
39516                 (a.real * b.real + a.imag * b.imag) / denom,
39517                 (a.imag * b.real - a.real * b.imag) / denom);
39518         }
39519     }
39520     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)39521     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
39522         __pyx_t_float_complex z;
39523         z.real = -a.real;
39524         z.imag = -a.imag;
39525         return z;
39526     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)39527     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
39528        return (a.real == 0) && (a.imag == 0);
39529     }
__Pyx_c_conj_float(__pyx_t_float_complex a)39530     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
39531         __pyx_t_float_complex z;
39532         z.real =  a.real;
39533         z.imag = -a.imag;
39534         return z;
39535     }
39536     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)39537         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
39538           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
39539             return sqrtf(z.real*z.real + z.imag*z.imag);
39540           #else
39541             return hypotf(z.real, z.imag);
39542           #endif
39543         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)39544         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39545             __pyx_t_float_complex z;
39546             float r, lnr, theta, z_r, z_theta;
39547             if (b.imag == 0 && b.real == (int)b.real) {
39548                 if (b.real < 0) {
39549                     float denom = a.real * a.real + a.imag * a.imag;
39550                     a.real = a.real / denom;
39551                     a.imag = -a.imag / denom;
39552                     b.real = -b.real;
39553                 }
39554                 switch ((int)b.real) {
39555                     case 0:
39556                         z.real = 1;
39557                         z.imag = 0;
39558                         return z;
39559                     case 1:
39560                         return a;
39561                     case 2:
39562                         return __Pyx_c_prod_float(a, a);
39563                     case 3:
39564                         z = __Pyx_c_prod_float(a, a);
39565                         return __Pyx_c_prod_float(z, a);
39566                     case 4:
39567                         z = __Pyx_c_prod_float(a, a);
39568                         return __Pyx_c_prod_float(z, z);
39569                 }
39570             }
39571             if (a.imag == 0) {
39572                 if (a.real == 0) {
39573                     return a;
39574                 } else if (b.imag == 0) {
39575                     z.real = powf(a.real, b.real);
39576                     z.imag = 0;
39577                     return z;
39578                 } else if (a.real > 0) {
39579                     r = a.real;
39580                     theta = 0;
39581                 } else {
39582                     r = -a.real;
39583                     theta = atan2f(0.0, -1.0);
39584                 }
39585             } else {
39586                 r = __Pyx_c_abs_float(a);
39587                 theta = atan2f(a.imag, a.real);
39588             }
39589             lnr = logf(r);
39590             z_r = expf(lnr * b.real - theta * b.imag);
39591             z_theta = theta * b.real + lnr * b.imag;
39592             z.real = z_r * cosf(z_theta);
39593             z.imag = z_r * sinf(z_theta);
39594             return z;
39595         }
39596     #endif
39597 #endif
39598 
39599 /* Declarations */
39600   #if CYTHON_CCOMPLEX
39601   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)39602     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
39603       return ::std::complex< double >(x, y);
39604     }
39605   #else
__pyx_t_double_complex_from_parts(double x,double y)39606     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
39607       return x + y*(__pyx_t_double_complex)_Complex_I;
39608     }
39609   #endif
39610 #else
__pyx_t_double_complex_from_parts(double x,double y)39611     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
39612       __pyx_t_double_complex z;
39613       z.real = x;
39614       z.imag = y;
39615       return z;
39616     }
39617 #endif
39618 
39619 /* Arithmetic */
39620   #if CYTHON_CCOMPLEX
39621 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39622     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39623        return (a.real == b.real) && (a.imag == b.imag);
39624     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39625     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39626         __pyx_t_double_complex z;
39627         z.real = a.real + b.real;
39628         z.imag = a.imag + b.imag;
39629         return z;
39630     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39631     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39632         __pyx_t_double_complex z;
39633         z.real = a.real - b.real;
39634         z.imag = a.imag - b.imag;
39635         return z;
39636     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39637     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39638         __pyx_t_double_complex z;
39639         z.real = a.real * b.real - a.imag * b.imag;
39640         z.imag = a.real * b.imag + a.imag * b.real;
39641         return z;
39642     }
39643     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39644     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39645         if (b.imag == 0) {
39646             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
39647         } else if (fabs(b.real) >= fabs(b.imag)) {
39648             if (b.real == 0 && b.imag == 0) {
39649                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
39650             } else {
39651                 double r = b.imag / b.real;
39652                 double s = (double)(1.0) / (b.real + b.imag * r);
39653                 return __pyx_t_double_complex_from_parts(
39654                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
39655             }
39656         } else {
39657             double r = b.real / b.imag;
39658             double s = (double)(1.0) / (b.imag + b.real * r);
39659             return __pyx_t_double_complex_from_parts(
39660                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
39661         }
39662     }
39663     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39664     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39665         if (b.imag == 0) {
39666             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
39667         } else {
39668             double denom = b.real * b.real + b.imag * b.imag;
39669             return __pyx_t_double_complex_from_parts(
39670                 (a.real * b.real + a.imag * b.imag) / denom,
39671                 (a.imag * b.real - a.real * b.imag) / denom);
39672         }
39673     }
39674     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)39675     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
39676         __pyx_t_double_complex z;
39677         z.real = -a.real;
39678         z.imag = -a.imag;
39679         return z;
39680     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)39681     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
39682        return (a.real == 0) && (a.imag == 0);
39683     }
__Pyx_c_conj_double(__pyx_t_double_complex a)39684     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
39685         __pyx_t_double_complex z;
39686         z.real =  a.real;
39687         z.imag = -a.imag;
39688         return z;
39689     }
39690     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)39691         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
39692           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
39693             return sqrt(z.real*z.real + z.imag*z.imag);
39694           #else
39695             return hypot(z.real, z.imag);
39696           #endif
39697         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)39698         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39699             __pyx_t_double_complex z;
39700             double r, lnr, theta, z_r, z_theta;
39701             if (b.imag == 0 && b.real == (int)b.real) {
39702                 if (b.real < 0) {
39703                     double denom = a.real * a.real + a.imag * a.imag;
39704                     a.real = a.real / denom;
39705                     a.imag = -a.imag / denom;
39706                     b.real = -b.real;
39707                 }
39708                 switch ((int)b.real) {
39709                     case 0:
39710                         z.real = 1;
39711                         z.imag = 0;
39712                         return z;
39713                     case 1:
39714                         return a;
39715                     case 2:
39716                         return __Pyx_c_prod_double(a, a);
39717                     case 3:
39718                         z = __Pyx_c_prod_double(a, a);
39719                         return __Pyx_c_prod_double(z, a);
39720                     case 4:
39721                         z = __Pyx_c_prod_double(a, a);
39722                         return __Pyx_c_prod_double(z, z);
39723                 }
39724             }
39725             if (a.imag == 0) {
39726                 if (a.real == 0) {
39727                     return a;
39728                 } else if (b.imag == 0) {
39729                     z.real = pow(a.real, b.real);
39730                     z.imag = 0;
39731                     return z;
39732                 } else if (a.real > 0) {
39733                     r = a.real;
39734                     theta = 0;
39735                 } else {
39736                     r = -a.real;
39737                     theta = atan2(0.0, -1.0);
39738                 }
39739             } else {
39740                 r = __Pyx_c_abs_double(a);
39741                 theta = atan2(a.imag, a.real);
39742             }
39743             lnr = log(r);
39744             z_r = exp(lnr * b.real - theta * b.imag);
39745             z_theta = theta * b.real + lnr * b.imag;
39746             z.real = z_r * cos(z_theta);
39747             z.imag = z_r * sin(z_theta);
39748             return z;
39749         }
39750     #endif
39751 #endif
39752 
39753 /* CIntToPy */
__Pyx_PyInt_From_int(int value)39754   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
39755     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
39756     const int is_unsigned = neg_one > const_zero;
39757     if (is_unsigned) {
39758         if (sizeof(int) < sizeof(long)) {
39759             return PyInt_FromLong((long) value);
39760         } else if (sizeof(int) <= sizeof(unsigned long)) {
39761             return PyLong_FromUnsignedLong((unsigned long) value);
39762 #ifdef HAVE_LONG_LONG
39763         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
39764             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
39765 #endif
39766         }
39767     } else {
39768         if (sizeof(int) <= sizeof(long)) {
39769             return PyInt_FromLong((long) value);
39770 #ifdef HAVE_LONG_LONG
39771         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
39772             return PyLong_FromLongLong((PY_LONG_LONG) value);
39773 #endif
39774         }
39775     }
39776     {
39777         int one = 1; int little = (int)*(unsigned char *)&one;
39778         unsigned char *bytes = (unsigned char *)&value;
39779         return _PyLong_FromByteArray(bytes, sizeof(int),
39780                                      little, !is_unsigned);
39781     }
39782 }
39783 
39784 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)39785   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
39786     const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
39787     const int is_unsigned = neg_one > const_zero;
39788     if (is_unsigned) {
39789         if (sizeof(enum NPY_TYPES) < sizeof(long)) {
39790             return PyInt_FromLong((long) value);
39791         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
39792             return PyLong_FromUnsignedLong((unsigned long) value);
39793 #ifdef HAVE_LONG_LONG
39794         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
39795             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
39796 #endif
39797         }
39798     } else {
39799         if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
39800             return PyInt_FromLong((long) value);
39801 #ifdef HAVE_LONG_LONG
39802         } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
39803             return PyLong_FromLongLong((PY_LONG_LONG) value);
39804 #endif
39805         }
39806     }
39807     {
39808         int one = 1; int little = (int)*(unsigned char *)&one;
39809         unsigned char *bytes = (unsigned char *)&value;
39810         return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
39811                                      little, !is_unsigned);
39812     }
39813 }
39814 
39815 /* CIntFromPy */
__Pyx_PyInt_As_char(PyObject * x)39816   static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
39817     const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
39818     const int is_unsigned = neg_one > const_zero;
39819 #if PY_MAJOR_VERSION < 3
39820     if (likely(PyInt_Check(x))) {
39821         if (sizeof(char) < sizeof(long)) {
39822             __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
39823         } else {
39824             long val = PyInt_AS_LONG(x);
39825             if (is_unsigned && unlikely(val < 0)) {
39826                 goto raise_neg_overflow;
39827             }
39828             return (char) val;
39829         }
39830     } else
39831 #endif
39832     if (likely(PyLong_Check(x))) {
39833         if (is_unsigned) {
39834 #if CYTHON_USE_PYLONG_INTERNALS
39835             const digit* digits = ((PyLongObject*)x)->ob_digit;
39836             switch (Py_SIZE(x)) {
39837                 case  0: return (char) 0;
39838                 case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
39839                 case 2:
39840                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
39841                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39842                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39843                         } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
39844                             return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39845                         }
39846                     }
39847                     break;
39848                 case 3:
39849                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
39850                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39851                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39852                         } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
39853                             return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39854                         }
39855                     }
39856                     break;
39857                 case 4:
39858                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
39859                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39860                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39861                         } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
39862                             return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39863                         }
39864                     }
39865                     break;
39866             }
39867 #endif
39868 #if CYTHON_COMPILING_IN_CPYTHON
39869             if (unlikely(Py_SIZE(x) < 0)) {
39870                 goto raise_neg_overflow;
39871             }
39872 #else
39873             {
39874                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
39875                 if (unlikely(result < 0))
39876                     return (char) -1;
39877                 if (unlikely(result == 1))
39878                     goto raise_neg_overflow;
39879             }
39880 #endif
39881             if (sizeof(char) <= sizeof(unsigned long)) {
39882                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
39883 #ifdef HAVE_LONG_LONG
39884             } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
39885                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
39886 #endif
39887             }
39888         } else {
39889 #if CYTHON_USE_PYLONG_INTERNALS
39890             const digit* digits = ((PyLongObject*)x)->ob_digit;
39891             switch (Py_SIZE(x)) {
39892                 case  0: return (char) 0;
39893                 case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
39894                 case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
39895                 case -2:
39896                     if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
39897                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39898                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39899                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
39900                             return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39901                         }
39902                     }
39903                     break;
39904                 case 2:
39905                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
39906                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
39907                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39908                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
39909                             return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39910                         }
39911                     }
39912                     break;
39913                 case -3:
39914                     if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
39915                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39916                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39917                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
39918                             return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39919                         }
39920                     }
39921                     break;
39922                 case 3:
39923                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
39924                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
39925                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39926                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
39927                             return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39928                         }
39929                     }
39930                     break;
39931                 case -4:
39932                     if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
39933                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39934                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39935                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
39936                             return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39937                         }
39938                     }
39939                     break;
39940                 case 4:
39941                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
39942                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
39943                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39944                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
39945                             return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39946                         }
39947                     }
39948                     break;
39949             }
39950 #endif
39951             if (sizeof(char) <= sizeof(long)) {
39952                 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
39953 #ifdef HAVE_LONG_LONG
39954             } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
39955                 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
39956 #endif
39957             }
39958         }
39959         {
39960 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
39961             PyErr_SetString(PyExc_RuntimeError,
39962                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
39963 #else
39964             char val;
39965             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
39966  #if PY_MAJOR_VERSION < 3
39967             if (likely(v) && !PyLong_Check(v)) {
39968                 PyObject *tmp = v;
39969                 v = PyNumber_Long(tmp);
39970                 Py_DECREF(tmp);
39971             }
39972  #endif
39973             if (likely(v)) {
39974                 int one = 1; int is_little = (int)*(unsigned char *)&one;
39975                 unsigned char *bytes = (unsigned char *)&val;
39976                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
39977                                               bytes, sizeof(val),
39978                                               is_little, !is_unsigned);
39979                 Py_DECREF(v);
39980                 if (likely(!ret))
39981                     return val;
39982             }
39983 #endif
39984             return (char) -1;
39985         }
39986     } else {
39987         char val;
39988         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
39989         if (!tmp) return (char) -1;
39990         val = __Pyx_PyInt_As_char(tmp);
39991         Py_DECREF(tmp);
39992         return val;
39993     }
39994 raise_overflow:
39995     PyErr_SetString(PyExc_OverflowError,
39996         "value too large to convert to char");
39997     return (char) -1;
39998 raise_neg_overflow:
39999     PyErr_SetString(PyExc_OverflowError,
40000         "can't convert negative value to char");
40001     return (char) -1;
40002 }
40003 
40004 /* CIntFromPy */
__Pyx_PyInt_As_npy_int32(PyObject * x)40005   static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
40006     const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
40007     const int is_unsigned = neg_one > const_zero;
40008 #if PY_MAJOR_VERSION < 3
40009     if (likely(PyInt_Check(x))) {
40010         if (sizeof(npy_int32) < sizeof(long)) {
40011             __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
40012         } else {
40013             long val = PyInt_AS_LONG(x);
40014             if (is_unsigned && unlikely(val < 0)) {
40015                 goto raise_neg_overflow;
40016             }
40017             return (npy_int32) val;
40018         }
40019     } else
40020 #endif
40021     if (likely(PyLong_Check(x))) {
40022         if (is_unsigned) {
40023 #if CYTHON_USE_PYLONG_INTERNALS
40024             const digit* digits = ((PyLongObject*)x)->ob_digit;
40025             switch (Py_SIZE(x)) {
40026                 case  0: return (npy_int32) 0;
40027                 case  1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
40028                 case 2:
40029                     if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
40030                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40031                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40032                         } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
40033                             return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
40034                         }
40035                     }
40036                     break;
40037                 case 3:
40038                     if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
40039                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40040                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40041                         } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
40042                             return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
40043                         }
40044                     }
40045                     break;
40046                 case 4:
40047                     if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
40048                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40049                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40050                         } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
40051                             return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
40052                         }
40053                     }
40054                     break;
40055             }
40056 #endif
40057 #if CYTHON_COMPILING_IN_CPYTHON
40058             if (unlikely(Py_SIZE(x) < 0)) {
40059                 goto raise_neg_overflow;
40060             }
40061 #else
40062             {
40063                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
40064                 if (unlikely(result < 0))
40065                     return (npy_int32) -1;
40066                 if (unlikely(result == 1))
40067                     goto raise_neg_overflow;
40068             }
40069 #endif
40070             if (sizeof(npy_int32) <= sizeof(unsigned long)) {
40071                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
40072 #ifdef HAVE_LONG_LONG
40073             } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
40074                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
40075 #endif
40076             }
40077         } else {
40078 #if CYTHON_USE_PYLONG_INTERNALS
40079             const digit* digits = ((PyLongObject*)x)->ob_digit;
40080             switch (Py_SIZE(x)) {
40081                 case  0: return (npy_int32) 0;
40082                 case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
40083                 case  1: __PYX_VERIFY_RETURN_INT(npy_int32,  digit, +digits[0])
40084                 case -2:
40085                     if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
40086                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40087                             __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40088                         } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
40089                             return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
40090                         }
40091                     }
40092                     break;
40093                 case 2:
40094                     if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
40095                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40096                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40097                         } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
40098                             return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
40099                         }
40100                     }
40101                     break;
40102                 case -3:
40103                     if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
40104                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40105                             __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40106                         } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
40107                             return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
40108                         }
40109                     }
40110                     break;
40111                 case 3:
40112                     if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
40113                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40114                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40115                         } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
40116                             return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
40117                         }
40118                     }
40119                     break;
40120                 case -4:
40121                     if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
40122                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40123                             __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40124                         } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
40125                             return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
40126                         }
40127                     }
40128                     break;
40129                 case 4:
40130                     if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
40131                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40132                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40133                         } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
40134                             return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
40135                         }
40136                     }
40137                     break;
40138             }
40139 #endif
40140             if (sizeof(npy_int32) <= sizeof(long)) {
40141                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
40142 #ifdef HAVE_LONG_LONG
40143             } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
40144                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
40145 #endif
40146             }
40147         }
40148         {
40149 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
40150             PyErr_SetString(PyExc_RuntimeError,
40151                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
40152 #else
40153             npy_int32 val;
40154             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
40155  #if PY_MAJOR_VERSION < 3
40156             if (likely(v) && !PyLong_Check(v)) {
40157                 PyObject *tmp = v;
40158                 v = PyNumber_Long(tmp);
40159                 Py_DECREF(tmp);
40160             }
40161  #endif
40162             if (likely(v)) {
40163                 int one = 1; int is_little = (int)*(unsigned char *)&one;
40164                 unsigned char *bytes = (unsigned char *)&val;
40165                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
40166                                               bytes, sizeof(val),
40167                                               is_little, !is_unsigned);
40168                 Py_DECREF(v);
40169                 if (likely(!ret))
40170                     return val;
40171             }
40172 #endif
40173             return (npy_int32) -1;
40174         }
40175     } else {
40176         npy_int32 val;
40177         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
40178         if (!tmp) return (npy_int32) -1;
40179         val = __Pyx_PyInt_As_npy_int32(tmp);
40180         Py_DECREF(tmp);
40181         return val;
40182     }
40183 raise_overflow:
40184     PyErr_SetString(PyExc_OverflowError,
40185         "value too large to convert to npy_int32");
40186     return (npy_int32) -1;
40187 raise_neg_overflow:
40188     PyErr_SetString(PyExc_OverflowError,
40189         "can't convert negative value to npy_int32");
40190     return (npy_int32) -1;
40191 }
40192 
40193 /* CIntFromPy */
__Pyx_PyInt_As_short(PyObject * x)40194   static CYTHON_INLINE short __Pyx_PyInt_As_short(PyObject *x) {
40195     const short neg_one = (short) ((short) 0 - (short) 1), const_zero = (short) 0;
40196     const int is_unsigned = neg_one > const_zero;
40197 #if PY_MAJOR_VERSION < 3
40198     if (likely(PyInt_Check(x))) {
40199         if (sizeof(short) < sizeof(long)) {
40200             __PYX_VERIFY_RETURN_INT(short, long, PyInt_AS_LONG(x))
40201         } else {
40202             long val = PyInt_AS_LONG(x);
40203             if (is_unsigned && unlikely(val < 0)) {
40204                 goto raise_neg_overflow;
40205             }
40206             return (short) val;
40207         }
40208     } else
40209 #endif
40210     if (likely(PyLong_Check(x))) {
40211         if (is_unsigned) {
40212 #if CYTHON_USE_PYLONG_INTERNALS
40213             const digit* digits = ((PyLongObject*)x)->ob_digit;
40214             switch (Py_SIZE(x)) {
40215                 case  0: return (short) 0;
40216                 case  1: __PYX_VERIFY_RETURN_INT(short, digit, digits[0])
40217                 case 2:
40218                     if (8 * sizeof(short) > 1 * PyLong_SHIFT) {
40219                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40220                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40221                         } else if (8 * sizeof(short) >= 2 * PyLong_SHIFT) {
40222                             return (short) (((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
40223                         }
40224                     }
40225                     break;
40226                 case 3:
40227                     if (8 * sizeof(short) > 2 * PyLong_SHIFT) {
40228                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40229                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40230                         } else if (8 * sizeof(short) >= 3 * PyLong_SHIFT) {
40231                             return (short) (((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
40232                         }
40233                     }
40234                     break;
40235                 case 4:
40236                     if (8 * sizeof(short) > 3 * PyLong_SHIFT) {
40237                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40238                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40239                         } else if (8 * sizeof(short) >= 4 * PyLong_SHIFT) {
40240                             return (short) (((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
40241                         }
40242                     }
40243                     break;
40244             }
40245 #endif
40246 #if CYTHON_COMPILING_IN_CPYTHON
40247             if (unlikely(Py_SIZE(x) < 0)) {
40248                 goto raise_neg_overflow;
40249             }
40250 #else
40251             {
40252                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
40253                 if (unlikely(result < 0))
40254                     return (short) -1;
40255                 if (unlikely(result == 1))
40256                     goto raise_neg_overflow;
40257             }
40258 #endif
40259             if (sizeof(short) <= sizeof(unsigned long)) {
40260                 __PYX_VERIFY_RETURN_INT_EXC(short, unsigned long, PyLong_AsUnsignedLong(x))
40261 #ifdef HAVE_LONG_LONG
40262             } else if (sizeof(short) <= sizeof(unsigned PY_LONG_LONG)) {
40263                 __PYX_VERIFY_RETURN_INT_EXC(short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
40264 #endif
40265             }
40266         } else {
40267 #if CYTHON_USE_PYLONG_INTERNALS
40268             const digit* digits = ((PyLongObject*)x)->ob_digit;
40269             switch (Py_SIZE(x)) {
40270                 case  0: return (short) 0;
40271                 case -1: __PYX_VERIFY_RETURN_INT(short, sdigit, (sdigit) (-(sdigit)digits[0]))
40272                 case  1: __PYX_VERIFY_RETURN_INT(short,  digit, +digits[0])
40273                 case -2:
40274                     if (8 * sizeof(short) - 1 > 1 * PyLong_SHIFT) {
40275                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40276                             __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40277                         } else if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
40278                             return (short) (((short)-1)*(((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
40279                         }
40280                     }
40281                     break;
40282                 case 2:
40283                     if (8 * sizeof(short) > 1 * PyLong_SHIFT) {
40284                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40285                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40286                         } else if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
40287                             return (short) ((((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
40288                         }
40289                     }
40290                     break;
40291                 case -3:
40292                     if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
40293                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40294                             __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40295                         } else if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
40296                             return (short) (((short)-1)*(((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
40297                         }
40298                     }
40299                     break;
40300                 case 3:
40301                     if (8 * sizeof(short) > 2 * PyLong_SHIFT) {
40302                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40303                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40304                         } else if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
40305                             return (short) ((((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
40306                         }
40307                     }
40308                     break;
40309                 case -4:
40310                     if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
40311                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40312                             __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40313                         } else if (8 * sizeof(short) - 1 > 4 * PyLong_SHIFT) {
40314                             return (short) (((short)-1)*(((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
40315                         }
40316                     }
40317                     break;
40318                 case 4:
40319                     if (8 * sizeof(short) > 3 * PyLong_SHIFT) {
40320                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40321                             __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40322                         } else if (8 * sizeof(short) - 1 > 4 * PyLong_SHIFT) {
40323                             return (short) ((((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
40324                         }
40325                     }
40326                     break;
40327             }
40328 #endif
40329             if (sizeof(short) <= sizeof(long)) {
40330                 __PYX_VERIFY_RETURN_INT_EXC(short, long, PyLong_AsLong(x))
40331 #ifdef HAVE_LONG_LONG
40332             } else if (sizeof(short) <= sizeof(PY_LONG_LONG)) {
40333                 __PYX_VERIFY_RETURN_INT_EXC(short, PY_LONG_LONG, PyLong_AsLongLong(x))
40334 #endif
40335             }
40336         }
40337         {
40338 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
40339             PyErr_SetString(PyExc_RuntimeError,
40340                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
40341 #else
40342             short val;
40343             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
40344  #if PY_MAJOR_VERSION < 3
40345             if (likely(v) && !PyLong_Check(v)) {
40346                 PyObject *tmp = v;
40347                 v = PyNumber_Long(tmp);
40348                 Py_DECREF(tmp);
40349             }
40350  #endif
40351             if (likely(v)) {
40352                 int one = 1; int is_little = (int)*(unsigned char *)&one;
40353                 unsigned char *bytes = (unsigned char *)&val;
40354                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
40355                                               bytes, sizeof(val),
40356                                               is_little, !is_unsigned);
40357                 Py_DECREF(v);
40358                 if (likely(!ret))
40359                     return val;
40360             }
40361 #endif
40362             return (short) -1;
40363         }
40364     } else {
40365         short val;
40366         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
40367         if (!tmp) return (short) -1;
40368         val = __Pyx_PyInt_As_short(tmp);
40369         Py_DECREF(tmp);
40370         return val;
40371     }
40372 raise_overflow:
40373     PyErr_SetString(PyExc_OverflowError,
40374         "value too large to convert to short");
40375     return (short) -1;
40376 raise_neg_overflow:
40377     PyErr_SetString(PyExc_OverflowError,
40378         "can't convert negative value to short");
40379     return (short) -1;
40380 }
40381 
40382 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)40383   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
40384     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
40385     const int is_unsigned = neg_one > const_zero;
40386 #if PY_MAJOR_VERSION < 3
40387     if (likely(PyInt_Check(x))) {
40388         if (sizeof(long) < sizeof(long)) {
40389             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
40390         } else {
40391             long val = PyInt_AS_LONG(x);
40392             if (is_unsigned && unlikely(val < 0)) {
40393                 goto raise_neg_overflow;
40394             }
40395             return (long) val;
40396         }
40397     } else
40398 #endif
40399     if (likely(PyLong_Check(x))) {
40400         if (is_unsigned) {
40401 #if CYTHON_USE_PYLONG_INTERNALS
40402             const digit* digits = ((PyLongObject*)x)->ob_digit;
40403             switch (Py_SIZE(x)) {
40404                 case  0: return (long) 0;
40405                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
40406                 case 2:
40407                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
40408                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40409                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40410                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
40411                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
40412                         }
40413                     }
40414                     break;
40415                 case 3:
40416                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
40417                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40418                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40419                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
40420                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
40421                         }
40422                     }
40423                     break;
40424                 case 4:
40425                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
40426                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40427                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40428                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
40429                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
40430                         }
40431                     }
40432                     break;
40433             }
40434 #endif
40435 #if CYTHON_COMPILING_IN_CPYTHON
40436             if (unlikely(Py_SIZE(x) < 0)) {
40437                 goto raise_neg_overflow;
40438             }
40439 #else
40440             {
40441                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
40442                 if (unlikely(result < 0))
40443                     return (long) -1;
40444                 if (unlikely(result == 1))
40445                     goto raise_neg_overflow;
40446             }
40447 #endif
40448             if (sizeof(long) <= sizeof(unsigned long)) {
40449                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
40450 #ifdef HAVE_LONG_LONG
40451             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
40452                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
40453 #endif
40454             }
40455         } else {
40456 #if CYTHON_USE_PYLONG_INTERNALS
40457             const digit* digits = ((PyLongObject*)x)->ob_digit;
40458             switch (Py_SIZE(x)) {
40459                 case  0: return (long) 0;
40460                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
40461                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
40462                 case -2:
40463                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
40464                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40465                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40466                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
40467                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40468                         }
40469                     }
40470                     break;
40471                 case 2:
40472                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
40473                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40474                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40475                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
40476                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40477                         }
40478                     }
40479                     break;
40480                 case -3:
40481                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
40482                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40483                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40484                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
40485                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40486                         }
40487                     }
40488                     break;
40489                 case 3:
40490                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
40491                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40492                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40493                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
40494                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40495                         }
40496                     }
40497                     break;
40498                 case -4:
40499                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
40500                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40501                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40502                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
40503                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40504                         }
40505                     }
40506                     break;
40507                 case 4:
40508                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
40509                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40510                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40511                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
40512                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
40513                         }
40514                     }
40515                     break;
40516             }
40517 #endif
40518             if (sizeof(long) <= sizeof(long)) {
40519                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
40520 #ifdef HAVE_LONG_LONG
40521             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
40522                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
40523 #endif
40524             }
40525         }
40526         {
40527 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
40528             PyErr_SetString(PyExc_RuntimeError,
40529                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
40530 #else
40531             long val;
40532             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
40533  #if PY_MAJOR_VERSION < 3
40534             if (likely(v) && !PyLong_Check(v)) {
40535                 PyObject *tmp = v;
40536                 v = PyNumber_Long(tmp);
40537                 Py_DECREF(tmp);
40538             }
40539  #endif
40540             if (likely(v)) {
40541                 int one = 1; int is_little = (int)*(unsigned char *)&one;
40542                 unsigned char *bytes = (unsigned char *)&val;
40543                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
40544                                               bytes, sizeof(val),
40545                                               is_little, !is_unsigned);
40546                 Py_DECREF(v);
40547                 if (likely(!ret))
40548                     return val;
40549             }
40550 #endif
40551             return (long) -1;
40552         }
40553     } else {
40554         long val;
40555         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
40556         if (!tmp) return (long) -1;
40557         val = __Pyx_PyInt_As_long(tmp);
40558         Py_DECREF(tmp);
40559         return val;
40560     }
40561 raise_overflow:
40562     PyErr_SetString(PyExc_OverflowError,
40563         "value too large to convert to long");
40564     return (long) -1;
40565 raise_neg_overflow:
40566     PyErr_SetString(PyExc_OverflowError,
40567         "can't convert negative value to long");
40568     return (long) -1;
40569 }
40570 
40571 /* CIntFromPy */
__Pyx_PyInt_As_npy_int64(PyObject * x)40572   static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
40573     const npy_int64 neg_one = (npy_int64) ((npy_int64) 0 - (npy_int64) 1), const_zero = (npy_int64) 0;
40574     const int is_unsigned = neg_one > const_zero;
40575 #if PY_MAJOR_VERSION < 3
40576     if (likely(PyInt_Check(x))) {
40577         if (sizeof(npy_int64) < sizeof(long)) {
40578             __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x))
40579         } else {
40580             long val = PyInt_AS_LONG(x);
40581             if (is_unsigned && unlikely(val < 0)) {
40582                 goto raise_neg_overflow;
40583             }
40584             return (npy_int64) val;
40585         }
40586     } else
40587 #endif
40588     if (likely(PyLong_Check(x))) {
40589         if (is_unsigned) {
40590 #if CYTHON_USE_PYLONG_INTERNALS
40591             const digit* digits = ((PyLongObject*)x)->ob_digit;
40592             switch (Py_SIZE(x)) {
40593                 case  0: return (npy_int64) 0;
40594                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0])
40595                 case 2:
40596                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
40597                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40598                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40599                         } else if (8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT) {
40600                             return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
40601                         }
40602                     }
40603                     break;
40604                 case 3:
40605                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
40606                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40607                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40608                         } else if (8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT) {
40609                             return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
40610                         }
40611                     }
40612                     break;
40613                 case 4:
40614                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
40615                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40616                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40617                         } else if (8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT) {
40618                             return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
40619                         }
40620                     }
40621                     break;
40622             }
40623 #endif
40624 #if CYTHON_COMPILING_IN_CPYTHON
40625             if (unlikely(Py_SIZE(x) < 0)) {
40626                 goto raise_neg_overflow;
40627             }
40628 #else
40629             {
40630                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
40631                 if (unlikely(result < 0))
40632                     return (npy_int64) -1;
40633                 if (unlikely(result == 1))
40634                     goto raise_neg_overflow;
40635             }
40636 #endif
40637             if (sizeof(npy_int64) <= sizeof(unsigned long)) {
40638                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
40639 #ifdef HAVE_LONG_LONG
40640             } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
40641                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
40642 #endif
40643             }
40644         } else {
40645 #if CYTHON_USE_PYLONG_INTERNALS
40646             const digit* digits = ((PyLongObject*)x)->ob_digit;
40647             switch (Py_SIZE(x)) {
40648                 case  0: return (npy_int64) 0;
40649                 case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, (sdigit) (-(sdigit)digits[0]))
40650                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64,  digit, +digits[0])
40651                 case -2:
40652                     if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) {
40653                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40654                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40655                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
40656                             return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
40657                         }
40658                     }
40659                     break;
40660                 case 2:
40661                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
40662                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40663                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40664                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
40665                             return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
40666                         }
40667                     }
40668                     break;
40669                 case -3:
40670                     if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
40671                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40672                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40673                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
40674                             return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
40675                         }
40676                     }
40677                     break;
40678                 case 3:
40679                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
40680                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40681                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40682                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
40683                             return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
40684                         }
40685                     }
40686                     break;
40687                 case -4:
40688                     if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
40689                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40690                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40691                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
40692                             return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
40693                         }
40694                     }
40695                     break;
40696                 case 4:
40697                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
40698                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40699                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40700                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
40701                             return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
40702                         }
40703                     }
40704                     break;
40705             }
40706 #endif
40707             if (sizeof(npy_int64) <= sizeof(long)) {
40708                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x))
40709 #ifdef HAVE_LONG_LONG
40710             } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
40711                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
40712 #endif
40713             }
40714         }
40715         {
40716 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
40717             PyErr_SetString(PyExc_RuntimeError,
40718                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
40719 #else
40720             npy_int64 val;
40721             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
40722  #if PY_MAJOR_VERSION < 3
40723             if (likely(v) && !PyLong_Check(v)) {
40724                 PyObject *tmp = v;
40725                 v = PyNumber_Long(tmp);
40726                 Py_DECREF(tmp);
40727             }
40728  #endif
40729             if (likely(v)) {
40730                 int one = 1; int is_little = (int)*(unsigned char *)&one;
40731                 unsigned char *bytes = (unsigned char *)&val;
40732                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
40733                                               bytes, sizeof(val),
40734                                               is_little, !is_unsigned);
40735                 Py_DECREF(v);
40736                 if (likely(!ret))
40737                     return val;
40738             }
40739 #endif
40740             return (npy_int64) -1;
40741         }
40742     } else {
40743         npy_int64 val;
40744         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
40745         if (!tmp) return (npy_int64) -1;
40746         val = __Pyx_PyInt_As_npy_int64(tmp);
40747         Py_DECREF(tmp);
40748         return val;
40749     }
40750 raise_overflow:
40751     PyErr_SetString(PyExc_OverflowError,
40752         "value too large to convert to npy_int64");
40753     return (npy_int64) -1;
40754 raise_neg_overflow:
40755     PyErr_SetString(PyExc_OverflowError,
40756         "can't convert negative value to npy_int64");
40757     return (npy_int64) -1;
40758 }
40759 
40760 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)40761   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
40762     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
40763     const int is_unsigned = neg_one > const_zero;
40764 #if PY_MAJOR_VERSION < 3
40765     if (likely(PyInt_Check(x))) {
40766         if (sizeof(int) < sizeof(long)) {
40767             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
40768         } else {
40769             long val = PyInt_AS_LONG(x);
40770             if (is_unsigned && unlikely(val < 0)) {
40771                 goto raise_neg_overflow;
40772             }
40773             return (int) val;
40774         }
40775     } else
40776 #endif
40777     if (likely(PyLong_Check(x))) {
40778         if (is_unsigned) {
40779 #if CYTHON_USE_PYLONG_INTERNALS
40780             const digit* digits = ((PyLongObject*)x)->ob_digit;
40781             switch (Py_SIZE(x)) {
40782                 case  0: return (int) 0;
40783                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
40784                 case 2:
40785                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
40786                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40787                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40788                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
40789                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
40790                         }
40791                     }
40792                     break;
40793                 case 3:
40794                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
40795                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40796                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40797                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
40798                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
40799                         }
40800                     }
40801                     break;
40802                 case 4:
40803                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
40804                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40805                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40806                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
40807                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
40808                         }
40809                     }
40810                     break;
40811             }
40812 #endif
40813 #if CYTHON_COMPILING_IN_CPYTHON
40814             if (unlikely(Py_SIZE(x) < 0)) {
40815                 goto raise_neg_overflow;
40816             }
40817 #else
40818             {
40819                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
40820                 if (unlikely(result < 0))
40821                     return (int) -1;
40822                 if (unlikely(result == 1))
40823                     goto raise_neg_overflow;
40824             }
40825 #endif
40826             if (sizeof(int) <= sizeof(unsigned long)) {
40827                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
40828 #ifdef HAVE_LONG_LONG
40829             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
40830                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
40831 #endif
40832             }
40833         } else {
40834 #if CYTHON_USE_PYLONG_INTERNALS
40835             const digit* digits = ((PyLongObject*)x)->ob_digit;
40836             switch (Py_SIZE(x)) {
40837                 case  0: return (int) 0;
40838                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
40839                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
40840                 case -2:
40841                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
40842                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40843                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40844                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
40845                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40846                         }
40847                     }
40848                     break;
40849                 case 2:
40850                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
40851                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
40852                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40853                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
40854                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40855                         }
40856                     }
40857                     break;
40858                 case -3:
40859                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
40860                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40861                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40862                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
40863                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40864                         }
40865                     }
40866                     break;
40867                 case 3:
40868                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
40869                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
40870                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40871                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
40872                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40873                         }
40874                     }
40875                     break;
40876                 case -4:
40877                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
40878                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40879                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40880                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
40881                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40882                         }
40883                     }
40884                     break;
40885                 case 4:
40886                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
40887                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
40888                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40889                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
40890                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40891                         }
40892                     }
40893                     break;
40894             }
40895 #endif
40896             if (sizeof(int) <= sizeof(long)) {
40897                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
40898 #ifdef HAVE_LONG_LONG
40899             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
40900                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
40901 #endif
40902             }
40903         }
40904         {
40905 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
40906             PyErr_SetString(PyExc_RuntimeError,
40907                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
40908 #else
40909             int val;
40910             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
40911  #if PY_MAJOR_VERSION < 3
40912             if (likely(v) && !PyLong_Check(v)) {
40913                 PyObject *tmp = v;
40914                 v = PyNumber_Long(tmp);
40915                 Py_DECREF(tmp);
40916             }
40917  #endif
40918             if (likely(v)) {
40919                 int one = 1; int is_little = (int)*(unsigned char *)&one;
40920                 unsigned char *bytes = (unsigned char *)&val;
40921                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
40922                                               bytes, sizeof(val),
40923                                               is_little, !is_unsigned);
40924                 Py_DECREF(v);
40925                 if (likely(!ret))
40926                     return val;
40927             }
40928 #endif
40929             return (int) -1;
40930         }
40931     } else {
40932         int val;
40933         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
40934         if (!tmp) return (int) -1;
40935         val = __Pyx_PyInt_As_int(tmp);
40936         Py_DECREF(tmp);
40937         return val;
40938     }
40939 raise_overflow:
40940     PyErr_SetString(PyExc_OverflowError,
40941         "value too large to convert to int");
40942     return (int) -1;
40943 raise_neg_overflow:
40944     PyErr_SetString(PyExc_OverflowError,
40945         "can't convert negative value to int");
40946     return (int) -1;
40947 }
40948 
40949 /* FastTypeChecks */
40950   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)40951 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
40952     while (a) {
40953         a = a->tp_base;
40954         if (a == b)
40955             return 1;
40956     }
40957     return b == &PyBaseObject_Type;
40958 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)40959 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
40960     PyObject *mro;
40961     if (a == b) return 1;
40962     mro = a->tp_mro;
40963     if (likely(mro)) {
40964         Py_ssize_t i, n;
40965         n = PyTuple_GET_SIZE(mro);
40966         for (i = 0; i < n; i++) {
40967             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
40968                 return 1;
40969         }
40970         return 0;
40971     }
40972     return __Pyx_InBases(a, b);
40973 }
40974 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)40975 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
40976     PyObject *exception, *value, *tb;
40977     int res;
40978     __Pyx_PyThreadState_declare
40979     __Pyx_PyThreadState_assign
40980     __Pyx_ErrFetch(&exception, &value, &tb);
40981     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
40982     if (unlikely(res == -1)) {
40983         PyErr_WriteUnraisable(err);
40984         res = 0;
40985     }
40986     if (!res) {
40987         res = PyObject_IsSubclass(err, exc_type2);
40988         if (unlikely(res == -1)) {
40989             PyErr_WriteUnraisable(err);
40990             res = 0;
40991         }
40992     }
40993     __Pyx_ErrRestore(exception, value, tb);
40994     return res;
40995 }
40996 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)40997 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
40998     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
40999     if (!res) {
41000         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
41001     }
41002     return res;
41003 }
41004 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)41005 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
41006     Py_ssize_t i, n;
41007     assert(PyExceptionClass_Check(exc_type));
41008     n = PyTuple_GET_SIZE(tuple);
41009 #if PY_MAJOR_VERSION >= 3
41010     for (i=0; i<n; i++) {
41011         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
41012     }
41013 #endif
41014     for (i=0; i<n; i++) {
41015         PyObject *t = PyTuple_GET_ITEM(tuple, i);
41016         #if PY_MAJOR_VERSION < 3
41017         if (likely(exc_type == t)) return 1;
41018         #endif
41019         if (likely(PyExceptionClass_Check(t))) {
41020             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
41021         } else {
41022         }
41023     }
41024     return 0;
41025 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)41026 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
41027     if (likely(err == exc_type)) return 1;
41028     if (likely(PyExceptionClass_Check(err))) {
41029         if (likely(PyExceptionClass_Check(exc_type))) {
41030             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
41031         } else if (likely(PyTuple_Check(exc_type))) {
41032             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
41033         } else {
41034         }
41035     }
41036     return PyErr_GivenExceptionMatches(err, exc_type);
41037 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)41038 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
41039     assert(PyExceptionClass_Check(exc_type1));
41040     assert(PyExceptionClass_Check(exc_type2));
41041     if (likely(err == exc_type1 || err == exc_type2)) return 1;
41042     if (likely(PyExceptionClass_Check(err))) {
41043         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
41044     }
41045     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
41046 }
41047 #endif
41048 
41049 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)41050   static int __Pyx_check_binary_version(void) {
41051     char ctversion[4], rtversion[4];
41052     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
41053     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
41054     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
41055         char message[200];
41056         PyOS_snprintf(message, sizeof(message),
41057                       "compiletime version %s of module '%.100s' "
41058                       "does not match runtime version %s",
41059                       ctversion, __Pyx_MODULE_NAME, rtversion);
41060         return PyErr_WarnEx(NULL, message, 1);
41061     }
41062     return 0;
41063 }
41064 
41065 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)41066   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
41067     while (t->p) {
41068         #if PY_MAJOR_VERSION < 3
41069         if (t->is_unicode) {
41070             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
41071         } else if (t->intern) {
41072             *t->p = PyString_InternFromString(t->s);
41073         } else {
41074             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
41075         }
41076         #else
41077         if (t->is_unicode | t->is_str) {
41078             if (t->intern) {
41079                 *t->p = PyUnicode_InternFromString(t->s);
41080             } else if (t->encoding) {
41081                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
41082             } else {
41083                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
41084             }
41085         } else {
41086             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
41087         }
41088         #endif
41089         if (!*t->p)
41090             return -1;
41091         if (PyObject_Hash(*t->p) == -1)
41092             return -1;
41093         ++t;
41094     }
41095     return 0;
41096 }
41097 
__Pyx_PyUnicode_FromString(const char * c_str)41098 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
41099     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
41100 }
__Pyx_PyObject_AsString(PyObject * o)41101 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
41102     Py_ssize_t ignore;
41103     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
41104 }
41105 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
41106 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)41107 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
41108     char* defenc_c;
41109     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
41110     if (!defenc) return NULL;
41111     defenc_c = PyBytes_AS_STRING(defenc);
41112 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
41113     {
41114         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
41115         char* c;
41116         for (c = defenc_c; c < end; c++) {
41117             if ((unsigned char) (*c) >= 128) {
41118                 PyUnicode_AsASCIIString(o);
41119                 return NULL;
41120             }
41121         }
41122     }
41123 #endif
41124     *length = PyBytes_GET_SIZE(defenc);
41125     return defenc_c;
41126 }
41127 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)41128 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
41129     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
41130 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
41131     if (likely(PyUnicode_IS_ASCII(o))) {
41132         *length = PyUnicode_GET_LENGTH(o);
41133         return PyUnicode_AsUTF8(o);
41134     } else {
41135         PyUnicode_AsASCIIString(o);
41136         return NULL;
41137     }
41138 #else
41139     return PyUnicode_AsUTF8AndSize(o, length);
41140 #endif
41141 }
41142 #endif
41143 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)41144 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
41145 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
41146     if (
41147 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
41148             __Pyx_sys_getdefaultencoding_not_ascii &&
41149 #endif
41150             PyUnicode_Check(o)) {
41151         return __Pyx_PyUnicode_AsStringAndSize(o, length);
41152     } else
41153 #endif
41154 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
41155     if (PyByteArray_Check(o)) {
41156         *length = PyByteArray_GET_SIZE(o);
41157         return PyByteArray_AS_STRING(o);
41158     } else
41159 #endif
41160     {
41161         char* result;
41162         int r = PyBytes_AsStringAndSize(o, &result, length);
41163         if (unlikely(r < 0)) {
41164             return NULL;
41165         } else {
41166             return result;
41167         }
41168     }
41169 }
__Pyx_PyObject_IsTrue(PyObject * x)41170 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
41171    int is_true = x == Py_True;
41172    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
41173    else return PyObject_IsTrue(x);
41174 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)41175 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
41176     int retval;
41177     if (unlikely(!x)) return -1;
41178     retval = __Pyx_PyObject_IsTrue(x);
41179     Py_DECREF(x);
41180     return retval;
41181 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)41182 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
41183 #if PY_MAJOR_VERSION >= 3
41184     if (PyLong_Check(result)) {
41185         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
41186                 "__int__ returned non-int (type %.200s).  "
41187                 "The ability to return an instance of a strict subclass of int "
41188                 "is deprecated, and may be removed in a future version of Python.",
41189                 Py_TYPE(result)->tp_name)) {
41190             Py_DECREF(result);
41191             return NULL;
41192         }
41193         return result;
41194     }
41195 #endif
41196     PyErr_Format(PyExc_TypeError,
41197                  "__%.4s__ returned non-%.4s (type %.200s)",
41198                  type_name, type_name, Py_TYPE(result)->tp_name);
41199     Py_DECREF(result);
41200     return NULL;
41201 }
__Pyx_PyNumber_IntOrLong(PyObject * x)41202 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
41203 #if CYTHON_USE_TYPE_SLOTS
41204   PyNumberMethods *m;
41205 #endif
41206   const char *name = NULL;
41207   PyObject *res = NULL;
41208 #if PY_MAJOR_VERSION < 3
41209   if (likely(PyInt_Check(x) || PyLong_Check(x)))
41210 #else
41211   if (likely(PyLong_Check(x)))
41212 #endif
41213     return __Pyx_NewRef(x);
41214 #if CYTHON_USE_TYPE_SLOTS
41215   m = Py_TYPE(x)->tp_as_number;
41216   #if PY_MAJOR_VERSION < 3
41217   if (m && m->nb_int) {
41218     name = "int";
41219     res = m->nb_int(x);
41220   }
41221   else if (m && m->nb_long) {
41222     name = "long";
41223     res = m->nb_long(x);
41224   }
41225   #else
41226   if (likely(m && m->nb_int)) {
41227     name = "int";
41228     res = m->nb_int(x);
41229   }
41230   #endif
41231 #else
41232   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
41233     res = PyNumber_Int(x);
41234   }
41235 #endif
41236   if (likely(res)) {
41237 #if PY_MAJOR_VERSION < 3
41238     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
41239 #else
41240     if (unlikely(!PyLong_CheckExact(res))) {
41241 #endif
41242         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
41243     }
41244   }
41245   else if (!PyErr_Occurred()) {
41246     PyErr_SetString(PyExc_TypeError,
41247                     "an integer is required");
41248   }
41249   return res;
41250 }
41251 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
41252   Py_ssize_t ival;
41253   PyObject *x;
41254 #if PY_MAJOR_VERSION < 3
41255   if (likely(PyInt_CheckExact(b))) {
41256     if (sizeof(Py_ssize_t) >= sizeof(long))
41257         return PyInt_AS_LONG(b);
41258     else
41259         return PyInt_AsSsize_t(b);
41260   }
41261 #endif
41262   if (likely(PyLong_CheckExact(b))) {
41263     #if CYTHON_USE_PYLONG_INTERNALS
41264     const digit* digits = ((PyLongObject*)b)->ob_digit;
41265     const Py_ssize_t size = Py_SIZE(b);
41266     if (likely(__Pyx_sst_abs(size) <= 1)) {
41267         ival = likely(size) ? digits[0] : 0;
41268         if (size == -1) ival = -ival;
41269         return ival;
41270     } else {
41271       switch (size) {
41272          case 2:
41273            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
41274              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
41275            }
41276            break;
41277          case -2:
41278            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
41279              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
41280            }
41281            break;
41282          case 3:
41283            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
41284              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
41285            }
41286            break;
41287          case -3:
41288            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
41289              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
41290            }
41291            break;
41292          case 4:
41293            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
41294              return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
41295            }
41296            break;
41297          case -4:
41298            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
41299              return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
41300            }
41301            break;
41302       }
41303     }
41304     #endif
41305     return PyLong_AsSsize_t(b);
41306   }
41307   x = PyNumber_Index(b);
41308   if (!x) return -1;
41309   ival = PyInt_AsSsize_t(x);
41310   Py_DECREF(x);
41311   return ival;
41312 }
41313 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
41314   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
41315 }
41316 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
41317     return PyInt_FromSize_t(ival);
41318 }
41319 
41320 
41321 #endif /* Py_PYTHON_H */
41322