Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

9823 lines (9344 sloc) 524.779 kB
/* Generated by Cython 0.16 on Wed Aug 1 19:50:23 2012 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
#error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
#endif
#ifndef __cdecl
#define __cdecl
#endif
#ifndef __fastcall
#define __fastcall
#endif
#endif
#ifndef DL_IMPORT
#define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyCFunction_Call PyObject_Call
#else
#define __Pyx_PyCFunction_Call PyCFunction_Call
#endif
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#define PY_FORMAT_SIZE_T ""
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
#define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o)
#define PyNumber_Index(o) PyNumber_Int(o)
#define PyIndex_Check(o) PyNumber_Check(o)
#define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#define __PYX_BUILD_PY_SSIZE_T "i"
#else
#define __PYX_BUILD_PY_SSIZE_T "n"
#endif
#if PY_VERSION_HEX < 0x02060000
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
#define PyVarObject_HEAD_INIT(type, size) \
PyObject_HEAD_INIT(type) size,
#define PyType_Modified(t)
typedef struct {
void *buf;
PyObject *obj;
Py_ssize_t len;
Py_ssize_t itemsize;
int readonly;
int ndim;
char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
void *internal;
} Py_buffer;
#define PyBUF_SIMPLE 0
#define PyBUF_WRITABLE 0x0001
#define PyBUF_FORMAT 0x0004
#define PyBUF_ND 0x0008
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
#define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
#define Py_TPFLAGS_CHECKTYPES 0
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_GET_LENGTH)
#define CYTHON_PEP393_ENABLED 1
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#else
#define CYTHON_PEP393_ENABLED 0
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
#define PyString_Type PyUnicode_Type
#define PyString_Check PyUnicode_Check
#define PyString_CheckExact PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
#define PyBytesObject PyStringObject
#define PyBytes_Type PyString_Type
#define PyBytes_Check PyString_Check
#define PyBytes_CheckExact PyString_CheckExact
#define PyBytes_FromString PyString_FromString
#define PyBytes_FromStringAndSize PyString_FromStringAndSize
#define PyBytes_FromFormat PyString_FromFormat
#define PyBytes_DecodeEscape PyString_DecodeEscape
#define PyBytes_AsString PyString_AsString
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
#define PyBytes_Size PyString_Size
#define PyBytes_AS_STRING PyString_AS_STRING
#define PyBytes_GET_SIZE PyString_GET_SIZE
#define PyBytes_Repr PyString_Repr
#define PyBytes_Concat PyString_Concat
#define PyBytes_ConcatAndDel PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
#define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
#define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
#define PyInt_FromString PyLong_FromString
#define PyInt_FromUnicode PyLong_FromUnicode
#define PyInt_FromLong PyLong_FromLong
#define PyInt_FromSize_t PyLong_FromSize_t
#define PyInt_FromSsize_t PyLong_FromSsize_t
#define PyInt_AsLong PyLong_AsLong
#define PyInt_AS_LONG PyLong_AS_LONG
#define PyInt_AsSsize_t PyLong_AsSsize_t
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBoolObject PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
typedef long Py_hash_t;
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
#define __Pyx_PyInt_AsHash_t PyInt_AsLong
#else
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
#endif
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
#define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
#define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
#define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
#define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
#define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
#define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
#define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
#else
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_NAMESTR(n) ((char *)(n))
#define __Pyx_DOCSTR(n) ((char *)(n))
#else
#define __Pyx_NAMESTR(n) (n)
#define __Pyx_DOCSTR(n) (n)
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
#endif
#ifndef __PYX_EXTERN_C
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#endif
#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__MACS2__cPeakDetect
#define __PYX_HAVE_API__MACS2__cPeakDetect
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */
#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif
/* inline attribute */
#ifndef CYTHON_INLINE
#if defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif
/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
/* Type Conversion Predeclarations */
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
static const char *__pyx_f[] = {
"cPeakDetect.pyx",
};
/*--- Type declarations ---*/
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
typedef struct {
void (*INCREF)(void*, PyObject*, int);
void (*DECREF)(void*, PyObject*, int);
void (*GOTREF)(void*, PyObject*, int);
void (*GIVEREF)(void*, PyObject*, int);
void* (*SetupContext)(const char*, int, const char*);
void (*FinishContext)(void**);
} __Pyx_RefNannyAPIStruct;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
#define __Pyx_RefNannySetupContext(name, acquire_gil) \
if (acquire_gil) { \
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
PyGILState_Release(__pyx_gilstate_save); \
} else { \
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
}
#else
#define __Pyx_RefNannySetupContext(name, acquire_gil) \
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
#define __Pyx_RefNannyFinishContext() \
__Pyx_RefNanny->FinishContext(&__pyx_refnanny)
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
#define __Pyx_RefNannyDeclarations
#define __Pyx_RefNannySetupContext(name, acquire_gil)
#define __Pyx_RefNannyFinishContext()
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_DECREF(r) Py_DECREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GIVEREF(r)
#define __Pyx_XINCREF(r) Py_XINCREF(r)
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#define __Pyx_XGOTREF(r)
#define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
#ifndef CYTHON_PROFILE
#define CYTHON_PROFILE 1
#endif
#ifndef CYTHON_PROFILE_REUSE_FRAME
#define CYTHON_PROFILE_REUSE_FRAME 0
#endif
#if CYTHON_PROFILE
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if CYTHON_PROFILE_REUSE_FRAME
#define CYTHON_FRAME_MODIFIER static
#define CYTHON_FRAME_DEL
#else
#define CYTHON_FRAME_MODIFIER
#define CYTHON_FRAME_DEL Py_DECREF(__pyx_frame)
#endif
#define __Pyx_TraceDeclarations \
static PyCodeObject *__pyx_frame_code = NULL; \
CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL; \
int __Pyx_use_tracing = 0;
#define __Pyx_TraceCall(funcname, srcfile, firstlineno) \
if (unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc)) { \
__Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno); \
}
#define __Pyx_TraceException() \
if (unlikely(__Pyx_use_tracing( && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \
PyObject *exc_info = __Pyx_GetExceptionTuple(); \
if (exc_info) { \
PyThreadState_GET()->c_profilefunc( \
PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \
Py_DECREF(exc_info); \
} \
}
#define __Pyx_TraceReturn(result) \
if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \
PyThreadState_GET()->c_profilefunc( \
PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \
CYTHON_FRAME_DEL; \
}
static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/
static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/
#else
#define __Pyx_TraceDeclarations
#define __Pyx_TraceCall(funcname, srcfile, firstlineno)
#define __Pyx_TraceException()
#define __Pyx_TraceReturn(result)
#endif /* CYTHON_PROFILE */
static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
const char* function_name); /*proto*/
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
Py_DECREF(j);
return r;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_List_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
if (likely(o != Py_None)) {
if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
Py_INCREF(r);
return r;
}
else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
Py_INCREF(r);
return r;
}
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_Tuple_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
if (likely(o != Py_None)) {
if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
Py_INCREF(r);
return r;
}
else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
Py_INCREF(r);
return r;
}
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
if (PyList_CheckExact(o)) {
Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, n);
Py_INCREF(r);
return r;
}
}
else if (PyTuple_CheckExact(o)) {
Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, n);
Py_INCREF(r);
return r;
}
}
else if (likely(i >= 0)) {
PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
if (likely(m && m->sq_item)) {
return m->sq_item(o, i);
}
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
#define __Pyx_PyObject_AsDouble(obj) \
((likely(PyFloat_CheckExact(obj))) ? \
PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);
static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
PyObject *modname); /*proto*/
#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
#define __Pyx_CYFUNCTION_CCLASS 0x04
#define __Pyx_CyFunction_GetClosure(f) \
(((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f) \
(((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f) \
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
PyCFunctionObject func;
int flags;
PyObject *func_dict;
PyObject *func_weakreflist;
PyObject *func_name;
PyObject *func_doc;
PyObject *func_code;
PyObject *func_closure;
PyObject *func_classobj; /* No-args super() class cell */
void *defaults;
int defaults_pyobjects;
PyObject *defaults_tuple; /* Const defaults tuple */
PyObject *(*defaults_getter)(PyObject *);
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, self, module, code) \
__Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, self, module, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *,
PyMethodDef *ml, int flags,
PyObject *self, PyObject *module,
PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
size_t size,
int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
PyObject *tuple);
static int __Pyx_CyFunction_init(void);
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
static CYTHON_INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/
static int __Pyx_check_binary_version(void);
typedef struct {
int code_line;
PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
int max_count;
__Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from 'MACS2.cPeakDetect' */
static PyObject *__pyx_f_5MACS2_11cPeakDetect_subpeak_letters(short); /*proto*/
#define __Pyx_MODULE_NAME "MACS2.cPeakDetect"
int __pyx_module_is_main_MACS2__cPeakDetect = 0;
/* Implementation of 'MACS2.cPeakDetect' */
static PyObject *__pyx_builtin_chr;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_ord;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_pf_5MACS2_11cPeakDetect_10PeakDetect___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_opt, PyObject *__pyx_v_treat, PyObject *__pyx_v_control, PyObject *__pyx_v_d, PyObject *__pyx_v_slocal, PyObject *__pyx_v_llocal, PyObject *__pyx_v_shiftcontrol); /* proto */
static PyObject *__pyx_pf_5MACS2_11cPeakDetect_10PeakDetect_2call_peaks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_11cPeakDetect_10PeakDetect_4toxls(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ofhd, PyObject *__pyx_v_name_prefix, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5MACS2_11cPeakDetect_10PeakDetect_6__call_peaks_w_control(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5MACS2_11cPeakDetect_10PeakDetect_8__call_peaks_wo_control(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static char __pyx_k_1[] = "#3 !!!! DYNAMIC LAMBDA IS DISABLED !!!!";
static char __pyx_k_3[] = "_PeakDetect__call_peaks_w_control";
static char __pyx_k_4[] = "_PeakDetect__call_peaks_wo_control";
static char __pyx_k_5[] = "%s_peak_";
static char __pyx_k_6[] = "\t";
static char __pyx_k_7[] = "-log10(pvalue)";
static char __pyx_k_8[] = "-log10(qvalue)";
static char __pyx_k_11[] = "\n";
static char __pyx_k_13[] = "%s%d%s";
static char __pyx_k_14[] = "%s\t%d\t%d\t%d";
static char __pyx_k_15[] = "\t%d";
static char __pyx_k_16[] = "\t%.5f";
static char __pyx_k_17[] = "\t%s";
static char __pyx_k_19[] = "%s%d";
static char __pyx_k_21[] = "halfextension not supported in PE mode";
static char __pyx_k_23[] = "#3 pileup treatment data";
static char __pyx_k_25[] = "#3 pileup treatment data by extending tags towards 3' to %d length";
static char __pyx_k_28[] = "#3 calculate local lambda from control data";
static char __pyx_k_30[] = "slocal can't be smaller than d!";
static char __pyx_k_31[] = "llocal can't be smaller than d!";
static char __pyx_k_32[] = "llocal can't be smaller than slocal!";
static char __pyx_k_33[] = "#3 Build score track ...";
static char __pyx_k_35[] = "make_scoreTrackII_for_macs";
static char __pyx_k_36[] = "#3 Going to call summits inside each peak ...";
static char __pyx_k_38[] = "#3 Calculate pvalues ...";
static char __pyx_k_40[] = "#3 Call broad peaks with given level1 -log10pvalue cutoff and level2: %.5f, %.5f...";
static char __pyx_k_41[] = "#3 Call peaks with given -log10pvalue cutoff: %.5f ...";
static char __pyx_k_42[] = "#3 Calculate qvalues ...";
static char __pyx_k_44[] = "#3 Call broad peaks with given level1 -log10qvalue cutoff and level2: %f, %f...";
static char __pyx_k_45[] = "#3 Call peaks with given -log10qvalue cutoff: %.5f ...";
static char __pyx_k_46[] = "%s for \"%s\" from MACS v%s";
static char __pyx_k_47[] = "%s";
static char __pyx_k_48[] = "fragment pileup";
static char __pyx_k_49[] = "tag pileup";
static char __pyx_k_50[] = "_pileup.bdg";
static char __pyx_k_51[] = "_lambda.bdg";
static char __pyx_k_52[] = "Maximum local lambda";
static char __pyx_k_53[] = "#3 save the %s track into bedGraph file...";
static char __pyx_k_54[] = "change_normalization_method";
static char __pyx_k_57[] = "#3 calculate large local lambda from treatment data";
static char __pyx_k_62[] = "#3 Call broad peaks with given level1 -log10qvalue cutoff and level2: %.5f, %.5f...";
static char __pyx_k_64[] = "Module Description\n\nCopyright (c) 2008,2009 Yong Zhang, Tao Liu <taoliu@jimmy.harvard.edu>\nCopyright (c) 2010,2011 Tao Liu <taoliu@jimmy.harvard.edu>\n\nThis code is free software; you can redistribute it and/or modify it\nunder the terms of the Artistic License (see the file COPYING included\nwith the distribution).\n\n@status: experimental\n@version: $Revision$\n@author: Yong Zhang, Tao Liu\n@contact: taoliu@jimmy.harvard.edu\n";
static char __pyx_k_65[] = "MACS2.IO.cPeakIO";
static char __pyx_k_66[] = "MACS2.IO.cBedGraphIO";
static char __pyx_k_67[] = "MACS2.Constants";
static char __pyx_k_68[] = "*";
static char __pyx_k_69[] = "MACS2.cPileup";
static char __pyx_k_72[] = "/Users/taoliu/Codes/Git/MACS_original/MACS/MACS2/cPeakDetect.pyx";
static char __pyx_k_74[] = "MACS2.cPeakDetect";
static char __pyx_k_80[] = "effective_depth_in_million";
static char __pyx_k_83[] = "__call_peaks_w_control";
static char __pyx_k_86[] = "__call_peaks_wo_control";
static char __pyx_k_87[] = "Class to do the peak calling.\n\n e.g\n >>> from MACS2.cPeakDetect import cPeakDetect\n >>> pd = PeakDetect(treat=treatdata, control=controldata, pvalue=pvalue_cutoff, d=100, gsize=3000000000)\n >>> pd.call_peaks()\n ";
static char __pyx_k__d[] = "d";
static char __pyx_k__i[] = "i";
static char __pyx_k__w[] = "w";
static char __pyx_k__fc[] = "fc";
static char __pyx_k__gc[] = "gc";
static char __pyx_k__io[] = "io";
static char __pyx_k__wb[] = "wb";
static char __pyx_k__chr[] = "chr";
static char __pyx_k__d_s[] = "d_s";
static char __pyx_k__end[] = "end";
static char __pyx_k__key[] = "key";
static char __pyx_k__opt[] = "opt";
static char __pyx_k__ord[] = "ord";
static char __pyx_k__MACS[] = "MACS";
static char __pyx_k__chrs[] = "chrs";
static char __pyx_k__desc[] = "desc";
static char __pyx_k__info[] = "info";
static char __pyx_k__join[] = "join";
static char __pyx_k__keys[] = "keys";
static char __pyx_k__name[] = "name";
static char __pyx_k__ofhd[] = "ofhd";
static char __pyx_k__open[] = "open";
static char __pyx_k__peak[] = "peak";
static char __pyx_k__self[] = "self";
static char __pyx_k__sort[] = "sort";
static char __pyx_k__warn[] = "warn";
static char __pyx_k__broad[] = "broad";
static char __pyx_k__chrom[] = "chrom";
static char __pyx_k__debug[] = "debug";
static char __pyx_k__desc1[] = "desc1";
static char __pyx_k__group[] = "group";
static char __pyx_k__gsize[] = "gsize";
static char __pyx_k__peaks[] = "peaks";
static char __pyx_k__start[] = "start";
static char __pyx_k__title[] = "title";
static char __pyx_k__tmp_v[] = "tmp_v";
static char __pyx_k__total[] = "total";
static char __pyx_k__toxls[] = "toxls";
static char __pyx_k__treat[] = "treat";
static char __pyx_k__tsize[] = "tsize";
static char __pyx_k__write[] = "write";
static char __pyx_k__PeakIO[] = "PeakIO";
static char __pyx_k__bdgfhd[] = "bdgfhd";
static char __pyx_k__cutoff[] = "cutoff";
static char __pyx_k__length[] = "length";
static char __pyx_k__llocal[] = "llocal";
static char __pyx_k__n_peak[] = "n_peak";
static char __pyx_k__pileup[] = "pileup";
static char __pyx_k__pscore[] = "pscore";
static char __pyx_k__qscore[] = "qscore";
static char __pyx_k__slocal[] = "slocal";
static char __pyx_k__summit[] = "summit";
static char __pyx_k__tracks[] = "tracks";
static char __pyx_k__PE_MODE[] = "PE_MODE";
static char __pyx_k__Unknown[] = "Unknown";
static char __pyx_k__control[] = "control";
static char __pyx_k__destroy[] = "destroy";
static char __pyx_k__do_SPMR[] = "do_SPMR";
static char __pyx_k__groupby[] = "groupby";
static char __pyx_k__halfext[] = "halfext";
static char __pyx_k__lregion[] = "lregion";
static char __pyx_k__max_gap[] = "max_gap";
static char __pyx_k__sregion[] = "sregion";
static char __pyx_k__zwig_tr[] = "zwig_tr";
static char __pyx_k____exit__[] = "__exit__";
static char __pyx_k____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__filename[] = "filename";
static char __pyx_k__nolambda[] = "nolambda";
static char __pyx_k__operator[] = "operator";
static char __pyx_k__peakname[] = "peakname";
static char __pyx_k__scorecol[] = "scorecol";
static char __pyx_k__zwig_ctl[] = "zwig_ctl";
static char __pyx_k____enter__[] = "__enter__";
static char __pyx_k__enumerate[] = "enumerate";
static char __pyx_k__itertools[] = "itertools";
static char __pyx_k__lambda_bg[] = "lambda_bg";
static char __pyx_k__store_bdg[] = "store_bdg";
static char __pyx_k__tocontrol[] = "tocontrol";
static char __pyx_k__trackdesc[] = "trackdesc";
static char __pyx_k__trackline[] = "trackline";
static char __pyx_k__PeakDetect[] = "PeakDetect";
static char __pyx_k__abs_summit[] = "abs_summit";
static char __pyx_k__bedGraphIO[] = "bedGraphIO";
static char __pyx_k__broadpeaks[] = "broadpeaks";
static char __pyx_k__call_peaks[] = "call_peaks";
static char __pyx_k__itemgetter[] = "itemgetter";
static char __pyx_k__largelocal[] = "largelocal";
static char __pyx_k__log_pvalue[] = "log_pvalue";
static char __pyx_k__log_qvalue[] = "log_qvalue";
static char __pyx_k__min_length[] = "min_length";
static char __pyx_k__peakprefix[] = "peakprefix";
static char __pyx_k__shift_size[] = "shift_size";
static char __pyx_k__smalllocal[] = "smalllocal";
static char __pyx_k__directional[] = "directional";
static char __pyx_k__final_peaks[] = "final_peaks";
static char __pyx_k__lvl1_cutoff[] = "lvl1_cutoff";
static char __pyx_k__lvl2_cutoff[] = "lvl2_cutoff";
static char __pyx_k__name_prefix[] = "name_prefix";
static char __pyx_k__these_peaks[] = "these_peaks";
static char __pyx_k__treat_total[] = "treat_total";
static char __pyx_k__MACS_VERSION[] = "MACS_VERSION";
static char __pyx_k__call_summits[] = "call_summits";
static char __pyx_k__lvl1_max_gap[] = "lvl1_max_gap";
static char __pyx_k__lvl2_max_gap[] = "lvl2_max_gap";
static char __pyx_k__score_btrack[] = "score_btrack";
static char __pyx_k__shiftcontrol[] = "shiftcontrol";
static char __pyx_k__treat_btrack[] = "treat_btrack";
static char __pyx_k__control_total[] = "control_total";
static char __pyx_k__halfextension[] = "halfextension";
static char __pyx_k__scale_factors[] = "scale_factors";
static char __pyx_k__baseline_value[] = "baseline_value";
static char __pyx_k__control_btrack[] = "control_btrack";
static char __pyx_k__scale_factor_s[] = "scale_factor_s";
static char __pyx_k__write_bedGraph[] = "write_bedGraph";
static char __pyx_k__call_broadpeaks[] = "call_broadpeaks";
static char __pyx_k__fold_enrichment[] = "fold_enrichment";
static char __pyx_k__log_broadcutoff[] = "log_broadcutoff";
static char __pyx_k__enable_trackline[] = "enable_trackline";
static char __pyx_k__set_single_value[] = "set_single_value";
static char __pyx_k__unified_pileup_bdg[] = "unified_pileup_bdg";
static char __pyx_k__change_score_method[] = "change_score_method";
static char __pyx_k__ratio_treat2control[] = "ratio_treat2control";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_kp_s_19;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_n_s_3;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_n_s_35;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_kp_s_38;
static PyObject *__pyx_n_s_4;
static PyObject *__pyx_kp_s_40;
static PyObject *__pyx_kp_s_41;
static PyObject *__pyx_kp_s_42;
static PyObject *__pyx_kp_s_44;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_kp_s_46;
static PyObject *__pyx_kp_s_47;
static PyObject *__pyx_kp_s_48;
static PyObject *__pyx_kp_s_49;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_50;
static PyObject *__pyx_kp_s_51;
static PyObject *__pyx_kp_s_52;
static PyObject *__pyx_kp_s_53;
static PyObject *__pyx_n_s_54;
static PyObject *__pyx_kp_s_57;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_62;
static PyObject *__pyx_n_s_65;
static PyObject *__pyx_n_s_66;
static PyObject *__pyx_n_s_67;
static PyObject *__pyx_n_s_68;
static PyObject *__pyx_n_s_69;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_s_72;
static PyObject *__pyx_n_s_74;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_n_s_80;
static PyObject *__pyx_n_s_83;
static PyObject *__pyx_n_s_86;
static PyObject *__pyx_kp_s_87;
static PyObject *__pyx_n_s__MACS;
static PyObject *__pyx_n_s__MACS_VERSION;
static PyObject *__pyx_n_s__PE_MODE;
static PyObject *__pyx_n_s__PeakDetect;
static PyObject *__pyx_n_s__PeakIO;
static PyObject *__pyx_n_s__Unknown;
static PyObject *__pyx_n_s____enter__;
static PyObject *__pyx_n_s____exit__;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s__abs_summit;
static PyObject *__pyx_n_s__baseline_value;
static PyObject *__pyx_n_s__bdgfhd;
static PyObject *__pyx_n_s__bedGraphIO;
static PyObject *__pyx_n_s__broad;
static PyObject *__pyx_n_s__broadpeaks;
static PyObject *__pyx_n_s__call_broadpeaks;
static PyObject *__pyx_n_s__call_peaks;
static PyObject *__pyx_n_s__call_summits;
static PyObject *__pyx_n_s__change_score_method;
static PyObject *__pyx_n_s__chr;
static PyObject *__pyx_n_s__chrom;
static PyObject *__pyx_n_s__chrs;
static PyObject *__pyx_n_s__control;
static PyObject *__pyx_n_s__control_btrack;
static PyObject *__pyx_n_s__control_total;
static PyObject *__pyx_n_s__cutoff;
static PyObject *__pyx_n_s__d;
static PyObject *__pyx_n_s__d_s;
static PyObject *__pyx_n_s__debug;
static PyObject *__pyx_n_s__desc;
static PyObject *__pyx_n_s__desc1;
static PyObject *__pyx_n_s__destroy;
static PyObject *__pyx_n_s__directional;
static PyObject *__pyx_n_s__do_SPMR;
static PyObject *__pyx_n_s__enable_trackline;
static PyObject *__pyx_n_s__end;
static PyObject *__pyx_n_s__enumerate;
static PyObject *__pyx_n_s__fc;
static PyObject *__pyx_n_s__filename;
static PyObject *__pyx_n_s__final_peaks;
static PyObject *__pyx_n_s__fold_enrichment;
static PyObject *__pyx_n_s__gc;
static PyObject *__pyx_n_s__group;
static PyObject *__pyx_n_s__groupby;
static PyObject *__pyx_n_s__gsize;
static PyObject *__pyx_n_s__halfext;
static PyObject *__pyx_n_s__halfextension;
static PyObject *__pyx_n_s__i;
static PyObject *__pyx_n_s__info;
static PyObject *__pyx_n_s__io;
static PyObject *__pyx_n_s__itemgetter;
static PyObject *__pyx_n_s__itertools;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__key;
static PyObject *__pyx_n_s__keys;
static PyObject *__pyx_n_s__lambda_bg;
static PyObject *__pyx_n_s__largelocal;
static PyObject *__pyx_n_s__length;
static PyObject *__pyx_n_s__llocal;
static PyObject *__pyx_n_s__log_broadcutoff;
static PyObject *__pyx_n_s__log_pvalue;
static PyObject *__pyx_n_s__log_qvalue;
static PyObject *__pyx_n_s__lregion;
static PyObject *__pyx_n_s__lvl1_cutoff;
static PyObject *__pyx_n_s__lvl1_max_gap;
static PyObject *__pyx_n_s__lvl2_cutoff;
static PyObject *__pyx_n_s__lvl2_max_gap;
static PyObject *__pyx_n_s__max_gap;
static PyObject *__pyx_n_s__min_length;
static PyObject *__pyx_n_s__n_peak;
static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__name_prefix;
static PyObject *__pyx_n_s__nolambda;
static PyObject *__pyx_n_s__ofhd;
static PyObject *__pyx_n_s__open;
static PyObject *__pyx_n_s__operator;
static PyObject *__pyx_n_s__opt;
static PyObject *__pyx_n_s__ord;
static PyObject *__pyx_n_s__peak;
static PyObject *__pyx_n_s__peakname;
static PyObject *__pyx_n_s__peakprefix;
static PyObject *__pyx_n_s__peaks;
static PyObject *__pyx_n_s__pileup;
static PyObject *__pyx_n_s__pscore;
static PyObject *__pyx_n_s__qscore;
static PyObject *__pyx_n_s__ratio_treat2control;
static PyObject *__pyx_n_s__scale_factor_s;
static PyObject *__pyx_n_s__scale_factors;
static PyObject *__pyx_n_s__score_btrack;
static PyObject *__pyx_n_s__scorecol;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__set_single_value;
static PyObject *__pyx_n_s__shift_size;
static PyObject *__pyx_n_s__shiftcontrol;
static PyObject *__pyx_n_s__slocal;
static PyObject *__pyx_n_s__smalllocal;
static PyObject *__pyx_n_s__sort;
static PyObject *__pyx_n_s__sregion;
static PyObject *__pyx_n_s__start;
static PyObject *__pyx_n_s__store_bdg;
static PyObject *__pyx_n_s__summit;
static PyObject *__pyx_n_s__these_peaks;
static PyObject *__pyx_n_s__title;
static PyObject *__pyx_n_s__tmp_v;
static PyObject *__pyx_n_s__tocontrol;
static PyObject *__pyx_n_s__total;
static PyObject *__pyx_n_s__toxls;
static PyObject *__pyx_n_s__trackdesc;
static PyObject *__pyx_n_s__trackline;
static PyObject *__pyx_n_s__tracks;
static PyObject *__pyx_n_s__treat;
static PyObject *__pyx_n_s__treat_btrack;
static PyObject *__pyx_n_s__treat_total;
static PyObject *__pyx_n_s__tsize;
static PyObject *__pyx_n_s__unified_pileup_bdg;
static PyObject *__pyx_n_s__w;
static PyObject *__pyx_n_s__warn;
static PyObject *__pyx_n_s__wb;
static PyObject *__pyx_n_s__write;
static PyObject *__pyx_n_s__write_bedGraph;
static PyObject *__pyx_n_s__zwig_ctl;
static PyObject *__pyx_n_s__zwig_tr;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_77;
static PyObject *__pyx_int_112;
static PyObject *__pyx_int_113;
static PyObject *__pyx_k_tuple_2;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_10;
static PyObject *__pyx_k_tuple_12;
static PyObject *__pyx_k_tuple_18;
static PyObject *__pyx_k_tuple_20;
static PyObject *__pyx_k_tuple_22;
static PyObject *__pyx_k_tuple_24;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_27;
static PyObject *__pyx_k_tuple_29;
static PyObject *__pyx_k_tuple_34;
static PyObject *__pyx_k_tuple_37;
static PyObject *__pyx_k_tuple_39;
static PyObject *__pyx_k_tuple_43;
static PyObject *__pyx_k_tuple_55;
static PyObject *__pyx_k_tuple_56;
static PyObject *__pyx_k_tuple_58;
static PyObject *__pyx_k_tuple_59;
static PyObject *__pyx_k_tuple_60;
static PyObject *__pyx_k_tuple_61;
static PyObject *__pyx_k_tuple_63;
static PyObject *__pyx_k_tuple_70;
static PyObject *__pyx_k_tuple_73;
static PyObject *__pyx_k_tuple_75;
static PyObject *__pyx_k_tuple_77;
static PyObject *__pyx_k_tuple_79;
static PyObject *__pyx_k_tuple_81;
static PyObject *__pyx_k_tuple_84;
static PyObject *__pyx_k_codeobj_71;
static PyObject *__pyx_k_codeobj_76;
static PyObject *__pyx_k_codeobj_78;
static PyObject *__pyx_k_codeobj_82;
static PyObject *__pyx_k_codeobj_85;
/* "MACS2/cPeakDetect.pyx":33
* #from MACS2.cPileup_old import pileup_bdg, pileup_w_multiple_d_bdg
*
* cdef str subpeak_letters(short i): # <<<<<<<<<<<<<<
* if i < 26:
* return chr(97+i)
*/
static PyObject *__pyx_f_5MACS2_11cPeakDetect_subpeak_letters(short __pyx_v_i) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_TraceDeclarations
__Pyx_RefNannySetupContext("subpeak_letters", 0);
__Pyx_TraceCall("subpeak_letters", __pyx_f[0], 33);
/* "MACS2/cPeakDetect.pyx":34
*
* cdef str subpeak_letters(short i):
* if i < 26: # <<<<<<<<<<<<<<
* return chr(97+i)
* else:
*/
__pyx_t_1 = (__pyx_v_i < 26);
if (__pyx_t_1) {
/* "MACS2/cPeakDetect.pyx":35
* cdef str subpeak_letters(short i):
* if i < 26:
* return chr(97+i) # <<<<<<<<<<<<<<
* else:
* return subpeak_letters(i / 26) + chr(97 + (i % 26))
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_2 = PyInt_FromLong((97 + __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
__pyx_t_2 = PyObject_Call(__pyx_builtin_chr, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
goto __pyx_L3;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":37
* return chr(97+i)
* else:
* return subpeak_letters(i / 26) + chr(97 + (i % 26)) # <<<<<<<<<<<<<<
*
* class PeakDetect:
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_2 = ((PyObject *)__pyx_f_5MACS2_11cPeakDetect_subpeak_letters(__Pyx_div_long(__pyx_v_i, 26))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyInt_FromLong((97 + __Pyx_mod_long(__pyx_v_i, 26))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_builtin_chr, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
}
__pyx_L3:;
__pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("MACS2.cPeakDetect.subpeak_letters", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_TraceReturn(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_11cPeakDetect_10PeakDetect___init__[] = "Initialize the PeakDetect object.\n\n ";
static PyMethodDef __pyx_mdef_5MACS2_11cPeakDetect_10PeakDetect_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_11cPeakDetect_10PeakDetect___init__)};
static PyObject *__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_opt = 0;
PyObject *__pyx_v_treat = 0;
PyObject *__pyx_v_control = 0;
PyObject *__pyx_v_d = 0;
PyObject *__pyx_v_slocal = 0;
PyObject *__pyx_v_llocal = 0;
PyObject *__pyx_v_shiftcontrol = 0;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__opt,&__pyx_n_s__treat,&__pyx_n_s__control,&__pyx_n_s__d,&__pyx_n_s__slocal,&__pyx_n_s__llocal,&__pyx_n_s__shiftcontrol,0};
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
__pyx_self = __pyx_self;
{
PyObject* values[8] = {0,0,0,0,0,0,0,0};
/* "MACS2/cPeakDetect.pyx":47
* >>> pd.call_peaks()
* """
* def __init__ (self,opt = None,treat = None, control = None, d = None, # <<<<<<<<<<<<<<
* slocal = None, llocal = None, shiftcontrol = None):
* """Initialize the PeakDetect object.
*/
values[1] = ((PyObject *)((PyObject *)Py_None));
values[2] = ((PyObject *)((PyObject *)Py_None));
values[3] = ((PyObject *)((PyObject *)Py_None));
values[4] = ((PyObject *)((PyObject *)Py_None));
/* "MACS2/cPeakDetect.pyx":48
* """
* def __init__ (self,opt = None,treat = None, control = None, d = None,
* slocal = None, llocal = None, shiftcontrol = None): # <<<<<<<<<<<<<<
* """Initialize the PeakDetect object.
*
*/
values[5] = ((PyObject *)((PyObject *)Py_None));
values[6] = ((PyObject *)((PyObject *)Py_None));
values[7] = ((PyObject *)((PyObject *)Py_None));
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
if (likely(values[0])) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__opt);
if (value) { values[1] = value; kw_args--; }
}
case 2:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__treat);
if (value) { values[2] = value; kw_args--; }
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__control);
if (value) { values[3] = value; kw_args--; }
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__d);
if (value) { values[4] = value; kw_args--; }
}
case 5:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__slocal);
if (value) { values[5] = value; kw_args--; }
}
case 6:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__llocal);
if (value) { values[6] = value; kw_args--; }
}
case 7:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shiftcontrol);
if (value) { values[7] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_self = values[0];
__pyx_v_opt = values[1];
__pyx_v_treat = values[2];
__pyx_v_control = values[3];
__pyx_v_d = values[4];
__pyx_v_slocal = values[5];
__pyx_v_llocal = values[6];
__pyx_v_shiftcontrol = values[7];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("MACS2.cPeakDetect.PeakDetect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5MACS2_11cPeakDetect_10PeakDetect___init__(__pyx_self, __pyx_v_self, __pyx_v_opt, __pyx_v_treat, __pyx_v_control, __pyx_v_d, __pyx_v_slocal, __pyx_v_llocal, __pyx_v_shiftcontrol);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "MACS2/cPeakDetect.pyx":47
* >>> pd.call_peaks()
* """
* def __init__ (self,opt = None,treat = None, control = None, d = None, # <<<<<<<<<<<<<<
* slocal = None, llocal = None, shiftcontrol = None):
* """Initialize the PeakDetect object.
*/
static PyObject *__pyx_pf_5MACS2_11cPeakDetect_10PeakDetect___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_opt, PyObject *__pyx_v_treat, PyObject *__pyx_v_control, PyObject *__pyx_v_d, PyObject *__pyx_v_slocal, PyObject *__pyx_v_llocal, PyObject *__pyx_v_shiftcontrol) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_TraceDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
__Pyx_TraceCall("__init__", __pyx_f[0], 47);
/* "MACS2/cPeakDetect.pyx":52
*
* """
* self.opt = opt # <<<<<<<<<<<<<<
* self.info = opt.info
* self.debug = opt.debug
*/
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__opt, __pyx_v_opt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "MACS2/cPeakDetect.pyx":53
* """
* self.opt = opt
* self.info = opt.info # <<<<<<<<<<<<<<
* self.debug = opt.debug
* self.warn = opt.warn
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__info, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":54
* self.opt = opt
* self.info = opt.info
* self.debug = opt.debug # <<<<<<<<<<<<<<
* self.warn = opt.warn
*
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__debug, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":55
* self.info = opt.info
* self.debug = opt.debug
* self.warn = opt.warn # <<<<<<<<<<<<<<
*
* self.treat = treat
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__warn, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":57
* self.warn = opt.warn
*
* self.treat = treat # <<<<<<<<<<<<<<
* self.control = control
* self.ratio_treat2control = None
*/
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__treat, __pyx_v_treat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "MACS2/cPeakDetect.pyx":58
*
* self.treat = treat
* self.control = control # <<<<<<<<<<<<<<
* self.ratio_treat2control = None
* self.peaks = None
*/
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__control, __pyx_v_control) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "MACS2/cPeakDetect.pyx":59
* self.treat = treat
* self.control = control
* self.ratio_treat2control = None # <<<<<<<<<<<<<<
* self.peaks = None
* self.final_peaks = None
*/
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__ratio_treat2control, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "MACS2/cPeakDetect.pyx":60
* self.control = control
* self.ratio_treat2control = None
* self.peaks = None # <<<<<<<<<<<<<<
* self.final_peaks = None
* self.PE_MODE = opt.PE_MODE
*/
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__peaks, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "MACS2/cPeakDetect.pyx":61
* self.ratio_treat2control = None
* self.peaks = None
* self.final_peaks = None # <<<<<<<<<<<<<<
* self.PE_MODE = opt.PE_MODE
*
*/
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__final_peaks, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "MACS2/cPeakDetect.pyx":62
* self.peaks = None
* self.final_peaks = None
* self.PE_MODE = opt.PE_MODE # <<<<<<<<<<<<<<
*
* #self.femax = opt.femax
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__PE_MODE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__PE_MODE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":68
* #self.festep = opt.festep
*
* self.log_pvalue = opt.log_pvalue # -log10pvalue # <<<<<<<<<<<<<<
* self.log_qvalue = opt.log_qvalue # -log10qvalue
* if d != None:
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__log_pvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__log_pvalue, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":69
*
* self.log_pvalue = opt.log_pvalue # -log10pvalue
* self.log_qvalue = opt.log_qvalue # -log10qvalue # <<<<<<<<<<<<<<
* if d != None:
* self.d = d
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__log_qvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__log_qvalue, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":70
* self.log_pvalue = opt.log_pvalue # -log10pvalue
* self.log_qvalue = opt.log_qvalue # -log10qvalue
* if d != None: # <<<<<<<<<<<<<<
* self.d = d
* else:
*/
__pyx_t_1 = PyObject_RichCompare(__pyx_v_d, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":71
* self.log_qvalue = opt.log_qvalue # -log10qvalue
* if d != None:
* self.d = d # <<<<<<<<<<<<<<
* else:
* self.d = self.opt.d
*/
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__d, __pyx_v_d) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L3;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":73
* self.d = d
* else:
* self.d = self.opt.d # <<<<<<<<<<<<<<
* self.shift_size = self.d/2
* self.gsize = opt.gsize
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__opt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__d, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
/* "MACS2/cPeakDetect.pyx":74
* else:
* self.d = self.opt.d
* self.shift_size = self.d/2 # <<<<<<<<<<<<<<
* self.gsize = opt.gsize
*
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__shift_size, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":75
* self.d = self.opt.d
* self.shift_size = self.d/2
* self.gsize = opt.gsize # <<<<<<<<<<<<<<
*
* self.nolambda = opt.nolambda
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__gsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__gsize, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":77
* self.gsize = opt.gsize
*
* self.nolambda = opt.nolambda # <<<<<<<<<<<<<<
*
* if slocal != None:
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__nolambda); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__nolambda, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":79
* self.nolambda = opt.nolambda
*
* if slocal != None: # <<<<<<<<<<<<<<
* self.sregion = slocal
* else:
*/
__pyx_t_1 = PyObject_RichCompare(__pyx_v_slocal, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":80
*
* if slocal != None:
* self.sregion = slocal # <<<<<<<<<<<<<<
* else:
* self.sregion = opt.smalllocal
*/
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__sregion, __pyx_v_slocal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":82
* self.sregion = slocal
* else:
* self.sregion = opt.smalllocal # <<<<<<<<<<<<<<
*
* if llocal != None:
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__smalllocal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__sregion, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L4:;
/* "MACS2/cPeakDetect.pyx":84
* self.sregion = opt.smalllocal
*
* if llocal != None: # <<<<<<<<<<<<<<
* self.lregion = llocal
* else:
*/
__pyx_t_1 = PyObject_RichCompare(__pyx_v_llocal, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":85
*
* if llocal != None:
* self.lregion = llocal # <<<<<<<<<<<<<<
* else:
* self.lregion = opt.largelocal
*/
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lregion, __pyx_v_llocal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L5;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":87
* self.lregion = llocal
* else:
* self.lregion = opt.largelocal # <<<<<<<<<<<<<<
*
* if shiftcontrol != None:
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__largelocal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lregion, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L5:;
/* "MACS2/cPeakDetect.pyx":89
* self.lregion = opt.largelocal
*
* if shiftcontrol != None: # <<<<<<<<<<<<<<
* self.shiftcontrol = shiftcontrol
* else:
*/
__pyx_t_1 = PyObject_RichCompare(__pyx_v_shiftcontrol, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":90
*
* if shiftcontrol != None:
* self.shiftcontrol = shiftcontrol # <<<<<<<<<<<<<<
* else:
* self.shiftcontrol = opt.shiftcontrol
*/
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__shiftcontrol, __pyx_v_shiftcontrol) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L6;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":92
* self.shiftcontrol = shiftcontrol
* else:
* self.shiftcontrol = opt.shiftcontrol # <<<<<<<<<<<<<<
*
* if (self.nolambda):
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__shiftcontrol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__shiftcontrol, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L6:;
/* "MACS2/cPeakDetect.pyx":94
* self.shiftcontrol = opt.shiftcontrol
*
* if (self.nolambda): # <<<<<<<<<<<<<<
* self.info("#3 !!!! DYNAMIC LAMBDA IS DISABLED !!!!")
* #self.diag = opt.diag
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nolambda); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":95
*
* if (self.nolambda):
* self.info("#3 !!!! DYNAMIC LAMBDA IS DISABLED !!!!") # <<<<<<<<<<<<<<
* #self.diag = opt.diag
* #self.save_score = opt.store_score
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L7;
}
__pyx_L7:;
/* "MACS2/cPeakDetect.pyx":98
* #self.diag = opt.diag
* #self.save_score = opt.store_score
* self.zwig_tr = opt.zwig_tr # <<<<<<<<<<<<<<
* self.zwig_ctl= opt.zwig_ctl
*
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__zwig_tr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__zwig_tr, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "MACS2/cPeakDetect.pyx":99
* #self.save_score = opt.store_score
* self.zwig_tr = opt.zwig_tr
* self.zwig_ctl= opt.zwig_ctl # <<<<<<<<<<<<<<
*
* def call_peaks (self):
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_opt, __pyx_n_s__zwig_ctl); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__zwig_ctl, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("MACS2.cPeakDetect.PeakDetect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_TraceReturn(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_3call_peaks(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_5MACS2_11cPeakDetect_10PeakDetect_2call_peaks[] = "Call peaks function.\n\n Scan the whole genome for peaks. RESULTS WILL BE SAVED IN\n self.final_peaks and self.final_negative_peaks.\n ";
static PyMethodDef __pyx_mdef_5MACS2_11cPeakDetect_10PeakDetect_3call_peaks = {__Pyx_NAMESTR("call_peaks"), (PyCFunction)__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_3call_peaks, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_11cPeakDetect_10PeakDetect_2call_peaks)};
static PyObject *__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_3call_peaks(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("call_peaks (wrapper)", 0);
__pyx_self = __pyx_self;
__pyx_r = __pyx_pf_5MACS2_11cPeakDetect_10PeakDetect_2call_peaks(__pyx_self, ((PyObject *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "MACS2/cPeakDetect.pyx":101
* self.zwig_ctl= opt.zwig_ctl
*
* def call_peaks (self): # <<<<<<<<<<<<<<
* """Call peaks function.
*
*/
static PyObject *__pyx_pf_5MACS2_11cPeakDetect_10PeakDetect_2call_peaks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *(*__pyx_t_6)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_TraceDeclarations
__Pyx_RefNannySetupContext("call_peaks", 0);
__Pyx_TraceCall("call_peaks", __pyx_f[0], 101);
/* "MACS2/cPeakDetect.pyx":107
* self.final_peaks and self.final_negative_peaks.
* """
* if self.control: # w/ control # <<<<<<<<<<<<<<
* if self.opt.broad:
* (self.peaks,self.broadpeaks) = self.__call_peaks_w_control()
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__control); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":108
* """
* if self.control: # w/ control
* if self.opt.broad: # <<<<<<<<<<<<<<
* (self.peaks,self.broadpeaks) = self.__call_peaks_w_control()
* else:
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__opt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__broad); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":109
* if self.control: # w/ control
* if self.opt.broad:
* (self.peaks,self.broadpeaks) = self.__call_peaks_w_control() # <<<<<<<<<<<<<<
* else:
* self.peaks = self.__call_peaks_w_control ()
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
if (likely(PyTuple_CheckExact(sequence))) {
if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
} else {
if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_3 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L6_unpacking_done:;
}
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__peaks, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__broadpeaks, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L4;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":111
* (self.peaks,self.broadpeaks) = self.__call_peaks_w_control()
* else:
* self.peaks = self.__call_peaks_w_control () # <<<<<<<<<<<<<<
* else: # w/o control
* if self.opt.broad:
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__peaks, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__pyx_L4:;
goto __pyx_L3;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":113
* self.peaks = self.__call_peaks_w_control ()
* else: # w/o control
* if self.opt.broad: # <<<<<<<<<<<<<<
* (self.peaks,self.broadpeaks) = self.__call_peaks_wo_control()
* else:
*/
__pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__opt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__broad); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":114
* else: # w/o control
* if self.opt.broad:
* (self.peaks,self.broadpeaks) = self.__call_peaks_wo_control() # <<<<<<<<<<<<<<
* else:
* self.peaks = self.__call_peaks_wo_control ()
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
PyObject* sequence = __pyx_t_4;
if (likely(PyTuple_CheckExact(sequence))) {
if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
} else {
if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L9_unpacking_done:;
}
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__peaks, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__broadpeaks, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L7;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":116
* (self.peaks,self.broadpeaks) = self.__call_peaks_wo_control()
* else:
* self.peaks = self.__call_peaks_wo_control () # <<<<<<<<<<<<<<
* return self.peaks
*
*/
__pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__peaks, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L7:;
}
__pyx_L3:;
/* "MACS2/cPeakDetect.pyx":117
* else:
* self.peaks = self.__call_peaks_wo_control ()
* return self.peaks # <<<<<<<<<<<<<<
*
* # def diag_result (self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__peaks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("MACS2.cPeakDetect.PeakDetect.call_peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_TraceReturn(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_5toxls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5MACS2_11cPeakDetect_10PeakDetect_4toxls[] = "Save the peak results in a tab-delimited plain text file\n with suffix .xls.\n \n ";
static PyMethodDef __pyx_mdef_5MACS2_11cPeakDetect_10PeakDetect_5toxls = {__Pyx_NAMESTR("toxls"), (PyCFunction)__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_5toxls, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5MACS2_11cPeakDetect_10PeakDetect_4toxls)};
static PyObject *__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_5toxls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_ofhd = 0;
PyObject *__pyx_v_name_prefix = 0;
PyObject *__pyx_v_name = 0;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__ofhd,&__pyx_n_s__name_prefix,&__pyx_n_s__name,0};
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("toxls (wrapper)", 0);
__pyx_self = __pyx_self;
{
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)((PyObject*)__pyx_kp_s_5));
values[3] = ((PyObject *)((PyObject*)__pyx_n_s__MACS));
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
if (likely(values[0])) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ofhd);
if (likely(values[1])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("toxls", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name_prefix);
if (value) { values[2] = value; kw_args--; }
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "toxls") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_self = values[0];
__pyx_v_ofhd = values[1];
__pyx_v_name_prefix = values[2];
__pyx_v_name = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("toxls", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("MACS2.cPeakDetect.PeakDetect.toxls", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5MACS2_11cPeakDetect_10PeakDetect_4toxls(__pyx_self, __pyx_v_self, __pyx_v_ofhd, __pyx_v_name_prefix, __pyx_v_name);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "MACS2/cPeakDetect.pyx":132
* # This function allows writing to anything with a write method
* # maybe should pass write method instead of fhd?
* def toxls (self, ofhd, name_prefix="%s_peak_", name="MACS"): # <<<<<<<<<<<<<<
* """Save the peak results in a tab-delimited plain text file
* with suffix .xls.
*/
static PyObject *__pyx_pf_5MACS2_11cPeakDetect_10PeakDetect_4toxls(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ofhd, PyObject *__pyx_v_name_prefix, PyObject *__pyx_v_name) {
PyObject *__pyx_v_write = NULL;
PyObject *__pyx_v_peakprefix = NULL;
PyObject *__pyx_v_peaks = NULL;
PyObject *__pyx_v_chrs = NULL;
PyObject *__pyx_v_n_peak = NULL;
PyObject *__pyx_v_chrom = NULL;
CYTHON_UNUSED PyObject *__pyx_v_end = NULL;
PyObject *__pyx_v_group = NULL;
PyObject *__pyx_v_these_peaks = NULL;
PyObject *__pyx_v_i = NULL;
PyObject *__pyx_v_peak = NULL;
PyObject *__pyx_v_peakname = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
Py_ssize_t __pyx_t_8;
PyObject *(*__pyx_t_9)(PyObject *);
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
Py_ssize_t __pyx_t_13;
PyObject *(*__pyx_t_14)(PyObject *);
PyObject *(*__pyx_t_15)(PyObject *);
Py_ssize_t __pyx_t_16;
short __pyx_t_17;
PyObject *__pyx_t_18 = NULL;
PyObject *__pyx_t_19 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_TraceDeclarations
__Pyx_RefNannySetupContext("toxls", 0);
__Pyx_TraceCall("toxls", __pyx_f[0], 132);
/* "MACS2/cPeakDetect.pyx":137
*
* """
* write = ofhd.write # <<<<<<<<<<<<<<
* if self.peaks:
* write("\t".join(("chr","start", "end", "length", "abs_summit", "pileup", "-log10(pvalue)", "fold_enrichment", "-log10(qvalue)", "name"))+"\n")
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_ofhd, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_write = __pyx_t_1;
__pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":138
* """
* write = ofhd.write
* if self.peaks: # <<<<<<<<<<<<<<
* write("\t".join(("chr","start", "end", "length", "abs_summit", "pileup", "-log10(pvalue)", "fold_enrichment", "-log10(qvalue)", "name"))+"\n")
* else:
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__peaks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":139
* write = ofhd.write
* if self.peaks:
* write("\t".join(("chr","start", "end", "length", "abs_summit", "pileup", "-log10(pvalue)", "fold_enrichment", "-log10(qvalue)", "name"))+"\n") # <<<<<<<<<<<<<<
* else:
* return
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_6), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_kp_s_11)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L3;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":141
* write("\t".join(("chr","start", "end", "length", "abs_summit", "pileup", "-log10(pvalue)", "fold_enrichment", "-log10(qvalue)", "name"))+"\n")
* else:
* return # <<<<<<<<<<<<<<
*
* try: peakprefix = name_prefix % name
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
__pyx_L3:;
/* "MACS2/cPeakDetect.pyx":143
* return
*
* try: peakprefix = name_prefix % name # <<<<<<<<<<<<<<
* except: peakprefix = name_prefix
*
*/
{
__Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
/*try:*/ {
__pyx_t_1 = PyNumber_Remainder(__pyx_v_name_prefix, __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_peakprefix = __pyx_t_1;
__pyx_t_1 = 0;
}
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L11_try_end;
__pyx_L4_error:;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":144
*
* try: peakprefix = name_prefix % name
* except: peakprefix = name_prefix # <<<<<<<<<<<<<<
*
* peaks = self.peaks.peaks
*/
/*except:*/ {
__Pyx_AddTraceback("MACS2.cPeakDetect.PeakDetect.toxls", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_name_prefix);
__Pyx_XDECREF(__pyx_v_peakprefix);
__pyx_v_peakprefix = __pyx_v_name_prefix;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L5_exception_handled;
}
__pyx_L6_except_error:;
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
goto __pyx_L1_error;
__pyx_L5_exception_handled:;
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
__pyx_L11_try_end:;
}
/* "MACS2/cPeakDetect.pyx":146
* except: peakprefix = name_prefix
*
* peaks = self.peaks.peaks # <<<<<<<<<<<<<<
* chrs = peaks.keys()
* chrs.sort()
*/
__pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__peaks); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__peaks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_peaks = __pyx_t_3;
__pyx_t_3 = 0;
/* "MACS2/cPeakDetect.pyx":147
*
* peaks = self.peaks.peaks
* chrs = peaks.keys() # <<<<<<<<<<<<<<
* chrs.sort()
* n_peak = 0
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_peaks, __pyx_n_s__keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_chrs = __pyx_t_7;
__pyx_t_7 = 0;
/* "MACS2/cPeakDetect.pyx":148
* peaks = self.peaks.peaks
* chrs = peaks.keys()
* chrs.sort() # <<<<<<<<<<<<<<
* n_peak = 0
* for chrom in chrs:
*/
__pyx_t_7 = PyObject_GetAttr(__pyx_v_chrs, __pyx_n_s__sort); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "MACS2/cPeakDetect.pyx":149
* chrs = peaks.keys()
* chrs.sort()
* n_peak = 0 # <<<<<<<<<<<<<<
* for chrom in chrs:
* for end, group in groupby(peaks[chrom], key=itemgetter("end")):
*/
__Pyx_INCREF(__pyx_int_0);
__pyx_v_n_peak = __pyx_int_0;
/* "MACS2/cPeakDetect.pyx":150
* chrs.sort()
* n_peak = 0
* for chrom in chrs: # <<<<<<<<<<<<<<
* for end, group in groupby(peaks[chrom], key=itemgetter("end")):
* n_peak += 1
*/
if (PyList_CheckExact(__pyx_v_chrs) || PyTuple_CheckExact(__pyx_v_chrs)) {
__pyx_t_3 = __pyx_v_chrs; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
__pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_chrs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
for (;;) {
if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
__pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++;
} else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
__pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++;
} else {
__pyx_t_7 = __pyx_t_9(__pyx_t_3);
if (unlikely(!__pyx_t_7)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_7);
}
__Pyx_XDECREF(__pyx_v_chrom);
__pyx_v_chrom = __pyx_t_7;
__pyx_t_7 = 0;
/* "MACS2/cPeakDetect.pyx":151
* n_peak = 0
* for chrom in chrs:
* for end, group in groupby(peaks[chrom], key=itemgetter("end")): # <<<<<<<<<<<<<<
* n_peak += 1
* these_peaks = list(group)
*/
__pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__groupby); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = PyObject_GetItem(__pyx_v_peaks, __pyx_v_chrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__itemgetter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__key), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) {
__pyx_t_1 = __pyx_t_12; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0;
__pyx_t_14 = NULL;
} else {
__pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_14 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
for (;;) {
if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break;
__pyx_t_12 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++;
} else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
__pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++;
} else {
__pyx_t_12 = __pyx_t_14(__pyx_t_1);
if (unlikely(!__pyx_t_12)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_12);
}
if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
PyObject* sequence = __pyx_t_12;
if (likely(PyTuple_CheckExact(sequence))) {
if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_10 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
} else {
if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_10 = PyList_GET_ITEM(sequence, 0);
__pyx_t_7 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_11 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_15 = Py_TYPE(__pyx_t_11)->tp_iternext;
index = 0; __pyx_t_10 = __pyx_t_15(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L18_unpacking_failed;
__Pyx_GOTREF(__pyx_t_10);
index = 1; __pyx_t_7 = __pyx_t_15(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L18_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
goto __pyx_L19_unpacking_done;
__pyx_L18_unpacking_failed:;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L19_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_end);
__pyx_v_end = __pyx_t_10;
__pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_v_group);
__pyx_v_group = __pyx_t_7;
__pyx_t_7 = 0;
/* "MACS2/cPeakDetect.pyx":152
* for chrom in chrs:
* for end, group in groupby(peaks[chrom], key=itemgetter("end")):
* n_peak += 1 # <<<<<<<<<<<<<<
* these_peaks = list(group)
* if len(these_peaks) > 1:
*/
__pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_n_peak, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_v_n_peak);
__pyx_v_n_peak = __pyx_t_12;
__pyx_t_12 = 0;
/* "MACS2/cPeakDetect.pyx":153
* for end, group in groupby(peaks[chrom], key=itemgetter("end")):
* n_peak += 1
* these_peaks = list(group) # <<<<<<<<<<<<<<
* if len(these_peaks) > 1:
* for i, peak in enumerate(these_peaks):
*/
__pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_INCREF(__pyx_v_group);
PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_group);
__Pyx_GIVEREF(__pyx_v_group);
__pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_these_peaks));
__pyx_v_these_peaks = ((PyObject*)__pyx_t_7);
__pyx_t_7 = 0;
/* "MACS2/cPeakDetect.pyx":154
* n_peak += 1
* these_peaks = list(group)
* if len(these_peaks) > 1: # <<<<<<<<<<<<<<
* for i, peak in enumerate(these_peaks):
* peakname = "%s%d%s" % (peakprefix, n_peak, subpeak_letters(i))
*/
__pyx_t_16 = PyList_GET_SIZE(((PyObject *)__pyx_v_these_peaks));
__pyx_t_2 = (__pyx_t_16 > 1);
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":155
* these_peaks = list(group)
* if len(these_peaks) > 1:
* for i, peak in enumerate(these_peaks): # <<<<<<<<<<<<<<
* peakname = "%s%d%s" % (peakprefix, n_peak, subpeak_letters(i))
* #[start,end,end-start,summit,peak_height,number_tags,pvalue,fold_change,qvalue]
*/
__Pyx_INCREF(__pyx_int_0);
__pyx_t_7 = __pyx_int_0;
__pyx_t_12 = ((PyObject *)__pyx_v_these_peaks); __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0;
for (;;) {
if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_12)) break;
__pyx_t_10 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_16); __Pyx_INCREF(__pyx_t_10); __pyx_t_16++;
__Pyx_XDECREF(__pyx_v_peak);
__pyx_v_peak = __pyx_t_10;
__pyx_t_10 = 0;
__Pyx_INCREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_7;
__pyx_t_10 = PyNumber_Add(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_7);
__pyx_t_7 = __pyx_t_10;
__pyx_t_10 = 0;
/* "MACS2/cPeakDetect.pyx":156
* if len(these_peaks) > 1:
* for i, peak in enumerate(these_peaks):
* peakname = "%s%d%s" % (peakprefix, n_peak, subpeak_letters(i)) # <<<<<<<<<<<<<<
* #[start,end,end-start,summit,peak_height,number_tags,pvalue,fold_change,qvalue]
* write("%s\t%d\t%d\t%d" % (chrom,peak["start"]+1,peak["end"],peak["length"]))
*/
__pyx_t_17 = __Pyx_PyInt_AsShort(__pyx_v_i); if (unlikely((__pyx_t_17 == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_10 = ((PyObject *)__pyx_f_5MACS2_11cPeakDetect_subpeak_letters(__pyx_t_17)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_v_peakprefix);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_peakprefix);
__Pyx_GIVEREF(__pyx_v_peakprefix);
__Pyx_INCREF(__pyx_v_n_peak);
PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_n_peak);
__Pyx_GIVEREF(__pyx_v_n_peak);
PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
__pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_10));
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_v_peakname);
__pyx_v_peakname = ((PyObject *)__pyx_t_10);
__pyx_t_10 = 0;
/* "MACS2/cPeakDetect.pyx":158
* peakname = "%s%d%s" % (peakprefix, n_peak, subpeak_letters(i))
* #[start,end,end-start,summit,peak_height,number_tags,pvalue,fold_change,qvalue]
* write("%s\t%d\t%d\t%d" % (chrom,peak["start"]+1,peak["end"],peak["length"])) # <<<<<<<<<<<<<<
* write("\t%d" % (peak["summit"]+1)) # summit position
* write("\t%.5f" % (peak["pileup"])) # pileup height at summit
*/
__pyx_t_10 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_18 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__length)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_19 = PyTuple_New(4); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_INCREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_19, 3, __pyx_t_18);
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_11 = 0;
__pyx_t_10 = 0;
__pyx_t_18 = 0;
__pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_14), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
/* "MACS2/cPeakDetect.pyx":159
* #[start,end,end-start,summit,peak_height,number_tags,pvalue,fold_change,qvalue]
* write("%s\t%d\t%d\t%d" % (chrom,peak["start"]+1,peak["end"],peak["length"]))
* write("\t%d" % (peak["summit"]+1)) # summit position # <<<<<<<<<<<<<<
* write("\t%.5f" % (peak["pileup"])) # pileup height at summit
* write("\t%.5f" % (peak["pscore"])) # -log10pvalue at summit
*/
__pyx_t_18 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__summit)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_19 = PyNumber_Add(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_15), __pyx_t_19); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
/* "MACS2/cPeakDetect.pyx":160
* write("%s\t%d\t%d\t%d" % (chrom,peak["start"]+1,peak["end"],peak["length"]))
* write("\t%d" % (peak["summit"]+1)) # summit position
* write("\t%.5f" % (peak["pileup"])) # pileup height at summit # <<<<<<<<<<<<<<
* write("\t%.5f" % (peak["pscore"])) # -log10pvalue at summit
* write("\t%.5f" % (peak["fc"])) # fold change at summit
*/
__pyx_t_18 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__pileup)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_19 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_19));
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_t_19));
__Pyx_GIVEREF(((PyObject *)__pyx_t_19));
__pyx_t_19 = 0;
__pyx_t_19 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
/* "MACS2/cPeakDetect.pyx":161
* write("\t%d" % (peak["summit"]+1)) # summit position
* write("\t%.5f" % (peak["pileup"])) # pileup height at summit
* write("\t%.5f" % (peak["pscore"])) # -log10pvalue at summit # <<<<<<<<<<<<<<
* write("\t%.5f" % (peak["fc"])) # fold change at summit
* write("\t%.5f" % (peak["qscore"])) # -log10qvalue at summit
*/
__pyx_t_19 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__pscore)); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_19); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
/* "MACS2/cPeakDetect.pyx":162
* write("\t%.5f" % (peak["pileup"])) # pileup height at summit
* write("\t%.5f" % (peak["pscore"])) # -log10pvalue at summit
* write("\t%.5f" % (peak["fc"])) # fold change at summit # <<<<<<<<<<<<<<
* write("\t%.5f" % (peak["qscore"])) # -log10qvalue at summit
* write("\t%s" % peakname)
*/
__pyx_t_18 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__fc)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_19 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_19));
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_t_19));
__Pyx_GIVEREF(((PyObject *)__pyx_t_19));
__pyx_t_19 = 0;
__pyx_t_19 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
/* "MACS2/cPeakDetect.pyx":163
* write("\t%.5f" % (peak["pscore"])) # -log10pvalue at summit
* write("\t%.5f" % (peak["fc"])) # fold change at summit
* write("\t%.5f" % (peak["qscore"])) # -log10qvalue at summit # <<<<<<<<<<<<<<
* write("\t%s" % peakname)
* write("\n")
*/
__pyx_t_19 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__qscore)); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_19); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
/* "MACS2/cPeakDetect.pyx":164
* write("\t%.5f" % (peak["fc"])) # fold change at summit
* write("\t%.5f" % (peak["qscore"])) # -log10qvalue at summit
* write("\t%s" % peakname) # <<<<<<<<<<<<<<
* write("\n")
* else:
*/
__pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), __pyx_v_peakname); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
/* "MACS2/cPeakDetect.pyx":165
* write("\t%.5f" % (peak["qscore"])) # -log10qvalue at summit
* write("\t%s" % peakname)
* write("\n") # <<<<<<<<<<<<<<
* else:
* peak = these_peaks[0]
*/
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L20;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":167
* write("\n")
* else:
* peak = these_peaks[0] # <<<<<<<<<<<<<<
* peakname = "%s%d" % (peakprefix, n_peak)
* #[start,end,end-start,summit,peak_height,number_tags,pvalue,fold_change,qvalue]
*/
__pyx_t_7 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_these_peaks), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_v_peak);
__pyx_v_peak = __pyx_t_7;
__pyx_t_7 = 0;
/* "MACS2/cPeakDetect.pyx":168
* else:
* peak = these_peaks[0]
* peakname = "%s%d" % (peakprefix, n_peak) # <<<<<<<<<<<<<<
* #[start,end,end-start,summit,peak_height,number_tags,pvalue,fold_change,qvalue]
* write("%s\t%d\t%d\t%d" % (chrom,peak["start"]+1,peak["end"],peak["length"]))
*/
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_peakprefix);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_peakprefix);
__Pyx_GIVEREF(__pyx_v_peakprefix);
__Pyx_INCREF(__pyx_v_n_peak);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_n_peak);
__Pyx_GIVEREF(__pyx_v_n_peak);
__pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_19), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_12));
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_v_peakname);
__pyx_v_peakname = ((PyObject *)__pyx_t_12);
__pyx_t_12 = 0;
/* "MACS2/cPeakDetect.pyx":170
* peakname = "%s%d" % (peakprefix, n_peak)
* #[start,end,end-start,summit,peak_height,number_tags,pvalue,fold_change,qvalue]
* write("%s\t%d\t%d\t%d" % (chrom,peak["start"]+1,peak["end"],peak["length"])) # <<<<<<<<<<<<<<
* write("\t%d" % (peak["summit"]+1)) # summit position
* write("\t%.5f" % (peak["pileup"])) # pileup height at summit
*/
__pyx_t_12 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_7 = PyNumber_Add(__pyx_t_12, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__end)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_18 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__length)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_19 = PyTuple_New(4); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_INCREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_chrom);
__Pyx_GIVEREF(__pyx_v_chrom);
PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_19, 3, __pyx_t_18);
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_7 = 0;
__pyx_t_12 = 0;
__pyx_t_18 = 0;
__pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_14), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
/* "MACS2/cPeakDetect.pyx":171
* #[start,end,end-start,summit,peak_height,number_tags,pvalue,fold_change,qvalue]
* write("%s\t%d\t%d\t%d" % (chrom,peak["start"]+1,peak["end"],peak["length"]))
* write("\t%d" % (peak["summit"]+1)) # summit position # <<<<<<<<<<<<<<
* write("\t%.5f" % (peak["pileup"])) # pileup height at summit
* write("\t%.5f" % (peak["pscore"])) # -log10pvalue at summit
*/
__pyx_t_18 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__summit)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_19 = PyNumber_Add(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_15), __pyx_t_19); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
/* "MACS2/cPeakDetect.pyx":172
* write("%s\t%d\t%d\t%d" % (chrom,peak["start"]+1,peak["end"],peak["length"]))
* write("\t%d" % (peak["summit"]+1)) # summit position
* write("\t%.5f" % (peak["pileup"])) # pileup height at summit # <<<<<<<<<<<<<<
* write("\t%.5f" % (peak["pscore"])) # -log10pvalue at summit
* write("\t%.5f" % (peak["fc"])) # fold change at summit
*/
__pyx_t_18 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__pileup)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_19 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_19));
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_t_19));
__Pyx_GIVEREF(((PyObject *)__pyx_t_19));
__pyx_t_19 = 0;
__pyx_t_19 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
/* "MACS2/cPeakDetect.pyx":173
* write("\t%d" % (peak["summit"]+1)) # summit position
* write("\t%.5f" % (peak["pileup"])) # pileup height at summit
* write("\t%.5f" % (peak["pscore"])) # -log10pvalue at summit # <<<<<<<<<<<<<<
* write("\t%.5f" % (peak["fc"])) # fold change at summit
* write("\t%.5f" % (peak["qscore"])) # -log10qvalue at summit
*/
__pyx_t_19 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__pscore)); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_19); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
/* "MACS2/cPeakDetect.pyx":174
* write("\t%.5f" % (peak["pileup"])) # pileup height at summit
* write("\t%.5f" % (peak["pscore"])) # -log10pvalue at summit
* write("\t%.5f" % (peak["fc"])) # fold change at summit # <<<<<<<<<<<<<<
* write("\t%.5f" % (peak["qscore"])) # -log10qvalue at summit
* write("\t%s" % peakname)
*/
__pyx_t_18 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__fc)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_19 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_19));
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_t_19));
__Pyx_GIVEREF(((PyObject *)__pyx_t_19));
__pyx_t_19 = 0;
__pyx_t_19 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
/* "MACS2/cPeakDetect.pyx":175
* write("\t%.5f" % (peak["pscore"])) # -log10pvalue at summit
* write("\t%.5f" % (peak["fc"])) # fold change at summit
* write("\t%.5f" % (peak["qscore"])) # -log10qvalue at summit # <<<<<<<<<<<<<<
* write("\t%s" % peakname)
* write("\n")
*/
__pyx_t_19 = PyObject_GetItem(__pyx_v_peak, ((PyObject *)__pyx_n_s__qscore)); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_19); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
/* "MACS2/cPeakDetect.pyx":176
* write("\t%.5f" % (peak["fc"])) # fold change at summit
* write("\t%.5f" % (peak["qscore"])) # -log10qvalue at summit
* write("\t%s" % peakname) # <<<<<<<<<<<<<<
* write("\n")
* return
*/
__pyx_t_18 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), __pyx_v_peakname); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
/* "MACS2/cPeakDetect.pyx":177
* write("\t%.5f" % (peak["qscore"])) # -log10qvalue at summit
* write("\t%s" % peakname)
* write("\n") # <<<<<<<<<<<<<<
* return
*
*/
__pyx_t_18 = PyObject_Call(__pyx_v_write, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
}
__pyx_L20:;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "MACS2/cPeakDetect.pyx":178
* write("\t%s" % peakname)
* write("\n")
* return # <<<<<<<<<<<<<<
*
* def __call_peaks_w_control (self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_18);
__Pyx_XDECREF(__pyx_t_19);
__Pyx_AddTraceback("MACS2.cPeakDetect.PeakDetect.toxls", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_write);
__Pyx_XDECREF(__pyx_v_peakprefix);
__Pyx_XDECREF(__pyx_v_peaks);
__Pyx_XDECREF(__pyx_v_chrs);
__Pyx_XDECREF(__pyx_v_n_peak);
__Pyx_XDECREF(__pyx_v_chrom);
__Pyx_XDECREF(__pyx_v_end);
__Pyx_XDECREF(__pyx_v_group);
__Pyx_XDECREF(__pyx_v_these_peaks);
__Pyx_XDECREF(__pyx_v_i);
__Pyx_XDECREF(__pyx_v_peak);
__Pyx_XDECREF(__pyx_v_peakname);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_TraceReturn(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_7__call_peaks_w_control(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_5MACS2_11cPeakDetect_10PeakDetect_6__call_peaks_w_control[] = "To call peaks with control data.\n\n A peak info type is a: dictionary\n\n key value: chromosome\n\n items: (peak start,peak end, peak length, peak summit, peak\n height, number of tags in peak region, peak pvalue, peak\n fold_enrichment) <-- tuple type\n\n While calculating pvalue:\n\n First, t and c will be adjusted by the ratio between total\n reads in treatment and total reads in control, depending on\n --to-small option.\n\n Then, t and c will be multiplied by the smallest peak size --\n self.d.\n\n Finally, a poisson CDF is applied to calculate one-side pvalue\n for enrichment.\n ";
static PyMethodDef __pyx_mdef_5MACS2_11cPeakDetect_10PeakDetect_7__call_peaks_w_control = {__Pyx_NAMESTR("__call_peaks_w_control"), (PyCFunction)__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_7__call_peaks_w_control, METH_O, __Pyx_DOCSTR(__pyx_doc_5MACS2_11cPeakDetect_10PeakDetect_6__call_peaks_w_control)};
static PyObject *__pyx_pw_5MACS2_11cPeakDetect_10PeakDetect_7__call_peaks_w_control(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call_peaks_w_control (wrapper)", 0);
__pyx_self = __pyx_self;
__pyx_r = __pyx_pf_5MACS2_11cPeakDetect_10PeakDetect_6__call_peaks_w_control(__pyx_self, ((PyObject *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "MACS2/cPeakDetect.pyx":180
* return
*
* def __call_peaks_w_control (self): # <<<<<<<<<<<<<<
* """To call peaks with control data.
*
*/
static PyObject *__pyx_pf_5MACS2_11cPeakDetect_10PeakDetect_6__call_peaks_w_control(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
float __pyx_v_lambda_bg;
float __pyx_v_effective_depth_in_million;
PyObject *__pyx_v_treat_total = NULL;
PyObject *__pyx_v_control_total = NULL;
PyObject *__pyx_v_d = NULL;
PyObject *__pyx_v_treat_btrack = NULL;
PyObject *__pyx_v_d_s = NULL;
PyObject *__pyx_v_scale_factor_s = NULL;
PyObject *__pyx_v_tmp_v = NULL;
PyObject *__pyx_v_control_btrack = NULL;
PyObject *__pyx_v_score_btrack = NULL;
PyObject *__pyx_v_call_summits = NULL;
PyObject *__pyx_v_peaks = NULL;
PyObject *__pyx_v_name = NULL;
PyObject *__pyx_v_trackdesc = NULL;
PyObject *__pyx_v_desc1 = NULL;
PyObject *__pyx_v_tracks = NULL;
PyObject *__pyx_v_filename = NULL;
PyObject *__pyx_v_title = NULL;
PyObject *__pyx_v_desc = NULL;
PyObject *__pyx_v_scorecol = NULL;
PyObject *__pyx_v_bdgfhd = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
double __pyx_t_4;
float __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_t_9;
int __pyx_t_10;
int __pyx_t_11;
Py_ssize_t __pyx_t_12;
PyObject *__pyx_t_13 = NULL;
PyObject *__pyx_t_14 = NULL;
PyObject *(*__pyx_t_15)(PyObject *);
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
PyObject *__pyx_t_18 = NULL;
PyObject *__pyx_t_19 = NULL;
PyObject *__pyx_t_20 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_TraceDeclarations
__Pyx_RefNannySetupContext("__call_peaks_w_control", 0);
__Pyx_TraceCall("__call_peaks_w_control", __pyx_f[0], 180);
/* "MACS2/cPeakDetect.pyx":206
* cdef float lambda_bg, effective_depth_in_million
*
* if self.PE_MODE: # <<<<<<<<<<<<<<
* treat_total = self.treat.length()
* control_total = self.control.length()
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__PE_MODE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":207
*
* if self.PE_MODE:
* treat_total = self.treat.length() # <<<<<<<<<<<<<<
* control_total = self.control.length()
* d = None
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__treat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_treat_total = __pyx_t_1;
__pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":208
* if self.PE_MODE:
* treat_total = self.treat.length()
* control_total = self.control.length() # <<<<<<<<<<<<<<
* d = None
* else:
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__control); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_control_total = __pyx_t_1;
__pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":209
* treat_total = self.treat.length()
* control_total = self.control.length()
* d = None # <<<<<<<<<<<<<<
* else:
* treat_total = self.treat.total
*/
__Pyx_INCREF(Py_None);
__pyx_v_d = Py_None;
goto __pyx_L3;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":211
* d = None
* else:
* treat_total = self.treat.total # <<<<<<<<<<<<<<
* control_total = self.control.total
* d = self.d
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__treat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__total); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_treat_total = __pyx_t_3;
__pyx_t_3 = 0;
/* "MACS2/cPeakDetect.pyx":212
* else:
* treat_total = self.treat.total
* control_total = self.control.total # <<<<<<<<<<<<<<
* d = self.d
* self.ratio_treat2control = float(treat_total)/control_total
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__control); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__total); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_control_total = __pyx_t_1;
__pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":213
* treat_total = self.treat.total
* control_total = self.control.total
* d = self.d # <<<<<<<<<<<<<<
* self.ratio_treat2control = float(treat_total)/control_total
*
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_d = __pyx_t_1;
__pyx_t_1 = 0;
}
__pyx_L3:;
/* "MACS2/cPeakDetect.pyx":214
* control_total = self.control.total
* d = self.d
* self.ratio_treat2control = float(treat_total)/control_total # <<<<<<<<<<<<<<
*
* if self.opt.tocontrol:
*/
__pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_v_treat_total); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_1 = PyFloat_FromDouble(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_control_total); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__ratio_treat2control, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "MACS2/cPeakDetect.pyx":216
* self.ratio_treat2control = float(treat_total)/control_total
*
* if self.opt.tocontrol: # <<<<<<<<<<<<<<
* # if MACS decides to scale treatment to control data because treatment is bigger
* effective_depth_in_million = control_total / 1000000.0
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__opt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__tocontrol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":218
* if self.opt.tocontrol:
* # if MACS decides to scale treatment to control data because treatment is bigger
* effective_depth_in_million = control_total / 1000000.0 # <<<<<<<<<<<<<<
*
* if self.PE_MODE:
*/
__pyx_t_1 = PyFloat_FromDouble(1000000.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_control_total, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_effective_depth_in_million = __pyx_t_5;
/* "MACS2/cPeakDetect.pyx":220
* effective_depth_in_million = control_total / 1000000.0
*
* if self.PE_MODE: # <<<<<<<<<<<<<<
* if self.opt.halfext: warn('halfextension not supported in PE mode')
* self.info("#3 pileup treatment data")
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__PE_MODE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_2) {
/* "MACS2/cPeakDetect.pyx":221
*
* if self.PE_MODE:
* if self.opt.halfext: warn('halfextension not supported in PE mode') # <<<<<<<<<<<<<<
* self.info("#3 pileup treatment data")
* lambda_bg = treat_total/self.gsize/self.ratio_treat2control
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__opt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__halfext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L6;
}
__pyx_L6:;
/* "MACS2/cPeakDetect.pyx":222
* if self.PE_MODE:
* if self.opt.halfext: warn('halfextension not supported in PE mode')
* self.info("#3 pileup treatment data") # <<<<<<<<<<<<<<
* lambda_bg = treat_total/self.gsize/self.ratio_treat2control
* else:
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "MACS2/cPeakDetect.pyx":223
* if self.opt.halfext: warn('halfextension not supported in PE mode')
* self.info("#3 pileup treatment data")
* lambda_bg = treat_total/self.gsize/self.ratio_treat2control # <<<<<<<<<<<<<<
* else:
* self.info("#3 pileup treatment data by extending tags towards 3' to %d length" % self.d)
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__gsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_treat_total, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ratio_treat2control); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_lambda_bg = __pyx_t_5;
goto __pyx_L5;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":225
* lambda_bg = treat_total/self.gsize/self.ratio_treat2control
* else:
* self.info("#3 pileup treatment data by extending tags towards 3' to %d length" % self.d) # <<<<<<<<<<<<<<
* lambda_bg = float(self.d)*treat_total/self.gsize/self.ratio_treat2control
* treat_btrack = unified_pileup_bdg(self.treat, d,
*/
__pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_25), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
__pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "MACS2/cPeakDetect.pyx":226
* else:
* self.info("#3 pileup treatment data by extending tags towards 3' to %d length" % self.d)
* lambda_bg = float(self.d)*treat_total/self.gsize/self.ratio_treat2control # <<<<<<<<<<<<<<
* treat_btrack = unified_pileup_bdg(self.treat, d,
* 1/self.ratio_treat2control,
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_t_3); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyFloat_FromDouble(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_treat_total); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__gsize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ratio_treat2control); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_lambda_bg = __pyx_t_5;
}
__pyx_L5:;
/* "MACS2/cPeakDetect.pyx":227
* self.info("#3 pileup treatment data by extending tags towards 3' to %d length" % self.d)
* lambda_bg = float(self.d)*treat_total/self.gsize/self.ratio_treat2control
* treat_btrack = unified_pileup_bdg(self.treat, d, # <<<<<<<<<<<<<<
* 1/self.ratio_treat2control,
* directional=True,
*/
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__unified_pileup_bdg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__treat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
/* "MACS2/cPeakDetect.pyx":228
* lambda_bg = float(self.d)*treat_total/self.gsize/self.ratio_treat2control
* treat_btrack = unified_pileup_bdg(self.treat, d,
* 1/self.ratio_treat2control, # <<<<<<<<<<<<<<
* directional=True,
* halfextension=self.opt.halfext)
*/
__pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ratio_treat2control); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_d);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_d);
__Pyx_GIVEREF(__pyx_v_d);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
__pyx_t_3 = 0;
__pyx_t_7 = 0;
/* "MACS2/cPeakDetect.pyx":227
* self.info("#3 pileup treatment data by extending tags towards 3' to %d length" % self.d)
* lambda_bg = float(self.d)*treat_total/self.gsize/self.ratio_treat2control
* treat_btrack = unified_pileup_bdg(self.treat, d, # <<<<<<<<<<<<<<
* 1/self.ratio_treat2control,
* directional=True,
*/
__pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_7));
/* "MACS2/cPeakDetect.pyx":229
* treat_btrack = unified_pileup_bdg(self.treat, d,
* 1/self.ratio_treat2control,
* directional=True, # <<<<<<<<<<<<<<
* halfextension=self.opt.halfext)
* else:
*/
__pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__directional), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "MACS2/cPeakDetect.pyx":230
* 1/self.ratio_treat2control,
* directional=True,
* halfextension=self.opt.halfext) # <<<<<<<<<<<<<<
* else:
* # if MACS decides to scale control to treatment because control sample is bigger
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__opt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__halfext); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__halfextension), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
__pyx_v_treat_btrack = __pyx_t_8;
__pyx_t_8 = 0;
goto __pyx_L4;
}
/*else*/ {
/* "MACS2/cPeakDetect.pyx":233
* else:
* # if MACS decides to scale control to treatment because control sample is bigger
* effective_depth_in_million = treat_total / 1000000.0 # <<<<<<<<<<<<<<
* self.info("#3 pileup treatment data")
* if self.PE_MODE:
*/
__pyx_t_8 = PyFloat_FromDouble(1000000.0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_v_treat_total, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_effective_depth_in_million = __pyx_t_5;
/* "MACS2/cPeakDetect.pyx":234
* # if MACS decides to scale control to treatment because control sample is bigger
* effective_depth_in_million = treat_total / 1000000.0
* self.info("#3 pileup treatment data") # <<<<<<<<<<<<<<
* if self.PE_MODE:
* if self.opt.halfext: warn('halfextension not supported in PE mode')
*/
__pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;