/* Generated by Cython 0.18 on Thu Aug 22 18:40:35 2013 */

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


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

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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__pybedtools__cbedtools
#define __PYX_HAVE_API__pybedtools__cbedtools
#include "string.h"
#include "stdio.h"
#include "pythread.h"
#include <vector>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <string>
#include "bedFile.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))


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


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

/*--- Type declarations ---*/
struct __pyx_obj_10pybedtools_9cbedtools_Attributes;
struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile;
struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator;
struct __pyx_obj_10pybedtools_9cbedtools_Interval;

/* "pybedtools/cbedtools.pyx":99
 * 
 * 
 * cdef class Attributes(dict):             # <<<<<<<<<<<<<<
 *     """
 *     Class to map between a dict of attrs and fields[8] of a GFF Interval obj.
 */
struct __pyx_obj_10pybedtools_9cbedtools_Attributes {
  PyDictObject __pyx_base;
  PyObject *sep;
  PyObject *field_sep;
  PyObject *_attr_str;
  PyObject *_quoted;
};


/* "pybedtools/cbedtools.pyx":639
 * 
 * 
 * cdef class IntervalFile:             # <<<<<<<<<<<<<<
 *     cdef BedFile *intervalFile_ptr
 *     cdef bint _loaded
 */
struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile {
  PyObject_HEAD
  BedFile *intervalFile_ptr;
  int _loaded;
  int _open;
  PyObject *fn;
};


/* "pybedtools/cbedtools.pyx":591
 * 
 * 
 * cdef class IntervalIterator:             # <<<<<<<<<<<<<<
 *     cdef object stream
 *     cdef int _isstring
 */
struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator {
  PyObject_HEAD
  PyObject *stream;
  int _isstring;
};


/* "pybedtools/cbedtools.pxd":95
 * 
 * 
 * cdef class Interval:             # <<<<<<<<<<<<<<
 *     cdef BED *_bed
 *     cdef object _attrs
 */
struct __pyx_obj_10pybedtools_9cbedtools_Interval {
  PyObject_HEAD
  struct __pyx_vtabstruct_10pybedtools_9cbedtools_Interval *__pyx_vtab;
  BED *_bed;
  PyObject *_attrs;
};



/* "pybedtools/cbedtools.pyx":155
 *         return self.sep.join([self.field_sep.join(kvs) for kvs in items])
 * 
 * cdef class Interval:             # <<<<<<<<<<<<<<
 *     """
 *     Class to represent a genomic interval.
 */

struct __pyx_vtabstruct_10pybedtools_9cbedtools_Interval {
  PyObject *(*append)(struct __pyx_obj_10pybedtools_9cbedtools_Interval *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*deparse_attrs)(struct __pyx_obj_10pybedtools_9cbedtools_Interval *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_10pybedtools_9cbedtools_Interval *__pyx_vtabptr_10pybedtools_9cbedtools_Interval;
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext() \
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

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

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

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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

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

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

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

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

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

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

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 CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {  /* inlined PySequence_GetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return NULL;
                i += l;
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE PyObject* __Pyx_tp_new(PyObject* type_obj) {
    return (PyObject*) (((PyTypeObject*)(type_obj))->tp_new(
        (PyTypeObject*)(type_obj), __pyx_empty_tuple, NULL));
}

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

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

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, int level); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

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

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

static CYTHON_INLINE CHRPOS __Pyx_PyInt_from_py_CHRPOS(PyObject *);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_CHRPOS(CHRPOS);

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

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

static int __Pyx_check_binary_version(void);

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from '__builtin__' */

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

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

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

/* Module declarations from '__builtin__' */

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

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

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

/* Module declarations from '__builtin__' */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from 'cpython' */

/* Module declarations from 'libcpp.vector' */

/* Module declarations from 'pybedtools.cbedtools' */
static PyTypeObject *__pyx_ptype_10pybedtools_9cbedtools_Interval = 0;
static PyTypeObject *__pyx_ptype_10pybedtools_9cbedtools_Attributes = 0;
static PyTypeObject *__pyx_ptype_10pybedtools_9cbedtools_IntervalIterator = 0;
static PyTypeObject *__pyx_ptype_10pybedtools_9cbedtools_IntervalFile = 0;
static PyObject *__pyx_v_10pybedtools_9cbedtools_LOOKUPS = 0;
static struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_f_10pybedtools_9cbedtools_create_interval(BED); /*proto*/
static struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_f_10pybedtools_9cbedtools_create_interval_from_list(PyObject *, int __pyx_skip_dispatch); /*proto*/
static std::vector<std::string> __pyx_f_10pybedtools_9cbedtools_list_to_vector(PyObject *); /*proto*/
static PyObject *__pyx_f_10pybedtools_9cbedtools_string_vec2list(std::vector<std::string>); /*proto*/
static PyObject *__pyx_f_10pybedtools_9cbedtools_bed_vec2list(std::vector<BED>); /*proto*/
#define __Pyx_MODULE_NAME "pybedtools.cbedtools"
int __pyx_module_is_main_pybedtools__cbedtools = 0;

/* Implementation of 'pybedtools.cbedtools' */
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_cmp;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_basestring;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_open;
static int __pyx_pf_10pybedtools_9cbedtools_10Attributes___init__(struct __pyx_obj_10pybedtools_9cbedtools_Attributes *__pyx_v_self, PyObject *__pyx_v_attr_str); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_10Attributes_2__setitem__(struct __pyx_obj_10pybedtools_9cbedtools_Attributes *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_10Attributes_4__str__(struct __pyx_obj_10pybedtools_9cbedtools_Attributes *__pyx_v_self); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_8Interval___init__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_name, PyObject *__pyx_v_score, PyObject *__pyx_v_strand, PyObject *__pyx_v_otherfields); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_2__copy__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static Py_hash_t __pyx_pf_10pybedtools_9cbedtools_8Interval_4__hash__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_5chrom___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_8Interval_5chrom_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, char *__pyx_v_chrom); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_6__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_5start___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_8Interval_5start_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, int __pyx_v_start); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_3end___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_8Interval_3end_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, int __pyx_v_end); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_4stop___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_8Interval_4stop_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, int __pyx_v_end); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_6strand___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_8Interval_6strand_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_strand); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_6length___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_8deparse_attrs(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_6fields___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_5attrs___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_8Interval_5attrs_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_attrs); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_10count(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_4name___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_8Interval_4name_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_5score___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_8Interval_5score_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_9file_type___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_8Interval_9file_type_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_12o_start(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_14o_end(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_16o_amt(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_18__str__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_20__repr__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static void __pyx_pf_10pybedtools_9cbedtools_8Interval_22__dealloc__(CYTHON_UNUSED struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_10pybedtools_9cbedtools_8Interval_24__len__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_26__getitem__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_8Interval_28__setitem__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_30append(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_create_interval_from_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_2overlap(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_s1, int __pyx_v_s2, int __pyx_v_e1, int __pyx_v_e2); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_16IntervalIterator___init__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *__pyx_v_self, PyObject *__pyx_v_stream); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_16IntervalIterator_2__iter__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_16IntervalIterator_4__next__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *__pyx_v_self); /* proto */
static int __pyx_pf_10pybedtools_9cbedtools_12IntervalFile___init__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self, PyObject *__pyx_v_intervalFile); /* proto */
static void __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_4__iter__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_6__next__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_8file_type(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_10loadIntoMap(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_12rewind(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_14seek(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self, PyObject *__pyx_v_offset); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_16all_hits(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self, struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_interval, PyBoolObject *__pyx_v_same_strand, float __pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_18any_hits(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self, struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_interval, PyBoolObject *__pyx_v_same_strand, float __pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_20count_hits(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self, struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_interval, PyBoolObject *__pyx_v_same_strand, float __pyx_v_overlap); /* proto */
static char __pyx_k_1[] = "";
static char __pyx_k_2[] = ";";
static char __pyx_k_4[] = "=";
static char __pyx_k_6[] = "\"";
static char __pyx_k_8[] = " ";
static char __pyx_k_11[] = ".";
static char __pyx_k_12[] = "\t";
static char __pyx_k_13[] = "Features are nested -- comparison undefined";
static char __pyx_k_15[] = "Currently unsupported comparison -- please submit a bug report";
static char __pyx_k_17[] = "Interval.attrs was not None, but this was a non-GFF Interval";
static char __pyx_k_21[] = "%s:%i";
static char __pyx_k_23[] = "\n";
static char __pyx_k_24[] = "Interval(%s:%i-%i)";
static char __pyx_k_25[] = "field index out of range";
static char __pyx_k_28[] = "+";
static char __pyx_k_29[] = "-";
static char __pyx_k_30[] = "MalformedBedLineError";
static char __pyx_k_31[] = "Unable to detect format from %s";
static char __pyx_k_32[] = "@";
static char __pyx_k_33[] = "#";
static char __pyx_k_36[] = "\r\n";
static char __pyx_k_39[] = "malformed line: %s";
static char __pyx_k_40[] = "IntervalFile objects do not yet natively support SAM. Please convert to BED/GFF/VCF first if you want to use the low-level API of IntervalFile";
static char __pyx_k_45[] = " the chromosome of the feature";
static char __pyx_k_46[] = "The 0-based start of the feature.";
static char __pyx_k_47[] = "The end of the feature";
static char __pyx_k_48[] = " the end of the feature";
static char __pyx_k_49[] = " the strand of the feature";
static char __pyx_k_50[] = " the length of the feature";
static char __pyx_k_51[] = "\n        >>> import pybedtools\n        >>> vcf = pybedtools.example_bedtool('v.vcf')\n        >>> [v.name for v in vcf]\n        ['rs6054257', 'chr1:16', 'rs6040355', 'chr1:222', 'microsat1']\n\n        ";
static char __pyx_k_52[] = "bed/vcf/gff";
static char __pyx_k_53[] = "\n    bedtools.pyx: A Cython wrapper for the BEDTools BedFile class\n\n    Authors: Aaron Quinlan[1], Brent Pedersen[2]\n    Affl:    [1] Center for Public Health Genomics, University of Virginia\n             [2]\n    Email:  aaronquinlan at gmail dot com\n";
static char __pyx_k_84[] = "pybedtools.cbedtools";
static char __pyx_k_87[] = "/home/ryan/proj/pybedtools/pybedtools/cbedtools.pyx";
static char __pyx_k_88[] = "create_interval_from_list (line 496)";
static char __pyx_k_89[] = "\n    Create an Interval object from a list of strings.\n\n    Constructor::\n\n        create_interval_from_list(fields)\n\n    Given the list of strings, `fields`, automatically detects the format (BED,\n    GFF, VCF, SAM) and creates a new Interval object.\n\n    `fields` is a list with an arbitrary number of items (it can be quite long,\n    say after a -wao intersection of a BED12 and a GFF), however, the first\n    fields must conform to one of the supported formats.  For example, if you\n    want the resulting Interval to be considered a GFF feature, then the first\n    9 fields must conform to the GFF format.  Similarly, if you want the\n    resulting Interval to be considered a BED feature, then the first three\n    fields must be chrom, start, stop.\n\n    Example usage:\n\n        >>> # Creates a BED3 feature\n        >>> feature = create_interval_from_list(['chr1', '1', '100'])\n\n    ";
static char __pyx_k_90[] = "IntervalFile.all_hits (line 724)";
static char __pyx_k_91[] = "\n        :Signature: `IntervalFile.all_hits(interval, same_strand=False, overlap=0.0)`\n\n        Search for the Interval `interval` this file and return **all**\n        overlaps as a list.\n\n        `same_strand`, if True, will only consider hits on the same strand as `interval`.\n\n        `overlap` can be used to specify the fraction of overlap between\n        `interval` and each feature in the IntervalFile.\n\n        Example usage:\n\n        >>> fn = pybedtools.example_filename('a.bed')\n\n        >>> # create an Interval to query with\n        >>> i = pybedtools.Interval('chr1', 1, 10000, strand='+')\n\n        >>> # Create an IntervalFile out of a.bed\n        >>> intervalfile = pybedtools.IntervalFile(fn)\n\n        >>> # get stranded hits\n        >>> intervalfile.all_hits(i, same_strand=True)\n        [Interval(chr1:1-100), Interval(chr1:100-200), Interval(chr1:900-950)]\n\n        ";
static char __pyx_k_92[] = "IntervalFile.any_hits (line 770)";
static char __pyx_k_93[] = "\n        :Signature: `IntervalFile.any_hits(interval, same_strand=False, overlap=0.0)`\n\n        Return 1 if the Interval `interval` had >=1 hit in this IntervalFile, 0 otherwise.\n\n        `same_strand`, if True, will only consider hits on the same strand as `interval`.\n\n        `overlap` can be used to specify the fraction of overlap between\n        `interval` and each feature in the IntervalFile.\n\n        Example usage:\n\n        >>> fn = pybedtools.example_filename('a.bed')\n\n        >>> # create an Interval to query with\n        >>> i = pybedtools.Interval('chr1', 1, 10000, strand='+')\n\n        >>> # Create an IntervalFile out of a.bed\n        >>> intervalfile = pybedtools.IntervalFile(fn)\n\n        >>> # any stranded hits?\n        >>> intervalfile.any_hits(i, same_strand=True)\n        1\n\n        ";
static char __pyx_k_94[] = "IntervalFile.count_hits (line 806)";
static char __pyx_k_95[] = "\n        :Signature: `IntervalFile.count_hits(interval, same_strand=False, overlap=0.0)`\n\n        Return the number of overlaps of the Interval `interval` had with this\n        IntervalFile.\n\n        `same_strand`, if True, will only consider hits on the same strand as\n        `interval`.\n\n        `overlap` can be used to specify the fraction of overlap between\n        `interval` and each feature in the IntervalFile.\n\n        Example usage:\n\n        >>> fn = pybedtools.example_filename('a.bed')\n\n        >>> # create an Interval to query with\n        >>> i = pybedtools.Interval('chr1', 1, 10000, strand='+')\n\n        >>> # Create an IntervalFile out of a.bed\n        >>> intervalfile = pybedtools.IntervalFile(fn)\n\n        >>> # get number of stranded hits\n        >>> intervalfile.count_hits(i, same_strand=True)\n        3\n\n        ";
static char __pyx_k__k[] = "k";
static char __pyx_k__v[] = "v";
static char __pyx_k__ID[] = "ID";
static char __pyx_k__e1[] = "e1";
static char __pyx_k__e2[] = "e2";
static char __pyx_k__s1[] = "s1";
static char __pyx_k__s2[] = "s2";
static char __pyx_k__bed[] = "bed";
static char __pyx_k__cmp[] = "cmp";
static char __pyx_k__end[] = "end";
static char __pyx_k__gff[] = "gff";
static char __pyx_k__map[] = "map";
static char __pyx_k__sam[] = "sam";
static char __pyx_k__sys[] = "sys";
static char __pyx_k__vcf[] = "vcf";
static char __pyx_k__Name[] = "Name";
static char __pyx_k__join[] = "join";
static char __pyx_k__name[] = "name";
static char __pyx_k__next[] = "next";
static char __pyx_k__open[] = "open";
static char __pyx_k__stop[] = "stop";
static char __pyx_k__attrs[] = "attrs";
static char __pyx_k__chrom[] = "chrom";
static char __pyx_k__close[] = "close";
static char __pyx_k__count[] = "count";
static char __pyx_k__items[] = "items";
static char __pyx_k__kdict[] = "kdict";
static char __pyx_k__ktype[] = "ktype";
static char __pyx_k__o_amt[] = "o_amt";
static char __pyx_k__o_end[] = "o_end";
static char __pyx_k__range[] = "range";
static char __pyx_k__score[] = "score";
static char __pyx_k__split[] = "split";
static char __pyx_k__start[] = "start";
static char __pyx_k__strip[] = "strip";
static char __pyx_k__track[] = "track";
static char __pyx_k__Parent[] = "Parent";
static char __pyx_k__append[] = "append";
static char __pyx_k__extend[] = "extend";
static char __pyx_k__fields[] = "fields";
static char __pyx_k__rstrip[] = "rstrip";
static char __pyx_k__search[] = "search";
static char __pyx_k__strand[] = "strand";
static char __pyx_k__stream[] = "stream";
static char __pyx_k____str__[] = "__str__";
static char __pyx_k__browser[] = "browser";
static char __pyx_k__gene_id[] = "gene_id";
static char __pyx_k__indices[] = "indices";
static char __pyx_k__isdigit[] = "isdigit";
static char __pyx_k__o_start[] = "o_start";
static char __pyx_k__overlap[] = "overlap";
static char __pyx_k__replace[] = "replace";
static char __pyx_k__KeyError[] = "KeyError";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__all_hits[] = "all_hits";
static char __pyx_k__attr_str[] = "attr_str";
static char __pyx_k__interval[] = "interval";
static char __pyx_k__property[] = "property";
static char __pyx_k__readline[] = "readline";
static char __pyx_k__Exception[] = "Exception";
static char __pyx_k__file_type[] = "file_type";
static char __pyx_k__gene_name[] = "gene_name";
static char __pyx_k__iteritems[] = "iteritems";
static char __pyx_k__IndexError[] = "IndexError";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k__basestring[] = "basestring";
static char __pyx_k__startswith[] = "startswith";
static char __pyx_k__subprocess[] = "subprocess";
static char __pyx_k____setitem__[] = "__setitem__";
static char __pyx_k__collections[] = "collections";
static char __pyx_k__defaultdict[] = "defaultdict";
static char __pyx_k__loadIntoMap[] = "loadIntoMap";
static char __pyx_k__otherfields[] = "otherfields";
static char __pyx_k__same_strand[] = "same_strand";
static char __pyx_k__intervalFile[] = "intervalFile";
static char __pyx_k__PROFILES_TRUE[] = "PROFILES_TRUE";
static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k__deparse_attrs[] = "deparse_attrs";
static char __pyx_k__transcript_id[] = "transcript_id";
static char __pyx_k__AttributeError[] = "AttributeError";
static char __pyx_k__NotImplementedError[] = "NotImplementedError";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_kp_s_24;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_n_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_s_40;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_n_s_84;
static PyObject *__pyx_kp_s_87;
static PyObject *__pyx_kp_u_88;
static PyObject *__pyx_kp_u_89;
static PyObject *__pyx_kp_u_90;
static PyObject *__pyx_kp_u_91;
static PyObject *__pyx_kp_u_92;
static PyObject *__pyx_kp_u_93;
static PyObject *__pyx_kp_u_94;
static PyObject *__pyx_kp_u_95;
static PyObject *__pyx_n_s__AttributeError;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__ID;
static PyObject *__pyx_n_s__IndexError;
static PyObject *__pyx_n_s__KeyError;
static PyObject *__pyx_n_s__Name;
static PyObject *__pyx_n_s__NotImplementedError;
static PyObject *__pyx_n_s__PROFILES_TRUE;
static PyObject *__pyx_n_s__Parent;
static PyObject *__pyx_n_s__StopIteration;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____setitem__;
static PyObject *__pyx_n_s____str__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s__all_hits;
static PyObject *__pyx_n_s__append;
static PyObject *__pyx_n_s__attr_str;
static PyObject *__pyx_n_s__attrs;
static PyObject *__pyx_n_s__basestring;
static PyObject *__pyx_n_s__bed;
static PyObject *__pyx_n_s__browser;
static PyObject *__pyx_n_s__chrom;
static PyObject *__pyx_n_s__close;
static PyObject *__pyx_n_s__cmp;
static PyObject *__pyx_n_s__collections;
static PyObject *__pyx_n_s__count;
static PyObject *__pyx_n_s__defaultdict;
static PyObject *__pyx_n_s__deparse_attrs;
static PyObject *__pyx_n_s__e1;
static PyObject *__pyx_n_s__e2;
static PyObject *__pyx_n_s__end;
static PyObject *__pyx_n_s__extend;
static PyObject *__pyx_n_s__fields;
static PyObject *__pyx_n_s__file_type;
static PyObject *__pyx_n_s__gene_id;
static PyObject *__pyx_n_s__gene_name;
static PyObject *__pyx_n_s__gff;
static PyObject *__pyx_n_s__indices;
static PyObject *__pyx_n_s__interval;
static PyObject *__pyx_n_s__intervalFile;
static PyObject *__pyx_n_s__isdigit;
static PyObject *__pyx_n_s__items;
static PyObject *__pyx_n_s__iteritems;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__k;
static PyObject *__pyx_n_s__kdict;
static PyObject *__pyx_n_s__ktype;
static PyObject *__pyx_n_s__loadIntoMap;
static PyObject *__pyx_n_s__map;
static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__next;
static PyObject *__pyx_n_s__o_amt;
static PyObject *__pyx_n_s__o_end;
static PyObject *__pyx_n_s__o_start;
static PyObject *__pyx_n_s__open;
static PyObject *__pyx_n_s__otherfields;
static PyObject *__pyx_n_s__overlap;
static PyObject *__pyx_n_s__property;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__readline;
static PyObject *__pyx_n_s__replace;
static PyObject *__pyx_n_s__rstrip;
static PyObject *__pyx_n_s__s1;
static PyObject *__pyx_n_s__s2;
static PyObject *__pyx_n_s__sam;
static PyObject *__pyx_n_s__same_strand;
static PyObject *__pyx_n_s__score;
static PyObject *__pyx_n_s__search;
static PyObject *__pyx_n_s__split;
static PyObject *__pyx_n_s__start;
static PyObject *__pyx_n_s__startswith;
static PyObject *__pyx_n_s__stop;
static PyObject *__pyx_n_s__strand;
static PyObject *__pyx_n_s__stream;
static PyObject *__pyx_n_s__strip;
static PyObject *__pyx_n_s__subprocess;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__track;
static PyObject *__pyx_n_s__transcript_id;
static PyObject *__pyx_n_s__v;
static PyObject *__pyx_n_s__vcf;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_16;
static PyBoolObject *__pyx_k_42;
static PyBoolObject *__pyx_k_43;
static PyBoolObject *__pyx_k_44;
static PyObject *__pyx_k_tuple_3;
static PyObject *__pyx_k_tuple_5;
static PyObject *__pyx_k_tuple_7;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_10;
static PyObject *__pyx_k_tuple_14;
static PyObject *__pyx_k_tuple_16;
static PyObject *__pyx_k_tuple_18;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_20;
static PyObject *__pyx_k_tuple_22;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_27;
static PyObject *__pyx_k_tuple_34;
static PyObject *__pyx_k_tuple_35;
static PyObject *__pyx_k_tuple_37;
static PyObject *__pyx_k_tuple_38;
static PyObject *__pyx_k_tuple_41;
static PyObject *__pyx_k_tuple_54;
static PyObject *__pyx_k_tuple_55;
static PyObject *__pyx_k_tuple_56;
static PyObject *__pyx_k_tuple_57;
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_62;
static PyObject *__pyx_k_tuple_63;
static PyObject *__pyx_k_tuple_64;
static PyObject *__pyx_k_tuple_65;
static PyObject *__pyx_k_tuple_66;
static PyObject *__pyx_k_tuple_67;
static PyObject *__pyx_k_tuple_68;
static PyObject *__pyx_k_tuple_69;
static PyObject *__pyx_k_tuple_70;
static PyObject *__pyx_k_tuple_71;
static PyObject *__pyx_k_tuple_72;
static PyObject *__pyx_k_tuple_73;
static PyObject *__pyx_k_tuple_74;
static PyObject *__pyx_k_tuple_75;
static PyObject *__pyx_k_tuple_76;
static PyObject *__pyx_k_tuple_77;
static PyObject *__pyx_k_tuple_78;
static PyObject *__pyx_k_tuple_79;
static PyObject *__pyx_k_tuple_80;
static PyObject *__pyx_k_tuple_81;
static PyObject *__pyx_k_tuple_82;
static PyObject *__pyx_k_tuple_83;
static PyObject *__pyx_k_tuple_85;
static PyObject *__pyx_k_codeobj_86;

/* Python wrapper */
static int __pyx_pw_10pybedtools_9cbedtools_10Attributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_10Attributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_attr_str = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__attr_str,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_kp_s_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__attr_str);
          if (value) { values[0] = 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 = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_attr_str = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.Attributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_10Attributes___init__(((struct __pyx_obj_10pybedtools_9cbedtools_Attributes *)__pyx_v_self), __pyx_v_attr_str);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":106
 *     cdef dict _quoted
 * 
 *     def __init__(self, attr_str=""):             # <<<<<<<<<<<<<<
 *         self._attr_str = attr_str
 * 
 */

static int __pyx_pf_10pybedtools_9cbedtools_10Attributes___init__(struct __pyx_obj_10pybedtools_9cbedtools_Attributes *__pyx_v_self, PyObject *__pyx_v_attr_str) {
  PyObject *__pyx_v_n_semi = NULL;
  PyObject *__pyx_v_n_eq = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_n_quotes = NULL;
  PyObject *__pyx_v_kvs = NULL;
  PyObject *__pyx_v_field = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_kv = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  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], 106);

  /* "pybedtools/cbedtools.pyx":107
 * 
 *     def __init__(self, attr_str=""):
 *         self._attr_str = attr_str             # <<<<<<<<<<<<<<
 * 
 *         # in general, GFF files will have either as many '=' as ';'
 */
  if (!(likely(PyString_CheckExact(__pyx_v_attr_str))||((__pyx_v_attr_str) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_v_attr_str)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_attr_str);
  __Pyx_GIVEREF(__pyx_v_attr_str);
  __Pyx_GOTREF(__pyx_v_self->_attr_str);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_attr_str));
  __pyx_v_self->_attr_str = ((PyObject*)__pyx_v_attr_str);

  /* "pybedtools/cbedtools.pyx":111
 *         # in general, GFF files will have either as many '=' as ';'
 *         # (or ';'-1 if there's no trailing ';')
 *         n_semi = attr_str.count(';')             # <<<<<<<<<<<<<<
 *         n_eq = attr_str.count('=')
 *         n_quotes = attr_str.count('"')
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_attr_str, __pyx_n_s__count); 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_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n_semi = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":112
 *         # (or ';'-1 if there's no trailing ';')
 *         n_semi = attr_str.count(';')
 *         n_eq = attr_str.count('=')             # <<<<<<<<<<<<<<
 *         n_quotes = attr_str.count('"')
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_attr_str, __pyx_n_s__count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n_eq = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":113
 *         n_semi = attr_str.count(';')
 *         n_eq = attr_str.count('=')
 *         n_quotes = attr_str.count('"')             # <<<<<<<<<<<<<<
 * 
 *         if n_eq > n_semi - 1:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_attr_str, __pyx_n_s__count); 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_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n_quotes = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":115
 *         n_quotes = attr_str.count('"')
 * 
 *         if n_eq > n_semi - 1:             # <<<<<<<<<<<<<<
 *             self.sep, self.field_sep = (';', '=')
 *         else:
 */
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_n_semi, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_n_eq, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pybedtools/cbedtools.pyx":116
 * 
 *         if n_eq > n_semi - 1:
 *             self.sep, self.field_sep = (';', '=')             # <<<<<<<<<<<<<<
 *         else:
 *             self.sep, self.field_sep = (';', ' ')
 */
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_2);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = ((PyObject *)__pyx_kp_s_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->sep);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->sep));
    __pyx_v_self->sep = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->field_sep);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->field_sep));
    __pyx_v_self->field_sep = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pybedtools/cbedtools.pyx":118
 *             self.sep, self.field_sep = (';', '=')
 *         else:
 *             self.sep, self.field_sep = (';', ' ')             # <<<<<<<<<<<<<<
 * 
 *         self._quoted = {}
 */
    __pyx_t_2 = ((PyObject *)__pyx_kp_s_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_8);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->sep);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->sep));
    __pyx_v_self->sep = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->field_sep);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->field_sep));
    __pyx_v_self->field_sep = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":120
 *             self.sep, self.field_sep = (';', ' ')
 * 
 *         self._quoted = {}             # <<<<<<<<<<<<<<
 * 
 *         # TODO: pathological case . . . detect this as GFF:
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->_quoted);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_quoted));
  __pyx_v_self->_quoted = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":131
 * 
 *         # quick exit
 *         if attr_str == "":             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_attr_str, ((PyObject *)__pyx_kp_s_1), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pybedtools/cbedtools.pyx":132
 *         # quick exit
 *         if attr_str == "":
 *             return             # <<<<<<<<<<<<<<
 * 
 *         kvs = map(str.strip, attr_str.strip().split(self.sep))
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pybedtools/cbedtools.pyx":134
 *             return
 * 
 *         kvs = map(str.strip, attr_str.strip().split(self.sep))             # <<<<<<<<<<<<<<
 *         for field, value in [kv.split(self.field_sep, 1) for kv in kvs if kv]:
 *             if value.count('"') == 2:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_n_s__strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_attr_str, __pyx_n_s__strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->sep));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->sep));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->sep));
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_kvs = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pybedtools/cbedtools.pyx":135
 * 
 *         kvs = map(str.strip, attr_str.strip().split(self.sep))
 *         for field, value in [kv.split(self.field_sep, 1) for kv in kvs if kv]:             # <<<<<<<<<<<<<<
 *             if value.count('"') == 2:
 *                 self._quoted[field] = True
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyList_CheckExact(__pyx_v_kvs) || PyTuple_CheckExact(__pyx_v_kvs)) {
    __pyx_t_4 = __pyx_v_kvs; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_kvs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_4)) {
      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_4)) {
      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_4);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_kv);
    __pyx_v_kv = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_kv); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_kv, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_self->field_sep));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->field_sep));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self->field_sep));
      __Pyx_INCREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (unlikely(__Pyx_PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = ((PyObject *)__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext;
      index = 0; __pyx_t_8 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_8)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L11_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_field);
    __pyx_v_field = __pyx_t_8;
    __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_v_value);
    __pyx_v_value = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pybedtools/cbedtools.pyx":136
 *         kvs = map(str.strip, attr_str.strip().split(self.sep))
 *         for field, value in [kv.split(self.field_sep, 1) for kv in kvs if kv]:
 *             if value.count('"') == 2:             # <<<<<<<<<<<<<<
 *                 self._quoted[field] = True
 *             self[field] = value.replace('"', '')
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_value, __pyx_n_s__count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {

      /* "pybedtools/cbedtools.pyx":137
 *         for field, value in [kv.split(self.field_sep, 1) for kv in kvs if kv]:
 *             if value.count('"') == 2:
 *                 self._quoted[field] = True             # <<<<<<<<<<<<<<
 *             self[field] = value.replace('"', '')
 * 
 */
      __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(((PyObject *)__pyx_v_self->_quoted) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (PyDict_SetItem(((PyObject *)__pyx_v_self->_quoted), __pyx_v_field, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "pybedtools/cbedtools.pyx":138
 *             if value.count('"') == 2:
 *                 self._quoted[field] = True
 *             self[field] = value.replace('"', '')             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, key, value):
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_value, __pyx_n_s__replace); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_field, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pybedtools.cbedtools.Attributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n_semi);
  __Pyx_XDECREF(__pyx_v_n_eq);
  __Pyx_XDECREF(__pyx_v_n_quotes);
  __Pyx_XDECREF(__pyx_v_kvs);
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_kv);
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10pybedtools_9cbedtools_10Attributes_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_10Attributes_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_10Attributes_2__setitem__(((struct __pyx_obj_10pybedtools_9cbedtools_Attributes *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":140
 *             self[field] = value.replace('"', '')
 * 
 *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
 *         dict.__setitem__(self, key, value)
 * 
 */

static int __pyx_pf_10pybedtools_9cbedtools_10Attributes_2__setitem__(struct __pyx_obj_10pybedtools_9cbedtools_Attributes *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_TraceCall("__setitem__", __pyx_f[0], 140);

  /* "pybedtools/cbedtools.pyx":141
 * 
 *     def __setitem__(self, key, value):
 *         dict.__setitem__(self, key, value)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_n_s____setitem__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  __Pyx_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pybedtools.cbedtools.Attributes.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_10Attributes_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_10Attributes_5__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_10Attributes_4__str__(((struct __pyx_obj_10pybedtools_9cbedtools_Attributes *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":143
 *         dict.__setitem__(self, key, value)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         # stringify all items first
 *         items = []
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_10Attributes_4__str__(struct __pyx_obj_10pybedtools_9cbedtools_Attributes *__pyx_v_self) {
  PyObject *__pyx_v_items = NULL;
  PyObject *__pyx_v_field = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_v_kvs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__str__", 0);
  __Pyx_TraceCall("__str__", __pyx_f[0], 143);

  /* "pybedtools/cbedtools.pyx":145
 *     def __str__(self):
 *         # stringify all items first
 *         items = []             # <<<<<<<<<<<<<<
 *         for field, val in dict.iteritems(self):
 *             try:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_items = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":146
 *         # stringify all items first
 *         items = []
 *         for field, val in dict.iteritems(self):             # <<<<<<<<<<<<<<
 *             try:
 *                 if self._quoted[field]:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_n_s__iteritems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); 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_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_field);
    __pyx_v_field = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "pybedtools/cbedtools.pyx":147
 *         items = []
 *         for field, val in dict.iteritems(self):
 *             try:             # <<<<<<<<<<<<<<
 *                 if self._quoted[field]:
 *                     val = '"' + str(val) + '"'
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      /*try:*/ {

        /* "pybedtools/cbedtools.pyx":148
 *         for field, val in dict.iteritems(self):
 *             try:
 *                 if self._quoted[field]:             # <<<<<<<<<<<<<<
 *                     val = '"' + str(val) + '"'
 *             except KeyError:
 */
        if (unlikely(((PyObject *)__pyx_v_self->_quoted) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_self->_quoted), __pyx_v_field); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_12) {

          /* "pybedtools/cbedtools.pyx":149
 *             try:
 *                 if self._quoted[field]:
 *                     val = '"' + str(val) + '"'             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 pass
 */
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_v_val);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val);
          __Pyx_GIVEREF(__pyx_v_val);
          __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_6), __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_v_val);
          __pyx_v_val = __pyx_t_6;
          __pyx_t_6 = 0;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pybedtools/cbedtools.pyx":150
 *                 if self._quoted[field]:
 *                     val = '"' + str(val) + '"'
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 pass
 *             items.append((field, val))
 */
      __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_13) {
        PyErr_Restore(0,0,0);
        goto __pyx_L8_exception_handled;
      }
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      goto __pyx_L1_error;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_L14_try_end:;
    }

    /* "pybedtools/cbedtools.pyx":152
 *             except KeyError:
 *                 pass
 *             items.append((field, val))             # <<<<<<<<<<<<<<
 *         return self.sep.join([self.field_sep.join(kvs) for kvs in items])
 * 
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_field);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_field);
    __Pyx_GIVEREF(__pyx_v_field);
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_14 = PyList_Append(__pyx_v_items, ((PyObject *)__pyx_t_6)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":153
 *                 pass
 *             items.append((field, val))
 *         return self.sep.join([self.field_sep.join(kvs) for kvs in items])             # <<<<<<<<<<<<<<
 * 
 * cdef class Interval:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self->sep), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = ((PyObject *)__pyx_v_items); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF(__pyx_v_kvs);
    __pyx_v_kvs = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->field_sep), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_kvs);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_kvs);
    __Pyx_GIVEREF(__pyx_v_kvs);
    __pyx_t_15 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    if (unlikely(__Pyx_PyList_Append(__pyx_t_6, (PyObject*)__pyx_t_15))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("pybedtools.cbedtools.Attributes.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_kvs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_end = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_score = 0;
  PyObject *__pyx_v_strand = 0;
  PyObject *__pyx_v_otherfields = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__chrom,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__name,&__pyx_n_s__score,&__pyx_n_s__strand,&__pyx_n_s__otherfields,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_kp_s_11);
    values[4] = ((PyObject *)__pyx_kp_s_11);
    values[5] = ((PyObject *)__pyx_kp_s_11);

    /* "pybedtools/cbedtools.pyx":198
 * 
 *     """
 *     def __init__(self, chrom, start, end, name=".", score=".", strand=".", otherfields=None):             # <<<<<<<<<<<<<<
 *         if otherfields is None:
 *             otherfields = []
 */
    values[6] = ((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  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__chrom)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__score);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__strand);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__otherfields);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_chrom = values[0];
    __pyx_v_start = values[1];
    __pyx_v_end = values[2];
    __pyx_v_name = values[3];
    __pyx_v_score = values[4];
    __pyx_v_strand = values[5];
    __pyx_v_otherfields = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval___init__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_name, __pyx_v_score, __pyx_v_strand, __pyx_v_otherfields);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10pybedtools_9cbedtools_8Interval___init__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_name, PyObject *__pyx_v_score, PyObject *__pyx_v_strand, PyObject *__pyx_v_otherfields) {
  PyObject *__pyx_v_fields = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  char *__pyx_t_3;
  CHRPOS __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_TraceCall("__init__", __pyx_f[0], 198);
  __Pyx_INCREF(__pyx_v_otherfields);

  /* "pybedtools/cbedtools.pyx":199
 *     """
 *     def __init__(self, chrom, start, end, name=".", score=".", strand=".", otherfields=None):
 *         if otherfields is None:             # <<<<<<<<<<<<<<
 *             otherfields = []
 *         self._bed = new BED()
 */
  __pyx_t_1 = (__pyx_v_otherfields == Py_None);
  if (__pyx_t_1) {

    /* "pybedtools/cbedtools.pyx":200
 *     def __init__(self, chrom, start, end, name=".", score=".", strand=".", otherfields=None):
 *         if otherfields is None:
 *             otherfields = []             # <<<<<<<<<<<<<<
 *         self._bed = new BED()
 *         self._bed.chrom = string(chrom)
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_otherfields);
    __pyx_v_otherfields = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":201
 *         if otherfields is None:
 *             otherfields = []
 *         self._bed = new BED()             # <<<<<<<<<<<<<<
 *         self._bed.chrom = string(chrom)
 *         self._bed.start = start
 */
  __pyx_v_self->_bed = new BED();

  /* "pybedtools/cbedtools.pyx":202
 *             otherfields = []
 *         self._bed = new BED()
 *         self._bed.chrom = string(chrom)             # <<<<<<<<<<<<<<
 *         self._bed.start = start
 *         self._bed.end = end
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_chrom); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_bed->chrom = std::string(__pyx_t_3);

  /* "pybedtools/cbedtools.pyx":203
 *         self._bed = new BED()
 *         self._bed.chrom = string(chrom)
 *         self._bed.start = start             # <<<<<<<<<<<<<<
 *         self._bed.end = end
 *         self._bed.name = string(name)
 */
  __pyx_t_4 = __Pyx_PyInt_from_py_CHRPOS(__pyx_v_start); if (unlikely((__pyx_t_4 == (CHRPOS)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_bed->start = __pyx_t_4;

  /* "pybedtools/cbedtools.pyx":204
 *         self._bed.chrom = string(chrom)
 *         self._bed.start = start
 *         self._bed.end = end             # <<<<<<<<<<<<<<
 *         self._bed.name = string(name)
 *         self._bed.score = string(score)
 */
  __pyx_t_4 = __Pyx_PyInt_from_py_CHRPOS(__pyx_v_end); if (unlikely((__pyx_t_4 == (CHRPOS)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_bed->end = __pyx_t_4;

  /* "pybedtools/cbedtools.pyx":205
 *         self._bed.start = start
 *         self._bed.end = end
 *         self._bed.name = string(name)             # <<<<<<<<<<<<<<
 *         self._bed.score = string(score)
 *         self._bed.strand = string(strand)
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_bed->name = std::string(__pyx_t_3);

  /* "pybedtools/cbedtools.pyx":206
 *         self._bed.end = end
 *         self._bed.name = string(name)
 *         self._bed.score = string(score)             # <<<<<<<<<<<<<<
 *         self._bed.strand = string(strand)
 *         fields = [chrom, str(start), str(end), name, score, strand]
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_score); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_bed->score = std::string(__pyx_t_3);

  /* "pybedtools/cbedtools.pyx":207
 *         self._bed.name = string(name)
 *         self._bed.score = string(score)
 *         self._bed.strand = string(strand)             # <<<<<<<<<<<<<<
 *         fields = [chrom, str(start), str(end), name, score, strand]
 *         fields.extend(otherfields)
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_strand); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_bed->strand = std::string(__pyx_t_3);

  /* "pybedtools/cbedtools.pyx":208
 *         self._bed.score = string(score)
 *         self._bed.strand = string(strand)
 *         fields = [chrom, str(start), str(end), name, score, strand]             # <<<<<<<<<<<<<<
 *         fields.extend(otherfields)
 *         self._bed.fields = list_to_vector(fields)
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_start);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_start);
  __Pyx_GIVEREF(__pyx_v_start);
  __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_end);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_end);
  __Pyx_GIVEREF(__pyx_v_end);
  __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_chrom);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
  __Pyx_GIVEREF(__pyx_v_chrom);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_name);
  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_INCREF(__pyx_v_score);
  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_v_score);
  __Pyx_GIVEREF(__pyx_v_score);
  __Pyx_INCREF(__pyx_v_strand);
  PyList_SET_ITEM(__pyx_t_2, 5, __pyx_v_strand);
  __Pyx_GIVEREF(__pyx_v_strand);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_v_fields = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":209
 *         self._bed.strand = string(strand)
 *         fields = [chrom, str(start), str(end), name, score, strand]
 *         fields.extend(otherfields)             # <<<<<<<<<<<<<<
 *         self._bed.fields = list_to_vector(fields)
 *         self._attrs = None
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_fields), __pyx_n_s__extend); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_otherfields);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_otherfields);
  __Pyx_GIVEREF(__pyx_v_otherfields);
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pybedtools/cbedtools.pyx":210
 *         fields = [chrom, str(start), str(end), name, score, strand]
 *         fields.extend(otherfields)
 *         self._bed.fields = list_to_vector(fields)             # <<<<<<<<<<<<<<
 *         self._attrs = None
 * 
 */
  __pyx_v_self->_bed->fields = __pyx_f_10pybedtools_9cbedtools_list_to_vector(__pyx_v_fields);

  /* "pybedtools/cbedtools.pyx":211
 *         fields.extend(otherfields)
 *         self._bed.fields = list_to_vector(fields)
 *         self._attrs = None             # <<<<<<<<<<<<<<
 * 
 *     def __copy__(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_attrs);
  __Pyx_DECREF(__pyx_v_self->_attrs);
  __pyx_v_self->_attrs = Py_None;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_otherfields);
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_3__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_3__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_2__copy__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":213
 *         self._attrs = None
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<<
 *         return create_interval_from_list(self.fields)
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_2__copy__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__copy__", 0);
  __Pyx_TraceCall("__copy__", __pyx_f[0], 213);

  /* "pybedtools/cbedtools.pyx":214
 * 
 *     def __copy__(self):
 *         return create_interval_from_list(self.fields)             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fields); 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);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyObject *)__pyx_f_10pybedtools_9cbedtools_create_interval_from_list(((PyObject*)__pyx_t_1), 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.__copy__", __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 Py_hash_t __pyx_pw_10pybedtools_9cbedtools_8Interval_5__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_10pybedtools_9cbedtools_8Interval_5__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_4__hash__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":216
 *         return create_interval_from_list(self.fields)
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash("\t".join(self.fields))
 * 
 */

static Py_hash_t __pyx_pf_10pybedtools_9cbedtools_8Interval_4__hash__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__hash__", 0);
  __Pyx_TraceCall("__hash__", __pyx_f[0], 216);

  /* "pybedtools/cbedtools.pyx":217
 * 
 *     def __hash__(self):
 *         return hash("\t".join(self.fields))             # <<<<<<<<<<<<<<
 * 
 *     property chrom:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_12), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_5chrom_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_5chrom_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_5chrom___get__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":221
 *     property chrom:
 *         """ the chromosome of the feature"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._bed.chrom.c_str()
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_5chrom___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 221);

  /* "pybedtools/cbedtools.pyx":222
 *         """ the chromosome of the feature"""
 *         def __get__(self):
 *             return self._bed.chrom.c_str()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, char* chrom):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_self->_bed->chrom.c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.chrom.__get__", __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 int __pyx_pw_10pybedtools_9cbedtools_8Interval_5chrom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_chrom); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_5chrom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_chrom) {
  char *__pyx_v_chrom;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_chrom); {
    __pyx_v_chrom = PyBytes_AsString(__pyx_arg_chrom); if (unlikely((!__pyx_v_chrom) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.chrom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_5chrom_2__set__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((char *)__pyx_v_chrom));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":224
 *             return self._bed.chrom.c_str()
 * 
 *         def __set__(self, char* chrom):             # <<<<<<<<<<<<<<
 *             self._bed.chrom = string(chrom)
 *             idx = LOOKUPS[self.file_type]["chrom"]
 */

static int __pyx_pf_10pybedtools_9cbedtools_8Interval_5chrom_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, char *__pyx_v_chrom) {
  PyObject *__pyx_v_idx = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 224);

  /* "pybedtools/cbedtools.pyx":225
 * 
 *         def __set__(self, char* chrom):
 *             self._bed.chrom = string(chrom)             # <<<<<<<<<<<<<<
 *             idx = LOOKUPS[self.file_type]["chrom"]
 *             self._bed.fields[idx] = string(chrom)
 */
  __pyx_v_self->_bed->chrom = std::string(__pyx_v_chrom);

  /* "pybedtools/cbedtools.pyx":226
 *         def __set__(self, char* chrom):
 *             self._bed.chrom = string(chrom)
 *             idx = LOOKUPS[self.file_type]["chrom"]             # <<<<<<<<<<<<<<
 *             self._bed.fields[idx] = string(chrom)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__file_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS), __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__chrom)); if (!__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_2); __pyx_t_2 = 0;
  __pyx_v_idx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":227
 *             self._bed.chrom = string(chrom)
 *             idx = LOOKUPS[self.file_type]["chrom"]
 *             self._bed.fields[idx] = string(chrom)             # <<<<<<<<<<<<<<
 * 
 *     # < 0 | <= 1 | == 2 | != 3 |  > 4 | >= 5
 */
  __pyx_t_3 = __Pyx_PyInt_AsSize_t(__pyx_v_idx); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  (__pyx_v_self->_bed->fields[__pyx_t_3]) = std::string(__pyx_v_chrom);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.chrom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_6__richcmp__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":230
 * 
 *     # < 0 | <= 1 | == 2 | != 3 |  > 4 | >= 5
 *     def __richcmp__(self, other, int op):             # <<<<<<<<<<<<<<
 * 
 *         if (self.chrom != other.chrom) or (self.strand != other.strand):
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_6__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_v_profile = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__richcmp__", 0);
  __Pyx_TraceCall("__richcmp__", __pyx_f[0], 230);

  /* "pybedtools/cbedtools.pyx":232
 *     def __richcmp__(self, other, int op):
 * 
 *         if (self.chrom != other.chrom) or (self.strand != other.strand):             # <<<<<<<<<<<<<<
 *             if op == 3: return True
 *             return False
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__chrom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__chrom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!__pyx_t_4) {
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__strand); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__strand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (__pyx_t_6) {

    /* "pybedtools/cbedtools.pyx":233
 * 
 *         if (self.chrom != other.chrom) or (self.strand != other.strand):
 *             if op == 3: return True             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_6 = (__pyx_v_op == 3);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "pybedtools/cbedtools.pyx":234
 *         if (self.chrom != other.chrom) or (self.strand != other.strand):
 *             if op == 3: return True
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         # check all 4 so that we can handle nesting and partial overlaps.
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":237
 * 
 *         # check all 4 so that we can handle nesting and partial overlaps.
 *         profile = (cmp(self.start, other.start),             # <<<<<<<<<<<<<<
 *                    cmp(self.stop, other.stop),
 *                    cmp(self.start, other.stop),
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "pybedtools/cbedtools.pyx":238
 *         # check all 4 so that we can handle nesting and partial overlaps.
 *         profile = (cmp(self.start, other.start),
 *                    cmp(self.stop, other.stop),             # <<<<<<<<<<<<<<
 *                    cmp(self.start, other.stop),
 *                    cmp(self.stop, other.start))
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__stop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__stop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;

  /* "pybedtools/cbedtools.pyx":239
 *         profile = (cmp(self.start, other.start),
 *                    cmp(self.stop, other.stop),
 *                    cmp(self.start, other.stop),             # <<<<<<<<<<<<<<
 *                    cmp(self.stop, other.start))
 * 
 */
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__start); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__stop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_7 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

  /* "pybedtools/cbedtools.pyx":240
 *                    cmp(self.stop, other.stop),
 *                    cmp(self.start, other.stop),
 *                    cmp(self.stop, other.start))             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__stop); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__start); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_8 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
  __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_v_profile = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pybedtools/cbedtools.pyx":242
 *                    cmp(self.stop, other.start))
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if PROFILES_TRUE[profile] == tuple():
 *                 raise NotImplementedError('Features are nested -- comparison undefined')
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_12);
    /*try:*/ {

      /* "pybedtools/cbedtools.pyx":243
 * 
 *         try:
 *             if PROFILES_TRUE[profile] == tuple():             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError('Features are nested -- comparison undefined')
 * 
 */
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__PROFILES_TRUE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = PyObject_GetItem(__pyx_t_9, ((PyObject *)__pyx_v_profile)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {

        /* "pybedtools/cbedtools.pyx":244
 *         try:
 *             if PROFILES_TRUE[profile] == tuple():
 *                 raise NotImplementedError('Features are nested -- comparison undefined')             # <<<<<<<<<<<<<<
 * 
 *             if op != 3:
 */
        __pyx_t_3 = PyObject_Call(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        goto __pyx_L13;
      }
      __pyx_L13:;

      /* "pybedtools/cbedtools.pyx":246
 *                 raise NotImplementedError('Features are nested -- comparison undefined')
 * 
 *             if op != 3:             # <<<<<<<<<<<<<<
 *                 if op in PROFILES_TRUE[profile]:
 *                     return True
 */
      __pyx_t_6 = (__pyx_v_op != 3);
      if (__pyx_t_6) {

        /* "pybedtools/cbedtools.pyx":247
 * 
 *             if op != 3:
 *                 if op in PROFILES_TRUE[profile]:             # <<<<<<<<<<<<<<
 *                     return True
 *                 return False
 */
        __pyx_t_3 = PyInt_FromLong(__pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__PROFILES_TRUE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_7 = PyObject_GetItem(__pyx_t_9, ((PyObject *)__pyx_v_profile)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_6 = (__Pyx_PySequence_Contains(__pyx_t_3, __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__pyx_t_6) {

          /* "pybedtools/cbedtools.pyx":248
 *             if op != 3:
 *                 if op in PROFILES_TRUE[profile]:
 *                     return True             # <<<<<<<<<<<<<<
 *                 return False
 *             else:
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_r = __pyx_t_7;
          __pyx_t_7 = 0;
          goto __pyx_L9_try_return;
          goto __pyx_L15;
        }
        __pyx_L15:;

        /* "pybedtools/cbedtools.pyx":249
 *                 if op in PROFILES_TRUE[profile]:
 *                     return True
 *                 return False             # <<<<<<<<<<<<<<
 *             else:
 *                 if 2 in PROFILES_TRUE[profile]:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L9_try_return;
        goto __pyx_L14;
      }
      /*else*/ {

        /* "pybedtools/cbedtools.pyx":251
 *                 return False
 *             else:
 *                 if 2 in PROFILES_TRUE[profile]:             # <<<<<<<<<<<<<<
 *                     return False
 *                 return True
 */
        __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__PROFILES_TRUE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = PyObject_GetItem(__pyx_t_7, ((PyObject *)__pyx_v_profile)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_6 = (__Pyx_PySequence_Contains(__pyx_int_2, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_6) {

          /* "pybedtools/cbedtools.pyx":252
 *             else:
 *                 if 2 in PROFILES_TRUE[profile]:
 *                     return False             # <<<<<<<<<<<<<<
 *                 return True
 *         except KeyError:
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_r = __pyx_t_3;
          __pyx_t_3 = 0;
          goto __pyx_L9_try_return;
          goto __pyx_L16;
        }
        __pyx_L16:;

        /* "pybedtools/cbedtools.pyx":253
 *                 if 2 in PROFILES_TRUE[profile]:
 *                     return False
 *                 return True             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             raise ValueError('Currently unsupported comparison -- please '
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L9_try_return;
      }
      __pyx_L14:;
    }
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L12_try_end;
    __pyx_L9_try_return:;
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_12);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
    goto __pyx_L0;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pybedtools/cbedtools.pyx":254
 *                     return False
 *                 return True
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             raise ValueError('Currently unsupported comparison -- please '
 *                              'submit a bug report')
 */
    __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_13) {
      __Pyx_AddTraceback("pybedtools.cbedtools.Interval.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_7, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_9);

      /* "pybedtools/cbedtools.pyx":255
 *                 return True
 *         except KeyError:
 *             raise ValueError('Currently unsupported comparison -- please '             # <<<<<<<<<<<<<<
 *                              'submit a bug report')
 * 
 */
      __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_12);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_12);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
    __pyx_L12_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_profile);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_5start_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_5start_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_5start___get__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":260
 *     property start:
 *         """The 0-based start of the feature."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._bed.start
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_5start___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 260);

  /* "pybedtools/cbedtools.pyx":261
 *         """The 0-based start of the feature."""
 *         def __get__(self):
 *             return self._bed.start             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, int start):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_CHRPOS(__pyx_v_self->_bed->start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.start.__get__", __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 int __pyx_pw_10pybedtools_9cbedtools_8Interval_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_start); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_start) {
  int __pyx_v_start;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_start); {
    __pyx_v_start = __Pyx_PyInt_AsInt(__pyx_arg_start); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_5start_2__set__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((int)__pyx_v_start));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":263
 *             return self._bed.start
 * 
 *         def __set__(self, int start):             # <<<<<<<<<<<<<<
 *             self._bed.start = start
 *             idx = LOOKUPS[self.file_type]["start"]
 */

static int __pyx_pf_10pybedtools_9cbedtools_8Interval_5start_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, int __pyx_v_start) {
  PyObject *__pyx_v_idx = NULL;
  PyObject *__pyx_v_s = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  char *__pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 263);

  /* "pybedtools/cbedtools.pyx":264
 * 
 *         def __set__(self, int start):
 *             self._bed.start = start             # <<<<<<<<<<<<<<
 *             idx = LOOKUPS[self.file_type]["start"]
 * 
 */
  __pyx_v_self->_bed->start = __pyx_v_start;

  /* "pybedtools/cbedtools.pyx":265
 *         def __set__(self, int start):
 *             self._bed.start = start
 *             idx = LOOKUPS[self.file_type]["start"]             # <<<<<<<<<<<<<<
 * 
 *             # Non-BED files should have 1-based coords in fields
 */
  if (unlikely(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__file_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS), __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__start)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_idx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":268
 * 
 *             # Non-BED files should have 1-based coords in fields
 *             if self.file_type != 'bed':             # <<<<<<<<<<<<<<
 *                 start += 1
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__file_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__bed), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pybedtools/cbedtools.pyx":269
 *             # Non-BED files should have 1-based coords in fields
 *             if self.file_type != 'bed':
 *                 start += 1             # <<<<<<<<<<<<<<
 * 
 *             s = str(start)
 */
    __pyx_v_start = (__pyx_v_start + 1);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":271
 *                 start += 1
 * 
 *             s = str(start)             # <<<<<<<<<<<<<<
 *             self._bed.fields[idx] = string(s)
 * 
 */
  __pyx_t_2 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_s = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":272
 * 
 *             s = str(start)
 *             self._bed.fields[idx] = string(s)             # <<<<<<<<<<<<<<
 * 
 *     property end:
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_s); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  (__pyx_v_self->_bed->fields[__pyx_t_5]) = std::string(__pyx_t_4);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_3end_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_3end_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_3end___get__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":276
 *     property end:
 *         """The end of the feature"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._bed.end
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_3end___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 276);

  /* "pybedtools/cbedtools.pyx":277
 *         """The end of the feature"""
 *         def __get__(self):
 *             return self._bed.end             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, int end):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_CHRPOS(__pyx_v_self->_bed->end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.end.__get__", __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 int __pyx_pw_10pybedtools_9cbedtools_8Interval_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_end); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_end) {
  int __pyx_v_end;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_end); {
    __pyx_v_end = __Pyx_PyInt_AsInt(__pyx_arg_end); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.end.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_3end_2__set__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((int)__pyx_v_end));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":279
 *             return self._bed.end
 * 
 *         def __set__(self, int end):             # <<<<<<<<<<<<<<
 *             self._bed.end = end
 *             e = str(end)
 */

static int __pyx_pf_10pybedtools_9cbedtools_8Interval_3end_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, int __pyx_v_end) {
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_idx = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char *__pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 279);

  /* "pybedtools/cbedtools.pyx":280
 * 
 *         def __set__(self, int end):
 *             self._bed.end = end             # <<<<<<<<<<<<<<
 *             e = str(end)
 *             idx = LOOKUPS[self.file_type]["stop"]
 */
  __pyx_v_self->_bed->end = __pyx_v_end;

  /* "pybedtools/cbedtools.pyx":281
 *         def __set__(self, int end):
 *             self._bed.end = end
 *             e = str(end)             # <<<<<<<<<<<<<<
 *             idx = LOOKUPS[self.file_type]["stop"]
 *             self._bed.fields[idx] = string(e)
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_e = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":282
 *             self._bed.end = end
 *             e = str(end)
 *             idx = LOOKUPS[self.file_type]["stop"]             # <<<<<<<<<<<<<<
 *             self._bed.fields[idx] = string(e)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__file_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS), __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__stop)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_idx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":283
 *             e = str(end)
 *             idx = LOOKUPS[self.file_type]["stop"]
 *             self._bed.fields[idx] = string(e)             # <<<<<<<<<<<<<<
 * 
 *     property stop:
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_e); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyInt_AsSize_t(__pyx_v_idx); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  (__pyx_v_self->_bed->fields[__pyx_t_4]) = std::string(__pyx_t_3);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.end.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_4stop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_4stop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_4stop___get__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":287
 *     property stop:
 *         """ the end of the feature"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._bed.end
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_4stop___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 287);

  /* "pybedtools/cbedtools.pyx":288
 *         """ the end of the feature"""
 *         def __get__(self):
 *             return self._bed.end             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, int end):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_CHRPOS(__pyx_v_self->_bed->end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.stop.__get__", __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 int __pyx_pw_10pybedtools_9cbedtools_8Interval_4stop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_end); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_4stop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_end) {
  int __pyx_v_end;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_end); {
    __pyx_v_end = __Pyx_PyInt_AsInt(__pyx_arg_end); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.stop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_4stop_2__set__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((int)__pyx_v_end));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":290
 *             return self._bed.end
 * 
 *         def __set__(self, int end):             # <<<<<<<<<<<<<<
 *             idx = LOOKUPS[self.file_type]["stop"]
 *             e = str(end)
 */

static int __pyx_pf_10pybedtools_9cbedtools_8Interval_4stop_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, int __pyx_v_end) {
  PyObject *__pyx_v_idx = NULL;
  PyObject *__pyx_v_e = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char *__pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 290);

  /* "pybedtools/cbedtools.pyx":291
 * 
 *         def __set__(self, int end):
 *             idx = LOOKUPS[self.file_type]["stop"]             # <<<<<<<<<<<<<<
 *             e = str(end)
 *             self._bed.fields[idx] = string(e)
 */
  if (unlikely(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__file_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS), __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__stop)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_idx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":292
 *         def __set__(self, int end):
 *             idx = LOOKUPS[self.file_type]["stop"]
 *             e = str(end)             # <<<<<<<<<<<<<<
 *             self._bed.fields[idx] = string(e)
 *             self._bed.end = end
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_e = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":293
 *             idx = LOOKUPS[self.file_type]["stop"]
 *             e = str(end)
 *             self._bed.fields[idx] = string(e)             # <<<<<<<<<<<<<<
 *             self._bed.end = end
 * 
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_e); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyInt_AsSize_t(__pyx_v_idx); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  (__pyx_v_self->_bed->fields[__pyx_t_4]) = std::string(__pyx_t_3);

  /* "pybedtools/cbedtools.pyx":294
 *             e = str(end)
 *             self._bed.fields[idx] = string(e)
 *             self._bed.end = end             # <<<<<<<<<<<<<<
 * 
 *     property strand:
 */
  __pyx_v_self->_bed->end = __pyx_v_end;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.stop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_6strand_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_6strand_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_6strand___get__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":298
 *     property strand:
 *         """ the strand of the feature"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._bed.strand.c_str()
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_6strand___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 298);

  /* "pybedtools/cbedtools.pyx":299
 *         """ the strand of the feature"""
 *         def __get__(self):
 *             return self._bed.strand.c_str()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, strand):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_self->_bed->strand.c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.strand.__get__", __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 int __pyx_pw_10pybedtools_9cbedtools_8Interval_6strand_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_strand); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_6strand_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_strand) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_6strand_2__set__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((PyObject *)__pyx_v_strand));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":301
 *             return self._bed.strand.c_str()
 * 
 *         def __set__(self, strand):             # <<<<<<<<<<<<<<
 *             idx = LOOKUPS[self.file_type]["strand"]
 *             self._bed.fields[idx] = string(strand)
 */

static int __pyx_pf_10pybedtools_9cbedtools_8Interval_6strand_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_strand) {
  PyObject *__pyx_v_idx = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char *__pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 301);

  /* "pybedtools/cbedtools.pyx":302
 * 
 *         def __set__(self, strand):
 *             idx = LOOKUPS[self.file_type]["strand"]             # <<<<<<<<<<<<<<
 *             self._bed.fields[idx] = string(strand)
 *             self._bed.strand = string(strand)
 */
  if (unlikely(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__file_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS), __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__strand)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_idx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":303
 *         def __set__(self, strand):
 *             idx = LOOKUPS[self.file_type]["strand"]
 *             self._bed.fields[idx] = string(strand)             # <<<<<<<<<<<<<<
 *             self._bed.strand = string(strand)
 * 
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_strand); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyInt_AsSize_t(__pyx_v_idx); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  (__pyx_v_self->_bed->fields[__pyx_t_4]) = std::string(__pyx_t_3);

  /* "pybedtools/cbedtools.pyx":304
 *             idx = LOOKUPS[self.file_type]["strand"]
 *             self._bed.fields[idx] = string(strand)
 *             self._bed.strand = string(strand)             # <<<<<<<<<<<<<<
 * 
 *     property length:
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_strand); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_bed->strand = std::string(__pyx_t_3);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.strand.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_6length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_6length_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_6length___get__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":308
 *     property length:
 *         """ the length of the feature"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._bed.end - self._bed.start
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_6length___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 308);

  /* "pybedtools/cbedtools.pyx":309
 *         """ the length of the feature"""
 *         def __get__(self):
 *             return self._bed.end - self._bed.start             # <<<<<<<<<<<<<<
 * 
 *     cpdef deparse_attrs(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_CHRPOS((__pyx_v_self->_bed->end - __pyx_v_self->_bed->start)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":311
 *             return self._bed.end - self._bed.start
 * 
 *     cpdef deparse_attrs(self):             # <<<<<<<<<<<<<<
 * 
 *         if self._attrs is None: return
 */

static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_9deparse_attrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10pybedtools_9cbedtools_8Interval_deparse_attrs(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, int __pyx_skip_dispatch) {
  char *__pyx_v_cstr;
  PyObject *__pyx_v_tmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("deparse_attrs", 0);
  __Pyx_TraceCall("deparse_attrs", __pyx_f[0], 311);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__deparse_attrs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_8Interval_9deparse_attrs)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pybedtools/cbedtools.pyx":313
 *     cpdef deparse_attrs(self):
 * 
 *         if self._attrs is None: return             # <<<<<<<<<<<<<<
 * 
 *         if self.file_type != "gff":
 */
  __pyx_t_3 = (__pyx_v_self->_attrs == Py_None);
  if (__pyx_t_3) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":315
 *         if self._attrs is None: return
 * 
 *         if self.file_type != "gff":             # <<<<<<<<<<<<<<
 *             raise ValueError('Interval.attrs was not None, but this was a non-GFF Interval')
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__file_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__gff), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pybedtools/cbedtools.pyx":316
 * 
 *         if self.file_type != "gff":
 *             raise ValueError('Interval.attrs was not None, but this was a non-GFF Interval')             # <<<<<<<<<<<<<<
 * 
 *         cdef char *cstr
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pybedtools/cbedtools.pyx":319
 * 
 *         cdef char *cstr
 *         tmp = self._attrs.__str__()             # <<<<<<<<<<<<<<
 *         cstr = tmp
 *         self._bed.fields[8] = string(cstr)
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->_attrs, __pyx_n_s____str__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tmp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":320
 *         cdef char *cstr
 *         tmp = self._attrs.__str__()
 *         cstr = tmp             # <<<<<<<<<<<<<<
 *         self._bed.fields[8] = string(cstr)
 * 
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_tmp); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_cstr = __pyx_t_4;

  /* "pybedtools/cbedtools.pyx":321
 *         tmp = self._attrs.__str__()
 *         cstr = tmp
 *         self._bed.fields[8] = string(cstr)             # <<<<<<<<<<<<<<
 * 
 *     property fields:
 */
  (__pyx_v_self->_bed->fields[8]) = std::string(__pyx_v_cstr);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.deparse_attrs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_9deparse_attrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_9deparse_attrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deparse_attrs (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_8deparse_attrs(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":311
 *             return self._bed.end - self._bed.start
 * 
 *     cpdef deparse_attrs(self):             # <<<<<<<<<<<<<<
 * 
 *         if self._attrs is None: return
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_8deparse_attrs(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("deparse_attrs", 0);
  __Pyx_TraceCall("deparse_attrs", __pyx_f[0], 311);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_10pybedtools_9cbedtools_Interval *)__pyx_v_self->__pyx_vtab)->deparse_attrs(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.deparse_attrs", __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_10pybedtools_9cbedtools_8Interval_6fields_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_6fields_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_6fields___get__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":324
 * 
 *     property fields:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             self.deparse_attrs()
 *             return string_vec2list(self._bed.fields)
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_6fields___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 324);

  /* "pybedtools/cbedtools.pyx":325
 *     property fields:
 *         def __get__(self):
 *             self.deparse_attrs()             # <<<<<<<<<<<<<<
 *             return string_vec2list(self._bed.fields)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10pybedtools_9cbedtools_Interval *)__pyx_v_self->__pyx_vtab)->deparse_attrs(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":326
 *         def __get__(self):
 *             self.deparse_attrs()
 *             return string_vec2list(self._bed.fields)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10pybedtools_9cbedtools_string_vec2list(__pyx_v_self->_bed->fields)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.fields.__get__", __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_10pybedtools_9cbedtools_8Interval_5attrs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_5attrs_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_5attrs___get__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":330
 * 
 *     property attrs:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef string ftype = self._bed.file_type
 *             if self._attrs is None:
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_5attrs___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  std::string __pyx_v_ftype;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 330);

  /* "pybedtools/cbedtools.pyx":331
 *     property attrs:
 *         def __get__(self):
 *             cdef string ftype = self._bed.file_type             # <<<<<<<<<<<<<<
 *             if self._attrs is None:
 *                 if ftype == <char *>"gff":
 */
  __pyx_t_1 = __pyx_v_self->_bed->file_type;
  __pyx_v_ftype = __pyx_t_1;

  /* "pybedtools/cbedtools.pyx":332
 *         def __get__(self):
 *             cdef string ftype = self._bed.file_type
 *             if self._attrs is None:             # <<<<<<<<<<<<<<
 *                 if ftype == <char *>"gff":
 *                     self._attrs = Attributes(self._bed.fields[8].c_str())
 */
  __pyx_t_2 = (__pyx_v_self->_attrs == Py_None);
  if (__pyx_t_2) {

    /* "pybedtools/cbedtools.pyx":333
 *             cdef string ftype = self._bed.file_type
 *             if self._attrs is None:
 *                 if ftype == <char *>"gff":             # <<<<<<<<<<<<<<
 *                     self._attrs = Attributes(self._bed.fields[8].c_str())
 *                 else:
 */
    __pyx_t_2 = (__pyx_v_ftype == ((char *)__pyx_k__gff));
    if (__pyx_t_2) {

      /* "pybedtools/cbedtools.pyx":334
 *             if self._attrs is None:
 *                 if ftype == <char *>"gff":
 *                     self._attrs = Attributes(self._bed.fields[8].c_str())             # <<<<<<<<<<<<<<
 *                 else:
 *                     self._attrs = Attributes("")
 */
      __pyx_t_3 = PyBytes_FromString((__pyx_v_self->_bed->fields[8]).c_str()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_10pybedtools_9cbedtools_Attributes)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_attrs);
      __Pyx_DECREF(__pyx_v_self->_attrs);
      __pyx_v_self->_attrs = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "pybedtools/cbedtools.pyx":336
 *                     self._attrs = Attributes(self._bed.fields[8].c_str())
 *                 else:
 *                     self._attrs = Attributes("")             # <<<<<<<<<<<<<<
 *             return self._attrs
 * 
 */
      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_10pybedtools_9cbedtools_Attributes)), ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_attrs);
      __Pyx_DECREF(__pyx_v_self->_attrs);
      __pyx_v_self->_attrs = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":337
 *                 else:
 *                     self._attrs = Attributes("")
 *             return self._attrs             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, attrs):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_attrs);
  __pyx_r = __pyx_v_self->_attrs;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.attrs.__get__", __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 int __pyx_pw_10pybedtools_9cbedtools_8Interval_5attrs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_attrs); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_5attrs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_attrs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_5attrs_2__set__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((PyObject *)__pyx_v_attrs));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":339
 *             return self._attrs
 * 
 *         def __set__(self, attrs):             # <<<<<<<<<<<<<<
 *             self._attrs = attrs
 * 
 */

static int __pyx_pf_10pybedtools_9cbedtools_8Interval_5attrs_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_attrs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 339);

  /* "pybedtools/cbedtools.pyx":340
 * 
 *         def __set__(self, attrs):
 *             self._attrs = attrs             # <<<<<<<<<<<<<<
 * 
 *     # TODO: make this more robust.
 */
  __Pyx_INCREF(__pyx_v_attrs);
  __Pyx_GIVEREF(__pyx_v_attrs);
  __Pyx_GOTREF(__pyx_v_self->_attrs);
  __Pyx_DECREF(__pyx_v_self->_attrs);
  __pyx_v_self->_attrs = __pyx_v_attrs;

  __pyx_r = 0;
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_11count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_11count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("count (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_10count(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":344
 *     # TODO: make this more robust.
 *     @property
 *     def count(self):             # <<<<<<<<<<<<<<
 *         return int(self.fields[-1])
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_10count(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("count", 0);
  __Pyx_TraceCall("count", __pyx_f[0], 344);

  /* "pybedtools/cbedtools.pyx":345
 *     @property
 *     def count(self):
 *         return int(self.fields[-1])             # <<<<<<<<<<<<<<
 * 
 *     property name:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.count", __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_10pybedtools_9cbedtools_8Interval_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_4name___get__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":355
 * 
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef string ftype = self._bed.file_type
 *             if ftype == <char *>"gff":
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_4name___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  std::string __pyx_v_ftype;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 355);

  /* "pybedtools/cbedtools.pyx":356
 *         """
 *         def __get__(self):
 *             cdef string ftype = self._bed.file_type             # <<<<<<<<<<<<<<
 *             if ftype == <char *>"gff":
 *                 """
 */
  __pyx_t_1 = __pyx_v_self->_bed->file_type;
  __pyx_v_ftype = __pyx_t_1;

  /* "pybedtools/cbedtools.pyx":357
 *         def __get__(self):
 *             cdef string ftype = self._bed.file_type
 *             if ftype == <char *>"gff":             # <<<<<<<<<<<<<<
 *                 """
 *                 # TODO. allow setting a name_key in the BedTool constructor?
 */
  __pyx_t_2 = (__pyx_v_ftype == ((char *)__pyx_k__gff));
  if (__pyx_t_2) {

    /* "pybedtools/cbedtools.pyx":363
 *                     return attrs[self.name_key]
 *                 """
 *                 for key in ("ID", "Name", "gene_name", "transcript_id", \             # <<<<<<<<<<<<<<
 *                             "gene_id", "Parent"):
 *                     if key in self.attrs:
 */
    __pyx_t_3 = ((PyObject *)__pyx_k_tuple_20); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_XDECREF(__pyx_v_key);
      __pyx_v_key = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pybedtools/cbedtools.pyx":365
 *                 for key in ("ID", "Name", "gene_name", "transcript_id", \
 *                             "gene_id", "Parent"):
 *                     if key in self.attrs:             # <<<<<<<<<<<<<<
 *                         return self.attrs[key]
 * 
 */
      __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__attrs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_2) {

        /* "pybedtools/cbedtools.pyx":366
 *                             "gene_id", "Parent"):
 *                     if key in self.attrs:
 *                         return self.attrs[key]             # <<<<<<<<<<<<<<
 * 
 *             elif ftype == <char *>"vcf":
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__attrs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyObject_GetItem(__pyx_t_5, __pyx_v_key); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L0;
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "pybedtools/cbedtools.pyx":368
 *                         return self.attrs[key]
 * 
 *             elif ftype == <char *>"vcf":             # <<<<<<<<<<<<<<
 *                 s = self.fields[2]
 *                 if s in ("", "."):
 */
  __pyx_t_2 = (__pyx_v_ftype == ((char *)__pyx_k__vcf));
  if (__pyx_t_2) {

    /* "pybedtools/cbedtools.pyx":369
 * 
 *             elif ftype == <char *>"vcf":
 *                 s = self.fields[2]             # <<<<<<<<<<<<<<
 *                 if s in ("", "."):
 *                     return "%s:%i" % (self.chrom, self.start)
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fields); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_s = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "pybedtools/cbedtools.pyx":370
 *             elif ftype == <char *>"vcf":
 *                 s = self.fields[2]
 *                 if s in ("", "."):             # <<<<<<<<<<<<<<
 *                     return "%s:%i" % (self.chrom, self.start)
 *                 return s
 */
    __Pyx_INCREF(__pyx_v_s);
    __pyx_t_6 = __pyx_v_s;
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_kp_s_1), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!((int)__pyx_t_2)) {
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_kp_s_11), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = ((int)__pyx_t_7);
    } else {
      __pyx_t_8 = ((int)__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __pyx_t_8;
    if (__pyx_t_2) {

      /* "pybedtools/cbedtools.pyx":371
 *                 s = self.fields[2]
 *                 if s in ("", "."):
 *                     return "%s:%i" % (self.chrom, self.start)             # <<<<<<<<<<<<<<
 *                 return s
 *             elif ftype == <char *>"bed":
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__chrom); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_6 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_r = ((PyObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "pybedtools/cbedtools.pyx":372
 *                 if s in ("", "."):
 *                     return "%s:%i" % (self.chrom, self.start)
 *                 return s             # <<<<<<<<<<<<<<
 *             elif ftype == <char *>"bed":
 *                 return self._bed.name.c_str()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_s);
    __pyx_r = __pyx_v_s;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pybedtools/cbedtools.pyx":373
 *                     return "%s:%i" % (self.chrom, self.start)
 *                 return s
 *             elif ftype == <char *>"bed":             # <<<<<<<<<<<<<<
 *                 return self._bed.name.c_str()
 * 
 */
  __pyx_t_2 = (__pyx_v_ftype == ((char *)__pyx_k__bed));
  if (__pyx_t_2) {

    /* "pybedtools/cbedtools.pyx":374
 *                 return s
 *             elif ftype == <char *>"bed":
 *                 return self._bed.name.c_str()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_self->_bed->name.c_str()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_r = ((PyObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_4name_2__set__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":376
 *                 return self._bed.name.c_str()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef string ftype = self._bed.file_type
 *             if ftype == <char *>"gff":
 */

static int __pyx_pf_10pybedtools_9cbedtools_8Interval_4name_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_value) {
  std::string __pyx_v_ftype;
  PyObject *__pyx_v_key = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 376);

  /* "pybedtools/cbedtools.pyx":377
 * 
 *         def __set__(self, value):
 *             cdef string ftype = self._bed.file_type             # <<<<<<<<<<<<<<
 *             if ftype == <char *>"gff":
 *                 for key in ("ID", "Name", "gene_name", "transcript_id", \
 */
  __pyx_t_1 = __pyx_v_self->_bed->file_type;
  __pyx_v_ftype = __pyx_t_1;

  /* "pybedtools/cbedtools.pyx":378
 *         def __set__(self, value):
 *             cdef string ftype = self._bed.file_type
 *             if ftype == <char *>"gff":             # <<<<<<<<<<<<<<
 *                 for key in ("ID", "Name", "gene_name", "transcript_id", \
 *                             "gene_id", "Parent"):
 */
  __pyx_t_2 = (__pyx_v_ftype == ((char *)__pyx_k__gff));
  if (__pyx_t_2) {

    /* "pybedtools/cbedtools.pyx":379
 *             cdef string ftype = self._bed.file_type
 *             if ftype == <char *>"gff":
 *                 for key in ("ID", "Name", "gene_name", "transcript_id", \             # <<<<<<<<<<<<<<
 *                             "gene_id", "Parent"):
 *                     if not key in self.attrs:
 */
    __pyx_t_3 = ((PyObject *)__pyx_k_tuple_22); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_XDECREF(__pyx_v_key);
      __pyx_v_key = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pybedtools/cbedtools.pyx":381
 *                 for key in ("ID", "Name", "gene_name", "transcript_id", \
 *                             "gene_id", "Parent"):
 *                     if not key in self.attrs:             # <<<<<<<<<<<<<<
 *                         continue
 * 
 */
      __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__attrs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = (!__pyx_t_2);
      if (__pyx_t_6) {

        /* "pybedtools/cbedtools.pyx":382
 *                             "gene_id", "Parent"):
 *                     if not key in self.attrs:
 *                         continue             # <<<<<<<<<<<<<<
 * 
 *                     self.attrs[key] = value
 */
        goto __pyx_L4_continue;
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "pybedtools/cbedtools.pyx":384
 *                         continue
 * 
 *                     self.attrs[key] = value             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__attrs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (PyObject_SetItem(__pyx_t_5, __pyx_v_key, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pybedtools/cbedtools.pyx":385
 * 
 *                     self.attrs[key] = value
 *                     break             # <<<<<<<<<<<<<<
 * 
 *             elif ftype == <char *>"vcf":
 */
      goto __pyx_L5_break;
      __pyx_L4_continue:;
    }
    __pyx_L5_break:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "pybedtools/cbedtools.pyx":387
 *                     break
 * 
 *             elif ftype == <char *>"vcf":             # <<<<<<<<<<<<<<
 *                 self._bed.fields[2] = string(value)
 *             else:
 */
  __pyx_t_6 = (__pyx_v_ftype == ((char *)__pyx_k__vcf));
  if (__pyx_t_6) {

    /* "pybedtools/cbedtools.pyx":388
 * 
 *             elif ftype == <char *>"vcf":
 *                 self._bed.fields[2] = string(value)             # <<<<<<<<<<<<<<
 *             else:
 *                 self._bed.name = string(value)
 */
    __pyx_t_7 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (__pyx_v_self->_bed->fields[2]) = std::string(__pyx_t_7);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pybedtools/cbedtools.pyx":390
 *                 self._bed.fields[2] = string(value)
 *             else:
 *                 self._bed.name = string(value)             # <<<<<<<<<<<<<<
 *                 self._bed.fields[3] = string(value)
 * 
 */
    __pyx_t_7 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->_bed->name = std::string(__pyx_t_7);

    /* "pybedtools/cbedtools.pyx":391
 *             else:
 *                 self._bed.name = string(value)
 *                 self._bed.fields[3] = string(value)             # <<<<<<<<<<<<<<
 * 
 *     property score:
 */
    __pyx_t_7 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (__pyx_v_self->_bed->fields[3]) = std::string(__pyx_t_7);
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_5score_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_5score_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_5score___get__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":394
 * 
 *     property score:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._bed.score.c_str()
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_5score___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 394);

  /* "pybedtools/cbedtools.pyx":395
 *     property score:
 *         def __get__(self):
 *             return self._bed.score.c_str()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_self->_bed->score.c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.score.__get__", __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 int __pyx_pw_10pybedtools_9cbedtools_8Interval_5score_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_5score_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_5score_2__set__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":397
 *             return self._bed.score.c_str()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._bed.score = string(value)
 *             idx = LOOKUPS[self.file_type]["score"]
 */

static int __pyx_pf_10pybedtools_9cbedtools_8Interval_5score_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_idx = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 397);

  /* "pybedtools/cbedtools.pyx":398
 * 
 *         def __set__(self, value):
 *             self._bed.score = string(value)             # <<<<<<<<<<<<<<
 *             idx = LOOKUPS[self.file_type]["score"]
 *             self._bed.fields[idx] = string(value)
 */
  __pyx_t_1 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_bed->score = std::string(__pyx_t_1);

  /* "pybedtools/cbedtools.pyx":399
 *         def __set__(self, value):
 *             self._bed.score = string(value)
 *             idx = LOOKUPS[self.file_type]["score"]             # <<<<<<<<<<<<<<
 *             self._bed.fields[idx] = string(value)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__file_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS), __pyx_t_2); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__score)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_idx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":400
 *             self._bed.score = string(value)
 *             idx = LOOKUPS[self.file_type]["score"]
 *             self._bed.fields[idx] = string(value)             # <<<<<<<<<<<<<<
 * 
 *     property file_type:
 */
  __pyx_t_1 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyInt_AsSize_t(__pyx_v_idx); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  (__pyx_v_self->_bed->fields[__pyx_t_4]) = std::string(__pyx_t_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.score.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_9file_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_9file_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_9file_type___get__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":404
 *     property file_type:
 *         "bed/vcf/gff"
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._bed.file_type.c_str()
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_9file_type___get__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 404);

  /* "pybedtools/cbedtools.pyx":405
 *         "bed/vcf/gff"
 *         def __get__(self):
 *             return self._bed.file_type.c_str()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_self->_bed->file_type.c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.file_type.__get__", __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 int __pyx_pw_10pybedtools_9cbedtools_8Interval_9file_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_9file_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_9file_type_2__set__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":407
 *             return self._bed.file_type.c_str()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._bed.file_type = string(value)
 * 
 */

static int __pyx_pf_10pybedtools_9cbedtools_8Interval_9file_type_2__set__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 407);

  /* "pybedtools/cbedtools.pyx":408
 * 
 *         def __set__(self, value):
 *             self._bed.file_type = string(value)             # <<<<<<<<<<<<<<
 * 
 *     # TODO: maybe bed.overlap_start or bed.overlap.start ??
 */
  __pyx_t_1 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_bed->file_type = std::string(__pyx_t_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.file_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_13o_start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_13o_start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("o_start (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_12o_start(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":412
 *     # TODO: maybe bed.overlap_start or bed.overlap.start ??
 *     @property
 *     def o_start(self):             # <<<<<<<<<<<<<<
 *         return self._bed.o_start
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_12o_start(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("o_start", 0);
  __Pyx_TraceCall("o_start", __pyx_f[0], 412);

  /* "pybedtools/cbedtools.pyx":413
 *     @property
 *     def o_start(self):
 *         return self._bed.o_start             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_CHRPOS(__pyx_v_self->_bed->o_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.o_start", __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_10pybedtools_9cbedtools_8Interval_15o_end(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_15o_end(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("o_end (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_14o_end(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":416
 * 
 *     @property
 *     def o_end(self):             # <<<<<<<<<<<<<<
 *         return self._bed.o_end
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_14o_end(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("o_end", 0);
  __Pyx_TraceCall("o_end", __pyx_f[0], 416);

  /* "pybedtools/cbedtools.pyx":417
 *     @property
 *     def o_end(self):
 *         return self._bed.o_end             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_CHRPOS(__pyx_v_self->_bed->o_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.o_end", __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_10pybedtools_9cbedtools_8Interval_17o_amt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_17o_amt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("o_amt (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_16o_amt(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":420
 * 
 *     @property
 *     def o_amt(self):             # <<<<<<<<<<<<<<
 *         return self._bed.o_end - self._bed.o_start
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_16o_amt(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("o_amt", 0);
  __Pyx_TraceCall("o_amt", __pyx_f[0], 420);

  /* "pybedtools/cbedtools.pyx":421
 *     @property
 *     def o_amt(self):
 *         return self._bed.o_end - self._bed.o_start             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_CHRPOS((__pyx_v_self->_bed->o_end - __pyx_v_self->_bed->o_start)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.o_amt", __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_10pybedtools_9cbedtools_8Interval_19__str__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_10pybedtools_9cbedtools_8Interval_18__str__[] = "\n        Interval objects always print with a newline to mimic a line in a\n        BED/GFF/VCF file\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_10pybedtools_9cbedtools_8Interval_18__str__;
#endif
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_19__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_18__str__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":423
 *         return self._bed.o_end - self._bed.o_start
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Interval objects always print with a newline to mimic a line in a
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_18__str__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__str__", 0);
  __Pyx_TraceCall("__str__", __pyx_f[0], 423);

  /* "pybedtools/cbedtools.pyx":428
 *         BED/GFF/VCF file
 *         """
 *         return "\t".join(self.fields) + "\n"             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_12), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __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 = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, ((PyObject *)__pyx_kp_s_23)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.__str__", __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_10pybedtools_9cbedtools_8Interval_21__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_21__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_20__repr__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":430
 *         return "\t".join(self.fields) + "\n"
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "Interval(%s:%i-%i)" % (self.chrom, self.start, self.end)
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_20__repr__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);
  __Pyx_TraceCall("__repr__", __pyx_f[0], 430);

  /* "pybedtools/cbedtools.pyx":431
 * 
 *     def __repr__(self):
 *         return "Interval(%s:%i-%i)" % (self.chrom, self.start, self.end)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__chrom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_24), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.__repr__", __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 void __pyx_pw_10pybedtools_9cbedtools_8Interval_23__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10pybedtools_9cbedtools_8Interval_23__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10pybedtools_9cbedtools_8Interval_22__dealloc__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "pybedtools/cbedtools.pyx":433
 *         return "Interval(%s:%i-%i)" % (self.chrom, self.start, self.end)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         del self._bed
 * 
 */

static void __pyx_pf_10pybedtools_9cbedtools_8Interval_22__dealloc__(CYTHON_UNUSED struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);
  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 433);

  /* "pybedtools/cbedtools.pyx":434
 * 
 *     def __dealloc__(self):
 *         del self._bed             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  delete __pyx_v_self->_bed;

  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static Py_ssize_t __pyx_pw_10pybedtools_9cbedtools_8Interval_25__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_10pybedtools_9cbedtools_8Interval_25__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_24__len__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":436
 *         del self._bed
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._bed.end - self._bed.start
 * 
 */

static Py_ssize_t __pyx_pf_10pybedtools_9cbedtools_8Interval_24__len__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);
  __Pyx_TraceCall("__len__", __pyx_f[0], 436);

  /* "pybedtools/cbedtools.pyx":437
 * 
 *     def __len__(self):
 *         return self._bed.end - self._bed.start             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, object key):
 */
  __pyx_r = (__pyx_v_self->_bed->end - __pyx_v_self->_bed->start);
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_26__getitem__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((PyObject *)__pyx_v_key));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":439
 *         return self._bed.end - self._bed.start
 * 
 *     def __getitem__(self, object key):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef string ftype = self._bed.file_type
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_26__getitem__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_key) {
  int __pyx_v_i;
  std::string __pyx_v_ftype;
  PyObject *__pyx_v_nfields = NULL;
  PyObject *__pyx_v_indices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_TraceCall("__getitem__", __pyx_f[0], 439);
  __Pyx_INCREF(__pyx_v_key);

  /* "pybedtools/cbedtools.pyx":441
 *     def __getitem__(self, object key):
 *         cdef int i
 *         cdef string ftype = self._bed.file_type             # <<<<<<<<<<<<<<
 * 
 *         self.deparse_attrs()
 */
  __pyx_t_1 = __pyx_v_self->_bed->file_type;
  __pyx_v_ftype = __pyx_t_1;

  /* "pybedtools/cbedtools.pyx":443
 *         cdef string ftype = self._bed.file_type
 * 
 *         self.deparse_attrs()             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, (int, long)):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10pybedtools_9cbedtools_Interval *)__pyx_v_self->__pyx_vtab)->deparse_attrs(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":445
 *         self.deparse_attrs()
 * 
 *         if isinstance(key, (int, long)):             # <<<<<<<<<<<<<<
 *             nfields = self._bed.fields.size()
 *             if key >= nfields:
 */
  __Pyx_INCREF(__pyx_v_key);
  __pyx_t_2 = __pyx_v_key;
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  if (!__pyx_t_3) {
    __pyx_t_4 = PyLong_Check(__pyx_t_2); 
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "pybedtools/cbedtools.pyx":446
 * 
 *         if isinstance(key, (int, long)):
 *             nfields = self._bed.fields.size()             # <<<<<<<<<<<<<<
 *             if key >= nfields:
 *                 raise IndexError('field index out of range')
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_bed->fields.size()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_nfields = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pybedtools/cbedtools.pyx":447
 *         if isinstance(key, (int, long)):
 *             nfields = self._bed.fields.size()
 *             if key >= nfields:             # <<<<<<<<<<<<<<
 *                 raise IndexError('field index out of range')
 *             elif key < 0:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, __pyx_v_nfields, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {

      /* "pybedtools/cbedtools.pyx":448
 *             nfields = self._bed.fields.size()
 *             if key >= nfields:
 *                 raise IndexError('field index out of range')             # <<<<<<<<<<<<<<
 *             elif key < 0:
 *                 key = nfields + key
 */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }

    /* "pybedtools/cbedtools.pyx":449
 *             if key >= nfields:
 *                 raise IndexError('field index out of range')
 *             elif key < 0:             # <<<<<<<<<<<<<<
 *                 key = nfields + key
 *             return self._bed.fields.at(key).c_str()
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {

      /* "pybedtools/cbedtools.pyx":450
 *                 raise IndexError('field index out of range')
 *             elif key < 0:
 *                 key = nfields + key             # <<<<<<<<<<<<<<
 *             return self._bed.fields.at(key).c_str()
 *         elif isinstance(key, slice):
 */
      __pyx_t_2 = PyNumber_Add(__pyx_v_nfields, __pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_v_key);
      __pyx_v_key = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "pybedtools/cbedtools.pyx":451
 *             elif key < 0:
 *                 key = nfields + key
 *             return self._bed.fields.at(key).c_str()             # <<<<<<<<<<<<<<
 *         elif isinstance(key, slice):
 *             indices = key.indices(self._bed.fields.size())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyInt_AsSize_t(__pyx_v_key); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyBytes_FromString(__pyx_v_self->_bed->fields.at(__pyx_t_6).c_str()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pybedtools/cbedtools.pyx":452
 *                 key = nfields + key
 *             return self._bed.fields.at(key).c_str()
 *         elif isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             indices = key.indices(self._bed.fields.size())
 *             return [self._bed.fields.at(i).c_str() for i in range(*indices)]
 */
  __pyx_t_5 = PySlice_Check(__pyx_v_key); 
  if (__pyx_t_5) {

    /* "pybedtools/cbedtools.pyx":453
 *             return self._bed.fields.at(key).c_str()
 *         elif isinstance(key, slice):
 *             indices = key.indices(self._bed.fields.size())             # <<<<<<<<<<<<<<
 *             return [self._bed.fields.at(i).c_str() for i in range(*indices)]
 * 
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__indices); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_bed->fields.size()); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __pyx_v_indices = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "pybedtools/cbedtools.pyx":454
 *         elif isinstance(key, slice):
 *             indices = key.indices(self._bed.fields.size())
 *             return [self._bed.fields.at(i).c_str() for i in range(*indices)]             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(key, basestring):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PySequence_Tuple(__pyx_v_indices); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_8)) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_8)) {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_2 = __pyx_t_10(__pyx_t_8);
        if (unlikely(!__pyx_t_2)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_i = __pyx_t_11;
      __pyx_t_2 = PyBytes_FromString(__pyx_v_self->_bed->fields.at(__pyx_v_i).c_str()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      if (unlikely(__Pyx_PyList_Append(__pyx_t_7, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_INCREF(((PyObject *)__pyx_t_7));
    __pyx_r = ((PyObject *)__pyx_t_7);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pybedtools/cbedtools.pyx":456
 *             return [self._bed.fields.at(i).c_str() for i in range(*indices)]
 * 
 *         elif isinstance(key, basestring):             # <<<<<<<<<<<<<<
 *             if ftype == <char *>"gff":
 *                 try:
 */
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_key, __pyx_builtin_basestring); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "pybedtools/cbedtools.pyx":457
 * 
 *         elif isinstance(key, basestring):
 *             if ftype == <char *>"gff":             # <<<<<<<<<<<<<<
 *                 try:
 *                     return self.attrs[key]
 */
    __pyx_t_5 = (__pyx_v_ftype == ((char *)__pyx_k__gff));
    if (__pyx_t_5) {

      /* "pybedtools/cbedtools.pyx":458
 *         elif isinstance(key, basestring):
 *             if ftype == <char *>"gff":
 *                 try:             # <<<<<<<<<<<<<<
 *                     return self.attrs[key]
 *                 except:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        /*try:*/ {

          /* "pybedtools/cbedtools.pyx":459
 *             if ftype == <char *>"gff":
 *                 try:
 *                     return self.attrs[key]             # <<<<<<<<<<<<<<
 *                 except:
 *                     pass
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__attrs); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = PyObject_GetItem(__pyx_t_7, __pyx_v_key); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_r = __pyx_t_8;
          __pyx_t_8 = 0;
          goto __pyx_L12_try_return;
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L15_try_end;
        __pyx_L12_try_return:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        goto __pyx_L0;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "pybedtools/cbedtools.pyx":460
 *                 try:
 *                     return self.attrs[key]
 *                 except:             # <<<<<<<<<<<<<<
 *                     pass
 *             return getattr(self, key)
 */
        /*except:*/ {
          PyErr_Restore(0,0,0);
          goto __pyx_L9_exception_handled;
        }
        __pyx_L9_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        __pyx_L15_try_end:;
      }
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "pybedtools/cbedtools.pyx":462
 *                 except:
 *                     pass
 *             return getattr(self, key)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, object key, object value):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_v_key); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nfields);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_29__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_8Interval_29__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_28__setitem__(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":464
 *             return getattr(self, key)
 * 
 *     def __setitem__(self, object key, object value):             # <<<<<<<<<<<<<<
 *         cdef string ft_string
 *         cdef char* ft_char
 */

static int __pyx_pf_10pybedtools_9cbedtools_8Interval_28__setitem__(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  std::string __pyx_v_ft_string;
  PyObject *__pyx_v_nfields = NULL;
  char *__pyx_v_ft;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  char *__pyx_t_5;
  size_t __pyx_t_6;
  std::string __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_TraceCall("__setitem__", __pyx_f[0], 464);
  __Pyx_INCREF(__pyx_v_key);

  /* "pybedtools/cbedtools.pyx":467
 *         cdef string ft_string
 *         cdef char* ft_char
 *         if isinstance(key, (int, long)):             # <<<<<<<<<<<<<<
 *             nfields = self._bed.fields.size()
 *             if key >= nfields:
 */
  __Pyx_INCREF(__pyx_v_key);
  __pyx_t_1 = __pyx_v_key;
  __pyx_t_2 = PyInt_Check(__pyx_t_1); 
  if (!__pyx_t_2) {
    __pyx_t_3 = PyLong_Check(__pyx_t_1); 
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pybedtools/cbedtools.pyx":468
 *         cdef char* ft_char
 *         if isinstance(key, (int, long)):
 *             nfields = self._bed.fields.size()             # <<<<<<<<<<<<<<
 *             if key >= nfields:
 *                 raise IndexError('field index out of range')
 */
    __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_bed->fields.size()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_nfields = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pybedtools/cbedtools.pyx":469
 *         if isinstance(key, (int, long)):
 *             nfields = self._bed.fields.size()
 *             if key >= nfields:             # <<<<<<<<<<<<<<
 *                 raise IndexError('field index out of range')
 *             elif key < 0:
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, __pyx_v_nfields, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "pybedtools/cbedtools.pyx":470
 *             nfields = self._bed.fields.size()
 *             if key >= nfields:
 *                 raise IndexError('field index out of range')             # <<<<<<<<<<<<<<
 *             elif key < 0:
 *                 key = nfields + key
 */
      __pyx_t_1 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }

    /* "pybedtools/cbedtools.pyx":471
 *             if key >= nfields:
 *                 raise IndexError('field index out of range')
 *             elif key < 0:             # <<<<<<<<<<<<<<
 *                 key = nfields + key
 *             self._bed.fields[key] = string(value)
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "pybedtools/cbedtools.pyx":472
 *                 raise IndexError('field index out of range')
 *             elif key < 0:
 *                 key = nfields + key             # <<<<<<<<<<<<<<
 *             self._bed.fields[key] = string(value)
 * 
 */
      __pyx_t_1 = PyNumber_Add(__pyx_v_nfields, __pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_v_key);
      __pyx_v_key = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "pybedtools/cbedtools.pyx":473
 *             elif key < 0:
 *                 key = nfields + key
 *             self._bed.fields[key] = string(value)             # <<<<<<<<<<<<<<
 * 
 *             ft_string = self._bed.file_type
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = __Pyx_PyInt_AsSize_t(__pyx_v_key); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (__pyx_v_self->_bed->fields[__pyx_t_6]) = std::string(__pyx_t_5);

    /* "pybedtools/cbedtools.pyx":475
 *             self._bed.fields[key] = string(value)
 * 
 *             ft_string = self._bed.file_type             # <<<<<<<<<<<<<<
 *             ft = <char *>ft_string.c_str()
 * 
 */
    __pyx_t_7 = __pyx_v_self->_bed->file_type;
    __pyx_v_ft_string = __pyx_t_7;

    /* "pybedtools/cbedtools.pyx":476
 * 
 *             ft_string = self._bed.file_type
 *             ft = <char *>ft_string.c_str()             # <<<<<<<<<<<<<<
 * 
 *             if key in LOOKUPS[ft]:
 */
    __pyx_v_ft = ((char *)__pyx_v_ft_string.c_str());

    /* "pybedtools/cbedtools.pyx":478
 *             ft = <char *>ft_string.c_str()
 * 
 *             if key in LOOKUPS[ft]:             # <<<<<<<<<<<<<<
 *                 setattr(self, LOOKUPS[ft][key], value)
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = PyBytes_FromString(__pyx_v_ft); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS), ((PyObject *)__pyx_t_1)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_t_8, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_4) {

      /* "pybedtools/cbedtools.pyx":479
 * 
 *             if key in LOOKUPS[ft]:
 *                 setattr(self, LOOKUPS[ft][key], value)             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(key, (basestring)):
 */
      if (unlikely(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = PyBytes_FromString(__pyx_v_ft); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS), ((PyObject *)__pyx_t_8)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_GetItem(__pyx_t_1, __pyx_v_key); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_t_8, __pyx_v_value); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }

  /* "pybedtools/cbedtools.pyx":481
 *                 setattr(self, LOOKUPS[ft][key], value)
 * 
 *         elif isinstance(key, (basestring)):             # <<<<<<<<<<<<<<
 *             setattr(self, key, value)
 * 
 */
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_key, __pyx_builtin_basestring); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "pybedtools/cbedtools.pyx":482
 * 
 *         elif isinstance(key, (basestring)):
 *             setattr(self, key, value)             # <<<<<<<<<<<<<<
 * 
 *     cpdef append(self, object value):
 */
    __pyx_t_9 = PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nfields);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":484
 *             setattr(self, key, value)
 * 
 *     cpdef append(self, object value):             # <<<<<<<<<<<<<<
 *         self._bed.fields.push_back(string(value))
 * 
 */

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

  /* "pybedtools/cbedtools.pyx":485
 * 
 *     cpdef append(self, object value):
 *         self._bed.fields.push_back(string(value))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_value); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_bed->fields.push_back(std::string(__pyx_t_4));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.append", __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_10pybedtools_9cbedtools_8Interval_31append(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_8Interval_31append(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_8Interval_30append(((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":484
 *             setattr(self, key, value)
 * 
 *     cpdef append(self, object value):             # <<<<<<<<<<<<<<
 *         self._bed.fields.push_back(string(value))
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_8Interval_30append(struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("append", 0);
  __Pyx_TraceCall("append", __pyx_f[0], 484);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_10pybedtools_9cbedtools_Interval *)__pyx_v_self->__pyx_vtab)->append(__pyx_v_self, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.Interval.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":488
 * 
 * 
 * cdef Interval create_interval(BED b):             # <<<<<<<<<<<<<<
 *     cdef Interval pyb = Interval.__new__(Interval)
 *     pyb._bed = new BED(b.chrom, b.start, b.end, b.name,
 */

static struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_f_10pybedtools_9cbedtools_create_interval(BED __pyx_v_b) {
  struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_pyb = 0;
  struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::string> __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("create_interval", 0);
  __Pyx_TraceCall("create_interval", __pyx_f[0], 488);

  /* "pybedtools/cbedtools.pyx":489
 * 
 * cdef Interval create_interval(BED b):
 *     cdef Interval pyb = Interval.__new__(Interval)             # <<<<<<<<<<<<<<
 *     pyb._bed = new BED(b.chrom, b.start, b.end, b.name,
 *                        b.score, b.strand, b.fields,
 */
  __pyx_t_1 = __Pyx_tp_new(((PyObject*)__pyx_ptype_10pybedtools_9cbedtools_Interval)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_10pybedtools_9cbedtools_Interval)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_pyb = ((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":490
 * cdef Interval create_interval(BED b):
 *     cdef Interval pyb = Interval.__new__(Interval)
 *     pyb._bed = new BED(b.chrom, b.start, b.end, b.name,             # <<<<<<<<<<<<<<
 *                        b.score, b.strand, b.fields,
 *                        b.o_start, b.o_end, b.bedType, b.file_type, b.status)
 */
  __pyx_v_pyb->_bed = new BED(__pyx_v_b.chrom, __pyx_v_b.start, __pyx_v_b.end, __pyx_v_b.name, __pyx_v_b.score, __pyx_v_b.strand, __pyx_v_b.fields, __pyx_v_b.o_start, __pyx_v_b.o_end, __pyx_v_b.bedType, __pyx_v_b.file_type, __pyx_v_b.status);

  /* "pybedtools/cbedtools.pyx":493
 *                        b.score, b.strand, b.fields,
 *                        b.o_start, b.o_end, b.bedType, b.file_type, b.status)
 *     pyb._bed.fields = b.fields             # <<<<<<<<<<<<<<
 *     return pyb
 * 
 */
  __pyx_t_2 = __pyx_v_b.fields;
  __pyx_v_pyb->_bed->fields = __pyx_t_2;

  /* "pybedtools/cbedtools.pyx":494
 *                        b.o_start, b.o_end, b.bedType, b.file_type, b.status)
 *     pyb._bed.fields = b.fields
 *     return pyb             # <<<<<<<<<<<<<<
 * 
 * cpdef Interval create_interval_from_list(list fields):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_pyb));
  __pyx_r = __pyx_v_pyb;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.create_interval", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pyb);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":496
 *     return pyb
 * 
 * cpdef Interval create_interval_from_list(list fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Interval object from a list of strings.
 */

static PyObject *__pyx_pw_10pybedtools_9cbedtools_1create_interval_from_list(PyObject *__pyx_self, PyObject *__pyx_v_fields); /*proto*/
static struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_f_10pybedtools_9cbedtools_create_interval_from_list(PyObject *__pyx_v_fields, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_pyb = 0;
  PyObject *__pyx_v_orig_fields = NULL;
  PyObject *__pyx_v_other_fields = NULL;
  PyObject *__pyx_v_strand = NULL;
  struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  char *__pyx_t_6;
  CHRPOS __pyx_t_7;
  CHRPOS __pyx_t_8;
  char *__pyx_t_9;
  char *__pyx_t_10;
  char *__pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("create_interval_from_list", 0);
  __Pyx_TraceCall("create_interval_from_list", __pyx_f[0], 496);

  /* "pybedtools/cbedtools.pyx":521
 * 
 *     """
 *     cdef Interval pyb = Interval.__new__(Interval)             # <<<<<<<<<<<<<<
 *     orig_fields = fields[:]
 *     # BED -- though a VCF will be detected as BED if its 2nd field, id, is a
 */
  __pyx_t_1 = __Pyx_tp_new(((PyObject*)__pyx_ptype_10pybedtools_9cbedtools_Interval)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_10pybedtools_9cbedtools_Interval)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_pyb = ((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":522
 *     """
 *     cdef Interval pyb = Interval.__new__(Interval)
 *     orig_fields = fields[:]             # <<<<<<<<<<<<<<
 *     # BED -- though a VCF will be detected as BED if its 2nd field, id, is a
 *     # digit
 */
  __pyx_t_1 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_fields), 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_orig_fields = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":525
 *     # BED -- though a VCF will be detected as BED if its 2nd field, id, is a
 *     # digit
 *     if (fields[1] + fields[2]).isdigit():             # <<<<<<<<<<<<<<
 *         # if it's too short, just add some empty fields.
 *         if len(fields) < 7:
 */
  if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__isdigit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "pybedtools/cbedtools.pyx":527
 *     if (fields[1] + fields[2]).isdigit():
 *         # if it's too short, just add some empty fields.
 *         if len(fields) < 7:             # <<<<<<<<<<<<<<
 *             fields.extend(["."] * (6 - len(fields)))
 *             other_fields = []
 */
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_fields)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = (__pyx_t_5 < 7);
    if (__pyx_t_4) {

      /* "pybedtools/cbedtools.pyx":528
 *         # if it's too short, just add some empty fields.
 *         if len(fields) < 7:
 *             fields.extend(["."] * (6 - len(fields)))             # <<<<<<<<<<<<<<
 *             other_fields = []
 *         else:
 */
      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_fields), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_fields)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = PyList_New(1 * (((6 - __pyx_t_5)<0) ? 0:(6 - __pyx_t_5))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      { Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (6 - __pyx_t_5); __pyx_temp++) {
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
          PyList_SET_ITEM(__pyx_t_2, __pyx_temp, ((PyObject *)__pyx_kp_s_11));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
        }
      }
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pybedtools/cbedtools.pyx":529
 *         if len(fields) < 7:
 *             fields.extend(["."] * (6 - len(fields)))
 *             other_fields = []             # <<<<<<<<<<<<<<
 *         else:
 *             other_fields = fields[6:]
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_other_fields = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "pybedtools/cbedtools.pyx":531
 *             other_fields = []
 *         else:
 *             other_fields = fields[6:]             # <<<<<<<<<<<<<<
 * 
 *         pyb._bed = new BED(string(fields[0]), int(fields[1]), int(fields[2]), string(fields[3]),
 */
      __pyx_t_2 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_fields), 6, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_v_other_fields = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L4:;

    /* "pybedtools/cbedtools.pyx":533
 *             other_fields = fields[6:]
 * 
 *         pyb._bed = new BED(string(fields[0]), int(fields[1]), int(fields[2]), string(fields[3]),             # <<<<<<<<<<<<<<
 *                 string(fields[4]), string(fields[5]), list_to_vector(other_fields))
 *         pyb.file_type = 'bed'
 */
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyInt_from_py_CHRPOS(__pyx_t_2); if (unlikely((__pyx_t_7 == (CHRPOS)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_from_py_CHRPOS(__pyx_t_2); if (unlikely((__pyx_t_8 == (CHRPOS)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pybedtools/cbedtools.pyx":534
 * 
 *         pyb._bed = new BED(string(fields[0]), int(fields[1]), int(fields[2]), string(fields[3]),
 *                 string(fields[4]), string(fields[5]), list_to_vector(other_fields))             # <<<<<<<<<<<<<<
 *         pyb.file_type = 'bed'
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 5, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pybedtools/cbedtools.pyx":533
 *             other_fields = fields[6:]
 * 
 *         pyb._bed = new BED(string(fields[0]), int(fields[1]), int(fields[2]), string(fields[3]),             # <<<<<<<<<<<<<<
 *                 string(fields[4]), string(fields[5]), list_to_vector(other_fields))
 *         pyb.file_type = 'bed'
 */
    __pyx_v_pyb->_bed = new BED(std::string(__pyx_t_6), __pyx_t_7, __pyx_t_8, std::string(__pyx_t_9), std::string(__pyx_t_10), std::string(__pyx_t_11), __pyx_f_10pybedtools_9cbedtools_list_to_vector(__pyx_v_other_fields));

    /* "pybedtools/cbedtools.pyx":535
 *         pyb._bed = new BED(string(fields[0]), int(fields[1]), int(fields[2]), string(fields[3]),
 *                 string(fields[4]), string(fields[5]), list_to_vector(other_fields))
 *         pyb.file_type = 'bed'             # <<<<<<<<<<<<<<
 * 
 *     # VCF
 */
    if (PyObject_SetAttr(((PyObject *)__pyx_v_pyb), __pyx_n_s__file_type, ((PyObject *)__pyx_n_s__bed)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }

  /* "pybedtools/cbedtools.pyx":538
 * 
 *     # VCF
 *     elif fields[1].isdigit() and not fields[3].isdigit() and len(fields) >= 8:             # <<<<<<<<<<<<<<
 *         pyb._bed = new BED(string(fields[0]), int(fields[1]), int(fields[1]) + 1,
 *                            string(fields[2]), string(fields[5]), string('.'),
 */
  if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__isdigit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__isdigit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_13 = (!__pyx_t_12);
    if (__pyx_t_13) {
      if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_fields)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = (__pyx_t_5 >= 8);
      __pyx_t_14 = __pyx_t_12;
    } else {
      __pyx_t_14 = __pyx_t_13;
    }
    __pyx_t_13 = __pyx_t_14;
  } else {
    __pyx_t_13 = __pyx_t_4;
  }
  if (__pyx_t_13) {

    /* "pybedtools/cbedtools.pyx":539
 *     # VCF
 *     elif fields[1].isdigit() and not fields[3].isdigit() and len(fields) >= 8:
 *         pyb._bed = new BED(string(fields[0]), int(fields[1]), int(fields[1]) + 1,             # <<<<<<<<<<<<<<
 *                            string(fields[2]), string(fields[5]), string('.'),
 *                            list_to_vector(fields))
 */
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_from_py_CHRPOS(__pyx_t_2); if (unlikely((__pyx_t_8 == (CHRPOS)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyInt_from_py_CHRPOS(__pyx_t_1); if (unlikely((__pyx_t_7 == (CHRPOS)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pybedtools/cbedtools.pyx":540
 *     elif fields[1].isdigit() and not fields[3].isdigit() and len(fields) >= 8:
 *         pyb._bed = new BED(string(fields[0]), int(fields[1]), int(fields[1]) + 1,
 *                            string(fields[2]), string(fields[5]), string('.'),             # <<<<<<<<<<<<<<
 *                            list_to_vector(fields))
 *         pyb.file_type = 'vcf'
 */
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 5, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pybedtools/cbedtools.pyx":539
 *     # VCF
 *     elif fields[1].isdigit() and not fields[3].isdigit() and len(fields) >= 8:
 *         pyb._bed = new BED(string(fields[0]), int(fields[1]), int(fields[1]) + 1,             # <<<<<<<<<<<<<<
 *                            string(fields[2]), string(fields[5]), string('.'),
 *                            list_to_vector(fields))
 */
    __pyx_v_pyb->_bed = new BED(std::string(__pyx_t_11), __pyx_t_8, __pyx_t_7, std::string(__pyx_t_10), std::string(__pyx_t_9), std::string(__pyx_k_11), __pyx_f_10pybedtools_9cbedtools_list_to_vector(__pyx_v_fields));

    /* "pybedtools/cbedtools.pyx":542
 *                            string(fields[2]), string(fields[5]), string('.'),
 *                            list_to_vector(fields))
 *         pyb.file_type = 'vcf'             # <<<<<<<<<<<<<<
 * 
 *     # SAM
 */
    if (PyObject_SetAttr(((PyObject *)__pyx_v_pyb), __pyx_n_s__file_type, ((PyObject *)__pyx_n_s__vcf)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }

  /* "pybedtools/cbedtools.pyx":545
 * 
 *     # SAM
 *     elif ( len(fields) >= 13) and (fields[1] + fields[3]).isdigit():             # <<<<<<<<<<<<<<
 *         strand = '+'
 *         if int(fields[1]) & 0x10:
 */
  if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_fields)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = (__pyx_t_5 >= 13);
  if (__pyx_t_13) {
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__isdigit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = __pyx_t_4;
  } else {
    __pyx_t_14 = __pyx_t_13;
  }
  if (__pyx_t_14) {

    /* "pybedtools/cbedtools.pyx":546
 *     # SAM
 *     elif ( len(fields) >= 13) and (fields[1] + fields[3]).isdigit():
 *         strand = '+'             # <<<<<<<<<<<<<<
 *         if int(fields[1]) & 0x10:
 *             strand = '-'
 */
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_28));
    __pyx_v_strand = ((PyObject *)__pyx_kp_s_28);

    /* "pybedtools/cbedtools.pyx":547
 *     elif ( len(fields) >= 13) and (fields[1] + fields[3]).isdigit():
 *         strand = '+'
 *         if int(fields[1]) & 0x10:             # <<<<<<<<<<<<<<
 *             strand = '-'
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_And(__pyx_t_3, __pyx_int_16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_14) {

      /* "pybedtools/cbedtools.pyx":548
 *         strand = '+'
 *         if int(fields[1]) & 0x10:
 *             strand = '-'             # <<<<<<<<<<<<<<
 * 
 *         # TODO: what should the stop position be?  Here, it's just the start
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
      __Pyx_DECREF(__pyx_v_strand);
      __pyx_v_strand = ((PyObject *)__pyx_kp_s_29);
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pybedtools/cbedtools.pyx":553
 *         # plus the length of the sequence, but perhaps this should eventually
 *         # do CIGAR string parsing.
 *         pyb._bed = new BED(string(fields[2]), int(fields[3])-1, int(fields[3]) + len(fields[9]) - 1,             # <<<<<<<<<<<<<<
 *                            string(strand), string(fields[0]), string(fields[1]), list_to_vector(fields))
 *         pyb.file_type = 'sam'
 */
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __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 = 553; __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(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyInt_from_py_CHRPOS(__pyx_t_3); if (unlikely((__pyx_t_7 == (CHRPOS)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 9, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __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_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_from_py_CHRPOS(__pyx_t_2); if (unlikely((__pyx_t_8 == (CHRPOS)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pybedtools/cbedtools.pyx":554
 *         # do CIGAR string parsing.
 *         pyb._bed = new BED(string(fields[2]), int(fields[3])-1, int(fields[3]) + len(fields[9]) - 1,
 *                            string(strand), string(fields[0]), string(fields[1]), list_to_vector(fields))             # <<<<<<<<<<<<<<
 *         pyb.file_type = 'sam'
 *     # GFF
 */
    __pyx_t_10 = PyBytes_AsString(__pyx_v_strand); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pybedtools/cbedtools.pyx":553
 *         # plus the length of the sequence, but perhaps this should eventually
 *         # do CIGAR string parsing.
 *         pyb._bed = new BED(string(fields[2]), int(fields[3])-1, int(fields[3]) + len(fields[9]) - 1,             # <<<<<<<<<<<<<<
 *                            string(strand), string(fields[0]), string(fields[1]), list_to_vector(fields))
 *         pyb.file_type = 'sam'
 */
    __pyx_v_pyb->_bed = new BED(std::string(__pyx_t_9), __pyx_t_7, __pyx_t_8, std::string(__pyx_t_10), std::string(__pyx_t_11), std::string(__pyx_t_6), __pyx_f_10pybedtools_9cbedtools_list_to_vector(__pyx_v_fields));

    /* "pybedtools/cbedtools.pyx":555
 *         pyb._bed = new BED(string(fields[2]), int(fields[3])-1, int(fields[3]) + len(fields[9]) - 1,
 *                            string(strand), string(fields[0]), string(fields[1]), list_to_vector(fields))
 *         pyb.file_type = 'sam'             # <<<<<<<<<<<<<<
 *     # GFF
 *     elif len(fields) >= 9 and (fields[3] + fields[4]).isdigit():
 */
    if (PyObject_SetAttr(((PyObject *)__pyx_v_pyb), __pyx_n_s__file_type, ((PyObject *)__pyx_n_s__sam)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }

  /* "pybedtools/cbedtools.pyx":557
 *         pyb.file_type = 'sam'
 *     # GFF
 *     elif len(fields) >= 9 and (fields[3] + fields[4]).isdigit():             # <<<<<<<<<<<<<<
 *         pyb._bed = new BED(string(fields[0]), int(fields[3])-1, int(fields[4]), string(fields[2]),
 *                            string(fields[5]), string(fields[6]), list_to_vector(fields[7:]))
 */
  if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_fields)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = (__pyx_t_5 >= 9);
  if (__pyx_t_14) {
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__isdigit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __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_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __pyx_t_13;
  } else {
    __pyx_t_4 = __pyx_t_14;
  }
  if (__pyx_t_4) {

    /* "pybedtools/cbedtools.pyx":558
 *     # GFF
 *     elif len(fields) >= 9 and (fields[3] + fields[4]).isdigit():
 *         pyb._bed = new BED(string(fields[0]), int(fields[3])-1, int(fields[4]), string(fields[2]),             # <<<<<<<<<<<<<<
 *                            string(fields[5]), string(fields[6]), list_to_vector(fields[7:]))
 *         pyb.file_type = 'gff'
 */
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyInt_from_py_CHRPOS(__pyx_t_1); if (unlikely((__pyx_t_8 == (CHRPOS)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyInt_from_py_CHRPOS(__pyx_t_1); if (unlikely((__pyx_t_7 == (CHRPOS)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pybedtools/cbedtools.pyx":559
 *     elif len(fields) >= 9 and (fields[3] + fields[4]).isdigit():
 *         pyb._bed = new BED(string(fields[0]), int(fields[3])-1, int(fields[4]), string(fields[2]),
 *                            string(fields[5]), string(fields[6]), list_to_vector(fields[7:]))             # <<<<<<<<<<<<<<
 *         pyb.file_type = 'gff'
 *     else:
 */
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 5, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(((PyObject *)__pyx_v_fields) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_fields), 6, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_fields), 7, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));

    /* "pybedtools/cbedtools.pyx":558
 *     # GFF
 *     elif len(fields) >= 9 and (fields[3] + fields[4]).isdigit():
 *         pyb._bed = new BED(string(fields[0]), int(fields[3])-1, int(fields[4]), string(fields[2]),             # <<<<<<<<<<<<<<
 *                            string(fields[5]), string(fields[6]), list_to_vector(fields[7:]))
 *         pyb.file_type = 'gff'
 */
    __pyx_v_pyb->_bed = new BED(std::string(__pyx_t_6), __pyx_t_8, __pyx_t_7, std::string(__pyx_t_11), std::string(__pyx_t_10), std::string(__pyx_t_9), __pyx_f_10pybedtools_9cbedtools_list_to_vector(((PyObject*)__pyx_t_1)));
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

    /* "pybedtools/cbedtools.pyx":560
 *         pyb._bed = new BED(string(fields[0]), int(fields[3])-1, int(fields[4]), string(fields[2]),
 *                            string(fields[5]), string(fields[6]), list_to_vector(fields[7:]))
 *         pyb.file_type = 'gff'             # <<<<<<<<<<<<<<
 *     else:
 *         raise MalformedBedLineError('Unable to detect format from %s' % fields)
 */
    if (PyObject_SetAttr(((PyObject *)__pyx_v_pyb), __pyx_n_s__file_type, ((PyObject *)__pyx_n_s__gff)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pybedtools/cbedtools.pyx":562
 *         pyb.file_type = 'gff'
 *     else:
 *         raise MalformedBedLineError('Unable to detect format from %s' % fields)             # <<<<<<<<<<<<<<
 *     pyb._bed.fields = list_to_vector(orig_fields)
 *     return pyb
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_30); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_31), ((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":563
 *     else:
 *         raise MalformedBedLineError('Unable to detect format from %s' % fields)
 *     pyb._bed.fields = list_to_vector(orig_fields)             # <<<<<<<<<<<<<<
 *     return pyb
 * 
 */
  __pyx_v_pyb->_bed->fields = __pyx_f_10pybedtools_9cbedtools_list_to_vector(__pyx_v_orig_fields);

  /* "pybedtools/cbedtools.pyx":564
 *         raise MalformedBedLineError('Unable to detect format from %s' % fields)
 *     pyb._bed.fields = list_to_vector(orig_fields)
 *     return pyb             # <<<<<<<<<<<<<<
 * 
 * cdef vector[string] list_to_vector(list li):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_pyb));
  __pyx_r = __pyx_v_pyb;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pybedtools.cbedtools.create_interval_from_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pyb);
  __Pyx_XDECREF(__pyx_v_orig_fields);
  __Pyx_XDECREF(__pyx_v_other_fields);
  __Pyx_XDECREF(__pyx_v_strand);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_1create_interval_from_list(PyObject *__pyx_self, PyObject *__pyx_v_fields); /*proto*/
static char __pyx_doc_10pybedtools_9cbedtools_create_interval_from_list[] = "\n    Create an Interval object from a list of strings.\n\n    Constructor::\n\n        create_interval_from_list(fields)\n\n    Given the list of strings, `fields`, automatically detects the format (BED,\n    GFF, VCF, SAM) and creates a new Interval object.\n\n    `fields` is a list with an arbitrary number of items (it can be quite long,\n    say after a -wao intersection of a BED12 and a GFF), however, the first\n    fields must conform to one of the supported formats.  For example, if you\n    want the resulting Interval to be considered a GFF feature, then the first\n    9 fields must conform to the GFF format.  Similarly, if you want the\n    resulting Interval to be considered a BED feature, then the first three\n    fields must be chrom, start, stop.\n\n    Example usage:\n\n        >>> # Creates a BED3 feature\n        >>> feature = create_interval_from_list(['chr1', '1', '100'])\n\n    ";
static PyObject *__pyx_pw_10pybedtools_9cbedtools_1create_interval_from_list(PyObject *__pyx_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_interval_from_list (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fields), (&PyList_Type), 1, "fields", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_create_interval_from_list(__pyx_self, ((PyObject*)__pyx_v_fields));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":496
 *     return pyb
 * 
 * cpdef Interval create_interval_from_list(list fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Interval object from a list of strings.
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_create_interval_from_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("create_interval_from_list", 0);
  __Pyx_TraceCall("create_interval_from_list", __pyx_f[0], 496);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10pybedtools_9cbedtools_create_interval_from_list(__pyx_v_fields, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.create_interval_from_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":566
 *     return pyb
 * 
 * cdef vector[string] list_to_vector(list li):             # <<<<<<<<<<<<<<
 *     cdef vector[string] s
 *     cdef int i
 */

static std::vector<std::string> __pyx_f_10pybedtools_9cbedtools_list_to_vector(PyObject *__pyx_v_li) {
  std::vector<std::string> __pyx_v_s;
  int __pyx_v_i;
  std::vector<std::string> __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("list_to_vector", 0);
  __Pyx_TraceCall("list_to_vector", __pyx_f[0], 566);

  /* "pybedtools/cbedtools.pyx":569
 *     cdef vector[string] s
 *     cdef int i
 *     for i in range(len(li)):             # <<<<<<<<<<<<<<
 *         s.push_back(string(li[i]))
 *     return s
 */
  if (unlikely(((PyObject *)__pyx_v_li) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_li)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pybedtools/cbedtools.pyx":570
 *     cdef int i
 *     for i in range(len(li)):
 *         s.push_back(string(li[i]))             # <<<<<<<<<<<<<<
 *     return s
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_li) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_li), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_s.push_back(std::string(__pyx_t_4));
  }

  /* "pybedtools/cbedtools.pyx":571
 *     for i in range(len(li)):
 *         s.push_back(string(li[i]))
 *     return s             # <<<<<<<<<<<<<<
 * 
 * cdef list string_vec2list(vector[string] sv):
 */
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("pybedtools.cbedtools.list_to_vector", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":573
 *     return s
 * 
 * cdef list string_vec2list(vector[string] sv):             # <<<<<<<<<<<<<<
 *     cdef size_t size = sv.size(), i
 *     return [sv.at(i).c_str() for i in range(size)]
 */

static PyObject *__pyx_f_10pybedtools_9cbedtools_string_vec2list(std::vector<std::string> __pyx_v_sv) {
  size_t __pyx_v_size;
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("string_vec2list", 0);
  __Pyx_TraceCall("string_vec2list", __pyx_f[0], 573);

  /* "pybedtools/cbedtools.pyx":574
 * 
 * cdef list string_vec2list(vector[string] sv):
 *     cdef size_t size = sv.size(), i             # <<<<<<<<<<<<<<
 *     return [sv.at(i).c_str() for i in range(size)]
 * 
 */
  __pyx_v_size = __pyx_v_sv.size();

  /* "pybedtools/cbedtools.pyx":575
 * cdef list string_vec2list(vector[string] sv):
 *     cdef size_t size = sv.size(), i
 *     return [sv.at(i).c_str() for i in range(size)]             # <<<<<<<<<<<<<<
 * 
 * cdef list bed_vec2list(vector[BED] bv):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_size;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
    __pyx_t_4 = PyBytes_FromString(__pyx_v_sv.at(__pyx_v_i).c_str()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = __pyx_t_1;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pybedtools.cbedtools.string_vec2list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":577
 *     return [sv.at(i).c_str() for i in range(size)]
 * 
 * cdef list bed_vec2list(vector[BED] bv):             # <<<<<<<<<<<<<<
 *     cdef size_t size = bv.size(), i
 *     cdef list l = []
 */

static PyObject *__pyx_f_10pybedtools_9cbedtools_bed_vec2list(std::vector<BED> __pyx_v_bv) {
  size_t __pyx_v_size;
  size_t __pyx_v_i;
  PyObject *__pyx_v_l = 0;
  BED __pyx_v_b;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("bed_vec2list", 0);
  __Pyx_TraceCall("bed_vec2list", __pyx_f[0], 577);

  /* "pybedtools/cbedtools.pyx":578
 * 
 * cdef list bed_vec2list(vector[BED] bv):
 *     cdef size_t size = bv.size(), i             # <<<<<<<<<<<<<<
 *     cdef list l = []
 *     cdef BED b
 */
  __pyx_v_size = __pyx_v_bv.size();

  /* "pybedtools/cbedtools.pyx":579
 * cdef list bed_vec2list(vector[BED] bv):
 *     cdef size_t size = bv.size(), i
 *     cdef list l = []             # <<<<<<<<<<<<<<
 *     cdef BED b
 *     for i in range(size):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":581
 *     cdef list l = []
 *     cdef BED b
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         b = bv.at(i)
 *         l.append(create_interval(b))
 */
  __pyx_t_2 = __pyx_v_size;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pybedtools/cbedtools.pyx":582
 *     cdef BED b
 *     for i in range(size):
 *         b = bv.at(i)             # <<<<<<<<<<<<<<
 *         l.append(create_interval(b))
 *     return l
 */
    __pyx_v_b = __pyx_v_bv.at(__pyx_v_i);

    /* "pybedtools/cbedtools.pyx":583
 *     for i in range(size):
 *         b = bv.at(i)
 *         l.append(create_interval(b))             # <<<<<<<<<<<<<<
 *     return l
 * 
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_10pybedtools_9cbedtools_create_interval(__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyList_Append(__pyx_v_l, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pybedtools/cbedtools.pyx":584
 *         b = bv.at(i)
 *         l.append(create_interval(b))
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_l));
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pybedtools.cbedtools.bed_vec2list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_3overlap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_10pybedtools_9cbedtools_3overlap = {__Pyx_NAMESTR("overlap"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_3overlap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_10pybedtools_9cbedtools_3overlap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_s1;
  int __pyx_v_s2;
  int __pyx_v_e1;
  int __pyx_v_e2;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("overlap (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__s1,&__pyx_n_s__s2,&__pyx_n_s__e1,&__pyx_n_s__e2,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__s1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__s2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("overlap", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("overlap", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("overlap", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "overlap") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_s1 = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_s1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_s2 = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_s2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_e1 = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_e1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_e2 = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_e2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("overlap", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.overlap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_2overlap(__pyx_self, __pyx_v_s1, __pyx_v_s2, __pyx_v_e1, __pyx_v_e2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":587
 * 
 * 
 * def overlap(int s1, int s2, int e1, int e2):             # <<<<<<<<<<<<<<
 *     return min(e1, e2) - max(s1, s2)
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_2overlap(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_s1, int __pyx_v_s2, int __pyx_v_e1, int __pyx_v_e2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("overlap", 0);
  __Pyx_TraceCall("overlap", __pyx_f[0], 587);

  /* "pybedtools/cbedtools.pyx":588
 * 
 * def overlap(int s1, int s2, int e1, int e2):
 *     return min(e1, e2) - max(s1, s2)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_e2;
  __pyx_t_2 = __pyx_v_e1;
  if ((__pyx_t_1 < __pyx_t_2)) {
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_3 = __pyx_t_2;
  }
  __pyx_t_1 = __pyx_v_s2;
  __pyx_t_2 = __pyx_v_s1;
  if ((__pyx_t_1 > __pyx_t_2)) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_t_5 = PyInt_FromLong((__pyx_t_3 - __pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pybedtools.cbedtools.overlap", __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 int __pyx_pw_10pybedtools_9cbedtools_16IntervalIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_16IntervalIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_stream = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stream,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_stream = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_16IntervalIterator___init__(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *)__pyx_v_self), __pyx_v_stream);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":594
 *     cdef object stream
 *     cdef int _isstring
 *     def __init__(self, stream):             # <<<<<<<<<<<<<<
 *         self.stream = stream
 * 
 */

static int __pyx_pf_10pybedtools_9cbedtools_16IntervalIterator___init__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *__pyx_v_self, PyObject *__pyx_v_stream) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_TraceCall("__init__", __pyx_f[0], 594);

  /* "pybedtools/cbedtools.pyx":595
 *     cdef int _isstring
 *     def __init__(self, stream):
 *         self.stream = stream             # <<<<<<<<<<<<<<
 * 
 *         # For speed, check int rather than call isinstance().
 */
  __Pyx_INCREF(__pyx_v_stream);
  __Pyx_GIVEREF(__pyx_v_stream);
  __Pyx_GOTREF(__pyx_v_self->stream);
  __Pyx_DECREF(__pyx_v_self->stream);
  __pyx_v_self->stream = __pyx_v_stream;

  /* "pybedtools/cbedtools.pyx":602
 *         # Also assumes that all items in the iterable `stream` are the same
 *         # type...this seems like a reasonable assumption.
 *         self._isstring = -1             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_v_self->_isstring = -1;

  __pyx_r = 0;
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_16IntervalIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_16IntervalIterator_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_16IntervalIterator_2__iter__(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":604
 *         self._isstring = -1
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 *     def __next__(self):
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_16IntervalIterator_2__iter__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __Pyx_TraceCall("__iter__", __pyx_f[0], 604);

  /* "pybedtools/cbedtools.pyx":605
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         while True:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_16IntervalIterator_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_16IntervalIterator_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_16IntervalIterator_4__next__(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":606
 *     def __iter__(self):
 *         return self
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             try:
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_16IntervalIterator_4__next__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *__pyx_v_self) {
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_fields = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__next__", 0);
  __Pyx_TraceCall("__next__", __pyx_f[0], 606);

  /* "pybedtools/cbedtools.pyx":607
 *         return self
 *     def __next__(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             try:
 *                 line = self.stream.next()
 */
  while (1) {
    if (!1) break;

    /* "pybedtools/cbedtools.pyx":608
 *     def __next__(self):
 *         while True:
 *             try:             # <<<<<<<<<<<<<<
 *                 line = self.stream.next()
 *                 if self._isstring < 0:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      /*try:*/ {

        /* "pybedtools/cbedtools.pyx":609
 *         while True:
 *             try:
 *                 line = self.stream.next()             # <<<<<<<<<<<<<<
 *                 if self._isstring < 0:
 *                     self._isstring = int(isinstance(line, basestring))
 */
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->stream, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_v_line);
        __pyx_v_line = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "pybedtools/cbedtools.pyx":610
 *             try:
 *                 line = self.stream.next()
 *                 if self._isstring < 0:             # <<<<<<<<<<<<<<
 *                     self._isstring = int(isinstance(line, basestring))
 * 
 */
        __pyx_t_6 = (__pyx_v_self->_isstring < 0);
        if (__pyx_t_6) {

          /* "pybedtools/cbedtools.pyx":611
 *                 line = self.stream.next()
 *                 if self._isstring < 0:
 *                     self._isstring = int(isinstance(line, basestring))             # <<<<<<<<<<<<<<
 * 
 *             # If you only trap StopIteration, for some reason even after
 */
          __pyx_t_6 = PyObject_IsInstance(__pyx_v_line, __pyx_builtin_basestring); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __pyx_v_self->_isstring = ((int)__pyx_t_6);
          goto __pyx_L13;
        }
        __pyx_L13:;
      }
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pybedtools/cbedtools.pyx":618
 *             # raises a ValueError, which we catch again . . . and again raise
 *             # another StopIteration.  Not sure why it works, but it does.
 *             except (StopIteration, ValueError):             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.stream.close()
 */
      __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration) || PyErr_ExceptionMatches(__pyx_builtin_ValueError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("pybedtools.cbedtools.IntervalIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_8);

        /* "pybedtools/cbedtools.pyx":619
 *             # another StopIteration.  Not sure why it works, but it does.
 *             except (StopIteration, ValueError):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.stream.close()
 *                 except AttributeError:
 */
        {
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {

            /* "pybedtools/cbedtools.pyx":620
 *             except (StopIteration, ValueError):
 *                 try:
 *                     self.stream.close()             # <<<<<<<<<<<<<<
 *                 except AttributeError:
 *                     pass
 */
            __pyx_t_12 = PyObject_GetAttr(__pyx_v_self->stream, __pyx_n_s__close); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_13 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L23_try_end;
          __pyx_L16_error:;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "pybedtools/cbedtools.pyx":621
 *                 try:
 *                     self.stream.close()
 *                 except AttributeError:             # <<<<<<<<<<<<<<
 *                     pass
 *                 raise StopIteration
 */
          __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
          if (__pyx_t_7) {
            PyErr_Restore(0,0,0);
            goto __pyx_L17_exception_handled;
          }
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L7_except_error;
          __pyx_L17_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          __pyx_L23_try_end:;
        }

        /* "pybedtools/cbedtools.pyx":623
 *                 except AttributeError:
 *                     pass
 *                 raise StopIteration             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L6_exception_handled;
      }
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
      __pyx_L12_try_end:;
    }

    /* "pybedtools/cbedtools.pyx":626
 *                 break
 * 
 *             if self._isstring:             # <<<<<<<<<<<<<<
 *                 if line.startswith(('@', '#', 'track', 'browser')):
 *                     continue
 */
    if (__pyx_v_self->_isstring) {

      /* "pybedtools/cbedtools.pyx":627
 * 
 *             if self._isstring:
 *                 if line.startswith(('@', '#', 'track', 'browser')):             # <<<<<<<<<<<<<<
 *                     continue
 *             break
 */
      __pyx_t_8 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__startswith); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {

        /* "pybedtools/cbedtools.pyx":628
 *             if self._isstring:
 *                 if line.startswith(('@', '#', 'track', 'browser')):
 *                     continue             # <<<<<<<<<<<<<<
 *             break
 * 
 */
        goto __pyx_L3_continue;
        goto __pyx_L25;
      }
      __pyx_L25:;
      goto __pyx_L24;
    }
    __pyx_L24:;

    /* "pybedtools/cbedtools.pyx":629
 *                 if line.startswith(('@', '#', 'track', 'browser')):
 *                     continue
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if self._isstring:
 */
    goto __pyx_L4_break;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pybedtools/cbedtools.pyx":631
 *             break
 * 
 *         if self._isstring:             # <<<<<<<<<<<<<<
 *             fields = line.rstrip('\r\n').split('\t')
 *         else:
 */
  if (__pyx_v_self->_isstring) {

    /* "pybedtools/cbedtools.pyx":632
 * 
 *         if self._isstring:
 *             fields = line.rstrip('\r\n').split('\t')             # <<<<<<<<<<<<<<
 *         else:
 *             fields = map(str, line)
 */
    if (unlikely(!__pyx_v_line)) { __Pyx_RaiseUnboundLocalError("line"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__rstrip); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_38), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_fields = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L26;
  }
  /*else*/ {

    /* "pybedtools/cbedtools.pyx":634
 *             fields = line.rstrip('\r\n').split('\t')
 *         else:
 *             fields = map(str, line)             # <<<<<<<<<<<<<<
 *         return create_interval_from_list(fields)
 * 
 */
    if (unlikely(!__pyx_v_line)) { __Pyx_RaiseUnboundLocalError("line"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
    PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
    __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
    __Pyx_INCREF(__pyx_v_line);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_line);
    __Pyx_GIVEREF(__pyx_v_line);
    __pyx_t_4 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __pyx_v_fields = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L26:;

  /* "pybedtools/cbedtools.pyx":635
 *         else:
 *             fields = map(str, line)
 *         return create_interval_from_list(fields)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(PyList_CheckExact(__pyx_v_fields))||((__pyx_v_fields) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_fields)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyObject *)__pyx_f_10pybedtools_9cbedtools_create_interval_from_list(((PyObject*)__pyx_v_fields), 0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10pybedtools_9cbedtools_12IntervalFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10pybedtools_9cbedtools_12IntervalFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_intervalFile = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__intervalFile,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__intervalFile)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_intervalFile = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_12IntervalFile___init__(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)__pyx_v_self), __pyx_v_intervalFile);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":651
 * 
 *     """
 *     def __init__(self, intervalFile):             # <<<<<<<<<<<<<<
 *         self.intervalFile_ptr = new BedFile(string(intervalFile))
 *         self._loaded = 0
 */

static int __pyx_pf_10pybedtools_9cbedtools_12IntervalFile___init__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self, PyObject *__pyx_v_intervalFile) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  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], 651);

  /* "pybedtools/cbedtools.pyx":652
 *     """
 *     def __init__(self, intervalFile):
 *         self.intervalFile_ptr = new BedFile(string(intervalFile))             # <<<<<<<<<<<<<<
 *         self._loaded = 0
 *         self._open = 0
 */
  __pyx_t_1 = PyBytes_AsString(__pyx_v_intervalFile); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->intervalFile_ptr = new BedFile(std::string(__pyx_t_1));

  /* "pybedtools/cbedtools.pyx":653
 *     def __init__(self, intervalFile):
 *         self.intervalFile_ptr = new BedFile(string(intervalFile))
 *         self._loaded = 0             # <<<<<<<<<<<<<<
 *         self._open = 0
 *         self.fn = intervalFile
 */
  __pyx_v_self->_loaded = 0;

  /* "pybedtools/cbedtools.pyx":654
 *         self.intervalFile_ptr = new BedFile(string(intervalFile))
 *         self._loaded = 0
 *         self._open = 0             # <<<<<<<<<<<<<<
 *         self.fn = intervalFile
 * 
 */
  __pyx_v_self->_open = 0;

  /* "pybedtools/cbedtools.pyx":655
 *         self._loaded = 0
 *         self._open = 0
 *         self.fn = intervalFile             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  if (!(likely(PyString_CheckExact(__pyx_v_intervalFile))||((__pyx_v_intervalFile) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_v_intervalFile)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_intervalFile);
  __Pyx_GIVEREF(__pyx_v_intervalFile);
  __Pyx_GOTREF(__pyx_v_self->fn);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->fn));
  __pyx_v_self->fn = ((PyObject*)__pyx_v_intervalFile);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_10pybedtools_9cbedtools_12IntervalFile_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10pybedtools_9cbedtools_12IntervalFile_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_2__dealloc__(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "pybedtools/cbedtools.pyx":657
 *         self.fn = intervalFile
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         del self.intervalFile_ptr
 * 
 */

static void __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);
  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 657);

  /* "pybedtools/cbedtools.pyx":658
 * 
 *     def __dealloc__(self):
 *         del self.intervalFile_ptr             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  delete __pyx_v_self->intervalFile_ptr;

  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_4__iter__(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":660
 *         del self.intervalFile_ptr
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_4__iter__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __Pyx_TraceCall("__iter__", __pyx_f[0], 660);

  /* "pybedtools/cbedtools.pyx":661
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_7__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_6__next__(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":663
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if not self._open:
 *             self.intervalFile_ptr.Open()
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_6__next__(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self) {
  BED __pyx_v_b;
  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("__next__", 0);
  __Pyx_TraceCall("__next__", __pyx_f[0], 663);

  /* "pybedtools/cbedtools.pyx":664
 * 
 *     def __next__(self):
 *         if not self._open:             # <<<<<<<<<<<<<<
 *             self.intervalFile_ptr.Open()
 *             self._open = 1
 */
  __pyx_t_1 = (!__pyx_v_self->_open);
  if (__pyx_t_1) {

    /* "pybedtools/cbedtools.pyx":665
 *     def __next__(self):
 *         if not self._open:
 *             self.intervalFile_ptr.Open()             # <<<<<<<<<<<<<<
 *             self._open = 1
 *         cdef BED b = self.intervalFile_ptr.GetNextBed()
 */
    __pyx_v_self->intervalFile_ptr->Open();

    /* "pybedtools/cbedtools.pyx":666
 *         if not self._open:
 *             self.intervalFile_ptr.Open()
 *             self._open = 1             # <<<<<<<<<<<<<<
 *         cdef BED b = self.intervalFile_ptr.GetNextBed()
 *         if b.status == BED_VALID:
 */
    __pyx_v_self->_open = 1;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":667
 *             self.intervalFile_ptr.Open()
 *             self._open = 1
 *         cdef BED b = self.intervalFile_ptr.GetNextBed()             # <<<<<<<<<<<<<<
 *         if b.status == BED_VALID:
 *             return create_interval(b)
 */
  __pyx_v_b = __pyx_v_self->intervalFile_ptr->GetNextBed();

  /* "pybedtools/cbedtools.pyx":668
 *             self._open = 1
 *         cdef BED b = self.intervalFile_ptr.GetNextBed()
 *         if b.status == BED_VALID:             # <<<<<<<<<<<<<<
 *             return create_interval(b)
 *         elif b.status == BED_INVALID:
 */
  __pyx_t_1 = (__pyx_v_b.status == BED_VALID);
  if (__pyx_t_1) {

    /* "pybedtools/cbedtools.pyx":669
 *         cdef BED b = self.intervalFile_ptr.GetNextBed()
 *         if b.status == BED_VALID:
 *             return create_interval(b)             # <<<<<<<<<<<<<<
 *         elif b.status == BED_INVALID:
 *             self.intervalFile_ptr.Close()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_10pybedtools_9cbedtools_create_interval(__pyx_v_b)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pybedtools/cbedtools.pyx":670
 *         if b.status == BED_VALID:
 *             return create_interval(b)
 *         elif b.status == BED_INVALID:             # <<<<<<<<<<<<<<
 *             self.intervalFile_ptr.Close()
 *             raise StopIteration
 */
  __pyx_t_1 = (__pyx_v_b.status == BED_INVALID);
  if (__pyx_t_1) {

    /* "pybedtools/cbedtools.pyx":671
 *             return create_interval(b)
 *         elif b.status == BED_INVALID:
 *             self.intervalFile_ptr.Close()             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         elif b.status == BED_MALFORMED:
 */
    __pyx_v_self->intervalFile_ptr->Close();

    /* "pybedtools/cbedtools.pyx":672
 *         elif b.status == BED_INVALID:
 *             self.intervalFile_ptr.Close()
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         elif b.status == BED_MALFORMED:
 *             raise MalformedBedLineError("malformed line: %s" % string_vec2list(b.fields))
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }

  /* "pybedtools/cbedtools.pyx":673
 *             self.intervalFile_ptr.Close()
 *             raise StopIteration
 *         elif b.status == BED_MALFORMED:             # <<<<<<<<<<<<<<
 *             raise MalformedBedLineError("malformed line: %s" % string_vec2list(b.fields))
 *         else:
 */
  __pyx_t_1 = (__pyx_v_b.status == BED_MALFORMED);
  if (__pyx_t_1) {

    /* "pybedtools/cbedtools.pyx":674
 *             raise StopIteration
 *         elif b.status == BED_MALFORMED:
 *             raise MalformedBedLineError("malformed line: %s" % string_vec2list(b.fields))             # <<<<<<<<<<<<<<
 *         else:
 *             return self.next()
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_30); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = ((PyObject *)__pyx_f_10pybedtools_9cbedtools_string_vec2list(__pyx_v_b.fields)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_39), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pybedtools/cbedtools.pyx":676
 *             raise MalformedBedLineError("malformed line: %s" % string_vec2list(b.fields))
 *         else:
 *             return self.next()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __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 = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.__next__", __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_10pybedtools_9cbedtools_12IntervalFile_9file_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_9file_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file_type (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_8file_type(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":679
 * 
 *     @property
 *     def file_type(self):             # <<<<<<<<<<<<<<
 *         if not self.intervalFile_ptr._typeIsKnown:
 *             try:
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_8file_type(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self) {
  CYTHON_UNUSED PyObject *__pyx_v_a = NULL;
  struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_interval = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("file_type", 0);
  __Pyx_TraceCall("file_type", __pyx_f[0], 679);

  /* "pybedtools/cbedtools.pyx":680
 *     @property
 *     def file_type(self):
 *         if not self.intervalFile_ptr._typeIsKnown:             # <<<<<<<<<<<<<<
 *             try:
 *                 a = iter(self).next()
 */
  __pyx_t_1 = (!__pyx_v_self->intervalFile_ptr->_typeIsKnown);
  if (__pyx_t_1) {

    /* "pybedtools/cbedtools.pyx":681
 *     def file_type(self):
 *         if not self.intervalFile_ptr._typeIsKnown:
 *             try:             # <<<<<<<<<<<<<<
 *                 a = iter(self).next()
 *                 return self.intervalFile_ptr.file_type.c_str()
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "pybedtools/cbedtools.pyx":682
 *         if not self.intervalFile_ptr._typeIsKnown:
 *             try:
 *                 a = iter(self).next()             # <<<<<<<<<<<<<<
 *                 return self.intervalFile_ptr.file_type.c_str()
 * 
 */
        __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__next); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_a = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "pybedtools/cbedtools.pyx":683
 *             try:
 *                 a = iter(self).next()
 *                 return self.intervalFile_ptr.file_type.c_str()             # <<<<<<<<<<<<<<
 * 
 *             except MalformedBedLineError:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = PyBytes_FromString(__pyx_v_self->intervalFile_ptr->file_type.c_str()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __pyx_r = ((PyObject *)__pyx_t_5);
        __pyx_t_5 = 0;
        goto __pyx_L8_try_return;
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L11_try_end;
      __pyx_L8_try_return:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L0;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pybedtools/cbedtools.pyx":685
 *                 return self.intervalFile_ptr.file_type.c_str()
 * 
 *             except MalformedBedLineError:             # <<<<<<<<<<<<<<
 *                 # If it's a SAM, raise a meaningful exception.  If not, fail.
 *                 interval = create_interval_from_list(open(self.fn).readline().strip().split())
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_30); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyErr_ExceptionMatches(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.file_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_8);

        /* "pybedtools/cbedtools.pyx":687
 *             except MalformedBedLineError:
 *                 # If it's a SAM, raise a meaningful exception.  If not, fail.
 *                 interval = create_interval_from_list(open(self.fn).readline().strip().split())             # <<<<<<<<<<<<<<
 *                 if interval.file_type == 'sam':
 *                     raise ValueError('IntervalFile objects do not yet natively support SAM. '
 */
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(((PyObject *)__pyx_v_self->fn));
        PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_self->fn));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_self->fn));
        __pyx_t_10 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__readline); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__strip); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__split); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (!(likely(PyList_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_10)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __pyx_t_9 = ((PyObject *)__pyx_f_10pybedtools_9cbedtools_create_interval_from_list(((PyObject*)__pyx_t_10), 0)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_v_interval = ((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)__pyx_t_9);
        __pyx_t_9 = 0;

        /* "pybedtools/cbedtools.pyx":688
 *                 # If it's a SAM, raise a meaningful exception.  If not, fail.
 *                 interval = create_interval_from_list(open(self.fn).readline().strip().split())
 *                 if interval.file_type == 'sam':             # <<<<<<<<<<<<<<
 *                     raise ValueError('IntervalFile objects do not yet natively support SAM. '
 *                                      'Please convert to BED/GFF/VCF first if you want to '
 */
        __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_interval), __pyx_n_s__file_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PyObject_RichCompare(__pyx_t_9, ((PyObject *)__pyx_n_s__sam), Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (__pyx_t_1) {

          /* "pybedtools/cbedtools.pyx":689
 *                 interval = create_interval_from_list(open(self.fn).readline().strip().split())
 *                 if interval.file_type == 'sam':
 *                     raise ValueError('IntervalFile objects do not yet natively support SAM. '             # <<<<<<<<<<<<<<
 *                                      'Please convert to BED/GFF/VCF first if you want to '
 *                                      'use the low-level API of IntervalFile')
 */
          __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_Raise(__pyx_t_10, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
          goto __pyx_L14;
        }
        /*else*/ {

          /* "pybedtools/cbedtools.pyx":693
 *                                      'use the low-level API of IntervalFile')
 *                 else:
 *                     raise             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __Pyx_GIVEREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_8);
          __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_8);
          __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_8 = 0; 
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        }
        __pyx_L14:;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L5_exception_handled;
      }
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L1_error;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      __pyx_L11_try_end:;
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.file_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF((PyObject *)__pyx_v_interval);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_11loadIntoMap(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10pybedtools_9cbedtools_12IntervalFile_10loadIntoMap[] = "\n        Prepares file for checking intersections.  Used by other methods like all_hits()\n        ";
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_11loadIntoMap(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("loadIntoMap (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_10loadIntoMap(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":696
 * 
 * 
 *     def loadIntoMap(self):             # <<<<<<<<<<<<<<
 *         """
 *         Prepares file for checking intersections.  Used by other methods like all_hits()
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_10loadIntoMap(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("loadIntoMap", 0);
  __Pyx_TraceCall("loadIntoMap", __pyx_f[0], 696);

  /* "pybedtools/cbedtools.pyx":700
 *         Prepares file for checking intersections.  Used by other methods like all_hits()
 *         """
 *         if self._loaded:             # <<<<<<<<<<<<<<
 *             return
 *         self.intervalFile_ptr.loadBedFileIntoMap()
 */
  if (__pyx_v_self->_loaded) {

    /* "pybedtools/cbedtools.pyx":701
 *         """
 *         if self._loaded:
 *             return             # <<<<<<<<<<<<<<
 *         self.intervalFile_ptr.loadBedFileIntoMap()
 *         self._loaded = 1
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":702
 *         if self._loaded:
 *             return
 *         self.intervalFile_ptr.loadBedFileIntoMap()             # <<<<<<<<<<<<<<
 *         self._loaded = 1
 * 
 */
  __pyx_v_self->intervalFile_ptr->loadBedFileIntoMap();

  /* "pybedtools/cbedtools.pyx":703
 *             return
 *         self.intervalFile_ptr.loadBedFileIntoMap()
 *         self._loaded = 1             # <<<<<<<<<<<<<<
 * 
 *     def rewind(self):
 */
  __pyx_v_self->_loaded = 1;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_13rewind(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10pybedtools_9cbedtools_12IntervalFile_12rewind[] = "\n        Jump to the beginning of the file.\n        ";
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_13rewind(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rewind (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_12rewind(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":705
 *         self._loaded = 1
 * 
 *     def rewind(self):             # <<<<<<<<<<<<<<
 *         """
 *         Jump to the beginning of the file.
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_12rewind(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("rewind", 0);
  __Pyx_TraceCall("rewind", __pyx_f[0], 705);

  /* "pybedtools/cbedtools.pyx":709
 *         Jump to the beginning of the file.
 *         """
 *         if not self._open:             # <<<<<<<<<<<<<<
 *             self.intervalFile_ptr.Open()
 *             self._open = 1
 */
  __pyx_t_1 = (!__pyx_v_self->_open);
  if (__pyx_t_1) {

    /* "pybedtools/cbedtools.pyx":710
 *         """
 *         if not self._open:
 *             self.intervalFile_ptr.Open()             # <<<<<<<<<<<<<<
 *             self._open = 1
 *         self.intervalFile_ptr.Rewind()
 */
    __pyx_v_self->intervalFile_ptr->Open();

    /* "pybedtools/cbedtools.pyx":711
 *         if not self._open:
 *             self.intervalFile_ptr.Open()
 *             self._open = 1             # <<<<<<<<<<<<<<
 *         self.intervalFile_ptr.Rewind()
 * 
 */
    __pyx_v_self->_open = 1;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":712
 *             self.intervalFile_ptr.Open()
 *             self._open = 1
 *         self.intervalFile_ptr.Rewind()             # <<<<<<<<<<<<<<
 * 
 *     def seek(self, offset):
 */
  __pyx_v_self->intervalFile_ptr->Rewind();

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

/* Python wrapper */
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_15seek(PyObject *__pyx_v_self, PyObject *__pyx_v_offset); /*proto*/
static char __pyx_doc_10pybedtools_9cbedtools_12IntervalFile_14seek[] = "\n        Jump to a specific byte offset in the file\n        ";
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_15seek(PyObject *__pyx_v_self, PyObject *__pyx_v_offset) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seek (wrapper)", 0);
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_14seek(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)__pyx_v_self), ((PyObject *)__pyx_v_offset));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pybedtools/cbedtools.pyx":714
 *         self.intervalFile_ptr.Rewind()
 * 
 *     def seek(self, offset):             # <<<<<<<<<<<<<<
 *         """
 *         Jump to a specific byte offset in the file
 */

static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_14seek(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self, PyObject *__pyx_v_offset) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  unsigned long __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("seek", 0);
  __Pyx_TraceCall("seek", __pyx_f[0], 714);

  /* "pybedtools/cbedtools.pyx":718
 *         Jump to a specific byte offset in the file
 *         """
 *         if not self._open:             # <<<<<<<<<<<<<<
 *             self.intervalFile_ptr.Open()
 *             self._open = 1
 */
  __pyx_t_1 = (!__pyx_v_self->_open);
  if (__pyx_t_1) {

    /* "pybedtools/cbedtools.pyx":719
 *         """
 *         if not self._open:
 *             self.intervalFile_ptr.Open()             # <<<<<<<<<<<<<<
 *             self._open = 1
 *         self.intervalFile_ptr.Seek(offset)
 */
    __pyx_v_self->intervalFile_ptr->Open();

    /* "pybedtools/cbedtools.pyx":720
 *         if not self._open:
 *             self.intervalFile_ptr.Open()
 *             self._open = 1             # <<<<<<<<<<<<<<
 *         self.intervalFile_ptr.Seek(offset)
 * 
 */
    __pyx_v_self->_open = 1;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":721
 *             self.intervalFile_ptr.Open()
 *             self._open = 1
 *         self.intervalFile_ptr.Seek(offset)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_offset); if (unlikely((__pyx_t_2 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->intervalFile_ptr->Seek(__pyx_t_2);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.seek", __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_10pybedtools_9cbedtools_12IntervalFile_17all_hits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10pybedtools_9cbedtools_12IntervalFile_16all_hits[] = "\n        :Signature: `IntervalFile.all_hits(interval, same_strand=False, overlap=0.0)`\n\n        Search for the Interval `interval` this file and return **all**\n        overlaps as a list.\n\n        `same_strand`, if True, will only consider hits on the same strand as `interval`.\n\n        `overlap` can be used to specify the fraction of overlap between\n        `interval` and each feature in the IntervalFile.\n\n        Example usage:\n\n        >>> fn = pybedtools.example_filename('a.bed')\n\n        >>> # create an Interval to query with\n        >>> i = pybedtools.Interval('chr1', 1, 10000, strand='+')\n\n        >>> # Create an IntervalFile out of a.bed\n        >>> intervalfile = pybedtools.IntervalFile(fn)\n\n        >>> # get stranded hits\n        >>> intervalfile.all_hits(i, same_strand=True)\n        [Interval(chr1:1-100), Interval(chr1:100-200), Interval(chr1:900-950)]\n\n        ";
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_17all_hits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_interval = 0;
  PyBoolObject *__pyx_v_same_strand = 0;
  float __pyx_v_overlap;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("all_hits (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__interval,&__pyx_n_s__same_strand,&__pyx_n_s__overlap,0};
    PyObject* values[3] = {0,0,0};
    values[1] = (PyObject *)__pyx_k_42;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__interval)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__same_strand);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__overlap);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "all_hits") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_interval = ((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)values[0]);
    __pyx_v_same_strand = ((PyBoolObject *)values[1]);
    if (values[2]) {
      __pyx_v_overlap = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_overlap == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "pybedtools/cbedtools.pyx":724
 * 
 * 
 *     def all_hits(self, Interval interval, bool same_strand=False, float overlap=0.0):             # <<<<<<<<<<<<<<
 *         """
 *         :Signature: `IntervalFile.all_hits(interval, same_strand=False, overlap=0.0)`
 */
      __pyx_v_overlap = ((float)0.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("all_hits", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.all_hits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interval), __pyx_ptype_10pybedtools_9cbedtools_Interval, 1, "interval", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_same_strand), __pyx_ptype_7cpython_4bool_bool, 1, "same_strand", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_16all_hits(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)__pyx_v_self), __pyx_v_interval, __pyx_v_same_strand, __pyx_v_overlap);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_16all_hits(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self, struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_interval, PyBoolObject *__pyx_v_same_strand, float __pyx_v_overlap) {
  std::vector<BED> __pyx_v_vec_b;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("all_hits", 0);
  __Pyx_TraceCall("all_hits", __pyx_f[0], 724);

  /* "pybedtools/cbedtools.pyx":752
 *         """
 *         cdef vector[BED] vec_b
 *         self.loadIntoMap()             # <<<<<<<<<<<<<<
 * 
 *         if same_strand == False:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loadIntoMap); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":754
 *         self.loadIntoMap()
 * 
 *         if same_strand == False:             # <<<<<<<<<<<<<<
 *             vec_b = self.intervalFile_ptr.FindOverlapsPerBin(deref(interval._bed), overlap)
 *             try:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_same_strand), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pybedtools/cbedtools.pyx":755
 * 
 *         if same_strand == False:
 *             vec_b = self.intervalFile_ptr.FindOverlapsPerBin(deref(interval._bed), overlap)             # <<<<<<<<<<<<<<
 *             try:
 *                 return bed_vec2list(vec_b)
 */
    __pyx_v_vec_b = __pyx_v_self->intervalFile_ptr->FindOverlapsPerBin((*__pyx_v_interval->_bed), __pyx_v_overlap);

    /* "pybedtools/cbedtools.pyx":756
 *         if same_strand == False:
 *             vec_b = self.intervalFile_ptr.FindOverlapsPerBin(deref(interval._bed), overlap)
 *             try:             # <<<<<<<<<<<<<<
 *                 return bed_vec2list(vec_b)
 *             finally:
 */
    /*try:*/ {

      /* "pybedtools/cbedtools.pyx":757
 *             vec_b = self.intervalFile_ptr.FindOverlapsPerBin(deref(interval._bed), overlap)
 *             try:
 *                 return bed_vec2list(vec_b)             # <<<<<<<<<<<<<<
 *             finally:
 *                 pass
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)__pyx_f_10pybedtools_9cbedtools_bed_vec2list(__pyx_v_vec_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L5;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L4;
    }

    /* "pybedtools/cbedtools.pyx":759
 *                 return bed_vec2list(vec_b)
 *             finally:
 *                 pass             # <<<<<<<<<<<<<<
 *         else:
 *             vec_b = self.intervalFile_ptr.FindOverlapsPerBin(deref(interval._bed), same_strand, overlap)
 */
    /*finally:*/ {
      int __pyx_why;
      PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
      int __pyx_exc_lineno;
      __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
      __pyx_why = 0; goto __pyx_L6;
      __pyx_L4: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
      __pyx_why = 3; goto __pyx_L6;
      __pyx_L5: {
        __pyx_why = 4;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
        __pyx_exc_lineno = __pyx_lineno;
        goto __pyx_L6;
      }
      __pyx_L6:;
      switch (__pyx_why) {
        case 3: goto __pyx_L0;
        case 4: {
          __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
          __pyx_lineno = __pyx_exc_lineno;
          __pyx_exc_type = 0;
          __pyx_exc_value = 0;
          __pyx_exc_tb = 0;
          goto __pyx_L1_error;
        }
      }
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pybedtools/cbedtools.pyx":761
 *                 pass
 *         else:
 *             vec_b = self.intervalFile_ptr.FindOverlapsPerBin(deref(interval._bed), same_strand, overlap)             # <<<<<<<<<<<<<<
 *             try:
 *                 return bed_vec2list(vec_b)
 */
    __pyx_v_vec_b = __pyx_v_self->intervalFile_ptr->FindOverlapsPerBin((*__pyx_v_interval->_bed), __pyx_v_same_strand, __pyx_v_overlap);

    /* "pybedtools/cbedtools.pyx":762
 *         else:
 *             vec_b = self.intervalFile_ptr.FindOverlapsPerBin(deref(interval._bed), same_strand, overlap)
 *             try:             # <<<<<<<<<<<<<<
 *                 return bed_vec2list(vec_b)
 *             finally:
 */
    /*try:*/ {

      /* "pybedtools/cbedtools.pyx":763
 *             vec_b = self.intervalFile_ptr.FindOverlapsPerBin(deref(interval._bed), same_strand, overlap)
 *             try:
 *                 return bed_vec2list(vec_b)             # <<<<<<<<<<<<<<
 *             finally:
 *                 pass
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)__pyx_f_10pybedtools_9cbedtools_bed_vec2list(__pyx_v_vec_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L9;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L8;
    }

    /* "pybedtools/cbedtools.pyx":765
 *                 return bed_vec2list(vec_b)
 *             finally:
 *                 pass             # <<<<<<<<<<<<<<
 * 
 *     # search() is an alias for all_hits
 */
    /*finally:*/ {
      int __pyx_why;
      PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
      int __pyx_exc_lineno;
      __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
      __pyx_why = 0; goto __pyx_L10;
      __pyx_L8: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
      __pyx_why = 3; goto __pyx_L10;
      __pyx_L9: {
        __pyx_why = 4;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
        __pyx_exc_lineno = __pyx_lineno;
        goto __pyx_L10;
      }
      __pyx_L10:;
      switch (__pyx_why) {
        case 3: goto __pyx_L0;
        case 4: {
          __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
          __pyx_lineno = __pyx_exc_lineno;
          __pyx_exc_type = 0;
          __pyx_exc_value = 0;
          __pyx_exc_tb = 0;
          goto __pyx_L1_error;
        }
      }
    }
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.all_hits", __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_10pybedtools_9cbedtools_12IntervalFile_19any_hits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10pybedtools_9cbedtools_12IntervalFile_18any_hits[] = "\n        :Signature: `IntervalFile.any_hits(interval, same_strand=False, overlap=0.0)`\n\n        Return 1 if the Interval `interval` had >=1 hit in this IntervalFile, 0 otherwise.\n\n        `same_strand`, if True, will only consider hits on the same strand as `interval`.\n\n        `overlap` can be used to specify the fraction of overlap between\n        `interval` and each feature in the IntervalFile.\n\n        Example usage:\n\n        >>> fn = pybedtools.example_filename('a.bed')\n\n        >>> # create an Interval to query with\n        >>> i = pybedtools.Interval('chr1', 1, 10000, strand='+')\n\n        >>> # Create an IntervalFile out of a.bed\n        >>> intervalfile = pybedtools.IntervalFile(fn)\n\n        >>> # any stranded hits?\n        >>> intervalfile.any_hits(i, same_strand=True)\n        1\n\n        ";
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_19any_hits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_interval = 0;
  PyBoolObject *__pyx_v_same_strand = 0;
  float __pyx_v_overlap;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("any_hits (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__interval,&__pyx_n_s__same_strand,&__pyx_n_s__overlap,0};
    PyObject* values[3] = {0,0,0};
    values[1] = (PyObject *)__pyx_k_43;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__interval)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__same_strand);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__overlap);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "any_hits") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_interval = ((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)values[0]);
    __pyx_v_same_strand = ((PyBoolObject *)values[1]);
    if (values[2]) {
      __pyx_v_overlap = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_overlap == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "pybedtools/cbedtools.pyx":770
 *     search = all_hits
 * 
 *     def any_hits(self, Interval interval, bool same_strand=False, float overlap=0.0):             # <<<<<<<<<<<<<<
 *         """
 *         :Signature: `IntervalFile.any_hits(interval, same_strand=False, overlap=0.0)`
 */
      __pyx_v_overlap = ((float)0.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("any_hits", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.any_hits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interval), __pyx_ptype_10pybedtools_9cbedtools_Interval, 1, "interval", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_same_strand), __pyx_ptype_7cpython_4bool_bool, 1, "same_strand", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_18any_hits(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)__pyx_v_self), __pyx_v_interval, __pyx_v_same_strand, __pyx_v_overlap);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_18any_hits(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self, struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_interval, PyBoolObject *__pyx_v_same_strand, float __pyx_v_overlap) {
  long __pyx_v_found;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("any_hits", 0);
  __Pyx_TraceCall("any_hits", __pyx_f[0], 770);

  /* "pybedtools/cbedtools.pyx":796
 * 
 *         """
 *         found = 0             # <<<<<<<<<<<<<<
 *         self.loadIntoMap()
 * 
 */
  __pyx_v_found = 0;

  /* "pybedtools/cbedtools.pyx":797
 *         """
 *         found = 0
 *         self.loadIntoMap()             # <<<<<<<<<<<<<<
 * 
 *         if same_strand == False:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loadIntoMap); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":799
 *         self.loadIntoMap()
 * 
 *         if same_strand == False:             # <<<<<<<<<<<<<<
 *             found = self.intervalFile_ptr.FindAnyOverlapsPerBin(deref(interval._bed), overlap)
 *         else:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_same_strand), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pybedtools/cbedtools.pyx":800
 * 
 *         if same_strand == False:
 *             found = self.intervalFile_ptr.FindAnyOverlapsPerBin(deref(interval._bed), overlap)             # <<<<<<<<<<<<<<
 *         else:
 *             found = self.intervalFile_ptr.FindAnyOverlapsPerBin(deref(interval._bed), same_strand, overlap)
 */
    __pyx_v_found = __pyx_v_self->intervalFile_ptr->FindAnyOverlapsPerBin((*__pyx_v_interval->_bed), __pyx_v_overlap);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pybedtools/cbedtools.pyx":802
 *             found = self.intervalFile_ptr.FindAnyOverlapsPerBin(deref(interval._bed), overlap)
 *         else:
 *             found = self.intervalFile_ptr.FindAnyOverlapsPerBin(deref(interval._bed), same_strand, overlap)             # <<<<<<<<<<<<<<
 * 
 *         return found
 */
    __pyx_v_found = __pyx_v_self->intervalFile_ptr->FindAnyOverlapsPerBin((*__pyx_v_interval->_bed), __pyx_v_same_strand, __pyx_v_overlap);
  }
  __pyx_L3:;

  /* "pybedtools/cbedtools.pyx":804
 *             found = self.intervalFile_ptr.FindAnyOverlapsPerBin(deref(interval._bed), same_strand, overlap)
 * 
 *         return found             # <<<<<<<<<<<<<<
 * 
 *     def count_hits(self, Interval interval, bool same_strand=False, float overlap=0.0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_found); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.any_hits", __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_10pybedtools_9cbedtools_12IntervalFile_21count_hits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10pybedtools_9cbedtools_12IntervalFile_20count_hits[] = "\n        :Signature: `IntervalFile.count_hits(interval, same_strand=False, overlap=0.0)`\n\n        Return the number of overlaps of the Interval `interval` had with this\n        IntervalFile.\n\n        `same_strand`, if True, will only consider hits on the same strand as\n        `interval`.\n\n        `overlap` can be used to specify the fraction of overlap between\n        `interval` and each feature in the IntervalFile.\n\n        Example usage:\n\n        >>> fn = pybedtools.example_filename('a.bed')\n\n        >>> # create an Interval to query with\n        >>> i = pybedtools.Interval('chr1', 1, 10000, strand='+')\n\n        >>> # Create an IntervalFile out of a.bed\n        >>> intervalfile = pybedtools.IntervalFile(fn)\n\n        >>> # get number of stranded hits\n        >>> intervalfile.count_hits(i, same_strand=True)\n        3\n\n        ";
static PyObject *__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_21count_hits(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_interval = 0;
  PyBoolObject *__pyx_v_same_strand = 0;
  float __pyx_v_overlap;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("count_hits (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__interval,&__pyx_n_s__same_strand,&__pyx_n_s__overlap,0};
    PyObject* values[3] = {0,0,0};
    values[1] = (PyObject *)__pyx_k_44;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__interval)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__same_strand);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__overlap);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_hits") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_interval = ((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)values[0]);
    __pyx_v_same_strand = ((PyBoolObject *)values[1]);
    if (values[2]) {
      __pyx_v_overlap = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_overlap == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "pybedtools/cbedtools.pyx":806
 *         return found
 * 
 *     def count_hits(self, Interval interval, bool same_strand=False, float overlap=0.0):             # <<<<<<<<<<<<<<
 *         """
 *         :Signature: `IntervalFile.count_hits(interval, same_strand=False, overlap=0.0)`
 */
      __pyx_v_overlap = ((float)0.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("count_hits", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.count_hits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interval), __pyx_ptype_10pybedtools_9cbedtools_Interval, 1, "interval", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_same_strand), __pyx_ptype_7cpython_4bool_bool, 1, "same_strand", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_10pybedtools_9cbedtools_12IntervalFile_20count_hits(((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)__pyx_v_self), __pyx_v_interval, __pyx_v_same_strand, __pyx_v_overlap);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10pybedtools_9cbedtools_12IntervalFile_20count_hits(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *__pyx_v_self, struct __pyx_obj_10pybedtools_9cbedtools_Interval *__pyx_v_interval, PyBoolObject *__pyx_v_same_strand, float __pyx_v_overlap) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("count_hits", 0);
  __Pyx_TraceCall("count_hits", __pyx_f[0], 806);

  /* "pybedtools/cbedtools.pyx":834
 * 
 *         """
 *         self.loadIntoMap()             # <<<<<<<<<<<<<<
 * 
 *         if same_strand == False:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loadIntoMap); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":836
 *         self.loadIntoMap()
 * 
 *         if same_strand == False:             # <<<<<<<<<<<<<<
 *             return self.intervalFile_ptr.CountOverlapsPerBin(deref(interval._bed), overlap)
 *         else:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_same_strand), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pybedtools/cbedtools.pyx":837
 * 
 *         if same_strand == False:
 *             return self.intervalFile_ptr.CountOverlapsPerBin(deref(interval._bed), overlap)             # <<<<<<<<<<<<<<
 *         else:
 *             return self.intervalFile_ptr.CountOverlapsPerBin(deref(interval._bed), same_strand, overlap)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(__pyx_v_self->intervalFile_ptr->CountOverlapsPerBin((*__pyx_v_interval->_bed), __pyx_v_overlap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pybedtools/cbedtools.pyx":839
 *             return self.intervalFile_ptr.CountOverlapsPerBin(deref(interval._bed), overlap)
 *         else:
 *             return self.intervalFile_ptr.CountOverlapsPerBin(deref(interval._bed), same_strand, overlap)             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(__pyx_v_self->intervalFile_ptr->CountOverlapsPerBin((*__pyx_v_interval->_bed), __pyx_v_same_strand, __pyx_v_overlap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pybedtools.cbedtools.IntervalFile.count_hits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_10pybedtools_9cbedtools_Interval __pyx_vtable_10pybedtools_9cbedtools_Interval;

static PyObject *__pyx_tp_new_10pybedtools_9cbedtools_Interval(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10pybedtools_9cbedtools_Interval *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_10pybedtools_9cbedtools_Interval *)o);
  p->__pyx_vtab = __pyx_vtabptr_10pybedtools_9cbedtools_Interval;
  p->_attrs = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_10pybedtools_9cbedtools_Interval(PyObject *o) {
  struct __pyx_obj_10pybedtools_9cbedtools_Interval *p = (struct __pyx_obj_10pybedtools_9cbedtools_Interval *)o;
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10pybedtools_9cbedtools_8Interval_23__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_attrs);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

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

static int __pyx_tp_clear_10pybedtools_9cbedtools_Interval(PyObject *o) {
  struct __pyx_obj_10pybedtools_9cbedtools_Interval *p = (struct __pyx_obj_10pybedtools_9cbedtools_Interval *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_attrs);
  p->_attrs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_10pybedtools_9cbedtools_Interval(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10pybedtools_9cbedtools_Interval(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10pybedtools_9cbedtools_8Interval_29__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10pybedtools_9cbedtools_8Interval_chrom(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10pybedtools_9cbedtools_8Interval_5chrom_1__get__(o);
}

static int __pyx_setprop_10pybedtools_9cbedtools_8Interval_chrom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10pybedtools_9cbedtools_8Interval_5chrom_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_10pybedtools_9cbedtools_8Interval_start(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10pybedtools_9cbedtools_8Interval_5start_1__get__(o);
}

static int __pyx_setprop_10pybedtools_9cbedtools_8Interval_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10pybedtools_9cbedtools_8Interval_5start_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_10pybedtools_9cbedtools_8Interval_end(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10pybedtools_9cbedtools_8Interval_3end_1__get__(o);
}

static int __pyx_setprop_10pybedtools_9cbedtools_8Interval_end(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10pybedtools_9cbedtools_8Interval_3end_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_10pybedtools_9cbedtools_8Interval_stop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10pybedtools_9cbedtools_8Interval_4stop_1__get__(o);
}

static int __pyx_setprop_10pybedtools_9cbedtools_8Interval_stop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10pybedtools_9cbedtools_8Interval_4stop_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_10pybedtools_9cbedtools_8Interval_strand(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10pybedtools_9cbedtools_8Interval_6strand_1__get__(o);
}

static int __pyx_setprop_10pybedtools_9cbedtools_8Interval_strand(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10pybedtools_9cbedtools_8Interval_6strand_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_10pybedtools_9cbedtools_8Interval_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10pybedtools_9cbedtools_8Interval_6length_1__get__(o);
}

static PyObject *__pyx_getprop_10pybedtools_9cbedtools_8Interval_fields(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10pybedtools_9cbedtools_8Interval_6fields_1__get__(o);
}

static PyObject *__pyx_getprop_10pybedtools_9cbedtools_8Interval_attrs(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10pybedtools_9cbedtools_8Interval_5attrs_1__get__(o);
}

static int __pyx_setprop_10pybedtools_9cbedtools_8Interval_attrs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10pybedtools_9cbedtools_8Interval_5attrs_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_10pybedtools_9cbedtools_8Interval_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10pybedtools_9cbedtools_8Interval_4name_1__get__(o);
}

static int __pyx_setprop_10pybedtools_9cbedtools_8Interval_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10pybedtools_9cbedtools_8Interval_4name_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_10pybedtools_9cbedtools_8Interval_score(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10pybedtools_9cbedtools_8Interval_5score_1__get__(o);
}

static int __pyx_setprop_10pybedtools_9cbedtools_8Interval_score(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10pybedtools_9cbedtools_8Interval_5score_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_10pybedtools_9cbedtools_8Interval_file_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10pybedtools_9cbedtools_8Interval_9file_type_1__get__(o);
}

static int __pyx_setprop_10pybedtools_9cbedtools_8Interval_file_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10pybedtools_9cbedtools_8Interval_9file_type_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10pybedtools_9cbedtools_Interval[] = {
  {__Pyx_NAMESTR("__copy__"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_8Interval_3__copy__, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("deparse_attrs"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_8Interval_9deparse_attrs, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("count"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_8Interval_11count, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("o_start"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_8Interval_13o_start, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("o_end"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_8Interval_15o_end, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("o_amt"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_8Interval_17o_amt, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_8Interval_31append, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10pybedtools_9cbedtools_Interval[] = {
  {(char *)"chrom", __pyx_getprop_10pybedtools_9cbedtools_8Interval_chrom, __pyx_setprop_10pybedtools_9cbedtools_8Interval_chrom, __Pyx_DOCSTR(__pyx_k_45), 0},
  {(char *)"start", __pyx_getprop_10pybedtools_9cbedtools_8Interval_start, __pyx_setprop_10pybedtools_9cbedtools_8Interval_start, __Pyx_DOCSTR(__pyx_k_46), 0},
  {(char *)"end", __pyx_getprop_10pybedtools_9cbedtools_8Interval_end, __pyx_setprop_10pybedtools_9cbedtools_8Interval_end, __Pyx_DOCSTR(__pyx_k_47), 0},
  {(char *)"stop", __pyx_getprop_10pybedtools_9cbedtools_8Interval_stop, __pyx_setprop_10pybedtools_9cbedtools_8Interval_stop, __Pyx_DOCSTR(__pyx_k_48), 0},
  {(char *)"strand", __pyx_getprop_10pybedtools_9cbedtools_8Interval_strand, __pyx_setprop_10pybedtools_9cbedtools_8Interval_strand, __Pyx_DOCSTR(__pyx_k_49), 0},
  {(char *)"length", __pyx_getprop_10pybedtools_9cbedtools_8Interval_length, 0, __Pyx_DOCSTR(__pyx_k_50), 0},
  {(char *)"fields", __pyx_getprop_10pybedtools_9cbedtools_8Interval_fields, 0, 0, 0},
  {(char *)"attrs", __pyx_getprop_10pybedtools_9cbedtools_8Interval_attrs, __pyx_setprop_10pybedtools_9cbedtools_8Interval_attrs, 0, 0},
  {(char *)"name", __pyx_getprop_10pybedtools_9cbedtools_8Interval_name, __pyx_setprop_10pybedtools_9cbedtools_8Interval_name, __Pyx_DOCSTR(__pyx_k_51), 0},
  {(char *)"score", __pyx_getprop_10pybedtools_9cbedtools_8Interval_score, __pyx_setprop_10pybedtools_9cbedtools_8Interval_score, 0, 0},
  {(char *)"file_type", __pyx_getprop_10pybedtools_9cbedtools_8Interval_file_type, __pyx_setprop_10pybedtools_9cbedtools_8Interval_file_type, __Pyx_DOCSTR(__pyx_k_52), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Interval = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Interval = {
  __pyx_pw_10pybedtools_9cbedtools_8Interval_25__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10pybedtools_9cbedtools_Interval, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Interval = {
  __pyx_pw_10pybedtools_9cbedtools_8Interval_25__len__, /*mp_length*/
  __pyx_pw_10pybedtools_9cbedtools_8Interval_27__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10pybedtools_9cbedtools_Interval, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Interval = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_10pybedtools_9cbedtools_Interval = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pybedtools.cbedtools.Interval"), /*tp_name*/
  sizeof(struct __pyx_obj_10pybedtools_9cbedtools_Interval), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10pybedtools_9cbedtools_Interval, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_10pybedtools_9cbedtools_8Interval_21__repr__, /*tp_repr*/
  &__pyx_tp_as_number_Interval, /*tp_as_number*/
  &__pyx_tp_as_sequence_Interval, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Interval, /*tp_as_mapping*/
  __pyx_pw_10pybedtools_9cbedtools_8Interval_5__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10pybedtools_9cbedtools_8Interval_19__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Interval, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Class to represent a genomic interval.\n\n    Constructor::\n\n        Interval(chrom, start, end, name=\".\", score=\".\", strand=\".\", otherfields=None)\n\n    Class to represent a genomic interval of any format.  Requires at least 3\n    args: chrom (string), start (int), end (int).\n\n    `start` is *always* the 0-based start coordinate.  If this Interval is to\n    represent a GFF object (which uses a 1-based coordinate system), then\n    subtract 1 from the 4th item in the line to get the start position in\n    0-based coords for this Interval.  The 1-based GFF coord will still be\n    available, albeit as a string, in fields[3].\n\n    `otherfields` is a list of fields that don't fit into the other kwargs, and\n    will be stored in the `fields` attribute of the Interval.\n\n    All the items in `otherfields` must be strings for proper conversion to\n    C++.\n\n    By convention, for BED files, `otherfields` is everything past the first 6\n    items in the line.  This allows an Interval to represent composite features\n    (e.g., a GFF line concatenated to the end of a BED line)\n\n    But for other formats (VCF, GFF, SAM), the entire line should be passed in\n    as a list for `otherfields` so that we can always check the\n    Interval.file_type and extract the fields we want, knowing that they'll be\n    in the right order as passed in with `otherfields`.\n\n    Example usage:\n\n        >>> from pybedtools import Interval\n        >>> i = Interval(\"chr1\", 22, 44, strand='-')\n        >>> i\n        Interval(chr1:22-44)\n\n        >>> i.start, i.end, i.strand, i.length\n        (22L, 44L, '-', 22L)\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_10pybedtools_9cbedtools_Interval, /*tp_traverse*/
  __pyx_tp_clear_10pybedtools_9cbedtools_Interval, /*tp_clear*/
  __pyx_pw_10pybedtools_9cbedtools_8Interval_7__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10pybedtools_9cbedtools_Interval, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10pybedtools_9cbedtools_Interval, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10pybedtools_9cbedtools_8Interval_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10pybedtools_9cbedtools_Interval, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_10pybedtools_9cbedtools_Attributes(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10pybedtools_9cbedtools_Attributes *p;
  PyObject *o = (&PyDict_Type)->tp_new(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_10pybedtools_9cbedtools_Attributes *)o);
  p->sep = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->field_sep = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_attr_str = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_quoted = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_10pybedtools_9cbedtools_Attributes(PyObject *o) {
  struct __pyx_obj_10pybedtools_9cbedtools_Attributes *p = (struct __pyx_obj_10pybedtools_9cbedtools_Attributes *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->sep);
  Py_CLEAR(p->field_sep);
  Py_CLEAR(p->_attr_str);
  Py_CLEAR(p->_quoted);
  PyObject_GC_Track(o);
  (&PyDict_Type)->tp_dealloc(o);
}

static int __pyx_tp_traverse_10pybedtools_9cbedtools_Attributes(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10pybedtools_9cbedtools_Attributes *p = (struct __pyx_obj_10pybedtools_9cbedtools_Attributes *)o;
  if (!(&PyDict_Type)->tp_traverse); else { e = (&PyDict_Type)->tp_traverse(o,v,a); if (e) return e; }
  if (p->sep) {
    e = (*v)(p->sep, a); if (e) return e;
  }
  if (p->field_sep) {
    e = (*v)(p->field_sep, a); if (e) return e;
  }
  if (p->_attr_str) {
    e = (*v)(p->_attr_str, a); if (e) return e;
  }
  if (p->_quoted) {
    e = (*v)(p->_quoted, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_10pybedtools_9cbedtools_Attributes(PyObject *o) {
  struct __pyx_obj_10pybedtools_9cbedtools_Attributes *p = (struct __pyx_obj_10pybedtools_9cbedtools_Attributes *)o;
  PyObject* tmp;
  if (!(&PyDict_Type)->tp_clear); else (&PyDict_Type)->tp_clear(o);
  tmp = ((PyObject*)p->sep);
  p->sep = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->field_sep);
  p->field_sep = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_attr_str);
  p->_attr_str = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_quoted);
  p->_quoted = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static int __pyx_mp_ass_subscript_10pybedtools_9cbedtools_Attributes(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10pybedtools_9cbedtools_10Attributes_3__setitem__(o, i, v);
  }
  else {
    if ((&PyDict_Type)->tp_as_mapping && (&PyDict_Type)->tp_as_mapping->mp_ass_subscript)
      return (&PyDict_Type)->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

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

static PyNumberMethods __pyx_tp_as_number_Attributes = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Attributes = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Attributes = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  __pyx_mp_ass_subscript_10pybedtools_9cbedtools_Attributes, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Attributes = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_10pybedtools_9cbedtools_Attributes = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pybedtools.cbedtools.Attributes"), /*tp_name*/
  sizeof(struct __pyx_obj_10pybedtools_9cbedtools_Attributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10pybedtools_9cbedtools_Attributes, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Attributes, /*tp_as_number*/
  &__pyx_tp_as_sequence_Attributes, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Attributes, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10pybedtools_9cbedtools_10Attributes_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Attributes, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Class to map between a dict of attrs and fields[8] of a GFF Interval obj.\n    "), /*tp_doc*/
  __pyx_tp_traverse_10pybedtools_9cbedtools_Attributes, /*tp_traverse*/
  __pyx_tp_clear_10pybedtools_9cbedtools_Attributes, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10pybedtools_9cbedtools_Attributes, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10pybedtools_9cbedtools_10Attributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10pybedtools_9cbedtools_Attributes, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_10pybedtools_9cbedtools_IntervalIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *)o);
  p->stream = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_10pybedtools_9cbedtools_IntervalIterator(PyObject *o) {
  struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *p = (struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->stream);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

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

static int __pyx_tp_clear_10pybedtools_9cbedtools_IntervalIterator(PyObject *o) {
  struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *p = (struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->stream);
  p->stream = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_10pybedtools_9cbedtools_IntervalIterator[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_16IntervalIterator_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_IntervalIterator = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_IntervalIterator = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_IntervalIterator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_IntervalIterator = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_10pybedtools_9cbedtools_IntervalIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pybedtools.cbedtools.IntervalIterator"), /*tp_name*/
  sizeof(struct __pyx_obj_10pybedtools_9cbedtools_IntervalIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10pybedtools_9cbedtools_IntervalIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_IntervalIterator, /*tp_as_number*/
  &__pyx_tp_as_sequence_IntervalIterator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_IntervalIterator, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_IntervalIterator, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10pybedtools_9cbedtools_IntervalIterator, /*tp_traverse*/
  __pyx_tp_clear_10pybedtools_9cbedtools_IntervalIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10pybedtools_9cbedtools_16IntervalIterator_3__iter__, /*tp_iter*/
  __pyx_pw_10pybedtools_9cbedtools_16IntervalIterator_5__next__, /*tp_iternext*/
  __pyx_methods_10pybedtools_9cbedtools_IntervalIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10pybedtools_9cbedtools_16IntervalIterator_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10pybedtools_9cbedtools_IntervalIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_10pybedtools_9cbedtools_IntervalFile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)o);
  p->fn = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_10pybedtools_9cbedtools_IntervalFile(PyObject *o) {
  struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *p = (struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)o;
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10pybedtools_9cbedtools_12IntervalFile_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->fn);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

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

static int __pyx_tp_clear_10pybedtools_9cbedtools_IntervalFile(PyObject *o) {
  struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *p = (struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->fn);
  p->fn = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_10pybedtools_9cbedtools_IntervalFile[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_7__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("file_type"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_9file_type, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("loadIntoMap"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_11loadIntoMap, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_10pybedtools_9cbedtools_12IntervalFile_10loadIntoMap)},
  {__Pyx_NAMESTR("rewind"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_13rewind, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_10pybedtools_9cbedtools_12IntervalFile_12rewind)},
  {__Pyx_NAMESTR("seek"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_15seek, METH_O, __Pyx_DOCSTR(__pyx_doc_10pybedtools_9cbedtools_12IntervalFile_14seek)},
  {__Pyx_NAMESTR("all_hits"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_17all_hits, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_10pybedtools_9cbedtools_12IntervalFile_16all_hits)},
  {__Pyx_NAMESTR("any_hits"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_19any_hits, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_10pybedtools_9cbedtools_12IntervalFile_18any_hits)},
  {__Pyx_NAMESTR("count_hits"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_12IntervalFile_21count_hits, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_10pybedtools_9cbedtools_12IntervalFile_20count_hits)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_IntervalFile = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_IntervalFile = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_IntervalFile = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_IntervalFile = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_10pybedtools_9cbedtools_IntervalFile = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pybedtools.cbedtools.IntervalFile"), /*tp_name*/
  sizeof(struct __pyx_obj_10pybedtools_9cbedtools_IntervalFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10pybedtools_9cbedtools_IntervalFile, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_IntervalFile, /*tp_as_number*/
  &__pyx_tp_as_sequence_IntervalFile, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_IntervalFile, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_IntervalFile, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10pybedtools_9cbedtools_IntervalFile, /*tp_traverse*/
  __pyx_tp_clear_10pybedtools_9cbedtools_IntervalFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10pybedtools_9cbedtools_12IntervalFile_5__iter__, /*tp_iter*/
  __pyx_pw_10pybedtools_9cbedtools_12IntervalFile_7__next__, /*tp_iternext*/
  __pyx_methods_10pybedtools_9cbedtools_IntervalFile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10pybedtools_9cbedtools_12IntervalFile_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10pybedtools_9cbedtools_IntervalFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("create_interval_from_list"), (PyCFunction)__pyx_pw_10pybedtools_9cbedtools_1create_interval_from_list, METH_O, __Pyx_DOCSTR(__pyx_doc_10pybedtools_9cbedtools_create_interval_from_list)},
  {0, 0, 0, 0}
};

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

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
  {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_n_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 1},
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
  {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
  {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
  {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
  {&__pyx_n_s_84, __pyx_k_84, sizeof(__pyx_k_84), 0, 0, 1, 1},
  {&__pyx_kp_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 0},
  {&__pyx_kp_u_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 1, 0, 0},
  {&__pyx_kp_u_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 1, 0, 0},
  {&__pyx_kp_u_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 1, 0, 0},
  {&__pyx_kp_u_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 1, 0, 0},
  {&__pyx_kp_u_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 1, 0, 0},
  {&__pyx_kp_u_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 1, 0, 0},
  {&__pyx_kp_u_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 1, 0, 0},
  {&__pyx_kp_u_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 1, 0, 0},
  {&__pyx_n_s__AttributeError, __pyx_k__AttributeError, sizeof(__pyx_k__AttributeError), 0, 0, 1, 1},
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
  {&__pyx_n_s__ID, __pyx_k__ID, sizeof(__pyx_k__ID), 0, 0, 1, 1},
  {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
  {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
  {&__pyx_n_s__Name, __pyx_k__Name, sizeof(__pyx_k__Name), 0, 0, 1, 1},
  {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s__PROFILES_TRUE, __pyx_k__PROFILES_TRUE, sizeof(__pyx_k__PROFILES_TRUE), 0, 0, 1, 1},
  {&__pyx_n_s__Parent, __pyx_k__Parent, sizeof(__pyx_k__Parent), 0, 0, 1, 1},
  {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____setitem__, __pyx_k____setitem__, sizeof(__pyx_k____setitem__), 0, 0, 1, 1},
  {&__pyx_n_s____str__, __pyx_k____str__, sizeof(__pyx_k____str__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s__all_hits, __pyx_k__all_hits, sizeof(__pyx_k__all_hits), 0, 0, 1, 1},
  {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1},
  {&__pyx_n_s__attr_str, __pyx_k__attr_str, sizeof(__pyx_k__attr_str), 0, 0, 1, 1},
  {&__pyx_n_s__attrs, __pyx_k__attrs, sizeof(__pyx_k__attrs), 0, 0, 1, 1},
  {&__pyx_n_s__basestring, __pyx_k__basestring, sizeof(__pyx_k__basestring), 0, 0, 1, 1},
  {&__pyx_n_s__bed, __pyx_k__bed, sizeof(__pyx_k__bed), 0, 0, 1, 1},
  {&__pyx_n_s__browser, __pyx_k__browser, sizeof(__pyx_k__browser), 0, 0, 1, 1},
  {&__pyx_n_s__chrom, __pyx_k__chrom, sizeof(__pyx_k__chrom), 0, 0, 1, 1},
  {&__pyx_n_s__close, __pyx_k__close, sizeof(__pyx_k__close), 0, 0, 1, 1},
  {&__pyx_n_s__cmp, __pyx_k__cmp, sizeof(__pyx_k__cmp), 0, 0, 1, 1},
  {&__pyx_n_s__collections, __pyx_k__collections, sizeof(__pyx_k__collections), 0, 0, 1, 1},
  {&__pyx_n_s__count, __pyx_k__count, sizeof(__pyx_k__count), 0, 0, 1, 1},
  {&__pyx_n_s__defaultdict, __pyx_k__defaultdict, sizeof(__pyx_k__defaultdict), 0, 0, 1, 1},
  {&__pyx_n_s__deparse_attrs, __pyx_k__deparse_attrs, sizeof(__pyx_k__deparse_attrs), 0, 0, 1, 1},
  {&__pyx_n_s__e1, __pyx_k__e1, sizeof(__pyx_k__e1), 0, 0, 1, 1},
  {&__pyx_n_s__e2, __pyx_k__e2, sizeof(__pyx_k__e2), 0, 0, 1, 1},
  {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
  {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1},
  {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1},
  {&__pyx_n_s__file_type, __pyx_k__file_type, sizeof(__pyx_k__file_type), 0, 0, 1, 1},
  {&__pyx_n_s__gene_id, __pyx_k__gene_id, sizeof(__pyx_k__gene_id), 0, 0, 1, 1},
  {&__pyx_n_s__gene_name, __pyx_k__gene_name, sizeof(__pyx_k__gene_name), 0, 0, 1, 1},
  {&__pyx_n_s__gff, __pyx_k__gff, sizeof(__pyx_k__gff), 0, 0, 1, 1},
  {&__pyx_n_s__indices, __pyx_k__indices, sizeof(__pyx_k__indices), 0, 0, 1, 1},
  {&__pyx_n_s__interval, __pyx_k__interval, sizeof(__pyx_k__interval), 0, 0, 1, 1},
  {&__pyx_n_s__intervalFile, __pyx_k__intervalFile, sizeof(__pyx_k__intervalFile), 0, 0, 1, 1},
  {&__pyx_n_s__isdigit, __pyx_k__isdigit, sizeof(__pyx_k__isdigit), 0, 0, 1, 1},
  {&__pyx_n_s__items, __pyx_k__items, sizeof(__pyx_k__items), 0, 0, 1, 1},
  {&__pyx_n_s__iteritems, __pyx_k__iteritems, sizeof(__pyx_k__iteritems), 0, 0, 1, 1},
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
  {&__pyx_n_s__k, __pyx_k__k, sizeof(__pyx_k__k), 0, 0, 1, 1},
  {&__pyx_n_s__kdict, __pyx_k__kdict, sizeof(__pyx_k__kdict), 0, 0, 1, 1},
  {&__pyx_n_s__ktype, __pyx_k__ktype, sizeof(__pyx_k__ktype), 0, 0, 1, 1},
  {&__pyx_n_s__loadIntoMap, __pyx_k__loadIntoMap, sizeof(__pyx_k__loadIntoMap), 0, 0, 1, 1},
  {&__pyx_n_s__map, __pyx_k__map, sizeof(__pyx_k__map), 0, 0, 1, 1},
  {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
  {&__pyx_n_s__next, __pyx_k__next, sizeof(__pyx_k__next), 0, 0, 1, 1},
  {&__pyx_n_s__o_amt, __pyx_k__o_amt, sizeof(__pyx_k__o_amt), 0, 0, 1, 1},
  {&__pyx_n_s__o_end, __pyx_k__o_end, sizeof(__pyx_k__o_end), 0, 0, 1, 1},
  {&__pyx_n_s__o_start, __pyx_k__o_start, sizeof(__pyx_k__o_start), 0, 0, 1, 1},
  {&__pyx_n_s__open, __pyx_k__open, sizeof(__pyx_k__open), 0, 0, 1, 1},
  {&__pyx_n_s__otherfields, __pyx_k__otherfields, sizeof(__pyx_k__otherfields), 0, 0, 1, 1},
  {&__pyx_n_s__overlap, __pyx_k__overlap, sizeof(__pyx_k__overlap), 0, 0, 1, 1},
  {&__pyx_n_s__property, __pyx_k__property, sizeof(__pyx_k__property), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__readline, __pyx_k__readline, sizeof(__pyx_k__readline), 0, 0, 1, 1},
  {&__pyx_n_s__replace, __pyx_k__replace, sizeof(__pyx_k__replace), 0, 0, 1, 1},
  {&__pyx_n_s__rstrip, __pyx_k__rstrip, sizeof(__pyx_k__rstrip), 0, 0, 1, 1},
  {&__pyx_n_s__s1, __pyx_k__s1, sizeof(__pyx_k__s1), 0, 0, 1, 1},
  {&__pyx_n_s__s2, __pyx_k__s2, sizeof(__pyx_k__s2), 0, 0, 1, 1},
  {&__pyx_n_s__sam, __pyx_k__sam, sizeof(__pyx_k__sam), 0, 0, 1, 1},
  {&__pyx_n_s__same_strand, __pyx_k__same_strand, sizeof(__pyx_k__same_strand), 0, 0, 1, 1},
  {&__pyx_n_s__score, __pyx_k__score, sizeof(__pyx_k__score), 0, 0, 1, 1},
  {&__pyx_n_s__search, __pyx_k__search, sizeof(__pyx_k__search), 0, 0, 1, 1},
  {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1},
  {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
  {&__pyx_n_s__startswith, __pyx_k__startswith, sizeof(__pyx_k__startswith), 0, 0, 1, 1},
  {&__pyx_n_s__stop, __pyx_k__stop, sizeof(__pyx_k__stop), 0, 0, 1, 1},
  {&__pyx_n_s__strand, __pyx_k__strand, sizeof(__pyx_k__strand), 0, 0, 1, 1},
  {&__pyx_n_s__stream, __pyx_k__stream, sizeof(__pyx_k__stream), 0, 0, 1, 1},
  {&__pyx_n_s__strip, __pyx_k__strip, sizeof(__pyx_k__strip), 0, 0, 1, 1},
  {&__pyx_n_s__subprocess, __pyx_k__subprocess, sizeof(__pyx_k__subprocess), 0, 0, 1, 1},
  {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
  {&__pyx_n_s__track, __pyx_k__track, sizeof(__pyx_k__track), 0, 0, 1, 1},
  {&__pyx_n_s__transcript_id, __pyx_k__transcript_id, sizeof(__pyx_k__transcript_id), 0, 0, 1, 1},
  {&__pyx_n_s__v, __pyx_k__v, sizeof(__pyx_k__v), 0, 0, 1, 1},
  {&__pyx_n_s__vcf, __pyx_k__vcf, sizeof(__pyx_k__vcf), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_cmp = __Pyx_GetName(__pyx_b, __pyx_n_s__cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_basestring = __Pyx_GetName(__pyx_b, __pyx_n_s__basestring); if (!__pyx_builtin_basestring) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_open = __Pyx_GetName(__pyx_b, __pyx_n_s__open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "pybedtools/cbedtools.pyx":111
 *         # in general, GFF files will have either as many '=' as ';'
 *         # (or ';'-1 if there's no trailing ';')
 *         n_semi = attr_str.count(';')             # <<<<<<<<<<<<<<
 *         n_eq = attr_str.count('=')
 *         n_quotes = attr_str.count('"')
 */
  __pyx_k_tuple_3 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_3);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));

  /* "pybedtools/cbedtools.pyx":112
 *         # (or ';'-1 if there's no trailing ';')
 *         n_semi = attr_str.count(';')
 *         n_eq = attr_str.count('=')             # <<<<<<<<<<<<<<
 *         n_quotes = attr_str.count('"')
 * 
 */
  __pyx_k_tuple_5 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_5);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));

  /* "pybedtools/cbedtools.pyx":113
 *         n_semi = attr_str.count(';')
 *         n_eq = attr_str.count('=')
 *         n_quotes = attr_str.count('"')             # <<<<<<<<<<<<<<
 * 
 *         if n_eq > n_semi - 1:
 */
  __pyx_k_tuple_7 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_7);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));

  /* "pybedtools/cbedtools.pyx":136
 *         kvs = map(str.strip, attr_str.strip().split(self.sep))
 *         for field, value in [kv.split(self.field_sep, 1) for kv in kvs if kv]:
 *             if value.count('"') == 2:             # <<<<<<<<<<<<<<
 *                 self._quoted[field] = True
 *             self[field] = value.replace('"', '')
 */
  __pyx_k_tuple_9 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_9);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));

  /* "pybedtools/cbedtools.pyx":138
 *             if value.count('"') == 2:
 *                 self._quoted[field] = True
 *             self[field] = value.replace('"', '')             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, key, value):
 */
  __pyx_k_tuple_10 = PyTuple_Pack(2, ((PyObject *)__pyx_kp_s_6), ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_10);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));

  /* "pybedtools/cbedtools.pyx":244
 *         try:
 *             if PROFILES_TRUE[profile] == tuple():
 *                 raise NotImplementedError('Features are nested -- comparison undefined')             # <<<<<<<<<<<<<<
 * 
 *             if op != 3:
 */
  __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_13)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_14);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));

  /* "pybedtools/cbedtools.pyx":255
 *                 return True
 *         except KeyError:
 *             raise ValueError('Currently unsupported comparison -- please '             # <<<<<<<<<<<<<<
 *                              'submit a bug report')
 * 
 */
  __pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_16);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));

  /* "pybedtools/cbedtools.pyx":316
 * 
 *         if self.file_type != "gff":
 *             raise ValueError('Interval.attrs was not None, but this was a non-GFF Interval')             # <<<<<<<<<<<<<<
 * 
 *         cdef char *cstr
 */
  __pyx_k_tuple_18 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_17)); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_18);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18));

  /* "pybedtools/cbedtools.pyx":336
 *                     self._attrs = Attributes(self._bed.fields[8].c_str())
 *                 else:
 *                     self._attrs = Attributes("")             # <<<<<<<<<<<<<<
 *             return self._attrs
 * 
 */
  __pyx_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_19);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));

  /* "pybedtools/cbedtools.pyx":363
 *                     return attrs[self.name_key]
 *                 """
 *                 for key in ("ID", "Name", "gene_name", "transcript_id", \             # <<<<<<<<<<<<<<
 *                             "gene_id", "Parent"):
 *                     if key in self.attrs:
 */
  __pyx_k_tuple_20 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__ID), ((PyObject *)__pyx_n_s__Name), ((PyObject *)__pyx_n_s__gene_name), ((PyObject *)__pyx_n_s__transcript_id), ((PyObject *)__pyx_n_s__gene_id), ((PyObject *)__pyx_n_s__Parent)); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_20);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20));

  /* "pybedtools/cbedtools.pyx":379
 *             cdef string ftype = self._bed.file_type
 *             if ftype == <char *>"gff":
 *                 for key in ("ID", "Name", "gene_name", "transcript_id", \             # <<<<<<<<<<<<<<
 *                             "gene_id", "Parent"):
 *                     if not key in self.attrs:
 */
  __pyx_k_tuple_22 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__ID), ((PyObject *)__pyx_n_s__Name), ((PyObject *)__pyx_n_s__gene_name), ((PyObject *)__pyx_n_s__transcript_id), ((PyObject *)__pyx_n_s__gene_id), ((PyObject *)__pyx_n_s__Parent)); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_22);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));

  /* "pybedtools/cbedtools.pyx":448
 *             nfields = self._bed.fields.size()
 *             if key >= nfields:
 *                 raise IndexError('field index out of range')             # <<<<<<<<<<<<<<
 *             elif key < 0:
 *                 key = nfields + key
 */
  __pyx_k_tuple_26 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_25)); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_26);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));

  /* "pybedtools/cbedtools.pyx":470
 *             nfields = self._bed.fields.size()
 *             if key >= nfields:
 *                 raise IndexError('field index out of range')             # <<<<<<<<<<<<<<
 *             elif key < 0:
 *                 key = nfields + key
 */
  __pyx_k_tuple_27 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_25)); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_27);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));

  /* "pybedtools/cbedtools.pyx":627
 * 
 *             if self._isstring:
 *                 if line.startswith(('@', '#', 'track', 'browser')):             # <<<<<<<<<<<<<<
 *                     continue
 *             break
 */
  __pyx_k_tuple_34 = PyTuple_Pack(4, ((PyObject *)__pyx_kp_s_32), ((PyObject *)__pyx_kp_s_33), ((PyObject *)__pyx_n_s__track), ((PyObject *)__pyx_n_s__browser)); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_34);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34));
  __pyx_k_tuple_35 = PyTuple_Pack(1, ((PyObject *)__pyx_k_tuple_34)); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_35);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));

  /* "pybedtools/cbedtools.pyx":632
 * 
 *         if self._isstring:
 *             fields = line.rstrip('\r\n').split('\t')             # <<<<<<<<<<<<<<
 *         else:
 *             fields = map(str, line)
 */
  __pyx_k_tuple_37 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_36)); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_37);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));
  __pyx_k_tuple_38 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_12)); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_38);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));

  /* "pybedtools/cbedtools.pyx":689
 *                 interval = create_interval_from_list(open(self.fn).readline().strip().split())
 *                 if interval.file_type == 'sam':
 *                     raise ValueError('IntervalFile objects do not yet natively support SAM. '             # <<<<<<<<<<<<<<
 *                                      'Please convert to BED/GFF/VCF first if you want to '
 *                                      'use the low-level API of IntervalFile')
 */
  __pyx_k_tuple_41 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_40)); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_41);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));

  /* "pybedtools/cbedtools.pyx":29
 * # < 0 | <= 1 | == 2 | != 3 |  > 4 | >= 5
 * PROFILES_TRUE = {
 *                 (0, 0, -1, 1): (2, 1, 5),  # a == b, a >= b, a <= b             # <<<<<<<<<<<<<<
 *                 # a  ---------
 *                 # b  ---------
 */
  __pyx_k_tuple_54 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_54);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));
  __pyx_k_tuple_55 = PyTuple_Pack(3, __pyx_int_2, __pyx_int_1, __pyx_int_5); if (unlikely(!__pyx_k_tuple_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_55);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55));

  /* "pybedtools/cbedtools.pyx":33
 *                 # b  ---------
 * 
 *                 (-1, -1, -1, -1): (0, 1),  # a < b, a <= b             # <<<<<<<<<<<<<<
 *                 # a ----
 *                 # b       -----
 */
  __pyx_k_tuple_56 = PyTuple_Pack(4, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_56);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));
  __pyx_k_tuple_57 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_57);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));

  /* "pybedtools/cbedtools.pyx":37
 *                 # b       -----
 * 
 *                 (-1, -1, -1, 0): (1,),  # a <= b             # <<<<<<<<<<<<<<
 *                 # a ----
 *                 # b     -----  (book-ended)
 */
  __pyx_k_tuple_58 = PyTuple_Pack(4, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_int_0); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_58);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));
  __pyx_k_tuple_59 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_59);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));

  /* "pybedtools/cbedtools.pyx":41
 *                 # b     -----  (book-ended)
 * 
 *                 (1, 1, 0, 1): (5,),  # a >= b             # <<<<<<<<<<<<<<
 *                 # a     -----
 *                 # b ----      (book-ended)
 */
  __pyx_k_tuple_60 = PyTuple_Pack(4, __pyx_int_1, __pyx_int_1, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_60);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60));
  __pyx_k_tuple_61 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_61);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));

  /* "pybedtools/cbedtools.pyx":45
 *                 # b ----      (book-ended)
 * 
 *                 (1, 1, 1, 1): (4, 5), # a > b, a >= b             # <<<<<<<<<<<<<<
 *                 # a       ------
 *                 # b ----
 */
  __pyx_k_tuple_62 = PyTuple_Pack(4, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_62);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));
  __pyx_k_tuple_63 = PyTuple_Pack(2, __pyx_int_4, __pyx_int_5); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_63);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63));

  /* "pybedtools/cbedtools.pyx":49
 *                 # b ----
 * 
 *                 (0, 1, -1, 1): (5,),  # a >= b             # <<<<<<<<<<<<<<
 *                 # a  ------------
 *                 # b  ---------
 */
  __pyx_k_tuple_64 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_1, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_64);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_64));
  __pyx_k_tuple_65 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_65);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));

  /* "pybedtools/cbedtools.pyx":53
 *                 # b  ---------
 * 
 *                 (1, 0, -1, 1): (5,),  # a >= b             # <<<<<<<<<<<<<<
 *                 # a   -----------
 *                 # b -------------
 */
  __pyx_k_tuple_66 = PyTuple_Pack(4, __pyx_int_1, __pyx_int_0, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_66);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_66));
  __pyx_k_tuple_67 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_67);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));

  /* "pybedtools/cbedtools.pyx":57
 *                 # b -------------
 * 
 *                 (-1, 0, -1, 1): (1,),  # a <= b             # <<<<<<<<<<<<<<
 *                 # a -------------
 *                 # b   -----------
 */
  __pyx_k_tuple_68 = PyTuple_Pack(4, __pyx_int_neg_1, __pyx_int_0, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_68);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));
  __pyx_k_tuple_69 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_69);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_69));

  /* "pybedtools/cbedtools.pyx":61
 *                 # b   -----------
 * 
 *                 (0, -1, -1, 1): (1,), # a <= b             # <<<<<<<<<<<<<<
 *                 # a  ---------
 *                 # b  ------------
 */
  __pyx_k_tuple_70 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_70);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));
  __pyx_k_tuple_71 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_71);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_71));

  /* "pybedtools/cbedtools.pyx":65
 *                 # b  ------------
 * 
 *                 (-1, -1, -1, 1): (1,), # a <= b             # <<<<<<<<<<<<<<
 *                 # a -----------
 *                 # b        -----------
 */
  __pyx_k_tuple_72 = PyTuple_Pack(4, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_72);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_72));
  __pyx_k_tuple_73 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_73);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73));

  /* "pybedtools/cbedtools.pyx":69
 *                 # b        -----------
 * 
 *                 (1, 1, -1, 1): (5,),  # a >= b             # <<<<<<<<<<<<<<
 *                 # a        -----------
 *                 # b -----------
 */
  __pyx_k_tuple_74 = PyTuple_Pack(4, __pyx_int_1, __pyx_int_1, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_74);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_74));
  __pyx_k_tuple_75 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_75);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75));

  /* "pybedtools/cbedtools.pyx":73
 *                 # b -----------
 * 
 *                 (1, -1, -1, 1): tuple(), # undef             # <<<<<<<<<<<<<<
 *                 # a    ----
 *                 # b -----------
 */
  __pyx_k_tuple_76 = PyTuple_Pack(4, __pyx_int_1, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_76);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));

  /* "pybedtools/cbedtools.pyx":77
 *                 # b -----------
 * 
 *                 (-1, 1, -1, 1): tuple(), # undef             # <<<<<<<<<<<<<<
 *                 # a -----------
 *                 # b    ----
 */
  __pyx_k_tuple_77 = PyTuple_Pack(4, __pyx_int_neg_1, __pyx_int_1, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_77);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_77));

  /* "pybedtools/cbedtools.pyx":81
 *                 # b    ----
 * 
 *                 (-1, 0, -1, 0): (1,),  # a <= b             # <<<<<<<<<<<<<<
 *                 # a -----------
 *                 # b           -
 */
  __pyx_k_tuple_78 = PyTuple_Pack(4, __pyx_int_neg_1, __pyx_int_0, __pyx_int_neg_1, __pyx_int_0); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_78);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_78));
  __pyx_k_tuple_79 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_79);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_79));

  /* "pybedtools/cbedtools.pyx":85
 *                 # b           -
 * 
 *                 (1, 0, 0, 1): (5,),  # a >= b             # <<<<<<<<<<<<<<
 *                 # a           -
 *                 # b -----------
 */
  __pyx_k_tuple_80 = PyTuple_Pack(4, __pyx_int_1, __pyx_int_0, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_80);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80));
  __pyx_k_tuple_81 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_k_tuple_81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_81);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_81));

  /* "pybedtools/cbedtools.pyx":89
 *                 # b -----------
 * 
 *                 (0, 0, 0, 0): (1, 2, 5),  # a == b, a <= b, a >= b             # <<<<<<<<<<<<<<
 *                 # a -
 *                 # b -  (starts and stops are identical for all features)
 */
  __pyx_k_tuple_82 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_82);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82));
  __pyx_k_tuple_83 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_2, __pyx_int_5); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_83);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_83));

  /* "pybedtools/cbedtools.pyx":587
 * 
 * 
 * def overlap(int s1, int s2, int e1, int e2):             # <<<<<<<<<<<<<<
 *     return min(e1, e2) - max(s1, s2)
 * 
 */
  __pyx_k_tuple_85 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__s1), ((PyObject *)__pyx_n_s__s2), ((PyObject *)__pyx_n_s__e1), ((PyObject *)__pyx_n_s__e2)); if (unlikely(!__pyx_k_tuple_85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_85);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_85));
  __pyx_k_codeobj_86 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_87, __pyx_n_s__overlap, 587, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initcbedtools(void); /*proto*/
PyMODINIT_FUNC initcbedtools(void)
#else
PyMODINIT_FUNC PyInit_cbedtools(void); /*proto*/
PyMODINIT_FUNC PyInit_cbedtools(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_cbedtools(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("cbedtools"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_53), 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "pybedtools.cbedtools")) {
      if (unlikely(PyDict_SetItemString(modules, "pybedtools.cbedtools", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_pybedtools__cbedtools) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  __pyx_v_10pybedtools_9cbedtools_LOOKUPS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_10pybedtools_9cbedtools_Interval = &__pyx_vtable_10pybedtools_9cbedtools_Interval;
  __pyx_vtable_10pybedtools_9cbedtools_Interval.append = (PyObject *(*)(struct __pyx_obj_10pybedtools_9cbedtools_Interval *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10pybedtools_9cbedtools_8Interval_append;
  __pyx_vtable_10pybedtools_9cbedtools_Interval.deparse_attrs = (PyObject *(*)(struct __pyx_obj_10pybedtools_9cbedtools_Interval *, int __pyx_skip_dispatch))__pyx_f_10pybedtools_9cbedtools_8Interval_deparse_attrs;
  if (PyType_Ready(&__pyx_type_10pybedtools_9cbedtools_Interval) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_10pybedtools_9cbedtools_Interval, "__str__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_10pybedtools_9cbedtools_8Interval_18__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_10pybedtools_9cbedtools_8Interval_18__str__.doc = __pyx_doc_10pybedtools_9cbedtools_8Interval_18__str__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10pybedtools_9cbedtools_8Interval_18__str__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_10pybedtools_9cbedtools_Interval.tp_dict, __pyx_vtabptr_10pybedtools_9cbedtools_Interval) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Interval", (PyObject *)&__pyx_type_10pybedtools_9cbedtools_Interval) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_10pybedtools_9cbedtools_Interval = &__pyx_type_10pybedtools_9cbedtools_Interval;
  __pyx_type_10pybedtools_9cbedtools_Attributes.tp_base = (&PyDict_Type);
  if (PyType_Ready(&__pyx_type_10pybedtools_9cbedtools_Attributes) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Attributes", (PyObject *)&__pyx_type_10pybedtools_9cbedtools_Attributes) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_10pybedtools_9cbedtools_Attributes = &__pyx_type_10pybedtools_9cbedtools_Attributes;
  if (PyType_Ready(&__pyx_type_10pybedtools_9cbedtools_IntervalIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "IntervalIterator", (PyObject *)&__pyx_type_10pybedtools_9cbedtools_IntervalIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_10pybedtools_9cbedtools_IntervalIterator = &__pyx_type_10pybedtools_9cbedtools_IntervalIterator;
  if (PyType_Ready(&__pyx_type_10pybedtools_9cbedtools_IntervalFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "IntervalFile", (PyObject *)&__pyx_type_10pybedtools_9cbedtools_IntervalFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_10pybedtools_9cbedtools_IntervalFile = &__pyx_type_10pybedtools_9cbedtools_IntervalFile;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "pybedtools/cbedtools.pyx":12
 * """
 * from cython.operator cimport dereference as deref
 * import sys             # <<<<<<<<<<<<<<
 * import subprocess
 * from collections import defaultdict
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":13
 * from cython.operator cimport dereference as deref
 * import sys
 * import subprocess             # <<<<<<<<<<<<<<
 * from collections import defaultdict
 * 
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__subprocess), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__subprocess, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":14
 * import sys
 * import subprocess
 * from collections import defaultdict             # <<<<<<<<<<<<<<
 * 
 * cdef dict LOOKUPS = {
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__defaultdict));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__defaultdict));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__defaultdict));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__collections), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__defaultdict);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__defaultdict);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__defaultdict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":16
 * from collections import defaultdict
 * 
 * cdef dict LOOKUPS = {             # <<<<<<<<<<<<<<
 *     "gff":  {"chrom": 0, "start": 3, "end": 4, "stop": 4, "strand": 6},
 *     "vcf":  {"chrom": 0, "start": 1},
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "pybedtools/cbedtools.pyx":17
 * 
 * cdef dict LOOKUPS = {
 *     "gff":  {"chrom": 0, "start": 3, "end": 4, "stop": 4, "strand": 6},             # <<<<<<<<<<<<<<
 *     "vcf":  {"chrom": 0, "start": 1},
 *     "bed":  {"chrom": 0, "start": 1, "end": 2, "stop": 2, "score": 4, "strand": 5}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__chrom), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__start), __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__end), __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__stop), __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__strand), __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__gff), ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":18
 * cdef dict LOOKUPS = {
 *     "gff":  {"chrom": 0, "start": 3, "end": 4, "stop": 4, "strand": 6},
 *     "vcf":  {"chrom": 0, "start": 1},             # <<<<<<<<<<<<<<
 *     "bed":  {"chrom": 0, "start": 1, "end": 2, "stop": 2, "score": 4, "strand": 5}
 * }
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__chrom), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__start), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__vcf), ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":19
 *     "gff":  {"chrom": 0, "start": 3, "end": 4, "stop": 4, "strand": 6},
 *     "vcf":  {"chrom": 0, "start": 1},
 *     "bed":  {"chrom": 0, "start": 1, "end": 2, "stop": 2, "score": 4, "strand": 5}             # <<<<<<<<<<<<<<
 * }
 * for ktype, kdict in LOOKUPS.items():
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__chrom), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__start), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__end), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__stop), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__score), __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__strand), __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__bed), ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_XGOTREF(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS));
  __Pyx_DECREF(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_v_10pybedtools_9cbedtools_LOOKUPS = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pybedtools/cbedtools.pyx":21
 *     "bed":  {"chrom": 0, "start": 1, "end": 2, "stop": 2, "score": 4, "strand": 5}
 * }
 * for ktype, kdict in LOOKUPS.items():             # <<<<<<<<<<<<<<
 *     for k, v in kdict.items():
 *         kdict[v] = k
 */
  if (unlikely(((PyObject *)__pyx_v_10pybedtools_9cbedtools_LOOKUPS) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyDict_Items(__pyx_v_10pybedtools_9cbedtools_LOOKUPS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L5_unpacking_done:;
    }
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ktype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__kdict, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pybedtools/cbedtools.pyx":22
 * }
 * for ktype, kdict in LOOKUPS.items():
 *     for k, v in kdict.items():             # <<<<<<<<<<<<<<
 *         kdict[v] = k
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__kdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__items); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_6)) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_6)) {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_2 = __pyx_t_10(__pyx_t_6);
        if (unlikely(!__pyx_t_2)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = NULL;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_8 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L9_unpacking_done:;
      }
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__k, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__v, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "pybedtools/cbedtools.pyx":23
 * for ktype, kdict in LOOKUPS.items():
 *     for k, v in kdict.items():
 *         kdict[v] = k             # <<<<<<<<<<<<<<
 * 
 * # Keys are tuples of start/start, stop/stop, start/stop, stop/start.
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__kdict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__v); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (PyObject_SetItem(__pyx_t_7, __pyx_t_5, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":28
 * # Values are which operators should return True, otherwise False
 * # < 0 | <= 1 | == 2 | != 3 |  > 4 | >= 5
 * PROFILES_TRUE = {             # <<<<<<<<<<<<<<
 *                 (0, 0, -1, 1): (2, 1, 5),  # a == b, a >= b, a <= b
 *                 # a  ---------
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "pybedtools/cbedtools.pyx":29
 * # < 0 | <= 1 | == 2 | != 3 |  > 4 | >= 5
 * PROFILES_TRUE = {
 *                 (0, 0, -1, 1): (2, 1, 5),  # a == b, a >= b, a <= b             # <<<<<<<<<<<<<<
 *                 # a  ---------
 *                 # b  ---------
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_54), ((PyObject *)__pyx_k_tuple_55)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":33
 *                 # b  ---------
 * 
 *                 (-1, -1, -1, -1): (0, 1),  # a < b, a <= b             # <<<<<<<<<<<<<<
 *                 # a ----
 *                 # b       -----
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_56), ((PyObject *)__pyx_k_tuple_57)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":37
 *                 # b       -----
 * 
 *                 (-1, -1, -1, 0): (1,),  # a <= b             # <<<<<<<<<<<<<<
 *                 # a ----
 *                 # b     -----  (book-ended)
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_58), ((PyObject *)__pyx_k_tuple_59)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":41
 *                 # b     -----  (book-ended)
 * 
 *                 (1, 1, 0, 1): (5,),  # a >= b             # <<<<<<<<<<<<<<
 *                 # a     -----
 *                 # b ----      (book-ended)
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_60), ((PyObject *)__pyx_k_tuple_61)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":45
 *                 # b ----      (book-ended)
 * 
 *                 (1, 1, 1, 1): (4, 5), # a > b, a >= b             # <<<<<<<<<<<<<<
 *                 # a       ------
 *                 # b ----
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_62), ((PyObject *)__pyx_k_tuple_63)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":49
 *                 # b ----
 * 
 *                 (0, 1, -1, 1): (5,),  # a >= b             # <<<<<<<<<<<<<<
 *                 # a  ------------
 *                 # b  ---------
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_64), ((PyObject *)__pyx_k_tuple_65)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":53
 *                 # b  ---------
 * 
 *                 (1, 0, -1, 1): (5,),  # a >= b             # <<<<<<<<<<<<<<
 *                 # a   -----------
 *                 # b -------------
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_66), ((PyObject *)__pyx_k_tuple_67)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":57
 *                 # b -------------
 * 
 *                 (-1, 0, -1, 1): (1,),  # a <= b             # <<<<<<<<<<<<<<
 *                 # a -------------
 *                 # b   -----------
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_68), ((PyObject *)__pyx_k_tuple_69)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":61
 *                 # b   -----------
 * 
 *                 (0, -1, -1, 1): (1,), # a <= b             # <<<<<<<<<<<<<<
 *                 # a  ---------
 *                 # b  ------------
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_70), ((PyObject *)__pyx_k_tuple_71)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":65
 *                 # b  ------------
 * 
 *                 (-1, -1, -1, 1): (1,), # a <= b             # <<<<<<<<<<<<<<
 *                 # a -----------
 *                 # b        -----------
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_72), ((PyObject *)__pyx_k_tuple_73)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":69
 *                 # b        -----------
 * 
 *                 (1, 1, -1, 1): (5,),  # a >= b             # <<<<<<<<<<<<<<
 *                 # a        -----------
 *                 # b -----------
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_74), ((PyObject *)__pyx_k_tuple_75)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":73
 *                 # b -----------
 * 
 *                 (1, -1, -1, 1): tuple(), # undef             # <<<<<<<<<<<<<<
 *                 # a    ----
 *                 # b -----------
 */
  __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_76), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pybedtools/cbedtools.pyx":77
 *                 # b -----------
 * 
 *                 (-1, 1, -1, 1): tuple(), # undef             # <<<<<<<<<<<<<<
 *                 # a -----------
 *                 # b    ----
 */
  __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_77), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pybedtools/cbedtools.pyx":81
 *                 # b    ----
 * 
 *                 (-1, 0, -1, 0): (1,),  # a <= b             # <<<<<<<<<<<<<<
 *                 # a -----------
 *                 # b           -
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_78), ((PyObject *)__pyx_k_tuple_79)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":85
 *                 # b           -
 * 
 *                 (1, 0, 0, 1): (5,),  # a >= b             # <<<<<<<<<<<<<<
 *                 # a           -
 *                 # b -----------
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_80), ((PyObject *)__pyx_k_tuple_81)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pybedtools/cbedtools.pyx":89
 *                 # b -----------
 * 
 *                 (0, 0, 0, 0): (1, 2, 5),  # a == b, a <= b, a >= b             # <<<<<<<<<<<<<<
 *                 # a -
 *                 # b -  (starts and stops are identical for all features)
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_k_tuple_82), ((PyObject *)__pyx_k_tuple_83)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PROFILES_TRUE, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":95
 * 
 * 
 * class MalformedBedLineError(Exception):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_1), __pyx_n_s_30, __pyx_n_s_30, __pyx_n_s_84); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_30, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":344
 *     # TODO: make this more robust.
 *     @property
 *     def count(self):             # <<<<<<<<<<<<<<
 *         return int(self.fields[-1])
 * 
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_Interval, __pyx_n_s__count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_Interval->tp_dict, __pyx_n_s__count, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_10pybedtools_9cbedtools_Interval);

  /* "pybedtools/cbedtools.pyx":412
 *     # TODO: maybe bed.overlap_start or bed.overlap.start ??
 *     @property
 *     def o_start(self):             # <<<<<<<<<<<<<<
 *         return self._bed.o_start
 * 
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_Interval, __pyx_n_s__o_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_Interval->tp_dict, __pyx_n_s__o_start, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_10pybedtools_9cbedtools_Interval);

  /* "pybedtools/cbedtools.pyx":416
 * 
 *     @property
 *     def o_end(self):             # <<<<<<<<<<<<<<
 *         return self._bed.o_end
 * 
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_Interval, __pyx_n_s__o_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_Interval->tp_dict, __pyx_n_s__o_end, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_10pybedtools_9cbedtools_Interval);

  /* "pybedtools/cbedtools.pyx":420
 * 
 *     @property
 *     def o_amt(self):             # <<<<<<<<<<<<<<
 *         return self._bed.o_end - self._bed.o_start
 * 
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_Interval, __pyx_n_s__o_amt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_Interval->tp_dict, __pyx_n_s__o_amt, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_10pybedtools_9cbedtools_Interval);

  /* "pybedtools/cbedtools.pyx":587
 * 
 * 
 * def overlap(int s1, int s2, int e1, int e2):             # <<<<<<<<<<<<<<
 *     return min(e1, e2) - max(s1, s2)
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10pybedtools_9cbedtools_3overlap, NULL, __pyx_n_s_84); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__overlap, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":679
 * 
 *     @property
 *     def file_type(self):             # <<<<<<<<<<<<<<
 *         if not self.intervalFile_ptr._typeIsKnown:
 *             try:
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_IntervalFile, __pyx_n_s__file_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_IntervalFile->tp_dict, __pyx_n_s__file_type, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_10pybedtools_9cbedtools_IntervalFile);

  /* "pybedtools/cbedtools.pyx":724
 * 
 * 
 *     def all_hits(self, Interval interval, bool same_strand=False, float overlap=0.0):             # <<<<<<<<<<<<<<
 *         """
 *         :Signature: `IntervalFile.all_hits(interval, same_strand=False, overlap=0.0)`
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_42 = ((PyBoolObject *)__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":768
 * 
 *     # search() is an alias for all_hits
 *     search = all_hits             # <<<<<<<<<<<<<<
 * 
 *     def any_hits(self, Interval interval, bool same_strand=False, float overlap=0.0):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_IntervalFile, __pyx_n_s__all_hits); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10pybedtools_9cbedtools_IntervalFile->tp_dict, __pyx_n_s__search, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_10pybedtools_9cbedtools_IntervalFile);

  /* "pybedtools/cbedtools.pyx":770
 *     search = all_hits
 * 
 *     def any_hits(self, Interval interval, bool same_strand=False, float overlap=0.0):             # <<<<<<<<<<<<<<
 *         """
 *         :Signature: `IntervalFile.any_hits(interval, same_strand=False, overlap=0.0)`
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_43 = ((PyBoolObject *)__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":806
 *         return found
 * 
 *     def count_hits(self, Interval interval, bool same_strand=False, float overlap=0.0):             # <<<<<<<<<<<<<<
 *         """
 *         :Signature: `IntervalFile.count_hits(interval, same_strand=False, overlap=0.0)`
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_k_44 = ((PyBoolObject *)__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pybedtools/cbedtools.pyx":1
 * # cython: profile=True             # <<<<<<<<<<<<<<
 * 
 * """
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_88), ((PyObject *)__pyx_kp_u_89)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_90), ((PyObject *)__pyx_kp_u_91)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_92), ((PyObject *)__pyx_kp_u_93)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_94), ((PyObject *)__pyx_kp_u_95)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  if (__pyx_m) {
    __Pyx_AddTraceback("init pybedtools.cbedtools", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pybedtools.cbedtools");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

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

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

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

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

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

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    #if PY_VERSION_HEX < 0x02050000
    if (PyClass_Check(type)) {
    #else
    if (PyType_Check(type)) {
    #endif
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *args;
        if (!value)
            args = PyTuple_New(0);
        else if (PyTuple_Check(value)) {
            Py_INCREF(value);
            args = value;
        }
        else
            args = PyTuple_Pack(1, value);
        if (!args)
            goto bad;
        owned_instance = PyEval_CallObject(type, args);
        Py_DECREF(args);
        if (!owned_instance)
            goto bad;
        value = owned_instance;
        if (!PyExceptionInstance_Check(value)) {
            PyErr_Format(PyExc_TypeError,
                         "calling %R should have returned an instance of "
                         "BaseException, not %R",
                         type, Py_TYPE(value));
            goto bad;
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause && cause != Py_None) {
        PyObject *fixed_cause;
        if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        }
        else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        }
        else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (DECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import = 0;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    #if PY_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
                 PyString_AsString(name));
#else
    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
    PyObject *metaclass;
#if PY_MAJOR_VERSION < 3
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = PyObject_GetAttrString(base, (char *)"__class__");
        if (!metaclass) {
            PyErr_Clear();
            metaclass = (PyObject*) Py_TYPE(base);
        }
    } else {
        metaclass = (PyObject *) &PyClass_Type;
    }
#else
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = (PyObject*) Py_TYPE(base);
    } else {
        metaclass = (PyObject *) &PyType_Type;
    }
#endif
    Py_INCREF(metaclass);
    return metaclass;
}

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *qualname, PyObject *modname) {
    PyObject *result;
    PyObject *metaclass;
    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;
    if (PyDict_SetItemString(dict, "__qualname__", qualname) < 0)
        return NULL;
    metaclass = PyDict_GetItemString(dict, "__metaclass__");
    if (metaclass) {
        Py_INCREF(metaclass);
    } else {
        metaclass = __Pyx_FindPy2Metaclass(bases);
    }
    result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
    Py_DECREF(metaclass);
    return result;
}

static CYTHON_INLINE CHRPOS __Pyx_PyInt_from_py_CHRPOS(PyObject* x) {
    const CHRPOS neg_one = (CHRPOS)-1, const_zero = (CHRPOS)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(CHRPOS) == sizeof(char)) {
        if (is_unsigned)
            return (CHRPOS)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (CHRPOS)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(CHRPOS) == sizeof(short)) {
        if (is_unsigned)
            return (CHRPOS)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (CHRPOS)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(CHRPOS) == sizeof(int)) {
        if (is_unsigned)
            return (CHRPOS)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (CHRPOS)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(CHRPOS) == sizeof(long)) {
        if (is_unsigned)
            return (CHRPOS)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (CHRPOS)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(CHRPOS) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (CHRPOS)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (CHRPOS)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
        #else
        CHRPOS val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        #endif
        return (CHRPOS)-1;
    }
}

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

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

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

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = (start + end) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,      /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
