1 /* Generated by Cython 0.13 on Thu May 5 14:57:46 2011 */
3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
9 #include <stddef.h> /* For offsetof */
11 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
14 #if !defined(WIN32) && !defined(MS_WINDOWS)
27 #define DL_IMPORT(t) t
30 #define DL_EXPORT(t) t
34 #define PY_LONG_LONG LONG_LONG
37 #if PY_VERSION_HEX < 0x02040000
38 #define METH_COEXIST 0
39 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
40 #define PyDict_Contains(d,o) PySequence_Contains(d,o)
43 #if PY_VERSION_HEX < 0x02050000
44 typedef int Py_ssize_t;
45 #define PY_SSIZE_T_MAX INT_MAX
46 #define PY_SSIZE_T_MIN INT_MIN
47 #define PY_FORMAT_SIZE_T ""
48 #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
49 #define PyInt_AsSsize_t(o) PyInt_AsLong(o)
50 #define PyNumber_Index(o) PyNumber_Int(o)
51 #define PyIndex_Check(o) PyNumber_Check(o)
52 #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
55 #if PY_VERSION_HEX < 0x02060000
56 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
57 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
58 #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
59 #define PyVarObject_HEAD_INIT(type, size) \
60 PyObject_HEAD_INIT(type) size,
61 #define PyType_Modified(t)
73 Py_ssize_t *suboffsets;
77 #define PyBUF_SIMPLE 0
78 #define PyBUF_WRITABLE 0x0001
79 #define PyBUF_FORMAT 0x0004
80 #define PyBUF_ND 0x0008
81 #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
82 #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
83 #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
84 #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
85 #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
89 #if PY_MAJOR_VERSION < 3
90 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
92 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
95 #if PY_MAJOR_VERSION >= 3
96 #define Py_TPFLAGS_CHECKTYPES 0
97 #define Py_TPFLAGS_HAVE_INDEX 0
100 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
101 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
104 #if PY_MAJOR_VERSION >= 3
105 #define PyBaseString_Type PyUnicode_Type
106 #define PyStringObject PyUnicodeObject
107 #define PyString_Type PyUnicode_Type
108 #define PyString_Check PyUnicode_Check
109 #define PyString_CheckExact PyUnicode_CheckExact
112 #if PY_VERSION_HEX < 0x02060000
113 #define PyBytesObject PyStringObject
114 #define PyBytes_Type PyString_Type
115 #define PyBytes_Check PyString_Check
116 #define PyBytes_CheckExact PyString_CheckExact
117 #define PyBytes_FromString PyString_FromString
118 #define PyBytes_FromStringAndSize PyString_FromStringAndSize
119 #define PyBytes_FromFormat PyString_FromFormat
120 #define PyBytes_DecodeEscape PyString_DecodeEscape
121 #define PyBytes_AsString PyString_AsString
122 #define PyBytes_AsStringAndSize PyString_AsStringAndSize
123 #define PyBytes_Size PyString_Size
124 #define PyBytes_AS_STRING PyString_AS_STRING
125 #define PyBytes_GET_SIZE PyString_GET_SIZE
126 #define PyBytes_Repr PyString_Repr
127 #define PyBytes_Concat PyString_Concat
128 #define PyBytes_ConcatAndDel PyString_ConcatAndDel
129 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
130 #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
133 #ifndef PySet_CheckExact
134 # define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
137 #if PY_MAJOR_VERSION >= 3
138 #define PyInt_Type PyLong_Type
139 #define PyInt_Check(op) PyLong_Check(op)
140 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
141 #define PyInt_FromString PyLong_FromString
142 #define PyInt_FromUnicode PyLong_FromUnicode
143 #define PyInt_FromLong PyLong_FromLong
144 #define PyInt_FromSize_t PyLong_FromSize_t
145 #define PyInt_FromSsize_t PyLong_FromSsize_t
146 #define PyInt_AsLong PyLong_AsLong
147 #define PyInt_AS_LONG PyLong_AS_LONG
148 #define PyInt_AsSsize_t PyLong_AsSsize_t
149 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
150 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
153 #if PY_MAJOR_VERSION >= 3
154 #define PyBoolObject PyLongObject
158 #if PY_MAJOR_VERSION >= 3
159 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
160 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
162 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
163 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
166 #if PY_MAJOR_VERSION >= 3
167 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
170 #if PY_VERSION_HEX < 0x02050000
171 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
172 #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
173 #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
175 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
176 #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
177 #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
180 #if PY_VERSION_HEX < 0x02050000
181 #define __Pyx_NAMESTR(n) ((char *)(n))
182 #define __Pyx_DOCSTR(n) ((char *)(n))
184 #define __Pyx_NAMESTR(n) (n)
185 #define __Pyx_DOCSTR(n) (n)
189 #define __PYX_EXTERN_C extern "C"
191 #define __PYX_EXTERN_C extern
194 #if defined(WIN32) || defined(MS_WINDOWS)
195 #define _USE_MATH_DEFINES
198 #define __PYX_HAVE_API__ctabix
203 #include "sys/types.h"
204 #include "sys/stat.h"
210 #include "pythread.h"
212 /* inline attribute */
213 #ifndef CYTHON_INLINE
214 #if defined(__GNUC__)
215 #define CYTHON_INLINE __inline__
216 #elif defined(_MSC_VER)
217 #define CYTHON_INLINE __inline
218 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
219 #define CYTHON_INLINE inline
221 #define CYTHON_INLINE
225 /* unused attribute */
226 #ifndef CYTHON_UNUSED
227 # if defined(__GNUC__)
228 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
231 # define CYTHON_UNUSED
233 # elif defined(__ICC) || defined(__INTEL_COMPILER)
234 # define CYTHON_UNUSED __attribute__ ((__unused__))
236 # define CYTHON_UNUSED
240 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*/
243 /* Type Conversion Predeclarations */
245 #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
246 #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
248 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
249 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
250 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
252 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
253 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
254 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
256 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
260 /* Test for GCC > 2.95 */
261 #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
262 #define likely(x) __builtin_expect(!!(x), 1)
263 #define unlikely(x) __builtin_expect(!!(x), 0)
264 #else /* __GNUC__ > 2 ... */
265 #define likely(x) (x)
266 #define unlikely(x) (x)
267 #endif /* __GNUC__ > 2 ... */
269 #define likely(x) (x)
270 #define unlikely(x) (x)
271 #endif /* __GNUC__ */
273 static PyObject *__pyx_m;
274 static PyObject *__pyx_b;
275 static PyObject *__pyx_empty_tuple;
276 static PyObject *__pyx_empty_bytes;
277 static int __pyx_lineno;
278 static int __pyx_clineno = 0;
279 static const char * __pyx_cfilenm= __FILE__;
280 static const char *__pyx_filename;
283 static const char *__pyx_f[] = {
289 /* Type declarations */
291 /* "pysam/ctabix.pxd":178
292 * cdef tabix_t * tabixfile
294 * cdef class Parser: # <<<<<<<<<<<<<<
298 struct __pyx_obj_6ctabix_Parser {
302 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":293
305 * cdef class asVCF( Parser ): # <<<<<<<<<<<<<<
306 * '''converts a :term:`tabix row` into a VCF record.'''
307 * def __call__(self, char * buffer, int len ):
310 struct __pyx_obj_6ctabix_asVCF {
311 struct __pyx_obj_6ctabix_Parser __pyx_base;
314 /* "pysam/TabProxies.pxd":42
315 * ctypedef int uint64_t
317 * cdef class TupleProxy: # <<<<<<<<<<<<<<
322 struct __pyx_obj_10TabProxies_TupleProxy {
324 struct __pyx_vtabstruct_10TabProxies_TupleProxy *__pyx_vtab;
334 /* "pysam/TabProxies.pxd":77
335 * cdef update( self, char * buffer, size_t nbytes )
337 * cdef class NamedTupleProxy( TupleProxy) : # <<<<<<<<<<<<<<
342 struct __pyx_obj_10TabProxies_NamedTupleProxy {
343 struct __pyx_obj_10TabProxies_TupleProxy __pyx_base;
346 /* "pysam/TabProxies.pxd":80
349 * cdef class BedProxy( NamedTupleProxy) : # <<<<<<<<<<<<<<
354 struct __pyx_obj_10TabProxies_BedProxy {
355 struct __pyx_obj_10TabProxies_NamedTupleProxy __pyx_base;
362 /* "pysam/TabProxies.pxd":91
363 * cdef update( self, char * buffer, size_t nbytes )
365 * cdef class VCFProxy( NamedTupleProxy) : # <<<<<<<<<<<<<<
370 struct __pyx_obj_10TabProxies_VCFProxy {
371 struct __pyx_obj_10TabProxies_NamedTupleProxy __pyx_base;
376 /* "pysam/TabProxies.pxd":60
377 * cdef update( self, char * buffer, size_t nbytes )
379 * cdef class GTFProxy( TupleProxy) : # <<<<<<<<<<<<<<
384 struct __pyx_obj_10TabProxies_GTFProxy {
385 struct __pyx_obj_10TabProxies_TupleProxy __pyx_base;
395 int hasOwnAttributes;
398 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":161
401 * cdef class TabixIterator: # <<<<<<<<<<<<<<
402 * """iterates over rows in *tabixfile* in region
403 * given by *tid*, *start* and *end*.
406 struct __pyx_obj_6ctabix_TabixIterator {
412 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":304
413 * #########################################################
414 * #########################################################
415 * cdef class TabixIteratorParsed: # <<<<<<<<<<<<<<
416 * """iterates over mapped reads in a region.
420 struct __pyx_obj_6ctabix_TabixIteratorParsed {
424 struct __pyx_obj_6ctabix_Parser *parser;
427 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":216
428 * ti_iter_destroy(self.iterator)
430 * cdef class TabixHeaderIterator: # <<<<<<<<<<<<<<
431 * """return header lines.
435 struct __pyx_obj_6ctabix_TabixHeaderIterator {
441 /* "pysam/ctabix.pxd":172
442 * # char *ti_iter_read(BGZF *fp, ti_iter_t iter, int *len)
444 * cdef class Tabixfile: # <<<<<<<<<<<<<<
445 * cdef char * filename
449 struct __pyx_obj_6ctabix_Tabixfile {
455 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":277
458 * cdef class asGTF(Parser): # <<<<<<<<<<<<<<
459 * '''converts a :term:`tabix row` into a GTF record.'''
460 * def __call__(self, char * buffer, int len):
463 struct __pyx_obj_6ctabix_asGTF {
464 struct __pyx_obj_6ctabix_Parser __pyx_base;
467 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":285
470 * cdef class asBed( Parser ): # <<<<<<<<<<<<<<
471 * '''converts a :term:`tabix row` into a GTF record.'''
472 * def __call__(self, char * buffer, int len):
475 struct __pyx_obj_6ctabix_asBed {
476 struct __pyx_obj_6ctabix_Parser __pyx_base;
479 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":267
482 * cdef class asTuple(Parser): # <<<<<<<<<<<<<<
483 * '''converts a :term:`tabix row` into a python tuple.'''
484 * def __call__(self, char * buffer, int len):
487 struct __pyx_obj_6ctabix_asTuple {
488 struct __pyx_obj_6ctabix_Parser __pyx_base;
492 /* "pysam/TabProxies.pxd":42
493 * ctypedef int uint64_t
495 * cdef class TupleProxy: # <<<<<<<<<<<<<<
500 struct __pyx_vtabstruct_10TabProxies_TupleProxy {
501 int (*getMaxFields)(struct __pyx_obj_10TabProxies_TupleProxy *, size_t);
502 PyObject *(*take)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
503 PyObject *(*present)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
504 PyObject *(*copy)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
505 PyObject *(*update)(struct __pyx_obj_10TabProxies_TupleProxy *, char *, size_t);
507 static struct __pyx_vtabstruct_10TabProxies_TupleProxy *__pyx_vtabptr_10TabProxies_TupleProxy;
510 /* "pysam/TabProxies.pxd":77
511 * cdef update( self, char * buffer, size_t nbytes )
513 * cdef class NamedTupleProxy( TupleProxy) : # <<<<<<<<<<<<<<
518 struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy {
519 struct __pyx_vtabstruct_10TabProxies_TupleProxy __pyx_base;
521 static struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy *__pyx_vtabptr_10TabProxies_NamedTupleProxy;
524 /* "pysam/TabProxies.pxd":91
525 * cdef update( self, char * buffer, size_t nbytes )
527 * cdef class VCFProxy( NamedTupleProxy) : # <<<<<<<<<<<<<<
532 struct __pyx_vtabstruct_10TabProxies_VCFProxy {
533 struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy __pyx_base;
535 static struct __pyx_vtabstruct_10TabProxies_VCFProxy *__pyx_vtabptr_10TabProxies_VCFProxy;
538 /* "pysam/TabProxies.pxd":80
541 * cdef class BedProxy( NamedTupleProxy) : # <<<<<<<<<<<<<<
546 struct __pyx_vtabstruct_10TabProxies_BedProxy {
547 struct __pyx_vtabstruct_10TabProxies_NamedTupleProxy __pyx_base;
549 static struct __pyx_vtabstruct_10TabProxies_BedProxy *__pyx_vtabptr_10TabProxies_BedProxy;
552 /* "pysam/TabProxies.pxd":60
553 * cdef update( self, char * buffer, size_t nbytes )
555 * cdef class GTFProxy( TupleProxy) : # <<<<<<<<<<<<<<
560 struct __pyx_vtabstruct_10TabProxies_GTFProxy {
561 struct __pyx_vtabstruct_10TabProxies_TupleProxy __pyx_base;
563 static struct __pyx_vtabstruct_10TabProxies_GTFProxy *__pyx_vtabptr_10TabProxies_GTFProxy;
565 #ifndef CYTHON_REFNANNY
566 #define CYTHON_REFNANNY 0
571 void (*INCREF)(void*, PyObject*, int);
572 void (*DECREF)(void*, PyObject*, int);
573 void (*GOTREF)(void*, PyObject*, int);
574 void (*GIVEREF)(void*, PyObject*, int);
575 void* (*SetupContext)(const char*, int, const char*);
576 void (*FinishContext)(void**);
577 } __Pyx_RefNannyAPIStruct;
578 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
579 static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
580 PyObject *m = NULL, *p = NULL;
582 m = PyImport_ImportModule((char *)modname);
584 p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
586 r = PyLong_AsVoidPtr(p);
590 return (__Pyx_RefNannyAPIStruct *)r;
592 #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
593 #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
594 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
595 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
596 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
597 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
598 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
600 #define __Pyx_RefNannySetupContext(name)
601 #define __Pyx_RefNannyFinishContext()
602 #define __Pyx_INCREF(r) Py_INCREF(r)
603 #define __Pyx_DECREF(r) Py_DECREF(r)
604 #define __Pyx_GOTREF(r)
605 #define __Pyx_GIVEREF(r)
606 #define __Pyx_XDECREF(r) Py_XDECREF(r)
607 #endif /* CYTHON_REFNANNY */
608 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
609 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
611 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
613 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
614 const char* function_name, int kw_allowed); /*proto*/
616 static void __Pyx_RaiseDoubleKeywordsError(
617 const char* func_name, PyObject* kw_name); /*proto*/
619 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
620 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
622 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
625 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
628 r = PyObject_GetItem(o, j);
634 #define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
635 __Pyx_GetItemInt_List_Fast(o, i) : \
636 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
638 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
639 if (likely(o != Py_None)) {
640 if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
641 PyObject *r = PyList_GET_ITEM(o, i);
645 else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
646 PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
651 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
654 #define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
655 __Pyx_GetItemInt_Tuple_Fast(o, i) : \
656 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
658 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
659 if (likely(o != Py_None)) {
660 if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
661 PyObject *r = PyTuple_GET_ITEM(o, i);
665 else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
666 PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
671 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
675 #define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
676 __Pyx_GetItemInt_Fast(o, i) : \
677 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
679 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
681 if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
682 r = PyList_GET_ITEM(o, i);
685 else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
686 r = PyTuple_GET_ITEM(o, i);
689 else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
690 r = PySequence_GetItem(o, i);
693 r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
698 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
700 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
702 static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
703 static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/
705 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
706 const char *name, int exact); /*proto*/
708 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);
711 #if PY_MAJOR_VERSION >= 3
712 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
714 if (unlikely(d == Py_None)) {
715 __Pyx_RaiseNoneIndexingError();
718 value = PyDict_GetItemWithError(d, key);
719 if (unlikely(!value)) {
720 if (!PyErr_Occurred())
721 PyErr_SetObject(PyExc_KeyError, key);
728 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
731 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
733 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
734 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
736 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
738 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
739 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
741 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
743 static CYTHON_INLINE int32_t __Pyx_PyInt_from_py_int32_t(PyObject *);
745 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
747 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
749 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
751 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
753 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
755 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
757 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
759 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
761 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
763 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
765 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
767 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
769 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
771 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
773 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
775 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
777 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/
779 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
781 static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
783 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
785 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
786 /* Module declarations from cpython.version */
788 /* Module declarations from cpython.ref */
790 /* Module declarations from cpython.exc */
792 /* Module declarations from cpython.module */
794 /* Module declarations from cpython.mem */
796 /* Module declarations from cpython.tuple */
798 /* Module declarations from cpython.list */
800 /* Module declarations from libc.stdio */
802 /* Module declarations from cpython.object */
804 /* Module declarations from cpython.sequence */
806 /* Module declarations from cpython.mapping */
808 /* Module declarations from cpython.iterator */
810 /* Module declarations from cpython.type */
812 /* Module declarations from cpython.number */
814 /* Module declarations from cpython.int */
816 /* Module declarations from __builtin__ */
818 /* Module declarations from cpython.bool */
820 static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
821 /* Module declarations from cpython.long */
823 /* Module declarations from cpython.float */
825 /* Module declarations from cpython.complex */
827 /* Module declarations from cpython.string */
829 /* Module declarations from cpython.unicode */
831 /* Module declarations from cpython.dict */
833 /* Module declarations from cpython.instance */
835 /* Module declarations from cpython.function */
837 /* Module declarations from cpython.method */
839 /* Module declarations from cpython.weakref */
841 /* Module declarations from cpython.getargs */
843 /* Module declarations from cpython.pythread */
845 /* Module declarations from cpython.cobject */
847 /* Module declarations from cpython.oldbuffer */
849 /* Module declarations from cpython.set */
851 /* Module declarations from cpython.buffer */
853 /* Module declarations from cpython.bytes */
855 /* Module declarations from cpython.pycapsule */
857 /* Module declarations from cpython */
859 /* Module declarations from TabProxies */
861 static PyTypeObject *__pyx_ptype_10TabProxies_TupleProxy = 0;
862 static PyTypeObject *__pyx_ptype_10TabProxies_GTFProxy = 0;
863 static PyTypeObject *__pyx_ptype_10TabProxies_NamedTupleProxy = 0;
864 static PyTypeObject *__pyx_ptype_10TabProxies_BedProxy = 0;
865 static PyTypeObject *__pyx_ptype_10TabProxies_VCFProxy = 0;
866 /* Module declarations from ctabix */
868 static PyTypeObject *__pyx_ptype_6ctabix_Tabixfile = 0;
869 static PyTypeObject *__pyx_ptype_6ctabix_Parser = 0;
870 static PyTypeObject *__pyx_ptype_6ctabix_TabixIterator = 0;
871 static PyTypeObject *__pyx_ptype_6ctabix_TabixHeaderIterator = 0;
872 static PyTypeObject *__pyx_ptype_6ctabix_asTuple = 0;
873 static PyTypeObject *__pyx_ptype_6ctabix_asGTF = 0;
874 static PyTypeObject *__pyx_ptype_6ctabix_asBed = 0;
875 static PyTypeObject *__pyx_ptype_6ctabix_asVCF = 0;
876 static PyTypeObject *__pyx_ptype_6ctabix_TabixIteratorParsed = 0;
877 #define __Pyx_MODULE_NAME "ctabix"
878 int __pyx_module_is_main_ctabix = 0;
880 /* Implementation of ctabix */
881 static PyObject *__pyx_builtin_IOError;
882 static PyObject *__pyx_builtin_ValueError;
883 static PyObject *__pyx_builtin_StopIteration;
884 static PyObject *__pyx_builtin_OSError;
885 static PyObject *__pyx_builtin_ord;
886 static PyObject *__pyx_builtin_KeyError;
887 static char __pyx_k_1[] = "invalid file opening mode `%s`";
888 static char __pyx_k_2[] = ".tbi";
889 static char __pyx_k_3[] = "file `%s` not found";
890 static char __pyx_k_4[] = "index `%s` not found";
891 static char __pyx_k_5[] = "could not open file `%s`";
892 static char __pyx_k_6[] = "%s:%i-%i";
893 static char __pyx_k_7[] = "invalid region `%s`";
894 static char __pyx_k_8[] = "invalid region: start (%i) > end (%i)";
895 static char __pyx_k_9[] = "start out of range (%i)";
896 static char __pyx_k_10[] = "end out of range (%i)";
897 static char __pyx_k_11[] = "I/O operation on closed file";
898 static char __pyx_k_12[] = "malformatted query or wrong sequence name.\n";
899 static char __pyx_k_13[] = "can't open header.\n";
900 static char __pyx_k_15[] = "Filename '%s' already exists, use *force* to overwrite";
901 static char __pyx_k_16[] = "could not open '%s' for writing";
902 static char __pyx_k_17[] = "could not open '%s' for reading";
903 static char __pyx_k_18[] = "writing failed";
904 static char __pyx_k_20[] = "#";
905 static char __pyx_k_22[] = "No such file '%s'";
906 static char __pyx_k_23[] = ".gz";
907 static char __pyx_k_24[] = "Filename '%s.tbi' already exists, use *force* to overwrite";
908 static char __pyx_k_25[] = "unknown preset '%s', valid presets are '%s'";
909 static char __pyx_k_26[] = ",";
910 static char __pyx_k_27[] = "chromosome names";
911 static char __pyx_k_28[] = "Tabixfile._isOpen (line 19)";
912 static char __pyx_k_29[] = "Tabixfile._open (line 23)";
913 static char __pyx_k_30[] = "Tabixfile._parseRegion (line 57)";
914 static char __pyx_k_31[] = "Tabixfile.fetch (line 102)";
915 static char __pyx_k_32[] = "Tabixfile.header.__get__ (line 140)";
916 static char __pyx_k_33[] = "TabixIterator.__next__ (line 192)";
917 static char __pyx_k_34[] = "TabixHeaderIterator.__next__ (line 239)";
918 static char __pyx_k_35[] = "TabixIteratorParsed.__next__ (line 342)";
919 static char __pyx_k_36[] = "tabix_compress (line 362)";
920 static char __pyx_k_37[] = "tabix_index (line 407)";
921 static char __pyx_k__r[] = "r";
922 static char __pyx_k__w[] = "w";
923 static char __pyx_k__bc[] = "bc";
924 static char __pyx_k__ec[] = "ec";
925 static char __pyx_k__fp[] = "fp";
926 static char __pyx_k__os[] = "os";
927 static char __pyx_k__sc[] = "sc";
928 static char __pyx_k__bed[] = "bed";
929 static char __pyx_k__end[] = "end";
930 static char __pyx_k__gff[] = "gff";
931 static char __pyx_k__idx[] = "idx";
932 static char __pyx_k__len[] = "len";
933 static char __pyx_k__ord[] = "ord";
934 static char __pyx_k__sam[] = "sam";
935 static char __pyx_k__sys[] = "sys";
936 static char __pyx_k__tid[] = "tid";
937 static char __pyx_k__vcf[] = "vcf";
938 static char __pyx_k__copy[] = "copy";
939 static char __pyx_k__gzip[] = "gzip";
940 static char __pyx_k__join[] = "join";
941 static char __pyx_k__keys[] = "keys";
942 static char __pyx_k__mode[] = "mode";
943 static char __pyx_k__path[] = "path";
944 static char __pyx_k___open[] = "_open";
945 static char __pyx_k__asBed[] = "asBed";
946 static char __pyx_k__asGTF[] = "asGTF";
947 static char __pyx_k__asVCF[] = "asVCF";
948 static char __pyx_k__close[] = "close";
949 static char __pyx_k__fetch[] = "fetch";
950 static char __pyx_k__force[] = "force";
951 static char __pyx_k__start[] = "start";
952 static char __pyx_k__types[] = "types";
953 static char __pyx_k__buffer[] = "buffer";
954 static char __pyx_k__ctypes[] = "ctypes";
955 static char __pyx_k__exists[] = "exists";
956 static char __pyx_k__header[] = "header";
957 static char __pyx_k__parser[] = "parser";
958 static char __pyx_k__pileup[] = "pileup";
959 static char __pyx_k__preset[] = "preset";
960 static char __pyx_k__psltbl[] = "psltbl";
961 static char __pyx_k__region[] = "region";
962 static char __pyx_k__struct[] = "struct";
963 static char __pyx_k__unlink[] = "unlink";
964 static char __pyx_k__IOError[] = "IOError";
965 static char __pyx_k__OSError[] = "OSError";
966 static char __pyx_k____all__[] = "__all__";
967 static char __pyx_k____get__[] = "__get__";
968 static char __pyx_k___isOpen[] = "_isOpen";
969 static char __pyx_k__asTuple[] = "asTuple";
970 static char __pyx_k__end_col[] = "end_col";
971 static char __pyx_k__seq_col[] = "seq_col";
972 static char __pyx_k__KeyError[] = "KeyError";
973 static char __pyx_k__O_RDONLY[] = "O_RDONLY";
974 static char __pyx_k____main__[] = "__main__";
975 static char __pyx_k____next__[] = "__next__";
976 static char __pyx_k____test__[] = "__test__";
977 static char __pyx_k__endswith[] = "endswith";
978 static char __pyx_k__filename[] = "filename";
979 static char __pyx_k__iterator[] = "iterator";
980 static char __pyx_k__tempfile[] = "tempfile";
981 static char __pyx_k__Tabixfile[] = "Tabixfile";
982 static char __pyx_k__itertools[] = "itertools";
983 static char __pyx_k__line_skip[] = "line_skip";
984 static char __pyx_k__meta_char[] = "meta_char";
985 static char __pyx_k__reference[] = "reference";
986 static char __pyx_k__start_col[] = "start_col";
987 static char __pyx_k__tabixfile[] = "tabixfile";
988 static char __pyx_k__zerobased[] = "zerobased";
989 static char __pyx_k__ValueError[] = "ValueError";
990 static char __pyx_k__filename_in[] = "filename_in";
991 static char __pyx_k__tabix_index[] = "tabix_index";
992 static char __pyx_k___parseRegion[] = "_parseRegion";
993 static char __pyx_k__filename_out[] = "filename_out";
994 static char __pyx_k__StopIteration[] = "StopIteration";
995 static char __pyx_k__TabixIterator[] = "TabixIterator";
996 static char __pyx_k__tabix_compress[] = "tabix_compress";
997 static char __pyx_k__TabixHeaderIterator[] = "TabixHeaderIterator";
998 static char __pyx_k__TabixIteratorParsed[] = "TabixIteratorParsed";
999 static PyObject *__pyx_kp_s_1;
1000 static PyObject *__pyx_kp_s_10;
1001 static PyObject *__pyx_kp_s_11;
1002 static PyObject *__pyx_kp_s_12;
1003 static PyObject *__pyx_kp_s_13;
1004 static PyObject *__pyx_kp_s_15;
1005 static PyObject *__pyx_kp_s_16;
1006 static PyObject *__pyx_kp_s_17;
1007 static PyObject *__pyx_kp_s_18;
1008 static PyObject *__pyx_kp_s_2;
1009 static PyObject *__pyx_kp_s_20;
1010 static PyObject *__pyx_kp_s_22;
1011 static PyObject *__pyx_kp_s_23;
1012 static PyObject *__pyx_kp_s_24;
1013 static PyObject *__pyx_kp_s_25;
1014 static PyObject *__pyx_kp_s_26;
1015 static PyObject *__pyx_kp_u_28;
1016 static PyObject *__pyx_kp_u_29;
1017 static PyObject *__pyx_kp_s_3;
1018 static PyObject *__pyx_kp_u_30;
1019 static PyObject *__pyx_kp_u_31;
1020 static PyObject *__pyx_kp_u_32;
1021 static PyObject *__pyx_kp_u_33;
1022 static PyObject *__pyx_kp_u_34;
1023 static PyObject *__pyx_kp_u_35;
1024 static PyObject *__pyx_kp_u_36;
1025 static PyObject *__pyx_kp_u_37;
1026 static PyObject *__pyx_kp_s_4;
1027 static PyObject *__pyx_kp_s_5;
1028 static PyObject *__pyx_kp_s_6;
1029 static PyObject *__pyx_kp_s_7;
1030 static PyObject *__pyx_kp_s_8;
1031 static PyObject *__pyx_kp_s_9;
1032 static PyObject *__pyx_n_s__IOError;
1033 static PyObject *__pyx_n_s__KeyError;
1034 static PyObject *__pyx_n_s__OSError;
1035 static PyObject *__pyx_n_s__O_RDONLY;
1036 static PyObject *__pyx_n_s__StopIteration;
1037 static PyObject *__pyx_n_s__TabixHeaderIterator;
1038 static PyObject *__pyx_n_s__TabixIterator;
1039 static PyObject *__pyx_n_s__TabixIteratorParsed;
1040 static PyObject *__pyx_n_s__Tabixfile;
1041 static PyObject *__pyx_n_s__ValueError;
1042 static PyObject *__pyx_n_s____all__;
1043 static PyObject *__pyx_n_s____get__;
1044 static PyObject *__pyx_n_s____main__;
1045 static PyObject *__pyx_n_s____next__;
1046 static PyObject *__pyx_n_s____test__;
1047 static PyObject *__pyx_n_s___isOpen;
1048 static PyObject *__pyx_n_s___open;
1049 static PyObject *__pyx_n_s___parseRegion;
1050 static PyObject *__pyx_n_s__asBed;
1051 static PyObject *__pyx_n_s__asGTF;
1052 static PyObject *__pyx_n_s__asTuple;
1053 static PyObject *__pyx_n_s__asVCF;
1054 static PyObject *__pyx_n_s__bc;
1055 static PyObject *__pyx_n_s__bed;
1056 static PyObject *__pyx_n_s__buffer;
1057 static PyObject *__pyx_n_s__close;
1058 static PyObject *__pyx_n_s__copy;
1059 static PyObject *__pyx_n_s__ctypes;
1060 static PyObject *__pyx_n_s__ec;
1061 static PyObject *__pyx_n_s__end;
1062 static PyObject *__pyx_n_s__end_col;
1063 static PyObject *__pyx_n_s__endswith;
1064 static PyObject *__pyx_n_s__exists;
1065 static PyObject *__pyx_n_s__fetch;
1066 static PyObject *__pyx_n_s__filename;
1067 static PyObject *__pyx_n_s__filename_in;
1068 static PyObject *__pyx_n_s__filename_out;
1069 static PyObject *__pyx_n_s__force;
1070 static PyObject *__pyx_n_s__fp;
1071 static PyObject *__pyx_n_s__gff;
1072 static PyObject *__pyx_n_s__gzip;
1073 static PyObject *__pyx_n_s__header;
1074 static PyObject *__pyx_n_s__idx;
1075 static PyObject *__pyx_n_s__iterator;
1076 static PyObject *__pyx_n_s__itertools;
1077 static PyObject *__pyx_n_s__join;
1078 static PyObject *__pyx_n_s__keys;
1079 static PyObject *__pyx_n_s__len;
1080 static PyObject *__pyx_n_s__line_skip;
1081 static PyObject *__pyx_n_s__meta_char;
1082 static PyObject *__pyx_n_s__mode;
1083 static PyObject *__pyx_n_s__ord;
1084 static PyObject *__pyx_n_s__os;
1085 static PyObject *__pyx_n_s__parser;
1086 static PyObject *__pyx_n_s__path;
1087 static PyObject *__pyx_n_s__pileup;
1088 static PyObject *__pyx_n_s__preset;
1089 static PyObject *__pyx_n_s__psltbl;
1090 static PyObject *__pyx_n_s__r;
1091 static PyObject *__pyx_n_s__reference;
1092 static PyObject *__pyx_n_s__region;
1093 static PyObject *__pyx_n_s__sam;
1094 static PyObject *__pyx_n_s__sc;
1095 static PyObject *__pyx_n_s__seq_col;
1096 static PyObject *__pyx_n_s__start;
1097 static PyObject *__pyx_n_s__start_col;
1098 static PyObject *__pyx_n_s__struct;
1099 static PyObject *__pyx_n_s__sys;
1100 static PyObject *__pyx_n_s__tabix_compress;
1101 static PyObject *__pyx_n_s__tabix_index;
1102 static PyObject *__pyx_n_s__tabixfile;
1103 static PyObject *__pyx_n_s__tempfile;
1104 static PyObject *__pyx_n_s__tid;
1105 static PyObject *__pyx_n_s__types;
1106 static PyObject *__pyx_n_s__unlink;
1107 static PyObject *__pyx_n_s__vcf;
1108 static PyObject *__pyx_n_s__w;
1109 static PyObject *__pyx_n_s__zerobased;
1110 static PyObject *__pyx_int_0;
1111 static PyObject *__pyx_int_1;
1112 static PyObject *__pyx_int_2;
1113 static PyObject *__pyx_int_3;
1114 static PyObject *__pyx_int_4;
1115 static PyObject *__pyx_int_5;
1116 static PyObject *__pyx_int_neg_1;
1117 static PyObject *__pyx_int_15;
1118 static PyObject *__pyx_int_17;
1119 static PyObject *__pyx_int_18;
1120 static PyObject *__pyx_int_0x10000;
1121 static PyObject *__pyx_k_14;
1122 static PyObject *__pyx_k_19;
1123 static PyObject *__pyx_k_21;
1125 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":15
1128 * def __cinit__(self, *args, **kwargs ): # <<<<<<<<<<<<<<
1129 * self.tabixfile = NULL
1130 * self._open( *args, **kwargs )
1133 static int __pyx_pf_6ctabix_9Tabixfile___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1134 static int __pyx_pf_6ctabix_9Tabixfile___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1135 PyObject *__pyx_v_args = 0;
1136 PyObject *__pyx_v_kwargs = 0;
1138 PyObject *__pyx_t_1 = NULL;
1139 PyObject *__pyx_t_2 = NULL;
1140 PyObject *__pyx_t_3 = NULL;
1141 __Pyx_RefNannySetupContext("__cinit__");
1142 if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
1143 __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
1144 if (unlikely(!__pyx_v_kwargs)) return -1;
1145 __Pyx_GOTREF(__pyx_v_kwargs);
1146 __Pyx_INCREF(__pyx_args);
1147 __pyx_v_args = __pyx_args;
1149 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":16
1151 * def __cinit__(self, *args, **kwargs ):
1152 * self.tabixfile = NULL # <<<<<<<<<<<<<<
1153 * self._open( *args, **kwargs )
1156 ((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->tabixfile = NULL;
1158 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":17
1159 * def __cinit__(self, *args, **kwargs ):
1160 * self.tabixfile = NULL
1161 * self._open( *args, **kwargs ) # <<<<<<<<<<<<<<
1163 * def _isOpen( self ):
1165 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1166 __Pyx_GOTREF(__pyx_t_1);
1167 __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1168 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
1169 __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_v_kwargs)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1170 __Pyx_GOTREF(__pyx_t_3);
1171 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1172 __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
1173 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1178 __Pyx_XDECREF(__pyx_t_1);
1179 __Pyx_XDECREF(__pyx_t_2);
1180 __Pyx_XDECREF(__pyx_t_3);
1181 __Pyx_AddTraceback("ctabix.Tabixfile.__cinit__");
1184 __Pyx_DECREF(__pyx_v_args);
1185 __Pyx_DECREF(__pyx_v_kwargs);
1186 __Pyx_RefNannyFinishContext();
1190 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":19
1191 * self._open( *args, **kwargs )
1193 * def _isOpen( self ): # <<<<<<<<<<<<<<
1194 * '''return true if samfile has been opened.'''
1195 * return self.tabixfile != NULL
1198 static PyObject *__pyx_pf_6ctabix_9Tabixfile__isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1199 static char __pyx_doc_6ctabix_9Tabixfile__isOpen[] = "Tabixfile._isOpen(self)\nreturn true if samfile has been opened.";
1200 static PyObject *__pyx_pf_6ctabix_9Tabixfile__isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1201 PyObject *__pyx_r = NULL;
1202 PyObject *__pyx_t_1 = NULL;
1203 __Pyx_RefNannySetupContext("_isOpen");
1205 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":21
1206 * def _isOpen( self ):
1207 * '''return true if samfile has been opened.'''
1208 * return self.tabixfile != NULL # <<<<<<<<<<<<<<
1212 __Pyx_XDECREF(__pyx_r);
1213 __pyx_t_1 = __Pyx_PyBool_FromLong((((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->tabixfile != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1214 __Pyx_GOTREF(__pyx_t_1);
1215 __pyx_r = __pyx_t_1;
1219 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1222 __Pyx_XDECREF(__pyx_t_1);
1223 __Pyx_AddTraceback("ctabix.Tabixfile._isOpen");
1226 __Pyx_XGIVEREF(__pyx_r);
1227 __Pyx_RefNannyFinishContext();
1231 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":23
1232 * return self.tabixfile != NULL
1234 * def _open( self, # <<<<<<<<<<<<<<
1239 static PyObject *__pyx_pf_6ctabix_9Tabixfile__open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1240 static char __pyx_doc_6ctabix_9Tabixfile__open[] = "Tabixfile._open(self, char *filename, mode='r')\nopen a :term:`tabix file` for reading.\n ";
1241 static PyObject *__pyx_pf_6ctabix_9Tabixfile__open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1242 char *__pyx_v_filename;
1243 PyObject *__pyx_v_mode = 0;
1244 PyObject *__pyx_v_filename_index;
1245 PyObject *__pyx_r = NULL;
1246 PyObject *__pyx_t_1 = NULL;
1247 PyObject *__pyx_t_2 = NULL;
1249 PyObject *__pyx_t_4 = NULL;
1252 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,&__pyx_n_s__mode,0};
1253 __Pyx_RefNannySetupContext("_open");
1254 if (unlikely(__pyx_kwds)) {
1255 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
1256 PyObject* values[2] = {0,0};
1257 values[1] = ((PyObject *)__pyx_n_s__r);
1258 switch (PyTuple_GET_SIZE(__pyx_args)) {
1259 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1260 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1262 default: goto __pyx_L5_argtuple_error;
1264 switch (PyTuple_GET_SIZE(__pyx_args)) {
1266 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename);
1267 if (likely(values[0])) kw_args--;
1268 else goto __pyx_L5_argtuple_error;
1271 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode);
1272 if (value) { values[1] = value; kw_args--; }
1275 if (unlikely(kw_args > 0)) {
1276 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_open") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1278 __pyx_v_filename = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1279 __pyx_v_mode = values[1];
1281 __pyx_v_mode = ((PyObject *)__pyx_n_s__r);
1282 switch (PyTuple_GET_SIZE(__pyx_args)) {
1283 case 2: __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 1);
1284 case 1: __pyx_v_filename = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1286 default: goto __pyx_L5_argtuple_error;
1289 goto __pyx_L4_argument_unpacking_done;
1290 __pyx_L5_argtuple_error:;
1291 __Pyx_RaiseArgtupleInvalid("_open", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1293 __Pyx_AddTraceback("ctabix.Tabixfile._open");
1294 __Pyx_RefNannyFinishContext();
1296 __pyx_L4_argument_unpacking_done:;
1297 __pyx_v_filename_index = Py_None; __Pyx_INCREF(Py_None);
1299 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":30
1302 * assert mode in ( "r",), "invalid file opening mode `%s`" % mode # <<<<<<<<<<<<<<
1304 * # close a previously opened file
1306 #ifndef PYREX_WITHOUT_ASSERTIONS
1307 __Pyx_INCREF(__pyx_v_mode);
1308 __pyx_t_1 = __pyx_v_mode;
1309 __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__r), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1310 __Pyx_GOTREF(__pyx_t_2);
1311 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1312 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1313 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1314 if (unlikely(!__pyx_t_3)) {
1315 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_v_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1316 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
1317 PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_t_1));
1318 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
1319 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1323 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":33
1325 * # close a previously opened file
1326 * if self.tabixfile != NULL: self.close() # <<<<<<<<<<<<<<
1327 * self.tabixfile = NULL
1330 __pyx_t_3 = (((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->tabixfile != NULL);
1332 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1333 __Pyx_GOTREF(__pyx_t_1);
1334 __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 = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1335 __Pyx_GOTREF(__pyx_t_2);
1336 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1337 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1342 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":34
1343 * # close a previously opened file
1344 * if self.tabixfile != NULL: self.close()
1345 * self.tabixfile = NULL # <<<<<<<<<<<<<<
1347 * self.filename = filename
1349 ((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->tabixfile = NULL;
1351 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":36
1352 * self.tabixfile = NULL
1354 * self.filename = filename # <<<<<<<<<<<<<<
1355 * filename_index = filename + ".tbi"
1358 ((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->filename = __pyx_v_filename;
1360 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":37
1362 * self.filename = filename
1363 * filename_index = filename + ".tbi" # <<<<<<<<<<<<<<
1365 * if mode[0] == 'w':
1367 __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1368 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
1369 __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1370 __Pyx_GOTREF(__pyx_t_1);
1371 __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
1372 __Pyx_DECREF(__pyx_v_filename_index);
1373 __pyx_v_filename_index = __pyx_t_1;
1376 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":39
1377 * filename_index = filename + ".tbi"
1379 * if mode[0] == 'w': # <<<<<<<<<<<<<<
1380 * # open file for writing
1383 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mode, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1384 __Pyx_GOTREF(__pyx_t_1);
1385 __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__w), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1386 __Pyx_GOTREF(__pyx_t_2);
1387 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1388 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1389 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1394 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":43
1397 * elif mode[0] == "r": # <<<<<<<<<<<<<<
1398 * # open file for reading
1399 * if not os.path.exists( self.filename ):
1401 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_mode, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1402 __Pyx_GOTREF(__pyx_t_2);
1403 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__r), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1404 __Pyx_GOTREF(__pyx_t_1);
1405 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1406 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1407 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1410 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":45
1411 * elif mode[0] == "r":
1412 * # open file for reading
1413 * if not os.path.exists( self.filename ): # <<<<<<<<<<<<<<
1414 * raise IOError( "file `%s` not found" % self.filename)
1417 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1418 __Pyx_GOTREF(__pyx_t_1);
1419 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1420 __Pyx_GOTREF(__pyx_t_2);
1421 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1422 __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__exists); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1423 __Pyx_GOTREF(__pyx_t_1);
1424 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1425 __pyx_t_2 = PyBytes_FromString(((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1426 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
1427 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1428 __Pyx_GOTREF(__pyx_t_4);
1429 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_2));
1430 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
1432 __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1433 __Pyx_GOTREF(__pyx_t_2);
1434 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1435 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1436 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1437 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1438 __pyx_t_5 = (!__pyx_t_3);
1441 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":46
1442 * # open file for reading
1443 * if not os.path.exists( self.filename ):
1444 * raise IOError( "file `%s` not found" % self.filename) # <<<<<<<<<<<<<<
1446 * if not os.path.exists( filename_index ):
1448 __pyx_t_2 = PyBytes_FromString(((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1449 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
1450 __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1451 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
1452 __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
1453 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1454 __Pyx_GOTREF(__pyx_t_2);
1455 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
1456 __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
1458 __pyx_t_4 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1459 __Pyx_GOTREF(__pyx_t_4);
1460 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1461 __Pyx_Raise(__pyx_t_4, 0, 0);
1462 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1463 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1468 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":48
1469 * raise IOError( "file `%s` not found" % self.filename)
1471 * if not os.path.exists( filename_index ): # <<<<<<<<<<<<<<
1472 * raise IOError( "index `%s` not found" % filename_index)
1475 __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1476 __Pyx_GOTREF(__pyx_t_4);
1477 __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1478 __Pyx_GOTREF(__pyx_t_2);
1479 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1480 __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1481 __Pyx_GOTREF(__pyx_t_4);
1482 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1483 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1484 __Pyx_GOTREF(__pyx_t_2);
1485 __Pyx_INCREF(__pyx_v_filename_index);
1486 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_filename_index);
1487 __Pyx_GIVEREF(__pyx_v_filename_index);
1488 __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1489 __Pyx_GOTREF(__pyx_t_1);
1490 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1491 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1492 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1493 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1494 __pyx_t_3 = (!__pyx_t_5);
1497 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":49
1499 * if not os.path.exists( filename_index ):
1500 * raise IOError( "index `%s` not found" % filename_index) # <<<<<<<<<<<<<<
1502 * # open file and load index
1504 __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), __pyx_v_filename_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1505 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
1506 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1507 __Pyx_GOTREF(__pyx_t_2);
1508 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
1509 __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
1511 __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1512 __Pyx_GOTREF(__pyx_t_1);
1513 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1514 __Pyx_Raise(__pyx_t_1, 0, 0);
1515 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1516 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1521 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":52
1523 * # open file and load index
1524 * self.tabixfile = ti_open( self.filename, filename_index ) # <<<<<<<<<<<<<<
1526 * if self.tabixfile == NULL:
1528 __pyx_t_6 = PyBytes_AsString(__pyx_v_filename_index); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1529 ((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->tabixfile = ti_open(((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->filename, __pyx_t_6);
1534 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":54
1535 * self.tabixfile = ti_open( self.filename, filename_index )
1537 * if self.tabixfile == NULL: # <<<<<<<<<<<<<<
1538 * raise IOError("could not open file `%s`" % filename )
1541 __pyx_t_3 = (((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->tabixfile == NULL);
1544 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":55
1546 * if self.tabixfile == NULL:
1547 * raise IOError("could not open file `%s`" % filename ) # <<<<<<<<<<<<<<
1549 * def _parseRegion( self,
1551 __pyx_t_1 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1552 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
1553 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1554 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
1555 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
1556 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1557 __Pyx_GOTREF(__pyx_t_1);
1558 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
1559 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
1561 __pyx_t_2 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1562 __Pyx_GOTREF(__pyx_t_2);
1563 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1564 __Pyx_Raise(__pyx_t_2, 0, 0);
1565 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1566 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1571 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1574 __Pyx_XDECREF(__pyx_t_1);
1575 __Pyx_XDECREF(__pyx_t_2);
1576 __Pyx_XDECREF(__pyx_t_4);
1577 __Pyx_AddTraceback("ctabix.Tabixfile._open");
1580 __Pyx_DECREF(__pyx_v_filename_index);
1581 __Pyx_XGIVEREF(__pyx_r);
1582 __Pyx_RefNannyFinishContext();
1586 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":57
1587 * raise IOError("could not open file `%s`" % filename )
1589 * def _parseRegion( self, # <<<<<<<<<<<<<<
1594 static PyObject *__pyx_pf_6ctabix_9Tabixfile__parseRegion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1595 static char __pyx_doc_6ctabix_9Tabixfile__parseRegion[] = "Tabixfile._parseRegion(self, reference=None, start=None, end=None, region=None)\nparse region information.\n\n raise ValueError for for invalid regions.\n\n returns a tuple of region, tid, start and end. Region\n is a valid samtools :term:`region` or None if the region\n extends over the whole file.\n\n Note that regions are 1-based, while start,end are python coordinates.\n ";
1596 static PyObject *__pyx_pf_6ctabix_9Tabixfile__parseRegion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1597 PyObject *__pyx_v_reference = 0;
1598 PyObject *__pyx_v_start = 0;
1599 PyObject *__pyx_v_end = 0;
1600 PyObject *__pyx_v_region = 0;
1604 int __pyx_v_max_pos;
1605 PyObject *__pyx_r = NULL;
1607 PyObject *__pyx_t_2 = NULL;
1610 PyObject *__pyx_t_5 = NULL;
1611 PyObject *__pyx_t_6 = NULL;
1613 PyObject *__pyx_t_8 = NULL;
1614 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__reference,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__region,0};
1615 __Pyx_RefNannySetupContext("_parseRegion");
1616 if (unlikely(__pyx_kwds)) {
1617 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
1618 PyObject* values[4] = {0,0,0,0};
1620 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":58
1622 * def _parseRegion( self,
1623 * reference = None, # <<<<<<<<<<<<<<
1627 values[0] = ((PyObject *)Py_None);
1629 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":59
1630 * def _parseRegion( self,
1632 * start = None, # <<<<<<<<<<<<<<
1636 values[1] = ((PyObject *)Py_None);
1638 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":60
1641 * end = None, # <<<<<<<<<<<<<<
1643 * '''parse region information.
1645 values[2] = ((PyObject *)Py_None);
1647 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":61
1650 * region = None ): # <<<<<<<<<<<<<<
1651 * '''parse region information.
1654 values[3] = ((PyObject *)Py_None);
1655 switch (PyTuple_GET_SIZE(__pyx_args)) {
1656 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1657 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1658 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1659 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1661 default: goto __pyx_L5_argtuple_error;
1663 switch (PyTuple_GET_SIZE(__pyx_args)) {
1666 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
1667 if (value) { values[0] = value; kw_args--; }
1671 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
1672 if (value) { values[1] = value; kw_args--; }
1676 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
1677 if (value) { values[2] = value; kw_args--; }
1681 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__region);
1682 if (value) { values[3] = value; kw_args--; }
1685 if (unlikely(kw_args > 0)) {
1686 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_parseRegion") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1688 __pyx_v_reference = values[0];
1689 __pyx_v_start = values[1];
1690 __pyx_v_end = values[2];
1691 __pyx_v_region = values[3];
1694 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":58
1696 * def _parseRegion( self,
1697 * reference = None, # <<<<<<<<<<<<<<
1701 __pyx_v_reference = ((PyObject *)Py_None);
1703 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":59
1704 * def _parseRegion( self,
1706 * start = None, # <<<<<<<<<<<<<<
1710 __pyx_v_start = ((PyObject *)Py_None);
1712 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":60
1715 * end = None, # <<<<<<<<<<<<<<
1717 * '''parse region information.
1719 __pyx_v_end = ((PyObject *)Py_None);
1721 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":61
1724 * region = None ): # <<<<<<<<<<<<<<
1725 * '''parse region information.
1728 __pyx_v_region = ((PyObject *)Py_None);
1729 switch (PyTuple_GET_SIZE(__pyx_args)) {
1730 case 4: __pyx_v_region = PyTuple_GET_ITEM(__pyx_args, 3);
1731 case 3: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 2);
1732 case 2: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 1);
1733 case 1: __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 0);
1735 default: goto __pyx_L5_argtuple_error;
1738 goto __pyx_L4_argument_unpacking_done;
1739 __pyx_L5_argtuple_error:;
1740 __Pyx_RaiseArgtupleInvalid("_parseRegion", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1742 __Pyx_AddTraceback("ctabix.Tabixfile._parseRegion");
1743 __Pyx_RefNannyFinishContext();
1745 __pyx_L4_argument_unpacking_done:;
1746 __Pyx_INCREF(__pyx_v_region);
1748 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":72
1749 * Note that regions are 1-based, while start,end are python coordinates.
1751 * ti_lazy_index_load( self.tabixfile ) # <<<<<<<<<<<<<<
1755 ti_lazy_index_load(((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->tabixfile);
1757 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":78
1760 * max_pos = 2 << 29 # <<<<<<<<<<<<<<
1762 * rtid = rstart = rend = 0
1764 __pyx_v_max_pos = 1073741824;
1766 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":80
1769 * rtid = rstart = rend = 0 # <<<<<<<<<<<<<<
1771 * # translate to a region
1777 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":83
1779 * # translate to a region
1780 * if reference: # <<<<<<<<<<<<<<
1781 * if start != None and end != None:
1782 * region = "%s:%i-%i" % (reference, start+1, end)
1784 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_reference); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1787 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":84
1788 * # translate to a region
1790 * if start != None and end != None: # <<<<<<<<<<<<<<
1791 * region = "%s:%i-%i" % (reference, start+1, end)
1792 * elif start == None and end != None:
1794 __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, Py_None, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1795 __Pyx_GOTREF(__pyx_t_2);
1796 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1797 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1799 __pyx_t_2 = PyObject_RichCompare(__pyx_v_end, Py_None, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1800 __Pyx_GOTREF(__pyx_t_2);
1801 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1802 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1803 __pyx_t_4 = __pyx_t_3;
1805 __pyx_t_4 = __pyx_t_1;
1809 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":85
1811 * if start != None and end != None:
1812 * region = "%s:%i-%i" % (reference, start+1, end) # <<<<<<<<<<<<<<
1813 * elif start == None and end != None:
1814 * region = "%s:%i-%i" % (reference, 1, end)
1816 __pyx_t_2 = PyNumber_Add(__pyx_v_start, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1817 __Pyx_GOTREF(__pyx_t_2);
1818 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1819 __Pyx_GOTREF(__pyx_t_5);
1820 __Pyx_INCREF(__pyx_v_reference);
1821 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_reference);
1822 __Pyx_GIVEREF(__pyx_v_reference);
1823 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
1824 __Pyx_GIVEREF(__pyx_t_2);
1825 __Pyx_INCREF(__pyx_v_end);
1826 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_end);
1827 __Pyx_GIVEREF(__pyx_v_end);
1829 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1830 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
1831 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1832 __Pyx_DECREF(__pyx_v_region);
1833 __pyx_v_region = ((PyObject *)__pyx_t_2);
1838 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":86
1839 * if start != None and end != None:
1840 * region = "%s:%i-%i" % (reference, start+1, end)
1841 * elif start == None and end != None: # <<<<<<<<<<<<<<
1842 * region = "%s:%i-%i" % (reference, 1, end)
1843 * elif end == None and start != None:
1845 __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, Py_None, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1846 __Pyx_GOTREF(__pyx_t_2);
1847 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1848 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1850 __pyx_t_2 = PyObject_RichCompare(__pyx_v_end, Py_None, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1851 __Pyx_GOTREF(__pyx_t_2);
1852 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1853 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1854 __pyx_t_3 = __pyx_t_1;
1856 __pyx_t_3 = __pyx_t_4;
1860 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":87
1861 * region = "%s:%i-%i" % (reference, start+1, end)
1862 * elif start == None and end != None:
1863 * region = "%s:%i-%i" % (reference, 1, end) # <<<<<<<<<<<<<<
1864 * elif end == None and start != None:
1865 * region = "%s:%i-%i" % (reference, start+1, max_pos-1)
1867 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1868 __Pyx_GOTREF(__pyx_t_2);
1869 __Pyx_INCREF(__pyx_v_reference);
1870 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference);
1871 __Pyx_GIVEREF(__pyx_v_reference);
1872 __Pyx_INCREF(__pyx_int_1);
1873 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1);
1874 __Pyx_GIVEREF(__pyx_int_1);
1875 __Pyx_INCREF(__pyx_v_end);
1876 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end);
1877 __Pyx_GIVEREF(__pyx_v_end);
1878 __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1879 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
1880 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1881 __Pyx_DECREF(__pyx_v_region);
1882 __pyx_v_region = ((PyObject *)__pyx_t_5);
1887 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":88
1888 * elif start == None and end != None:
1889 * region = "%s:%i-%i" % (reference, 1, end)
1890 * elif end == None and start != None: # <<<<<<<<<<<<<<
1891 * region = "%s:%i-%i" % (reference, start+1, max_pos-1)
1894 __pyx_t_5 = PyObject_RichCompare(__pyx_v_end, Py_None, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1895 __Pyx_GOTREF(__pyx_t_5);
1896 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1897 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1899 __pyx_t_5 = PyObject_RichCompare(__pyx_v_start, Py_None, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1900 __Pyx_GOTREF(__pyx_t_5);
1901 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1902 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1903 __pyx_t_1 = __pyx_t_4;
1905 __pyx_t_1 = __pyx_t_3;
1909 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":89
1910 * region = "%s:%i-%i" % (reference, 1, end)
1911 * elif end == None and start != None:
1912 * region = "%s:%i-%i" % (reference, start+1, max_pos-1) # <<<<<<<<<<<<<<
1914 * region = reference
1916 __pyx_t_5 = PyNumber_Add(__pyx_v_start, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1917 __Pyx_GOTREF(__pyx_t_5);
1918 __pyx_t_2 = PyInt_FromLong((__pyx_v_max_pos - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1919 __Pyx_GOTREF(__pyx_t_2);
1920 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1921 __Pyx_GOTREF(__pyx_t_6);
1922 __Pyx_INCREF(__pyx_v_reference);
1923 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_reference);
1924 __Pyx_GIVEREF(__pyx_v_reference);
1925 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
1926 __Pyx_GIVEREF(__pyx_t_5);
1927 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2);
1928 __Pyx_GIVEREF(__pyx_t_2);
1931 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1932 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
1933 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1934 __Pyx_DECREF(__pyx_v_region);
1935 __pyx_v_region = ((PyObject *)__pyx_t_2);
1941 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":91
1942 * region = "%s:%i-%i" % (reference, start+1, max_pos-1)
1944 * region = reference # <<<<<<<<<<<<<<
1948 __Pyx_INCREF(__pyx_v_reference);
1949 __Pyx_DECREF(__pyx_v_region);
1950 __pyx_v_region = __pyx_v_reference;
1957 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":93
1958 * region = reference
1960 * if region: # <<<<<<<<<<<<<<
1961 * ti_parse_region( self.tabixfile.idx, region, &rtid, &rstart, &rend)
1962 * if rtid < 0: raise ValueError( "invalid region `%s`" % region )
1964 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_region); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1967 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":94
1970 * ti_parse_region( self.tabixfile.idx, region, &rtid, &rstart, &rend) # <<<<<<<<<<<<<<
1971 * if rtid < 0: raise ValueError( "invalid region `%s`" % region )
1972 * if rstart > rend: raise ValueError( 'invalid region: start (%i) > end (%i)' % (rstart, rend) )
1974 __pyx_t_7 = PyBytes_AsString(__pyx_v_region); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1975 ti_parse_region(((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->tabixfile->idx, __pyx_t_7, (&__pyx_v_rtid), (&__pyx_v_rstart), (&__pyx_v_rend));
1977 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":95
1979 * ti_parse_region( self.tabixfile.idx, region, &rtid, &rstart, &rend)
1980 * if rtid < 0: raise ValueError( "invalid region `%s`" % region ) # <<<<<<<<<<<<<<
1981 * if rstart > rend: raise ValueError( 'invalid region: start (%i) > end (%i)' % (rstart, rend) )
1982 * if not 0 <= rstart < max_pos: raise ValueError( 'start out of range (%i)' % rstart )
1984 __pyx_t_1 = (__pyx_v_rtid < 0);
1986 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_v_region); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1987 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
1988 __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;}
1989 __Pyx_GOTREF(__pyx_t_6);
1990 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_2));
1991 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
1993 __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1994 __Pyx_GOTREF(__pyx_t_2);
1995 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1996 __Pyx_Raise(__pyx_t_2, 0, 0);
1997 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1998 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2003 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":96
2004 * ti_parse_region( self.tabixfile.idx, region, &rtid, &rstart, &rend)
2005 * if rtid < 0: raise ValueError( "invalid region `%s`" % region )
2006 * if rstart > rend: raise ValueError( 'invalid region: start (%i) > end (%i)' % (rstart, rend) ) # <<<<<<<<<<<<<<
2007 * if not 0 <= rstart < max_pos: raise ValueError( 'start out of range (%i)' % rstart )
2008 * if not 0 <= rend < max_pos: raise ValueError( 'end out of range (%i)' % rend )
2010 __pyx_t_1 = (__pyx_v_rstart > __pyx_v_rend);
2012 __pyx_t_2 = PyInt_FromLong(__pyx_v_rstart); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2013 __Pyx_GOTREF(__pyx_t_2);
2014 __pyx_t_6 = PyInt_FromLong(__pyx_v_rend); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2015 __Pyx_GOTREF(__pyx_t_6);
2016 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2017 __Pyx_GOTREF(__pyx_t_5);
2018 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
2019 __Pyx_GIVEREF(__pyx_t_2);
2020 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
2021 __Pyx_GIVEREF(__pyx_t_6);
2024 __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2025 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
2026 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2027 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2028 __Pyx_GOTREF(__pyx_t_5);
2029 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
2030 __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
2032 __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2033 __Pyx_GOTREF(__pyx_t_6);
2034 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2035 __Pyx_Raise(__pyx_t_6, 0, 0);
2036 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2037 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2042 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":97
2043 * if rtid < 0: raise ValueError( "invalid region `%s`" % region )
2044 * if rstart > rend: raise ValueError( 'invalid region: start (%i) > end (%i)' % (rstart, rend) )
2045 * if not 0 <= rstart < max_pos: raise ValueError( 'start out of range (%i)' % rstart ) # <<<<<<<<<<<<<<
2046 * if not 0 <= rend < max_pos: raise ValueError( 'end out of range (%i)' % rend )
2049 __pyx_t_1 = (0 <= __pyx_v_rstart);
2051 __pyx_t_1 = (__pyx_v_rstart < __pyx_v_max_pos);
2053 __pyx_t_3 = (!__pyx_t_1);
2055 __pyx_t_6 = PyInt_FromLong(__pyx_v_rstart); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2056 __Pyx_GOTREF(__pyx_t_6);
2057 __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2058 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
2059 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2060 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2061 __Pyx_GOTREF(__pyx_t_6);
2062 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
2063 __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
2065 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2066 __Pyx_GOTREF(__pyx_t_5);
2067 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2068 __Pyx_Raise(__pyx_t_5, 0, 0);
2069 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2070 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2075 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":98
2076 * if rstart > rend: raise ValueError( 'invalid region: start (%i) > end (%i)' % (rstart, rend) )
2077 * if not 0 <= rstart < max_pos: raise ValueError( 'start out of range (%i)' % rstart )
2078 * if not 0 <= rend < max_pos: raise ValueError( 'end out of range (%i)' % rend ) # <<<<<<<<<<<<<<
2080 * return region, rtid, rstart, rend
2082 __pyx_t_3 = (0 <= __pyx_v_rend);
2084 __pyx_t_3 = (__pyx_v_rend < __pyx_v_max_pos);
2086 __pyx_t_1 = (!__pyx_t_3);
2088 __pyx_t_5 = PyInt_FromLong(__pyx_v_rend); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2089 __Pyx_GOTREF(__pyx_t_5);
2090 __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2091 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
2092 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2093 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2094 __Pyx_GOTREF(__pyx_t_5);
2095 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
2096 __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
2098 __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2099 __Pyx_GOTREF(__pyx_t_6);
2100 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2101 __Pyx_Raise(__pyx_t_6, 0, 0);
2102 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2103 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2111 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":100
2112 * if not 0 <= rend < max_pos: raise ValueError( 'end out of range (%i)' % rend )
2114 * return region, rtid, rstart, rend # <<<<<<<<<<<<<<
2118 __Pyx_XDECREF(__pyx_r);
2119 __pyx_t_6 = PyInt_FromLong(__pyx_v_rtid); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2120 __Pyx_GOTREF(__pyx_t_6);
2121 __pyx_t_5 = PyInt_FromLong(__pyx_v_rstart); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2122 __Pyx_GOTREF(__pyx_t_5);
2123 __pyx_t_2 = PyInt_FromLong(__pyx_v_rend); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2124 __Pyx_GOTREF(__pyx_t_2);
2125 __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2126 __Pyx_GOTREF(__pyx_t_8);
2127 __Pyx_INCREF(__pyx_v_region);
2128 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_region);
2129 __Pyx_GIVEREF(__pyx_v_region);
2130 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
2131 __Pyx_GIVEREF(__pyx_t_6);
2132 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_5);
2133 __Pyx_GIVEREF(__pyx_t_5);
2134 PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_2);
2135 __Pyx_GIVEREF(__pyx_t_2);
2139 __pyx_r = __pyx_t_8;
2143 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2146 __Pyx_XDECREF(__pyx_t_2);
2147 __Pyx_XDECREF(__pyx_t_5);
2148 __Pyx_XDECREF(__pyx_t_6);
2149 __Pyx_XDECREF(__pyx_t_8);
2150 __Pyx_AddTraceback("ctabix.Tabixfile._parseRegion");
2153 __Pyx_DECREF(__pyx_v_region);
2154 __Pyx_XGIVEREF(__pyx_r);
2155 __Pyx_RefNannyFinishContext();
2159 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":102
2160 * return region, rtid, rstart, rend
2162 * def fetch( self, # <<<<<<<<<<<<<<
2167 static PyObject *__pyx_pf_6ctabix_9Tabixfile_fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2168 static char __pyx_doc_6ctabix_9Tabixfile_fetch[] = "Tabixfile.fetch(self, reference=None, start=None, end=None, region=None, parser=None)\n\n \n fetch one or more rows in a :term:`region` using 0-based indexing. The region is specified by\n :term:`reference`, *start* and *end*. Alternatively, a samtools :term:`region` string can be supplied.\n\n Without *reference* or *region* all entries will be fetched. \n \n If only *reference* is set, all reads matching on *reference* will be fetched.\n\n If *parser* is None, the results are returned as an unparsed string.\n Otherwise, *parser* is assumed to be a functor that will return parsed \n data (see for example :meth:`asTuple` and :meth:`asGTF`).\n ";
2169 static PyObject *__pyx_pf_6ctabix_9Tabixfile_fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2170 PyObject *__pyx_v_reference = 0;
2171 PyObject *__pyx_v_start = 0;
2172 PyObject *__pyx_v_end = 0;
2173 PyObject *__pyx_v_region = 0;
2174 PyObject *__pyx_v_parser = 0;
2175 PyObject *__pyx_v_rtid;
2176 PyObject *__pyx_v_rstart;
2177 PyObject *__pyx_v_rend;
2178 PyObject *__pyx_r = NULL;
2179 PyObject *__pyx_t_1 = NULL;
2180 PyObject *__pyx_t_2 = NULL;
2183 PyObject *__pyx_t_5 = NULL;
2184 PyObject *__pyx_t_6 = NULL;
2185 PyObject *__pyx_t_7 = NULL;
2186 PyObject *__pyx_t_8 = NULL;
2187 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__reference,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__region,&__pyx_n_s__parser,0};
2188 __Pyx_RefNannySetupContext("fetch");
2189 if (unlikely(__pyx_kwds)) {
2190 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2191 PyObject* values[5] = {0,0,0,0,0};
2193 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":103
2196 * reference = None, # <<<<<<<<<<<<<<
2200 values[0] = ((PyObject *)Py_None);
2202 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":104
2205 * start = None, # <<<<<<<<<<<<<<
2209 values[1] = ((PyObject *)Py_None);
2211 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":105
2214 * end = None, # <<<<<<<<<<<<<<
2218 values[2] = ((PyObject *)Py_None);
2220 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":106
2223 * region = None, # <<<<<<<<<<<<<<
2227 values[3] = ((PyObject *)Py_None);
2229 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":107
2232 * parser = None ): # <<<<<<<<<<<<<<
2236 values[4] = ((PyObject *)Py_None);
2237 switch (PyTuple_GET_SIZE(__pyx_args)) {
2238 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2239 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2240 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2241 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2242 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2244 default: goto __pyx_L5_argtuple_error;
2246 switch (PyTuple_GET_SIZE(__pyx_args)) {
2249 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reference);
2250 if (value) { values[0] = value; kw_args--; }
2254 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
2255 if (value) { values[1] = value; kw_args--; }
2259 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
2260 if (value) { values[2] = value; kw_args--; }
2264 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__region);
2265 if (value) { values[3] = value; kw_args--; }
2269 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parser);
2270 if (value) { values[4] = value; kw_args--; }
2273 if (unlikely(kw_args > 0)) {
2274 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "fetch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2276 __pyx_v_reference = values[0];
2277 __pyx_v_start = values[1];
2278 __pyx_v_end = values[2];
2279 __pyx_v_region = values[3];
2280 __pyx_v_parser = values[4];
2283 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":103
2286 * reference = None, # <<<<<<<<<<<<<<
2290 __pyx_v_reference = ((PyObject *)Py_None);
2292 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":104
2295 * start = None, # <<<<<<<<<<<<<<
2299 __pyx_v_start = ((PyObject *)Py_None);
2301 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":105
2304 * end = None, # <<<<<<<<<<<<<<
2308 __pyx_v_end = ((PyObject *)Py_None);
2310 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":106
2313 * region = None, # <<<<<<<<<<<<<<
2317 __pyx_v_region = ((PyObject *)Py_None);
2319 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":107
2322 * parser = None ): # <<<<<<<<<<<<<<
2326 __pyx_v_parser = ((PyObject *)Py_None);
2327 switch (PyTuple_GET_SIZE(__pyx_args)) {
2328 case 5: __pyx_v_parser = PyTuple_GET_ITEM(__pyx_args, 4);
2329 case 4: __pyx_v_region = PyTuple_GET_ITEM(__pyx_args, 3);
2330 case 3: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 2);
2331 case 2: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 1);
2332 case 1: __pyx_v_reference = PyTuple_GET_ITEM(__pyx_args, 0);
2334 default: goto __pyx_L5_argtuple_error;
2337 goto __pyx_L4_argument_unpacking_done;
2338 __pyx_L5_argtuple_error:;
2339 __Pyx_RaiseArgtupleInvalid("fetch", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2341 __Pyx_AddTraceback("ctabix.Tabixfile.fetch");
2342 __Pyx_RefNannyFinishContext();
2344 __pyx_L4_argument_unpacking_done:;
2345 __Pyx_INCREF(__pyx_v_region);
2346 __pyx_v_rtid = Py_None; __Pyx_INCREF(Py_None);
2347 __pyx_v_rstart = Py_None; __Pyx_INCREF(Py_None);
2348 __pyx_v_rend = Py_None; __Pyx_INCREF(Py_None);
2350 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":121
2351 * data (see for example :meth:`asTuple` and :meth:`asGTF`).
2353 * ti_lazy_index_load( self.tabixfile ) # <<<<<<<<<<<<<<
2355 * if not self._isOpen():
2357 ti_lazy_index_load(((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->tabixfile);
2359 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":123
2360 * ti_lazy_index_load( self.tabixfile )
2362 * if not self._isOpen(): # <<<<<<<<<<<<<<
2363 * raise ValueError( "I/O operation on closed file" )
2366 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2367 __Pyx_GOTREF(__pyx_t_1);
2368 __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 = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2369 __Pyx_GOTREF(__pyx_t_2);
2370 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2371 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2372 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2373 __pyx_t_4 = (!__pyx_t_3);
2376 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":124
2378 * if not self._isOpen():
2379 * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
2381 * region, rtid, rstart, rend = self._parseRegion( reference, start, end, region )
2383 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2384 __Pyx_GOTREF(__pyx_t_2);
2385 __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
2386 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_11));
2387 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
2388 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2389 __Pyx_GOTREF(__pyx_t_1);
2390 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2391 __Pyx_Raise(__pyx_t_1, 0, 0);
2392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2393 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2398 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":126
2399 * raise ValueError( "I/O operation on closed file" )
2401 * region, rtid, rstart, rend = self._parseRegion( reference, start, end, region ) # <<<<<<<<<<<<<<
2403 * if parser == None:
2405 __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___parseRegion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2406 __Pyx_GOTREF(__pyx_t_1);
2407 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2408 __Pyx_GOTREF(__pyx_t_2);
2409 __Pyx_INCREF(__pyx_v_reference);
2410 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference);
2411 __Pyx_GIVEREF(__pyx_v_reference);
2412 __Pyx_INCREF(__pyx_v_start);
2413 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_start);
2414 __Pyx_GIVEREF(__pyx_v_start);
2415 __Pyx_INCREF(__pyx_v_end);
2416 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end);
2417 __Pyx_GIVEREF(__pyx_v_end);
2418 __Pyx_INCREF(__pyx_v_region);
2419 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_region);
2420 __Pyx_GIVEREF(__pyx_v_region);
2421 __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2422 __Pyx_GOTREF(__pyx_t_5);
2423 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2424 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2425 if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 4)) {
2426 PyObject* tuple = __pyx_t_5;
2427 __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
2428 __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
2429 __pyx_t_6 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_6);
2430 __pyx_t_7 = PyTuple_GET_ITEM(tuple, 3); __Pyx_INCREF(__pyx_t_7);
2431 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2432 __Pyx_DECREF(__pyx_v_region);
2433 __pyx_v_region = __pyx_t_2;
2435 __Pyx_DECREF(__pyx_v_rtid);
2436 __pyx_v_rtid = __pyx_t_1;
2438 __Pyx_DECREF(__pyx_v_rstart);
2439 __pyx_v_rstart = __pyx_t_6;
2441 __Pyx_DECREF(__pyx_v_rend);
2442 __pyx_v_rend = __pyx_t_7;
2445 __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2446 __Pyx_GOTREF(__pyx_t_8);
2447 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2448 __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2449 __Pyx_GOTREF(__pyx_t_2);
2450 __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2451 __Pyx_GOTREF(__pyx_t_1);
2452 __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_8, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2453 __Pyx_GOTREF(__pyx_t_6);
2454 __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_8, 3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2455 __Pyx_GOTREF(__pyx_t_7);
2456 if (__Pyx_EndUnpack(__pyx_t_8, 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2457 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2458 __Pyx_DECREF(__pyx_v_region);
2459 __pyx_v_region = __pyx_t_2;
2461 __Pyx_DECREF(__pyx_v_rtid);
2462 __pyx_v_rtid = __pyx_t_1;
2464 __Pyx_DECREF(__pyx_v_rstart);
2465 __pyx_v_rstart = __pyx_t_6;
2467 __Pyx_DECREF(__pyx_v_rend);
2468 __pyx_v_rend = __pyx_t_7;
2472 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":128
2473 * region, rtid, rstart, rend = self._parseRegion( reference, start, end, region )
2475 * if parser == None: # <<<<<<<<<<<<<<
2477 * return TabixIterator( self, rtid, rstart, rend )
2479 __pyx_t_5 = PyObject_RichCompare(__pyx_v_parser, Py_None, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2480 __Pyx_GOTREF(__pyx_t_5);
2481 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2482 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2485 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":129
2487 * if parser == None:
2488 * if region: # <<<<<<<<<<<<<<
2489 * return TabixIterator( self, rtid, rstart, rend )
2492 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_region); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2495 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":130
2496 * if parser == None:
2498 * return TabixIterator( self, rtid, rstart, rend ) # <<<<<<<<<<<<<<
2500 * return TabixIterator( self, -1, 0, 0 )
2502 __Pyx_XDECREF(__pyx_r);
2503 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2504 __Pyx_GOTREF(__pyx_t_5);
2505 __Pyx_INCREF(__pyx_v_self);
2506 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self);
2507 __Pyx_GIVEREF(__pyx_v_self);
2508 __Pyx_INCREF(__pyx_v_rtid);
2509 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_rtid);
2510 __Pyx_GIVEREF(__pyx_v_rtid);
2511 __Pyx_INCREF(__pyx_v_rstart);
2512 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_rstart);
2513 __Pyx_GIVEREF(__pyx_v_rstart);
2514 __Pyx_INCREF(__pyx_v_rend);
2515 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_rend);
2516 __Pyx_GIVEREF(__pyx_v_rend);
2517 __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6ctabix_TabixIterator)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2518 __Pyx_GOTREF(__pyx_t_7);
2519 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2520 __pyx_r = __pyx_t_7;
2527 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":132
2528 * return TabixIterator( self, rtid, rstart, rend )
2530 * return TabixIterator( self, -1, 0, 0 ) # <<<<<<<<<<<<<<
2534 __Pyx_XDECREF(__pyx_r);
2535 __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2536 __Pyx_GOTREF(__pyx_t_7);
2537 __Pyx_INCREF(__pyx_v_self);
2538 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self);
2539 __Pyx_GIVEREF(__pyx_v_self);
2540 __Pyx_INCREF(__pyx_int_neg_1);
2541 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_neg_1);
2542 __Pyx_GIVEREF(__pyx_int_neg_1);
2543 __Pyx_INCREF(__pyx_int_0);
2544 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_int_0);
2545 __Pyx_GIVEREF(__pyx_int_0);
2546 __Pyx_INCREF(__pyx_int_0);
2547 PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_int_0);
2548 __Pyx_GIVEREF(__pyx_int_0);
2549 __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6ctabix_TabixIterator)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2550 __Pyx_GOTREF(__pyx_t_5);
2551 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2552 __pyx_r = __pyx_t_5;
2561 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":134
2562 * return TabixIterator( self, -1, 0, 0 )
2564 * if region: # <<<<<<<<<<<<<<
2565 * return TabixIteratorParsed( self, rtid, rstart, rend, parser )
2568 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_region); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2571 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":135
2574 * return TabixIteratorParsed( self, rtid, rstart, rend, parser ) # <<<<<<<<<<<<<<
2576 * return TabixIteratorParsed( self, -1, 0, 0, parser )
2578 __Pyx_XDECREF(__pyx_r);
2579 __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2580 __Pyx_GOTREF(__pyx_t_5);
2581 __Pyx_INCREF(__pyx_v_self);
2582 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self);
2583 __Pyx_GIVEREF(__pyx_v_self);
2584 __Pyx_INCREF(__pyx_v_rtid);
2585 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_rtid);
2586 __Pyx_GIVEREF(__pyx_v_rtid);
2587 __Pyx_INCREF(__pyx_v_rstart);
2588 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_rstart);
2589 __Pyx_GIVEREF(__pyx_v_rstart);
2590 __Pyx_INCREF(__pyx_v_rend);
2591 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_rend);
2592 __Pyx_GIVEREF(__pyx_v_rend);
2593 __Pyx_INCREF(__pyx_v_parser);
2594 PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_parser);
2595 __Pyx_GIVEREF(__pyx_v_parser);
2596 __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6ctabix_TabixIteratorParsed)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2597 __Pyx_GOTREF(__pyx_t_7);
2598 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2599 __pyx_r = __pyx_t_7;
2606 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":137
2607 * return TabixIteratorParsed( self, rtid, rstart, rend, parser )
2609 * return TabixIteratorParsed( self, -1, 0, 0, parser ) # <<<<<<<<<<<<<<
2613 __Pyx_XDECREF(__pyx_r);
2614 __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2615 __Pyx_GOTREF(__pyx_t_7);
2616 __Pyx_INCREF(__pyx_v_self);
2617 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self);
2618 __Pyx_GIVEREF(__pyx_v_self);
2619 __Pyx_INCREF(__pyx_int_neg_1);
2620 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_neg_1);
2621 __Pyx_GIVEREF(__pyx_int_neg_1);
2622 __Pyx_INCREF(__pyx_int_0);
2623 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_int_0);
2624 __Pyx_GIVEREF(__pyx_int_0);
2625 __Pyx_INCREF(__pyx_int_0);
2626 PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_int_0);
2627 __Pyx_GIVEREF(__pyx_int_0);
2628 __Pyx_INCREF(__pyx_v_parser);
2629 PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_parser);
2630 __Pyx_GIVEREF(__pyx_v_parser);
2631 __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6ctabix_TabixIteratorParsed)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2632 __Pyx_GOTREF(__pyx_t_5);
2633 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2634 __pyx_r = __pyx_t_5;
2642 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2645 __Pyx_XDECREF(__pyx_t_1);
2646 __Pyx_XDECREF(__pyx_t_2);
2647 __Pyx_XDECREF(__pyx_t_5);
2648 __Pyx_XDECREF(__pyx_t_6);
2649 __Pyx_XDECREF(__pyx_t_7);
2650 __Pyx_XDECREF(__pyx_t_8);
2651 __Pyx_AddTraceback("ctabix.Tabixfile.fetch");
2654 __Pyx_DECREF(__pyx_v_rtid);
2655 __Pyx_DECREF(__pyx_v_rstart);
2656 __Pyx_DECREF(__pyx_v_rend);
2657 __Pyx_DECREF(__pyx_v_region);
2658 __Pyx_XGIVEREF(__pyx_r);
2659 __Pyx_RefNannyFinishContext();
2663 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":140
2666 * def __get__( self ): # <<<<<<<<<<<<<<
2667 * '''return header lines as an iterator.
2671 static PyObject *__pyx_pf_6ctabix_9Tabixfile_6header___get__(PyObject *__pyx_v_self); /*proto*/
2672 static PyObject *__pyx_pf_6ctabix_9Tabixfile_6header___get__(PyObject *__pyx_v_self) {
2673 PyObject *__pyx_r = NULL;
2674 PyObject *__pyx_t_1 = NULL;
2675 PyObject *__pyx_t_2 = NULL;
2676 __Pyx_RefNannySetupContext("__get__");
2678 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":145
2679 * Note that the header lines do not contain the newline '\n' character.
2681 * return TabixHeaderIterator( self ) # <<<<<<<<<<<<<<
2685 __Pyx_XDECREF(__pyx_r);
2686 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2687 __Pyx_GOTREF(__pyx_t_1);
2688 __Pyx_INCREF(__pyx_v_self);
2689 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
2690 __Pyx_GIVEREF(__pyx_v_self);
2691 __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6ctabix_TabixHeaderIterator)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2692 __Pyx_GOTREF(__pyx_t_2);
2693 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2694 __pyx_r = __pyx_t_2;
2698 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2701 __Pyx_XDECREF(__pyx_t_1);
2702 __Pyx_XDECREF(__pyx_t_2);
2703 __Pyx_AddTraceback("ctabix.Tabixfile.header.__get__");
2706 __Pyx_XGIVEREF(__pyx_r);
2707 __Pyx_RefNannyFinishContext();
2711 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":149
2713 * '''chromosome names'''
2714 * def __get__(self): # <<<<<<<<<<<<<<
2715 * cdef char ** sequences
2716 * cdef int nsequences
2719 static PyObject *__pyx_pf_6ctabix_9Tabixfile_7contigs___get__(PyObject *__pyx_v_self); /*proto*/
2720 static PyObject *__pyx_pf_6ctabix_9Tabixfile_7contigs___get__(PyObject *__pyx_v_self) {
2721 char **__pyx_v_sequences;
2722 int __pyx_v_nsequences;
2724 PyObject *__pyx_v_result;
2725 PyObject *__pyx_r = NULL;
2726 PyObject *__pyx_t_1 = NULL;
2729 __Pyx_RefNannySetupContext("__get__");
2730 __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
2732 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":153
2733 * cdef int nsequences
2735 * ti_lazy_index_load( self.tabixfile ) # <<<<<<<<<<<<<<
2736 * sequences = ti_seqname( self.tabixfile.idx, &nsequences )
2739 ti_lazy_index_load(((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->tabixfile);
2741 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":154
2743 * ti_lazy_index_load( self.tabixfile )
2744 * sequences = ti_seqname( self.tabixfile.idx, &nsequences ) # <<<<<<<<<<<<<<
2748 __pyx_v_sequences = ti_seqname(((struct __pyx_obj_6ctabix_Tabixfile *)__pyx_v_self)->tabixfile->idx, (&__pyx_v_nsequences));
2750 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":156
2751 * sequences = ti_seqname( self.tabixfile.idx, &nsequences )
2753 * result = [] # <<<<<<<<<<<<<<
2754 * for x from 0 <= x < nsequences:
2755 * result.append( sequences[x] )
2757 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2758 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2759 __Pyx_DECREF(((PyObject *)__pyx_v_result));
2760 __pyx_v_result = __pyx_t_1;
2763 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":157
2766 * for x from 0 <= x < nsequences: # <<<<<<<<<<<<<<
2767 * result.append( sequences[x] )
2770 __pyx_t_2 = __pyx_v_nsequences;
2771 for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) {
2773 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":158
2775 * for x from 0 <= x < nsequences:
2776 * result.append( sequences[x] ) # <<<<<<<<<<<<<<
2780 if (unlikely(__pyx_v_result == Py_None)) {
2781 PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2783 __pyx_t_1 = PyBytes_FromString((__pyx_v_sequences[__pyx_v_x])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2784 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2785 __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2786 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2789 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":159
2790 * for x from 0 <= x < nsequences:
2791 * result.append( sequences[x] )
2792 * return result # <<<<<<<<<<<<<<
2794 * cdef class TabixIterator:
2796 __Pyx_XDECREF(__pyx_r);
2797 __Pyx_INCREF(((PyObject *)__pyx_v_result));
2798 __pyx_r = ((PyObject *)__pyx_v_result);
2801 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2804 __Pyx_XDECREF(__pyx_t_1);
2805 __Pyx_AddTraceback("ctabix.Tabixfile.contigs.__get__");
2808 __Pyx_DECREF(__pyx_v_result);
2809 __Pyx_XGIVEREF(__pyx_r);
2810 __Pyx_RefNannyFinishContext();
2814 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":169
2815 * cdef tabix_t * tabixfile
2817 * def __cinit__(self, Tabixfile tabixfile, # <<<<<<<<<<<<<<
2818 * int tid, int start, int end ):
2822 static int __pyx_pf_6ctabix_13TabixIterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2823 static int __pyx_pf_6ctabix_13TabixIterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2824 struct __pyx_obj_6ctabix_Tabixfile *__pyx_v_tabixfile = 0;
2829 PyObject *__pyx_t_1 = NULL;
2830 PyObject *__pyx_t_2 = NULL;
2832 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tabixfile,&__pyx_n_s__tid,&__pyx_n_s__start,&__pyx_n_s__end,0};
2833 __Pyx_RefNannySetupContext("__cinit__");
2834 if (unlikely(__pyx_kwds)) {
2835 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2836 PyObject* values[4] = {0,0,0,0};
2837 switch (PyTuple_GET_SIZE(__pyx_args)) {
2838 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2839 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2840 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2841 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2843 default: goto __pyx_L5_argtuple_error;
2845 switch (PyTuple_GET_SIZE(__pyx_args)) {
2847 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tabixfile);
2848 if (likely(values[0])) kw_args--;
2849 else goto __pyx_L5_argtuple_error;
2851 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tid);
2852 if (likely(values[1])) kw_args--;
2854 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2857 values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
2858 if (likely(values[2])) kw_args--;
2860 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2863 values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
2864 if (likely(values[3])) kw_args--;
2866 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2869 if (unlikely(kw_args > 0)) {
2870 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2872 __pyx_v_tabixfile = ((struct __pyx_obj_6ctabix_Tabixfile *)values[0]);
2873 __pyx_v_tid = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_tid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2874 __pyx_v_start = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2875 __pyx_v_end = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2876 } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2877 goto __pyx_L5_argtuple_error;
2879 __pyx_v_tabixfile = ((struct __pyx_obj_6ctabix_Tabixfile *)PyTuple_GET_ITEM(__pyx_args, 0));
2880 __pyx_v_tid = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_tid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2881 __pyx_v_start = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2882 __pyx_v_end = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2884 goto __pyx_L4_argument_unpacking_done;
2885 __pyx_L5_argtuple_error:;
2886 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2888 __Pyx_AddTraceback("ctabix.TabixIterator.__cinit__");
2889 __Pyx_RefNannyFinishContext();
2891 __pyx_L4_argument_unpacking_done:;
2892 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tabixfile), __pyx_ptype_6ctabix_Tabixfile, 1, "tabixfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2894 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":172
2895 * int tid, int start, int end ):
2897 * assert tabixfile._isOpen() # <<<<<<<<<<<<<<
2899 * # makes sure that samfile stays alive as long as the
2901 #ifndef PYREX_WITHOUT_ASSERTIONS
2902 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_tabixfile), __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2903 __Pyx_GOTREF(__pyx_t_1);
2904 __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2905 __Pyx_GOTREF(__pyx_t_2);
2906 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2907 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2908 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2909 if (unlikely(!__pyx_t_3)) {
2910 PyErr_SetNone(PyExc_AssertionError);
2911 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2915 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":176
2916 * # makes sure that samfile stays alive as long as the
2917 * # iterator is alive.
2918 * self.tabixfile = tabixfile.tabixfile # <<<<<<<<<<<<<<
2922 ((struct __pyx_obj_6ctabix_TabixIterator *)__pyx_v_self)->tabixfile = __pyx_v_tabixfile->tabixfile;
2924 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":178
2925 * self.tabixfile = tabixfile.tabixfile
2927 * if tid < 0: # <<<<<<<<<<<<<<
2928 * # seek to start of file to ensure iteration is over
2931 __pyx_t_3 = (__pyx_v_tid < 0);
2934 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":181
2935 * # seek to start of file to ensure iteration is over
2937 * bgzf_seek( self.tabixfile.fp, 0, 0) # <<<<<<<<<<<<<<
2938 * self.iterator = ti_iter_first()
2941 bgzf_seek(((struct __pyx_obj_6ctabix_TabixIterator *)__pyx_v_self)->tabixfile->fp, 0, 0);
2943 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":182
2945 * bgzf_seek( self.tabixfile.fp, 0, 0)
2946 * self.iterator = ti_iter_first() # <<<<<<<<<<<<<<
2948 * self.iterator = ti_queryi(self.tabixfile, tid, start, end)
2950 ((struct __pyx_obj_6ctabix_TabixIterator *)__pyx_v_self)->iterator = ti_iter_first();
2955 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":184
2956 * self.iterator = ti_iter_first()
2958 * self.iterator = ti_queryi(self.tabixfile, tid, start, end) # <<<<<<<<<<<<<<
2960 * if <void*>self.iterator == NULL:
2962 ((struct __pyx_obj_6ctabix_TabixIterator *)__pyx_v_self)->iterator = ti_queryi(((struct __pyx_obj_6ctabix_TabixIterator *)__pyx_v_self)->tabixfile, __pyx_v_tid, __pyx_v_start, __pyx_v_end);
2966 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":186
2967 * self.iterator = ti_queryi(self.tabixfile, tid, start, end)
2969 * if <void*>self.iterator == NULL: # <<<<<<<<<<<<<<
2970 * raise ValueError("malformatted query or wrong sequence name.\n")
2973 __pyx_t_3 = (((void *)((struct __pyx_obj_6ctabix_TabixIterator *)__pyx_v_self)->iterator) == NULL);
2976 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":187
2978 * if <void*>self.iterator == NULL:
2979 * raise ValueError("malformatted query or wrong sequence name.\n") # <<<<<<<<<<<<<<
2981 * def __iter__(self):
2983 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2984 __Pyx_GOTREF(__pyx_t_2);
2985 __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
2986 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_12));
2987 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12));
2988 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2989 __Pyx_GOTREF(__pyx_t_1);
2990 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2991 __Pyx_Raise(__pyx_t_1, 0, 0);
2992 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2993 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3001 __Pyx_XDECREF(__pyx_t_1);
3002 __Pyx_XDECREF(__pyx_t_2);
3003 __Pyx_AddTraceback("ctabix.TabixIterator.__cinit__");
3006 __Pyx_RefNannyFinishContext();
3010 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":189
3011 * raise ValueError("malformatted query or wrong sequence name.\n")
3013 * def __iter__(self): # <<<<<<<<<<<<<<
3018 static PyObject *__pyx_pf_6ctabix_13TabixIterator___iter__(PyObject *__pyx_v_self); /*proto*/
3019 static PyObject *__pyx_pf_6ctabix_13TabixIterator___iter__(PyObject *__pyx_v_self) {
3020 PyObject *__pyx_r = NULL;
3021 __Pyx_RefNannySetupContext("__iter__");
3023 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":190
3025 * def __iter__(self):
3026 * return self # <<<<<<<<<<<<<<
3028 * def __next__(self):
3030 __Pyx_XDECREF(__pyx_r);
3031 __Pyx_INCREF(__pyx_v_self);
3032 __pyx_r = __pyx_v_self;
3035 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3037 __Pyx_XGIVEREF(__pyx_r);
3038 __Pyx_RefNannyFinishContext();
3042 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":192
3045 * def __next__(self): # <<<<<<<<<<<<<<
3046 * """python version of next().
3050 static PyObject *__pyx_pf_6ctabix_13TabixIterator___next__(PyObject *__pyx_v_self); /*proto*/
3051 static char __pyx_doc_6ctabix_13TabixIterator___next__[] = "python version of next().\n\n pyrex uses this non-standard name instead of next()\n ";
3052 struct wrapperbase __pyx_wrapperbase_6ctabix_13TabixIterator___next__;
3053 static PyObject *__pyx_pf_6ctabix_13TabixIterator___next__(PyObject *__pyx_v_self) {
3056 PyObject *__pyx_r = NULL;
3058 PyObject *__pyx_t_2 = NULL;
3059 __Pyx_RefNannySetupContext("__next__");
3061 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":205
3063 * # simply use '#' for now.
3064 * while 1: # <<<<<<<<<<<<<<
3065 * s = ti_read(self.tabixfile, self.iterator, &len)
3066 * if s == NULL: raise StopIteration
3071 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":206
3072 * # simply use '#' for now.
3074 * s = ti_read(self.tabixfile, self.iterator, &len) # <<<<<<<<<<<<<<
3075 * if s == NULL: raise StopIteration
3076 * if s[0] != '#': break
3078 __pyx_v_s = ti_read(((struct __pyx_obj_6ctabix_TabixIterator *)__pyx_v_self)->tabixfile, ((struct __pyx_obj_6ctabix_TabixIterator *)__pyx_v_self)->iterator, (&__pyx_v_len));
3080 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":207
3082 * s = ti_read(self.tabixfile, self.iterator, &len)
3083 * if s == NULL: raise StopIteration # <<<<<<<<<<<<<<
3084 * if s[0] != '#': break
3087 __pyx_t_1 = (__pyx_v_s == NULL);
3089 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
3090 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3095 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":208
3096 * s = ti_read(self.tabixfile, self.iterator, &len)
3097 * if s == NULL: raise StopIteration
3098 * if s[0] != '#': break # <<<<<<<<<<<<<<
3102 __pyx_t_1 = ((__pyx_v_s[0]) != '#');
3104 goto __pyx_L6_break;
3111 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":210
3112 * if s[0] != '#': break
3114 * return s # <<<<<<<<<<<<<<
3116 * def __dealloc__(self):
3118 __Pyx_XDECREF(__pyx_r);
3119 __pyx_t_2 = PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3120 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3121 __pyx_r = ((PyObject *)__pyx_t_2);
3125 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3128 __Pyx_XDECREF(__pyx_t_2);
3129 __Pyx_AddTraceback("ctabix.TabixIterator.__next__");
3132 __Pyx_XGIVEREF(__pyx_r);
3133 __Pyx_RefNannyFinishContext();
3137 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":212
3140 * def __dealloc__(self): # <<<<<<<<<<<<<<
3141 * if <void*>self.iterator != NULL:
3142 * ti_iter_destroy(self.iterator)
3145 static void __pyx_pf_6ctabix_13TabixIterator___dealloc__(PyObject *__pyx_v_self); /*proto*/
3146 static void __pyx_pf_6ctabix_13TabixIterator___dealloc__(PyObject *__pyx_v_self) {
3148 __Pyx_RefNannySetupContext("__dealloc__");
3150 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":213
3152 * def __dealloc__(self):
3153 * if <void*>self.iterator != NULL: # <<<<<<<<<<<<<<
3154 * ti_iter_destroy(self.iterator)
3157 __pyx_t_1 = (((void *)((struct __pyx_obj_6ctabix_TabixIterator *)__pyx_v_self)->iterator) != NULL);
3160 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":214
3161 * def __dealloc__(self):
3162 * if <void*>self.iterator != NULL:
3163 * ti_iter_destroy(self.iterator) # <<<<<<<<<<<<<<
3165 * cdef class TabixHeaderIterator:
3167 ti_iter_destroy(((struct __pyx_obj_6ctabix_TabixIterator *)__pyx_v_self)->iterator);
3172 __Pyx_RefNannyFinishContext();
3175 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":223
3176 * cdef tabix_t * tabixfile
3178 * def __cinit__(self, Tabixfile tabixfile ): # <<<<<<<<<<<<<<
3180 * assert tabixfile._isOpen()
3183 static int __pyx_pf_6ctabix_19TabixHeaderIterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3184 static int __pyx_pf_6ctabix_19TabixHeaderIterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3185 struct __pyx_obj_6ctabix_Tabixfile *__pyx_v_tabixfile = 0;
3187 PyObject *__pyx_t_1 = NULL;
3188 PyObject *__pyx_t_2 = NULL;
3190 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tabixfile,0};
3191 __Pyx_RefNannySetupContext("__cinit__");
3192 if (unlikely(__pyx_kwds)) {
3193 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3194 PyObject* values[1] = {0};
3195 switch (PyTuple_GET_SIZE(__pyx_args)) {
3196 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3198 default: goto __pyx_L5_argtuple_error;
3200 switch (PyTuple_GET_SIZE(__pyx_args)) {
3202 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tabixfile);
3203 if (likely(values[0])) kw_args--;
3204 else goto __pyx_L5_argtuple_error;
3206 if (unlikely(kw_args > 0)) {
3207 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3209 __pyx_v_tabixfile = ((struct __pyx_obj_6ctabix_Tabixfile *)values[0]);
3210 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3211 goto __pyx_L5_argtuple_error;
3213 __pyx_v_tabixfile = ((struct __pyx_obj_6ctabix_Tabixfile *)PyTuple_GET_ITEM(__pyx_args, 0));
3215 goto __pyx_L4_argument_unpacking_done;
3216 __pyx_L5_argtuple_error:;
3217 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3219 __Pyx_AddTraceback("ctabix.TabixHeaderIterator.__cinit__");
3220 __Pyx_RefNannyFinishContext();
3222 __pyx_L4_argument_unpacking_done:;
3223 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tabixfile), __pyx_ptype_6ctabix_Tabixfile, 1, "tabixfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3225 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":225
3226 * def __cinit__(self, Tabixfile tabixfile ):
3228 * assert tabixfile._isOpen() # <<<<<<<<<<<<<<
3230 * # makes sure that samfile stays alive as long as the
3232 #ifndef PYREX_WITHOUT_ASSERTIONS
3233 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_tabixfile), __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3234 __Pyx_GOTREF(__pyx_t_1);
3235 __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 = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3236 __Pyx_GOTREF(__pyx_t_2);
3237 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3238 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3239 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3240 if (unlikely(!__pyx_t_3)) {
3241 PyErr_SetNone(PyExc_AssertionError);
3242 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3246 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":229
3247 * # makes sure that samfile stays alive as long as the
3248 * # iterator is alive.
3249 * self.tabixfile = tabixfile.tabixfile # <<<<<<<<<<<<<<
3251 * self.iterator = ti_query(self.tabixfile, NULL, 0, 0)
3253 ((struct __pyx_obj_6ctabix_TabixHeaderIterator *)__pyx_v_self)->tabixfile = __pyx_v_tabixfile->tabixfile;
3255 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":231
3256 * self.tabixfile = tabixfile.tabixfile
3258 * self.iterator = ti_query(self.tabixfile, NULL, 0, 0) # <<<<<<<<<<<<<<
3260 * if <void*>self.iterator == NULL:
3262 ((struct __pyx_obj_6ctabix_TabixHeaderIterator *)__pyx_v_self)->iterator = ti_query(((struct __pyx_obj_6ctabix_TabixHeaderIterator *)__pyx_v_self)->tabixfile, NULL, 0, 0);
3264 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":233
3265 * self.iterator = ti_query(self.tabixfile, NULL, 0, 0)
3267 * if <void*>self.iterator == NULL: # <<<<<<<<<<<<<<
3268 * raise ValueError("can't open header.\n")
3271 __pyx_t_3 = (((void *)((struct __pyx_obj_6ctabix_TabixHeaderIterator *)__pyx_v_self)->iterator) == NULL);
3274 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":234
3276 * if <void*>self.iterator == NULL:
3277 * raise ValueError("can't open header.\n") # <<<<<<<<<<<<<<
3279 * def __iter__(self):
3281 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3282 __Pyx_GOTREF(__pyx_t_2);
3283 __Pyx_INCREF(((PyObject *)__pyx_kp_s_13));
3284 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_13));
3285 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13));
3286 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3287 __Pyx_GOTREF(__pyx_t_1);
3288 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3289 __Pyx_Raise(__pyx_t_1, 0, 0);
3290 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3291 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3299 __Pyx_XDECREF(__pyx_t_1);
3300 __Pyx_XDECREF(__pyx_t_2);
3301 __Pyx_AddTraceback("ctabix.TabixHeaderIterator.__cinit__");
3304 __Pyx_RefNannyFinishContext();
3308 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":236
3309 * raise ValueError("can't open header.\n")
3311 * def __iter__(self): # <<<<<<<<<<<<<<
3316 static PyObject *__pyx_pf_6ctabix_19TabixHeaderIterator___iter__(PyObject *__pyx_v_self); /*proto*/
3317 static PyObject *__pyx_pf_6ctabix_19TabixHeaderIterator___iter__(PyObject *__pyx_v_self) {
3318 PyObject *__pyx_r = NULL;
3319 __Pyx_RefNannySetupContext("__iter__");
3321 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":237
3323 * def __iter__(self):
3324 * return self # <<<<<<<<<<<<<<
3326 * def __next__(self):
3328 __Pyx_XDECREF(__pyx_r);
3329 __Pyx_INCREF(__pyx_v_self);
3330 __pyx_r = __pyx_v_self;
3333 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3335 __Pyx_XGIVEREF(__pyx_r);
3336 __Pyx_RefNannyFinishContext();
3340 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":239
3343 * def __next__(self): # <<<<<<<<<<<<<<
3344 * """python version of next().
3348 static PyObject *__pyx_pf_6ctabix_19TabixHeaderIterator___next__(PyObject *__pyx_v_self); /*proto*/
3349 static char __pyx_doc_6ctabix_19TabixHeaderIterator___next__[] = "python version of next().\n\n pyrex uses this non-standard name instead of next()\n ";
3350 struct wrapperbase __pyx_wrapperbase_6ctabix_19TabixHeaderIterator___next__;
3351 static PyObject *__pyx_pf_6ctabix_19TabixHeaderIterator___next__(PyObject *__pyx_v_self) {
3354 PyObject *__pyx_r = NULL;
3356 PyObject *__pyx_t_2 = NULL;
3357 __Pyx_RefNannySetupContext("__next__");
3359 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":250
3360 * # Getting the metachar is a pain as ti_index_t is incomplete type.
3361 * # simply use '#' for now.
3362 * s = ti_read(self.tabixfile, self.iterator, &len) # <<<<<<<<<<<<<<
3363 * if s == NULL: raise StopIteration
3364 * # stop at first non-header line
3366 __pyx_v_s = ti_read(((struct __pyx_obj_6ctabix_TabixHeaderIterator *)__pyx_v_self)->tabixfile, ((struct __pyx_obj_6ctabix_TabixHeaderIterator *)__pyx_v_self)->iterator, (&__pyx_v_len));
3368 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":251
3369 * # simply use '#' for now.
3370 * s = ti_read(self.tabixfile, self.iterator, &len)
3371 * if s == NULL: raise StopIteration # <<<<<<<<<<<<<<
3372 * # stop at first non-header line
3373 * if s[0] != '#': raise StopIteration
3375 __pyx_t_1 = (__pyx_v_s == NULL);
3377 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
3378 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3383 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":253
3384 * if s == NULL: raise StopIteration
3385 * # stop at first non-header line
3386 * if s[0] != '#': raise StopIteration # <<<<<<<<<<<<<<
3390 __pyx_t_1 = ((__pyx_v_s[0]) != '#');
3392 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
3393 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3398 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":255
3399 * if s[0] != '#': raise StopIteration
3401 * return s # <<<<<<<<<<<<<<
3403 * def __dealloc__(self):
3405 __Pyx_XDECREF(__pyx_r);
3406 __pyx_t_2 = PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3407 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3408 __pyx_r = ((PyObject *)__pyx_t_2);
3412 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3415 __Pyx_XDECREF(__pyx_t_2);
3416 __Pyx_AddTraceback("ctabix.TabixHeaderIterator.__next__");
3419 __Pyx_XGIVEREF(__pyx_r);
3420 __Pyx_RefNannyFinishContext();
3424 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":257
3427 * def __dealloc__(self): # <<<<<<<<<<<<<<
3428 * if <void*>self.iterator != NULL:
3429 * ti_iter_destroy(self.iterator)
3432 static void __pyx_pf_6ctabix_19TabixHeaderIterator___dealloc__(PyObject *__pyx_v_self); /*proto*/
3433 static void __pyx_pf_6ctabix_19TabixHeaderIterator___dealloc__(PyObject *__pyx_v_self) {
3435 __Pyx_RefNannySetupContext("__dealloc__");
3437 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":258
3439 * def __dealloc__(self):
3440 * if <void*>self.iterator != NULL: # <<<<<<<<<<<<<<
3441 * ti_iter_destroy(self.iterator)
3444 __pyx_t_1 = (((void *)((struct __pyx_obj_6ctabix_TabixHeaderIterator *)__pyx_v_self)->iterator) != NULL);
3447 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":259
3448 * def __dealloc__(self):
3449 * if <void*>self.iterator != NULL:
3450 * ti_iter_destroy(self.iterator) # <<<<<<<<<<<<<<
3452 * #########################################################
3454 ti_iter_destroy(((struct __pyx_obj_6ctabix_TabixHeaderIterator *)__pyx_v_self)->iterator);
3459 __Pyx_RefNannyFinishContext();
3462 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":269
3463 * cdef class asTuple(Parser):
3464 * '''converts a :term:`tabix row` into a python tuple.'''
3465 * def __call__(self, char * buffer, int len): # <<<<<<<<<<<<<<
3466 * cdef TabProxies.TupleProxy r
3467 * r = TabProxies.TupleProxy()
3470 static PyObject *__pyx_pf_6ctabix_7asTuple___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3471 static PyObject *__pyx_pf_6ctabix_7asTuple___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3472 char *__pyx_v_buffer;
3474 struct __pyx_obj_10TabProxies_TupleProxy *__pyx_v_r;
3475 PyObject *__pyx_r = NULL;
3476 PyObject *__pyx_t_1 = NULL;
3477 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__buffer,&__pyx_n_s__len,0};
3478 __Pyx_RefNannySetupContext("__call__");
3479 if (unlikely(__pyx_kwds)) {
3480 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3481 PyObject* values[2] = {0,0};
3482 switch (PyTuple_GET_SIZE(__pyx_args)) {
3483 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3484 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3486 default: goto __pyx_L5_argtuple_error;
3488 switch (PyTuple_GET_SIZE(__pyx_args)) {
3490 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__buffer);
3491 if (likely(values[0])) kw_args--;
3492 else goto __pyx_L5_argtuple_error;
3494 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__len);
3495 if (likely(values[1])) kw_args--;
3497 __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3500 if (unlikely(kw_args > 0)) {
3501 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3503 __pyx_v_buffer = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3504 __pyx_v_len = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3505 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3506 goto __pyx_L5_argtuple_error;
3508 __pyx_v_buffer = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3509 __pyx_v_len = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3511 goto __pyx_L4_argument_unpacking_done;
3512 __pyx_L5_argtuple_error:;
3513 __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3515 __Pyx_AddTraceback("ctabix.asTuple.__call__");
3516 __Pyx_RefNannyFinishContext();
3518 __pyx_L4_argument_unpacking_done:;
3519 __pyx_v_r = ((struct __pyx_obj_10TabProxies_TupleProxy *)Py_None); __Pyx_INCREF(Py_None);
3521 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":271
3522 * def __call__(self, char * buffer, int len):
3523 * cdef TabProxies.TupleProxy r
3524 * r = TabProxies.TupleProxy() # <<<<<<<<<<<<<<
3525 * # need to copy - there were some
3526 * # persistence issues with "present"
3528 __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_10TabProxies_TupleProxy)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3529 __Pyx_GOTREF(__pyx_t_1);
3530 __Pyx_DECREF(((PyObject *)__pyx_v_r));
3531 __pyx_v_r = ((struct __pyx_obj_10TabProxies_TupleProxy *)__pyx_t_1);
3534 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":274
3535 * # need to copy - there were some
3536 * # persistence issues with "present"
3537 * r.copy( buffer, len ) # <<<<<<<<<<<<<<
3541 __pyx_t_1 = ((struct __pyx_vtabstruct_10TabProxies_TupleProxy *)__pyx_v_r->__pyx_vtab)->copy(__pyx_v_r, __pyx_v_buffer, __pyx_v_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3542 __Pyx_GOTREF(__pyx_t_1);
3543 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3545 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":275
3546 * # persistence issues with "present"
3547 * r.copy( buffer, len )
3548 * return r # <<<<<<<<<<<<<<
3550 * cdef class asGTF(Parser):
3552 __Pyx_XDECREF(__pyx_r);
3553 __Pyx_INCREF(((PyObject *)__pyx_v_r));
3554 __pyx_r = ((PyObject *)__pyx_v_r);
3557 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3560 __Pyx_XDECREF(__pyx_t_1);
3561 __Pyx_AddTraceback("ctabix.asTuple.__call__");
3564 __Pyx_DECREF((PyObject *)__pyx_v_r);
3565 __Pyx_XGIVEREF(__pyx_r);
3566 __Pyx_RefNannyFinishContext();
3570 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":279
3571 * cdef class asGTF(Parser):
3572 * '''converts a :term:`tabix row` into a GTF record.'''
3573 * def __call__(self, char * buffer, int len): # <<<<<<<<<<<<<<
3574 * cdef TabProxies.GTFProxy r
3575 * r = TabProxies.GTFProxy()
3578 static PyObject *__pyx_pf_6ctabix_5asGTF___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3579 static PyObject *__pyx_pf_6ctabix_5asGTF___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3580 char *__pyx_v_buffer;
3582 struct __pyx_obj_10TabProxies_GTFProxy *__pyx_v_r;
3583 PyObject *__pyx_r = NULL;
3584 PyObject *__pyx_t_1 = NULL;
3585 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__buffer,&__pyx_n_s__len,0};
3586 __Pyx_RefNannySetupContext("__call__");
3587 if (unlikely(__pyx_kwds)) {
3588 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3589 PyObject* values[2] = {0,0};
3590 switch (PyTuple_GET_SIZE(__pyx_args)) {
3591 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3592 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3594 default: goto __pyx_L5_argtuple_error;
3596 switch (PyTuple_GET_SIZE(__pyx_args)) {
3598 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__buffer);
3599 if (likely(values[0])) kw_args--;
3600 else goto __pyx_L5_argtuple_error;
3602 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__len);
3603 if (likely(values[1])) kw_args--;
3605 __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3608 if (unlikely(kw_args > 0)) {
3609 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3611 __pyx_v_buffer = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3612 __pyx_v_len = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3613 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3614 goto __pyx_L5_argtuple_error;
3616 __pyx_v_buffer = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3617 __pyx_v_len = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3619 goto __pyx_L4_argument_unpacking_done;
3620 __pyx_L5_argtuple_error:;
3621 __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3623 __Pyx_AddTraceback("ctabix.asGTF.__call__");
3624 __Pyx_RefNannyFinishContext();
3626 __pyx_L4_argument_unpacking_done:;
3627 __pyx_v_r = ((struct __pyx_obj_10TabProxies_GTFProxy *)Py_None); __Pyx_INCREF(Py_None);
3629 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":281
3630 * def __call__(self, char * buffer, int len):
3631 * cdef TabProxies.GTFProxy r
3632 * r = TabProxies.GTFProxy() # <<<<<<<<<<<<<<
3633 * r.copy( buffer, len )
3636 __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_10TabProxies_GTFProxy)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3637 __Pyx_GOTREF(__pyx_t_1);
3638 __Pyx_DECREF(((PyObject *)__pyx_v_r));
3639 __pyx_v_r = ((struct __pyx_obj_10TabProxies_GTFProxy *)__pyx_t_1);
3642 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":282
3643 * cdef TabProxies.GTFProxy r
3644 * r = TabProxies.GTFProxy()
3645 * r.copy( buffer, len ) # <<<<<<<<<<<<<<
3649 __pyx_t_1 = ((struct __pyx_vtabstruct_10TabProxies_GTFProxy *)__pyx_v_r->__pyx_base.__pyx_vtab)->__pyx_base.copy(((struct __pyx_obj_10TabProxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3650 __Pyx_GOTREF(__pyx_t_1);
3651 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3653 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":283
3654 * r = TabProxies.GTFProxy()
3655 * r.copy( buffer, len )
3656 * return r # <<<<<<<<<<<<<<
3658 * cdef class asBed( Parser ):
3660 __Pyx_XDECREF(__pyx_r);
3661 __Pyx_INCREF(((PyObject *)__pyx_v_r));
3662 __pyx_r = ((PyObject *)__pyx_v_r);
3665 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3668 __Pyx_XDECREF(__pyx_t_1);
3669 __Pyx_AddTraceback("ctabix.asGTF.__call__");
3672 __Pyx_DECREF((PyObject *)__pyx_v_r);
3673 __Pyx_XGIVEREF(__pyx_r);
3674 __Pyx_RefNannyFinishContext();
3678 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":287
3679 * cdef class asBed( Parser ):
3680 * '''converts a :term:`tabix row` into a GTF record.'''
3681 * def __call__(self, char * buffer, int len): # <<<<<<<<<<<<<<
3682 * cdef TabProxies.BedProxy r
3683 * r = TabProxies.BedProxy()
3686 static PyObject *__pyx_pf_6ctabix_5asBed___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3687 static PyObject *__pyx_pf_6ctabix_5asBed___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3688 char *__pyx_v_buffer;
3690 struct __pyx_obj_10TabProxies_BedProxy *__pyx_v_r;
3691 PyObject *__pyx_r = NULL;
3692 PyObject *__pyx_t_1 = NULL;
3693 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__buffer,&__pyx_n_s__len,0};
3694 __Pyx_RefNannySetupContext("__call__");
3695 if (unlikely(__pyx_kwds)) {
3696 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3697 PyObject* values[2] = {0,0};
3698 switch (PyTuple_GET_SIZE(__pyx_args)) {
3699 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3700 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3702 default: goto __pyx_L5_argtuple_error;
3704 switch (PyTuple_GET_SIZE(__pyx_args)) {
3706 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__buffer);
3707 if (likely(values[0])) kw_args--;
3708 else goto __pyx_L5_argtuple_error;
3710 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__len);
3711 if (likely(values[1])) kw_args--;
3713 __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3716 if (unlikely(kw_args > 0)) {
3717 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3719 __pyx_v_buffer = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3720 __pyx_v_len = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3721 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3722 goto __pyx_L5_argtuple_error;
3724 __pyx_v_buffer = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3725 __pyx_v_len = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3727 goto __pyx_L4_argument_unpacking_done;
3728 __pyx_L5_argtuple_error:;
3729 __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3731 __Pyx_AddTraceback("ctabix.asBed.__call__");
3732 __Pyx_RefNannyFinishContext();
3734 __pyx_L4_argument_unpacking_done:;
3735 __pyx_v_r = ((struct __pyx_obj_10TabProxies_BedProxy *)Py_None); __Pyx_INCREF(Py_None);
3737 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":289
3738 * def __call__(self, char * buffer, int len):
3739 * cdef TabProxies.BedProxy r
3740 * r = TabProxies.BedProxy() # <<<<<<<<<<<<<<
3741 * r.copy( buffer, len )
3744 __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_10TabProxies_BedProxy)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3745 __Pyx_GOTREF(__pyx_t_1);
3746 __Pyx_DECREF(((PyObject *)__pyx_v_r));
3747 __pyx_v_r = ((struct __pyx_obj_10TabProxies_BedProxy *)__pyx_t_1);
3750 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":290
3751 * cdef TabProxies.BedProxy r
3752 * r = TabProxies.BedProxy()
3753 * r.copy( buffer, len ) # <<<<<<<<<<<<<<
3757 __pyx_t_1 = ((struct __pyx_vtabstruct_10TabProxies_BedProxy *)__pyx_v_r->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.copy(((struct __pyx_obj_10TabProxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3758 __Pyx_GOTREF(__pyx_t_1);
3759 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3761 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":291
3762 * r = TabProxies.BedProxy()
3763 * r.copy( buffer, len )
3764 * return r # <<<<<<<<<<<<<<
3766 * cdef class asVCF( Parser ):
3768 __Pyx_XDECREF(__pyx_r);
3769 __Pyx_INCREF(((PyObject *)__pyx_v_r));
3770 __pyx_r = ((PyObject *)__pyx_v_r);
3773 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3776 __Pyx_XDECREF(__pyx_t_1);
3777 __Pyx_AddTraceback("ctabix.asBed.__call__");
3780 __Pyx_DECREF((PyObject *)__pyx_v_r);
3781 __Pyx_XGIVEREF(__pyx_r);
3782 __Pyx_RefNannyFinishContext();
3786 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":295
3787 * cdef class asVCF( Parser ):
3788 * '''converts a :term:`tabix row` into a VCF record.'''
3789 * def __call__(self, char * buffer, int len ): # <<<<<<<<<<<<<<
3790 * cdef TabProxies.VCFProxy r
3791 * r = TabProxies.VCFProxy()
3794 static PyObject *__pyx_pf_6ctabix_5asVCF___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3795 static PyObject *__pyx_pf_6ctabix_5asVCF___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3796 char *__pyx_v_buffer;
3798 struct __pyx_obj_10TabProxies_VCFProxy *__pyx_v_r;
3799 PyObject *__pyx_r = NULL;
3800 PyObject *__pyx_t_1 = NULL;
3801 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__buffer,&__pyx_n_s__len,0};
3802 __Pyx_RefNannySetupContext("__call__");
3803 if (unlikely(__pyx_kwds)) {
3804 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3805 PyObject* values[2] = {0,0};
3806 switch (PyTuple_GET_SIZE(__pyx_args)) {
3807 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3808 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3810 default: goto __pyx_L5_argtuple_error;
3812 switch (PyTuple_GET_SIZE(__pyx_args)) {
3814 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__buffer);
3815 if (likely(values[0])) kw_args--;
3816 else goto __pyx_L5_argtuple_error;
3818 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__len);
3819 if (likely(values[1])) kw_args--;
3821 __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3824 if (unlikely(kw_args > 0)) {
3825 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3827 __pyx_v_buffer = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3828 __pyx_v_len = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3829 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3830 goto __pyx_L5_argtuple_error;
3832 __pyx_v_buffer = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3833 __pyx_v_len = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_len == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3835 goto __pyx_L4_argument_unpacking_done;
3836 __pyx_L5_argtuple_error:;
3837 __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3839 __Pyx_AddTraceback("ctabix.asVCF.__call__");
3840 __Pyx_RefNannyFinishContext();
3842 __pyx_L4_argument_unpacking_done:;
3843 __pyx_v_r = ((struct __pyx_obj_10TabProxies_VCFProxy *)Py_None); __Pyx_INCREF(Py_None);
3845 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":297
3846 * def __call__(self, char * buffer, int len ):
3847 * cdef TabProxies.VCFProxy r
3848 * r = TabProxies.VCFProxy() # <<<<<<<<<<<<<<
3849 * r.copy( buffer, len )
3852 __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_10TabProxies_VCFProxy)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3853 __Pyx_GOTREF(__pyx_t_1);
3854 __Pyx_DECREF(((PyObject *)__pyx_v_r));
3855 __pyx_v_r = ((struct __pyx_obj_10TabProxies_VCFProxy *)__pyx_t_1);
3858 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":298
3859 * cdef TabProxies.VCFProxy r
3860 * r = TabProxies.VCFProxy()
3861 * r.copy( buffer, len ) # <<<<<<<<<<<<<<
3865 __pyx_t_1 = ((struct __pyx_vtabstruct_10TabProxies_VCFProxy *)__pyx_v_r->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.copy(((struct __pyx_obj_10TabProxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3866 __Pyx_GOTREF(__pyx_t_1);
3867 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3869 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":299
3870 * r = TabProxies.VCFProxy()
3871 * r.copy( buffer, len )
3872 * return r # <<<<<<<<<<<<<<
3874 * #########################################################
3876 __Pyx_XDECREF(__pyx_r);
3877 __Pyx_INCREF(((PyObject *)__pyx_v_r));
3878 __pyx_r = ((PyObject *)__pyx_v_r);
3881 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3884 __Pyx_XDECREF(__pyx_t_1);
3885 __Pyx_AddTraceback("ctabix.asVCF.__call__");
3888 __Pyx_DECREF((PyObject *)__pyx_v_r);
3889 __Pyx_XGIVEREF(__pyx_r);
3890 __Pyx_RefNannyFinishContext();
3894 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":314
3895 * cdef Parser parser
3897 * def __cinit__(self, # <<<<<<<<<<<<<<
3898 * Tabixfile tabixfile,
3902 static int __pyx_pf_6ctabix_19TabixIteratorParsed___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3903 static int __pyx_pf_6ctabix_19TabixIteratorParsed___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3904 struct __pyx_obj_6ctabix_Tabixfile *__pyx_v_tabixfile = 0;
3908 struct __pyx_obj_6ctabix_Parser *__pyx_v_parser = 0;
3910 PyObject *__pyx_t_1 = NULL;
3911 PyObject *__pyx_t_2 = NULL;
3913 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tabixfile,&__pyx_n_s__tid,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__parser,0};
3914 __Pyx_RefNannySetupContext("__cinit__");
3915 if (unlikely(__pyx_kwds)) {
3916 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3917 PyObject* values[5] = {0,0,0,0,0};
3918 switch (PyTuple_GET_SIZE(__pyx_args)) {
3919 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3920 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3921 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3922 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3923 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3925 default: goto __pyx_L5_argtuple_error;
3927 switch (PyTuple_GET_SIZE(__pyx_args)) {
3929 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tabixfile);
3930 if (likely(values[0])) kw_args--;
3931 else goto __pyx_L5_argtuple_error;
3933 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tid);
3934 if (likely(values[1])) kw_args--;
3936 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3939 values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
3940 if (likely(values[2])) kw_args--;
3942 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3945 values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
3946 if (likely(values[3])) kw_args--;
3948 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3951 values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parser);
3952 if (likely(values[4])) kw_args--;
3954 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3957 if (unlikely(kw_args > 0)) {
3958 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3960 __pyx_v_tabixfile = ((struct __pyx_obj_6ctabix_Tabixfile *)values[0]);
3961 __pyx_v_tid = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_tid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3962 __pyx_v_start = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3963 __pyx_v_end = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3964 __pyx_v_parser = ((struct __pyx_obj_6ctabix_Parser *)values[4]);
3965 } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
3966 goto __pyx_L5_argtuple_error;
3968 __pyx_v_tabixfile = ((struct __pyx_obj_6ctabix_Tabixfile *)PyTuple_GET_ITEM(__pyx_args, 0));
3969 __pyx_v_tid = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_tid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3970 __pyx_v_start = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3971 __pyx_v_end = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3972 __pyx_v_parser = ((struct __pyx_obj_6ctabix_Parser *)PyTuple_GET_ITEM(__pyx_args, 4));
3974 goto __pyx_L4_argument_unpacking_done;
3975 __pyx_L5_argtuple_error:;
3976 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3978 __Pyx_AddTraceback("ctabix.TabixIteratorParsed.__cinit__");
3979 __Pyx_RefNannyFinishContext();
3981 __pyx_L4_argument_unpacking_done:;
3982 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tabixfile), __pyx_ptype_6ctabix_Tabixfile, 1, "tabixfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3983 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_6ctabix_Parser, 1, "parser", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3985 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":321
3988 * assert tabixfile._isOpen() # <<<<<<<<<<<<<<
3989 * self.parser = parser
3992 #ifndef PYREX_WITHOUT_ASSERTIONS
3993 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_tabixfile), __pyx_n_s___isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3994 __Pyx_GOTREF(__pyx_t_1);
3995 __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 = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3996 __Pyx_GOTREF(__pyx_t_2);
3997 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3998 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3999 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4000 if (unlikely(!__pyx_t_3)) {
4001 PyErr_SetNone(PyExc_AssertionError);
4002 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4006 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":322
4008 * assert tabixfile._isOpen()
4009 * self.parser = parser # <<<<<<<<<<<<<<
4011 * # makes sure that samfile stays alive as long as the
4013 __Pyx_INCREF(((PyObject *)__pyx_v_parser));
4014 __Pyx_GIVEREF(((PyObject *)__pyx_v_parser));
4015 __Pyx_GOTREF(((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->parser);
4016 __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->parser));
4017 ((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->parser = __pyx_v_parser;
4019 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":326
4020 * # makes sure that samfile stays alive as long as the
4021 * # iterator is alive.
4022 * self.tabixfile = tabixfile.tabixfile # <<<<<<<<<<<<<<
4026 ((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->tabixfile = __pyx_v_tabixfile->tabixfile;
4028 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":328
4029 * self.tabixfile = tabixfile.tabixfile
4031 * if tid < 0: # <<<<<<<<<<<<<<
4032 * # seek to start of file to ensure iteration is over
4035 __pyx_t_3 = (__pyx_v_tid < 0);
4038 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":331
4039 * # seek to start of file to ensure iteration is over
4041 * bgzf_seek( self.tabixfile.fp, 0, 0) # <<<<<<<<<<<<<<
4042 * self.iterator = ti_iter_first()
4045 bgzf_seek(((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->tabixfile->fp, 0, 0);
4047 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":332
4049 * bgzf_seek( self.tabixfile.fp, 0, 0)
4050 * self.iterator = ti_iter_first() # <<<<<<<<<<<<<<
4052 * self.iterator = ti_queryi(self.tabixfile, tid, start, end)
4054 ((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->iterator = ti_iter_first();
4059 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":334
4060 * self.iterator = ti_iter_first()
4062 * self.iterator = ti_queryi(self.tabixfile, tid, start, end) # <<<<<<<<<<<<<<
4064 * if <void*>self.iterator == NULL:
4066 ((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->iterator = ti_queryi(((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->tabixfile, __pyx_v_tid, __pyx_v_start, __pyx_v_end);
4070 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":336
4071 * self.iterator = ti_queryi(self.tabixfile, tid, start, end)
4073 * if <void*>self.iterator == NULL: # <<<<<<<<<<<<<<
4074 * raise ValueError("malformatted query or wrong sequence name.\n")
4077 __pyx_t_3 = (((void *)((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->iterator) == NULL);
4080 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":337
4082 * if <void*>self.iterator == NULL:
4083 * raise ValueError("malformatted query or wrong sequence name.\n") # <<<<<<<<<<<<<<
4085 * def __iter__(self):
4087 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4088 __Pyx_GOTREF(__pyx_t_2);
4089 __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
4090 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_12));
4091 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12));
4092 __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4093 __Pyx_GOTREF(__pyx_t_1);
4094 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4095 __Pyx_Raise(__pyx_t_1, 0, 0);
4096 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4097 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4105 __Pyx_XDECREF(__pyx_t_1);
4106 __Pyx_XDECREF(__pyx_t_2);
4107 __Pyx_AddTraceback("ctabix.TabixIteratorParsed.__cinit__");
4110 __Pyx_RefNannyFinishContext();
4114 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":339
4115 * raise ValueError("malformatted query or wrong sequence name.\n")
4117 * def __iter__(self): # <<<<<<<<<<<<<<
4122 static PyObject *__pyx_pf_6ctabix_19TabixIteratorParsed___iter__(PyObject *__pyx_v_self); /*proto*/
4123 static PyObject *__pyx_pf_6ctabix_19TabixIteratorParsed___iter__(PyObject *__pyx_v_self) {
4124 PyObject *__pyx_r = NULL;
4125 __Pyx_RefNannySetupContext("__iter__");
4127 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":340
4129 * def __iter__(self):
4130 * return self # <<<<<<<<<<<<<<
4132 * def __next__(self):
4134 __Pyx_XDECREF(__pyx_r);
4135 __Pyx_INCREF(__pyx_v_self);
4136 __pyx_r = __pyx_v_self;
4139 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4141 __Pyx_XGIVEREF(__pyx_r);
4142 __Pyx_RefNannyFinishContext();
4146 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":342
4149 * def __next__(self): # <<<<<<<<<<<<<<
4150 * """python version of next().
4154 static PyObject *__pyx_pf_6ctabix_19TabixIteratorParsed___next__(PyObject *__pyx_v_self); /*proto*/
4155 static char __pyx_doc_6ctabix_19TabixIteratorParsed___next__[] = "python version of next().\n\n pyrex uses this non-standard name instead of next()\n ";
4156 struct wrapperbase __pyx_wrapperbase_6ctabix_19TabixIteratorParsed___next__;
4157 static PyObject *__pyx_pf_6ctabix_19TabixIteratorParsed___next__(PyObject *__pyx_v_self) {
4160 PyObject *__pyx_r = NULL;
4162 PyObject *__pyx_t_2 = NULL;
4163 PyObject *__pyx_t_3 = NULL;
4164 PyObject *__pyx_t_4 = NULL;
4165 __Pyx_RefNannySetupContext("__next__");
4167 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":350
4170 * while 1: # <<<<<<<<<<<<<<
4171 * s = ti_read(self.tabixfile, self.iterator, &len)
4172 * if s == NULL: raise StopIteration
4177 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":351
4180 * s = ti_read(self.tabixfile, self.iterator, &len) # <<<<<<<<<<<<<<
4181 * if s == NULL: raise StopIteration
4182 * # todo: read metachar from configuration
4184 __pyx_v_s = ti_read(((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->tabixfile, ((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->iterator, (&__pyx_v_len));
4186 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":352
4188 * s = ti_read(self.tabixfile, self.iterator, &len)
4189 * if s == NULL: raise StopIteration # <<<<<<<<<<<<<<
4190 * # todo: read metachar from configuration
4191 * if s[0] != '#': break
4193 __pyx_t_1 = (__pyx_v_s == NULL);
4195 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
4196 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4201 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":354
4202 * if s == NULL: raise StopIteration
4203 * # todo: read metachar from configuration
4204 * if s[0] != '#': break # <<<<<<<<<<<<<<
4206 * return self.parser(s, len)
4208 __pyx_t_1 = ((__pyx_v_s[0]) != '#');
4210 goto __pyx_L6_break;
4217 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":356
4218 * if s[0] != '#': break
4220 * return self.parser(s, len) # <<<<<<<<<<<<<<
4222 * def __dealloc__(self):
4224 __Pyx_XDECREF(__pyx_r);
4225 __pyx_t_2 = PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4226 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
4227 __pyx_t_3 = PyInt_FromLong(__pyx_v_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4228 __Pyx_GOTREF(__pyx_t_3);
4229 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4230 __Pyx_GOTREF(__pyx_t_4);
4231 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_2));
4232 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
4233 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
4234 __Pyx_GIVEREF(__pyx_t_3);
4237 __pyx_t_3 = PyObject_Call(((PyObject *)((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->parser), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4238 __Pyx_GOTREF(__pyx_t_3);
4239 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4240 __pyx_r = __pyx_t_3;
4244 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4247 __Pyx_XDECREF(__pyx_t_2);
4248 __Pyx_XDECREF(__pyx_t_3);
4249 __Pyx_XDECREF(__pyx_t_4);
4250 __Pyx_AddTraceback("ctabix.TabixIteratorParsed.__next__");
4253 __Pyx_XGIVEREF(__pyx_r);
4254 __Pyx_RefNannyFinishContext();
4258 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":358
4259 * return self.parser(s, len)
4261 * def __dealloc__(self): # <<<<<<<<<<<<<<
4262 * if <void*>self.iterator != NULL:
4263 * ti_iter_destroy(self.iterator)
4266 static void __pyx_pf_6ctabix_19TabixIteratorParsed___dealloc__(PyObject *__pyx_v_self); /*proto*/
4267 static void __pyx_pf_6ctabix_19TabixIteratorParsed___dealloc__(PyObject *__pyx_v_self) {
4269 __Pyx_RefNannySetupContext("__dealloc__");
4271 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":359
4273 * def __dealloc__(self):
4274 * if <void*>self.iterator != NULL: # <<<<<<<<<<<<<<
4275 * ti_iter_destroy(self.iterator)
4278 __pyx_t_1 = (((void *)((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->iterator) != NULL);
4281 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":360
4282 * def __dealloc__(self):
4283 * if <void*>self.iterator != NULL:
4284 * ti_iter_destroy(self.iterator) # <<<<<<<<<<<<<<
4286 * def tabix_compress( filename_in,
4288 ti_iter_destroy(((struct __pyx_obj_6ctabix_TabixIteratorParsed *)__pyx_v_self)->iterator);
4293 __Pyx_RefNannyFinishContext();
4296 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":362
4297 * ti_iter_destroy(self.iterator)
4299 * def tabix_compress( filename_in, # <<<<<<<<<<<<<<
4304 static PyObject *__pyx_pf_6ctabix_tabix_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4305 static char __pyx_doc_6ctabix_tabix_compress[] = "tabix_compress(filename_in, filename_out, force=False)\n\n compress *filename_in* writing the output to *filename_out*.\n \n Raise an IOError if *filename_out* already exists, unless *force* is set.\n ";
4306 static PyObject *__pyx_pf_6ctabix_tabix_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4307 PyObject *__pyx_v_filename_in = 0;
4308 PyObject *__pyx_v_filename_out = 0;
4309 PyObject *__pyx_v_force = 0;
4310 int __pyx_v_WINDOW_SIZE;
4313 void *__pyx_v_buffer;
4316 int __pyx_v_O_RDONLY;
4317 PyObject *__pyx_r = NULL;
4320 PyObject *__pyx_t_3 = NULL;
4321 PyObject *__pyx_t_4 = NULL;
4322 PyObject *__pyx_t_5 = NULL;
4326 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename_in,&__pyx_n_s__filename_out,&__pyx_n_s__force,0};
4327 __Pyx_RefNannySetupContext("tabix_compress");
4328 __pyx_self = __pyx_self;
4329 if (unlikely(__pyx_kwds)) {
4330 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4331 PyObject* values[3] = {0,0,0};
4332 values[2] = __pyx_k_14;
4333 switch (PyTuple_GET_SIZE(__pyx_args)) {
4334 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4335 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4336 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4338 default: goto __pyx_L5_argtuple_error;
4340 switch (PyTuple_GET_SIZE(__pyx_args)) {
4342 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename_in);
4343 if (likely(values[0])) kw_args--;
4344 else goto __pyx_L5_argtuple_error;
4346 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename_out);
4347 if (likely(values[1])) kw_args--;
4349 __Pyx_RaiseArgtupleInvalid("tabix_compress", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4353 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__force);
4354 if (value) { values[2] = value; kw_args--; }
4357 if (unlikely(kw_args > 0)) {
4358 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tabix_compress") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4360 __pyx_v_filename_in = values[0];
4361 __pyx_v_filename_out = values[1];
4362 __pyx_v_force = values[2];
4364 __pyx_v_force = __pyx_k_14;
4365 switch (PyTuple_GET_SIZE(__pyx_args)) {
4367 __pyx_v_force = PyTuple_GET_ITEM(__pyx_args, 2);
4369 __pyx_v_filename_out = PyTuple_GET_ITEM(__pyx_args, 1);
4370 __pyx_v_filename_in = PyTuple_GET_ITEM(__pyx_args, 0);
4372 default: goto __pyx_L5_argtuple_error;
4375 goto __pyx_L4_argument_unpacking_done;
4376 __pyx_L5_argtuple_error:;
4377 __Pyx_RaiseArgtupleInvalid("tabix_compress", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4379 __Pyx_AddTraceback("ctabix.tabix_compress");
4380 __Pyx_RefNannyFinishContext();
4382 __pyx_L4_argument_unpacking_done:;
4384 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":372
4387 * if not force and os.path.exists(filename_out ): # <<<<<<<<<<<<<<
4388 * raise IOError( "Filename '%s' already exists, use *force* to overwrite" % filename_out)
4391 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4392 __pyx_t_2 = (!__pyx_t_1);
4394 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4395 __Pyx_GOTREF(__pyx_t_3);
4396 __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4397 __Pyx_GOTREF(__pyx_t_4);
4398 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4399 __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__exists); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4400 __Pyx_GOTREF(__pyx_t_3);
4401 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4402 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4403 __Pyx_GOTREF(__pyx_t_4);
4404 __Pyx_INCREF(__pyx_v_filename_out);
4405 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_filename_out);
4406 __Pyx_GIVEREF(__pyx_v_filename_out);
4407 __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4408 __Pyx_GOTREF(__pyx_t_5);
4409 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4410 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4411 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4412 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4413 __pyx_t_6 = __pyx_t_1;
4415 __pyx_t_6 = __pyx_t_2;
4419 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":373
4421 * if not force and os.path.exists(filename_out ):
4422 * raise IOError( "Filename '%s' already exists, use *force* to overwrite" % filename_out) # <<<<<<<<<<<<<<
4424 * cdef int WINDOW_SIZE
4426 __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_15), __pyx_v_filename_out); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4427 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
4428 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4429 __Pyx_GOTREF(__pyx_t_4);
4430 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
4431 __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
4433 __pyx_t_5 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4434 __Pyx_GOTREF(__pyx_t_5);
4435 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4436 __Pyx_Raise(__pyx_t_5, 0, 0);
4437 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4438 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4443 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":382
4446 * O_RDONLY = os.O_RDONLY # <<<<<<<<<<<<<<
4448 * WINDOW_SIZE = 64 * 1024
4450 __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4451 __Pyx_GOTREF(__pyx_t_5);
4452 __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__O_RDONLY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4453 __Pyx_GOTREF(__pyx_t_4);
4454 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4455 __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4456 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4457 __pyx_v_O_RDONLY = __pyx_t_7;
4459 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":384
4460 * O_RDONLY = os.O_RDONLY
4462 * WINDOW_SIZE = 64 * 1024 # <<<<<<<<<<<<<<
4464 * fp = bgzf_open( filename_out, "w")
4466 __pyx_v_WINDOW_SIZE = 65536;
4468 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":386
4469 * WINDOW_SIZE = 64 * 1024
4471 * fp = bgzf_open( filename_out, "w") # <<<<<<<<<<<<<<
4473 * raise IOError( "could not open '%s' for writing" )
4475 __pyx_t_8 = PyBytes_AsString(__pyx_v_filename_out); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4476 __pyx_v_fp = bgzf_open(__pyx_t_8, __pyx_k__w);
4478 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":387
4480 * fp = bgzf_open( filename_out, "w")
4481 * if fp == NULL: # <<<<<<<<<<<<<<
4482 * raise IOError( "could not open '%s' for writing" )
4485 __pyx_t_6 = (__pyx_v_fp == NULL);
4488 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":388
4489 * fp = bgzf_open( filename_out, "w")
4491 * raise IOError( "could not open '%s' for writing" ) # <<<<<<<<<<<<<<
4493 * fd_src = open(filename_in, O_RDONLY)
4495 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4496 __Pyx_GOTREF(__pyx_t_4);
4497 __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
4498 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_16));
4499 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
4500 __pyx_t_5 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4501 __Pyx_GOTREF(__pyx_t_5);
4502 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4503 __Pyx_Raise(__pyx_t_5, 0, 0);
4504 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4505 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4510 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":390
4511 * raise IOError( "could not open '%s' for writing" )
4513 * fd_src = open(filename_in, O_RDONLY) # <<<<<<<<<<<<<<
4515 * raise IOError( "could not open '%s' for reading" )
4517 __pyx_t_8 = PyBytes_AsString(__pyx_v_filename_in); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4518 __pyx_v_fd_src = open(__pyx_t_8, __pyx_v_O_RDONLY);
4520 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":391
4522 * fd_src = open(filename_in, O_RDONLY)
4523 * if fd_src == 0: # <<<<<<<<<<<<<<
4524 * raise IOError( "could not open '%s' for reading" )
4527 __pyx_t_6 = (__pyx_v_fd_src == 0);
4530 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":392
4531 * fd_src = open(filename_in, O_RDONLY)
4533 * raise IOError( "could not open '%s' for reading" ) # <<<<<<<<<<<<<<
4535 * buffer = malloc(WINDOW_SIZE)
4537 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4538 __Pyx_GOTREF(__pyx_t_5);
4539 __Pyx_INCREF(((PyObject *)__pyx_kp_s_17));
4540 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_17));
4541 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_17));
4542 __pyx_t_4 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4543 __Pyx_GOTREF(__pyx_t_4);
4544 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4545 __Pyx_Raise(__pyx_t_4, 0, 0);
4546 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4547 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4552 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":394
4553 * raise IOError( "could not open '%s' for reading" )
4555 * buffer = malloc(WINDOW_SIZE) # <<<<<<<<<<<<<<
4559 __pyx_v_buffer = malloc(__pyx_v_WINDOW_SIZE);
4561 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":396
4562 * buffer = malloc(WINDOW_SIZE)
4564 * while c > 0: # <<<<<<<<<<<<<<
4565 * c = read(fd_src, buffer, WINDOW_SIZE)
4566 * r = bgzf_write(fp, buffer, c)
4569 __pyx_t_6 = (__pyx_v_c > 0);
4570 if (!__pyx_t_6) break;
4572 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":397
4575 * c = read(fd_src, buffer, WINDOW_SIZE) # <<<<<<<<<<<<<<
4576 * r = bgzf_write(fp, buffer, c)
4579 __pyx_v_c = read(__pyx_v_fd_src, __pyx_v_buffer, __pyx_v_WINDOW_SIZE);
4581 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":398
4583 * c = read(fd_src, buffer, WINDOW_SIZE)
4584 * r = bgzf_write(fp, buffer, c) # <<<<<<<<<<<<<<
4588 __pyx_v_r = bgzf_write(__pyx_v_fp, __pyx_v_buffer, __pyx_v_c);
4590 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":399
4591 * c = read(fd_src, buffer, WINDOW_SIZE)
4592 * r = bgzf_write(fp, buffer, c)
4593 * if r < 0: # <<<<<<<<<<<<<<
4595 * raise OSError("writing failed")
4597 __pyx_t_6 = (__pyx_v_r < 0);
4600 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":400
4601 * r = bgzf_write(fp, buffer, c)
4603 * free( buffer ) # <<<<<<<<<<<<<<
4604 * raise OSError("writing failed")
4607 free(__pyx_v_buffer);
4609 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":401
4612 * raise OSError("writing failed") # <<<<<<<<<<<<<<
4616 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4617 __Pyx_GOTREF(__pyx_t_4);
4618 __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
4619 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_18));
4620 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
4621 __pyx_t_5 = PyObject_Call(__pyx_builtin_OSError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4622 __Pyx_GOTREF(__pyx_t_5);
4623 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4624 __Pyx_Raise(__pyx_t_5, 0, 0);
4625 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4626 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4632 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":403
4633 * raise OSError("writing failed")
4635 * free( buffer ) # <<<<<<<<<<<<<<
4636 * r = bgzf_close(fp)
4637 * if r < 0: raise OSError("writing failed")
4639 free(__pyx_v_buffer);
4641 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":404
4644 * r = bgzf_close(fp) # <<<<<<<<<<<<<<
4645 * if r < 0: raise OSError("writing failed")
4648 __pyx_v_r = bgzf_close(__pyx_v_fp);
4650 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":405
4652 * r = bgzf_close(fp)
4653 * if r < 0: raise OSError("writing failed") # <<<<<<<<<<<<<<
4655 * def tabix_index( filename,
4657 __pyx_t_6 = (__pyx_v_r < 0);
4659 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4660 __Pyx_GOTREF(__pyx_t_5);
4661 __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
4662 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_18));
4663 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
4664 __pyx_t_4 = PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4665 __Pyx_GOTREF(__pyx_t_4);
4666 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4667 __Pyx_Raise(__pyx_t_4, 0, 0);
4668 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4669 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4674 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4677 __Pyx_XDECREF(__pyx_t_3);
4678 __Pyx_XDECREF(__pyx_t_4);
4679 __Pyx_XDECREF(__pyx_t_5);
4680 __Pyx_AddTraceback("ctabix.tabix_compress");
4683 __Pyx_XGIVEREF(__pyx_r);
4684 __Pyx_RefNannyFinishContext();
4688 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":407
4689 * if r < 0: raise OSError("writing failed")
4691 * def tabix_index( filename, # <<<<<<<<<<<<<<
4696 static PyObject *__pyx_pf_6ctabix_tabix_index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4697 static char __pyx_doc_6ctabix_tabix_index[] = "tabix_index(filename, force=False, seq_col=None, start_col=None, end_col=None, preset=None, meta_char='#', zerobased=False)\n\n index tab-separated *filename* using tabix.\n\n An existing index will not be overwritten unless\n *force* is set.\n\n The index will be built from coordinates\n in columns *seq_col*, *start_col* and *end_col*.\n\n The contents of *filename* have to be sorted by \n contig and position - the method does not check\n if the file is sorted.\n\n Column indices are 0-based. Coordinates in the file\n are assumed to be 1-based.\n\n If *preset* is provided, the column coordinates\n are taken from a preset. Valid values for preset\n are \"gff\", \"bed\", \"sam\", \"vcf\", psltbl\", \"pileup\".\n \n Lines beginning with *meta_char* and the first\n *line_skip* lines will be skipped.\n \n If *filename* does not end in \".gz\", it will be automatically\n compressed. The original file will be removed and only the \n compressed file will be retained. \n\n If *filename* ends in *gz*, the file is assumed to be already\n compressed with bgzf.\n\n returns the filename of the compressed data\n ";
4698 static PyObject *__pyx_pf_6ctabix_tabix_index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4699 PyObject *__pyx_v_filename = 0;
4700 PyObject *__pyx_v_force = 0;
4701 PyObject *__pyx_v_seq_col = 0;
4702 PyObject *__pyx_v_start_col = 0;
4703 PyObject *__pyx_v_end_col = 0;
4704 PyObject *__pyx_v_preset = 0;
4705 PyObject *__pyx_v_meta_char = 0;
4706 PyObject *__pyx_v_zerobased = 0;
4707 PyObject *__pyx_v_preset2conf;
4708 PyObject *__pyx_v_conf_data;
4709 ti_conf_t __pyx_v_conf;
4710 PyObject *__pyx_r = NULL;
4711 PyObject *__pyx_t_1 = NULL;
4712 PyObject *__pyx_t_2 = NULL;
4713 PyObject *__pyx_t_3 = NULL;
4716 PyObject *__pyx_t_6 = NULL;
4719 PyObject *__pyx_t_9 = NULL;
4720 PyObject *__pyx_t_10 = NULL;
4727 PyObject *__pyx_t_17 = NULL;
4729 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,&__pyx_n_s__force,&__pyx_n_s__seq_col,&__pyx_n_s__start_col,&__pyx_n_s__end_col,&__pyx_n_s__preset,&__pyx_n_s__meta_char,&__pyx_n_s__zerobased,0};
4730 __Pyx_RefNannySetupContext("tabix_index");
4731 __pyx_self = __pyx_self;
4732 if (unlikely(__pyx_kwds)) {
4733 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4734 PyObject* values[8] = {0,0,0,0,0,0,0,0};
4735 values[1] = __pyx_k_19;
4737 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":409
4738 * def tabix_index( filename,
4740 * seq_col = None, # <<<<<<<<<<<<<<
4744 values[2] = ((PyObject *)Py_None);
4746 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":410
4749 * start_col = None, # <<<<<<<<<<<<<<
4753 values[3] = ((PyObject *)Py_None);
4755 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":411
4758 * end_col = None, # <<<<<<<<<<<<<<
4762 values[4] = ((PyObject *)Py_None);
4764 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":412
4767 * preset = None, # <<<<<<<<<<<<<<
4769 * zerobased = False,
4771 values[5] = ((PyObject *)Py_None);
4772 values[6] = ((PyObject *)__pyx_kp_s_20);
4773 values[7] = __pyx_k_21;
4774 switch (PyTuple_GET_SIZE(__pyx_args)) {
4775 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4776 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4777 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4778 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4779 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4780 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4781 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4782 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4784 default: goto __pyx_L5_argtuple_error;
4786 switch (PyTuple_GET_SIZE(__pyx_args)) {
4788 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename);
4789 if (likely(values[0])) kw_args--;
4790 else goto __pyx_L5_argtuple_error;
4793 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__force);
4794 if (value) { values[1] = value; kw_args--; }
4798 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seq_col);
4799 if (value) { values[2] = value; kw_args--; }
4803 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_col);
4804 if (value) { values[3] = value; kw_args--; }
4808 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end_col);
4809 if (value) { values[4] = value; kw_args--; }
4813 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__preset);
4814 if (value) { values[5] = value; kw_args--; }
4818 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__meta_char);
4819 if (value) { values[6] = value; kw_args--; }
4823 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__zerobased);
4824 if (value) { values[7] = value; kw_args--; }
4827 if (unlikely(kw_args > 0)) {
4828 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tabix_index") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4830 __pyx_v_filename = values[0];
4831 __pyx_v_force = values[1];
4832 __pyx_v_seq_col = values[2];
4833 __pyx_v_start_col = values[3];
4834 __pyx_v_end_col = values[4];
4835 __pyx_v_preset = values[5];
4836 __pyx_v_meta_char = values[6];
4837 __pyx_v_zerobased = values[7];
4839 __pyx_v_force = __pyx_k_19;
4841 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":409
4842 * def tabix_index( filename,
4844 * seq_col = None, # <<<<<<<<<<<<<<
4848 __pyx_v_seq_col = ((PyObject *)Py_None);
4850 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":410
4853 * start_col = None, # <<<<<<<<<<<<<<
4857 __pyx_v_start_col = ((PyObject *)Py_None);
4859 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":411
4862 * end_col = None, # <<<<<<<<<<<<<<
4866 __pyx_v_end_col = ((PyObject *)Py_None);
4868 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":412
4871 * preset = None, # <<<<<<<<<<<<<<
4873 * zerobased = False,
4875 __pyx_v_preset = ((PyObject *)Py_None);
4876 __pyx_v_meta_char = ((PyObject *)__pyx_kp_s_20);
4877 __pyx_v_zerobased = __pyx_k_21;
4878 switch (PyTuple_GET_SIZE(__pyx_args)) {
4879 case 8: __pyx_v_zerobased = PyTuple_GET_ITEM(__pyx_args, 7);
4880 case 7: __pyx_v_meta_char = PyTuple_GET_ITEM(__pyx_args, 6);
4881 case 6: __pyx_v_preset = PyTuple_GET_ITEM(__pyx_args, 5);
4882 case 5: __pyx_v_end_col = PyTuple_GET_ITEM(__pyx_args, 4);
4883 case 4: __pyx_v_start_col = PyTuple_GET_ITEM(__pyx_args, 3);
4884 case 3: __pyx_v_seq_col = PyTuple_GET_ITEM(__pyx_args, 2);
4885 case 2: __pyx_v_force = PyTuple_GET_ITEM(__pyx_args, 1);
4886 case 1: __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 0);
4888 default: goto __pyx_L5_argtuple_error;
4891 goto __pyx_L4_argument_unpacking_done;
4892 __pyx_L5_argtuple_error:;
4893 __Pyx_RaiseArgtupleInvalid("tabix_index", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4895 __Pyx_AddTraceback("ctabix.tabix_index");
4896 __Pyx_RefNannyFinishContext();
4898 __pyx_L4_argument_unpacking_done:;
4899 __Pyx_INCREF(__pyx_v_filename);
4900 __Pyx_INCREF(__pyx_v_end_col);
4901 __Pyx_INCREF(__pyx_v_preset);
4902 __pyx_v_preset2conf = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
4903 __pyx_v_conf_data = Py_None; __Pyx_INCREF(Py_None);
4905 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":449
4908 * if not os.path.exists(filename): raise IOError("No such file '%s'" % filename) # <<<<<<<<<<<<<<
4910 * if not filename.endswith(".gz"):
4912 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4913 __Pyx_GOTREF(__pyx_t_1);
4914 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4915 __Pyx_GOTREF(__pyx_t_2);
4916 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4917 __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__exists); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4918 __Pyx_GOTREF(__pyx_t_1);
4919 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4920 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4921 __Pyx_GOTREF(__pyx_t_2);
4922 __Pyx_INCREF(__pyx_v_filename);
4923 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_filename);
4924 __Pyx_GIVEREF(__pyx_v_filename);
4925 __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4926 __Pyx_GOTREF(__pyx_t_3);
4927 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4928 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4929 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4930 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4931 __pyx_t_5 = (!__pyx_t_4);
4933 __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_22), __pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4934 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
4935 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4936 __Pyx_GOTREF(__pyx_t_2);
4937 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
4938 __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
4940 __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4941 __Pyx_GOTREF(__pyx_t_3);
4942 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4943 __Pyx_Raise(__pyx_t_3, 0, 0);
4944 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4945 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4950 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":451
4951 * if not os.path.exists(filename): raise IOError("No such file '%s'" % filename)
4953 * if not filename.endswith(".gz"): # <<<<<<<<<<<<<<
4955 * tabix_compress( filename, filename + ".gz", force = force )
4957 __pyx_t_3 = PyObject_GetAttr(__pyx_v_filename, __pyx_n_s__endswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4958 __Pyx_GOTREF(__pyx_t_3);
4959 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4960 __Pyx_GOTREF(__pyx_t_2);
4961 __Pyx_INCREF(((PyObject *)__pyx_kp_s_23));
4962 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_23));
4963 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
4964 __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4965 __Pyx_GOTREF(__pyx_t_1);
4966 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4967 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4968 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4969 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4970 __pyx_t_4 = (!__pyx_t_5);
4973 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":453
4974 * if not filename.endswith(".gz"):
4976 * tabix_compress( filename, filename + ".gz", force = force ) # <<<<<<<<<<<<<<
4977 * os.unlink( filename )
4980 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__tabix_compress); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4981 __Pyx_GOTREF(__pyx_t_1);
4982 __pyx_t_2 = PyNumber_Add(__pyx_v_filename, ((PyObject *)__pyx_kp_s_23)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4983 __Pyx_GOTREF(__pyx_t_2);
4984 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4985 __Pyx_GOTREF(__pyx_t_3);
4986 __Pyx_INCREF(__pyx_v_filename);
4987 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_filename);
4988 __Pyx_GIVEREF(__pyx_v_filename);
4989 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
4990 __Pyx_GIVEREF(__pyx_t_2);
4992 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4993 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
4994 if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__force), __pyx_v_force) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4995 __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4996 __Pyx_GOTREF(__pyx_t_6);
4997 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4998 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4999 __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
5000 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5002 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":454
5004 * tabix_compress( filename, filename + ".gz", force = force )
5005 * os.unlink( filename ) # <<<<<<<<<<<<<<
5009 __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5010 __Pyx_GOTREF(__pyx_t_6);
5011 __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__unlink); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5012 __Pyx_GOTREF(__pyx_t_2);
5013 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5014 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5015 __Pyx_GOTREF(__pyx_t_6);
5016 __Pyx_INCREF(__pyx_v_filename);
5017 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_filename);
5018 __Pyx_GIVEREF(__pyx_v_filename);
5019 __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5020 __Pyx_GOTREF(__pyx_t_3);
5021 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5022 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5023 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5025 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":455
5026 * tabix_compress( filename, filename + ".gz", force = force )
5027 * os.unlink( filename )
5028 * filename += ".gz" # <<<<<<<<<<<<<<
5030 * if not force and os.path.exists(filename + ".tbi" ):
5032 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_filename, ((PyObject *)__pyx_kp_s_23)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5033 __Pyx_GOTREF(__pyx_t_3);
5034 __Pyx_DECREF(__pyx_v_filename);
5035 __pyx_v_filename = __pyx_t_3;
5041 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":457
5044 * if not force and os.path.exists(filename + ".tbi" ): # <<<<<<<<<<<<<<
5045 * raise IOError( "Filename '%s.tbi' already exists, use *force* to overwrite" )
5048 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5049 __pyx_t_5 = (!__pyx_t_4);
5051 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5052 __Pyx_GOTREF(__pyx_t_3);
5053 __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5054 __Pyx_GOTREF(__pyx_t_6);
5055 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5056 __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__exists); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5057 __Pyx_GOTREF(__pyx_t_3);
5058 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5059 __pyx_t_6 = PyNumber_Add(__pyx_v_filename, ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5060 __Pyx_GOTREF(__pyx_t_6);
5061 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5062 __Pyx_GOTREF(__pyx_t_2);
5063 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
5064 __Pyx_GIVEREF(__pyx_t_6);
5066 __pyx_t_6 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5067 __Pyx_GOTREF(__pyx_t_6);
5068 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5069 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5070 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5071 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5072 __pyx_t_7 = __pyx_t_4;
5074 __pyx_t_7 = __pyx_t_5;
5078 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":458
5080 * if not force and os.path.exists(filename + ".tbi" ):
5081 * raise IOError( "Filename '%s.tbi' already exists, use *force* to overwrite" ) # <<<<<<<<<<<<<<
5083 * # columns (1-based)
5085 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5086 __Pyx_GOTREF(__pyx_t_6);
5087 __Pyx_INCREF(((PyObject *)__pyx_kp_s_24));
5088 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_24));
5089 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_24));
5090 __pyx_t_2 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5091 __Pyx_GOTREF(__pyx_t_2);
5092 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5093 __Pyx_Raise(__pyx_t_2, 0, 0);
5094 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5095 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5100 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":463
5101 * # preset-code, contig, start, end, metachar for commends, lines to ignore at beginning
5102 * # 0 is a missing column
5103 * preset2conf = { # <<<<<<<<<<<<<<
5104 * 'gff' : ( 0, 1, 4, 5, ord('#'), 0 ),
5105 * 'bed' : ( 0x10000, 1, 2, 3, ord('#'), 0 ),
5107 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5108 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
5110 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":464
5111 * # 0 is a missing column
5113 * 'gff' : ( 0, 1, 4, 5, ord('#'), 0 ), # <<<<<<<<<<<<<<
5114 * 'bed' : ( 0x10000, 1, 2, 3, ord('#'), 0 ),
5115 * 'psltbl' : ( 0x10000, 15, 17, 18, ord('#'), 0 ),
5117 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5118 __Pyx_GOTREF(__pyx_t_6);
5119 __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
5120 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_20));
5121 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
5122 __pyx_t_3 = PyObject_Call(__pyx_builtin_ord, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5123 __Pyx_GOTREF(__pyx_t_3);
5124 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5125 __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5126 __Pyx_GOTREF(__pyx_t_6);
5127 __Pyx_INCREF(__pyx_int_0);
5128 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_0);
5129 __Pyx_GIVEREF(__pyx_int_0);
5130 __Pyx_INCREF(__pyx_int_1);
5131 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_1);
5132 __Pyx_GIVEREF(__pyx_int_1);
5133 __Pyx_INCREF(__pyx_int_4);
5134 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_4);
5135 __Pyx_GIVEREF(__pyx_int_4);
5136 __Pyx_INCREF(__pyx_int_5);
5137 PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_int_5);
5138 __Pyx_GIVEREF(__pyx_int_5);
5139 PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_3);
5140 __Pyx_GIVEREF(__pyx_t_3);
5141 __Pyx_INCREF(__pyx_int_0);
5142 PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_0);
5143 __Pyx_GIVEREF(__pyx_int_0);
5145 if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__gff), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5146 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5148 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":465
5150 * 'gff' : ( 0, 1, 4, 5, ord('#'), 0 ),
5151 * 'bed' : ( 0x10000, 1, 2, 3, ord('#'), 0 ), # <<<<<<<<<<<<<<
5152 * 'psltbl' : ( 0x10000, 15, 17, 18, ord('#'), 0 ),
5153 * 'sam' : ( 1, 3, 4, 0, ord('#'), 0 ),
5155 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5156 __Pyx_GOTREF(__pyx_t_6);
5157 __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
5158 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_20));
5159 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
5160 __pyx_t_3 = PyObject_Call(__pyx_builtin_ord, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5161 __Pyx_GOTREF(__pyx_t_3);
5162 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5163 __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5164 __Pyx_GOTREF(__pyx_t_6);
5165 __Pyx_INCREF(__pyx_int_0x10000);
5166 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_0x10000);
5167 __Pyx_GIVEREF(__pyx_int_0x10000);
5168 __Pyx_INCREF(__pyx_int_1);
5169 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_1);
5170 __Pyx_GIVEREF(__pyx_int_1);
5171 __Pyx_INCREF(__pyx_int_2);
5172 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_2);
5173 __Pyx_GIVEREF(__pyx_int_2);
5174 __Pyx_INCREF(__pyx_int_3);
5175 PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_int_3);
5176 __Pyx_GIVEREF(__pyx_int_3);
5177 PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_3);
5178 __Pyx_GIVEREF(__pyx_t_3);
5179 __Pyx_INCREF(__pyx_int_0);
5180 PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_0);
5181 __Pyx_GIVEREF(__pyx_int_0);
5183 if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__bed), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5184 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5186 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":466
5187 * 'gff' : ( 0, 1, 4, 5, ord('#'), 0 ),
5188 * 'bed' : ( 0x10000, 1, 2, 3, ord('#'), 0 ),
5189 * 'psltbl' : ( 0x10000, 15, 17, 18, ord('#'), 0 ), # <<<<<<<<<<<<<<
5190 * 'sam' : ( 1, 3, 4, 0, ord('#'), 0 ),
5191 * 'vcf' : ( 2, 1, 2, 0, ord('#'), 0 ),
5193 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5194 __Pyx_GOTREF(__pyx_t_6);
5195 __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
5196 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_20));
5197 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
5198 __pyx_t_3 = PyObject_Call(__pyx_builtin_ord, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5199 __Pyx_GOTREF(__pyx_t_3);
5200 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5201 __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5202 __Pyx_GOTREF(__pyx_t_6);
5203 __Pyx_INCREF(__pyx_int_0x10000);
5204 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_0x10000);
5205 __Pyx_GIVEREF(__pyx_int_0x10000);
5206 __Pyx_INCREF(__pyx_int_15);
5207 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_15);
5208 __Pyx_GIVEREF(__pyx_int_15);
5209 __Pyx_INCREF(__pyx_int_17);
5210 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_17);
5211 __Pyx_GIVEREF(__pyx_int_17);
5212 __Pyx_INCREF(__pyx_int_18);
5213 PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_int_18);
5214 __Pyx_GIVEREF(__pyx_int_18);
5215 PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_3);
5216 __Pyx_GIVEREF(__pyx_t_3);
5217 __Pyx_INCREF(__pyx_int_0);
5218 PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_0);
5219 __Pyx_GIVEREF(__pyx_int_0);
5221 if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__psltbl), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5222 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5224 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":467
5225 * 'bed' : ( 0x10000, 1, 2, 3, ord('#'), 0 ),
5226 * 'psltbl' : ( 0x10000, 15, 17, 18, ord('#'), 0 ),
5227 * 'sam' : ( 1, 3, 4, 0, ord('#'), 0 ), # <<<<<<<<<<<<<<
5228 * 'vcf' : ( 2, 1, 2, 0, ord('#'), 0 ),
5229 * 'pileup': (3, 1, 2, 0, ord('#'), 0 ),
5231 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5232 __Pyx_GOTREF(__pyx_t_6);
5233 __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
5234 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_20));
5235 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
5236 __pyx_t_3 = PyObject_Call(__pyx_builtin_ord, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5237 __Pyx_GOTREF(__pyx_t_3);
5238 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5239 __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5240 __Pyx_GOTREF(__pyx_t_6);
5241 __Pyx_INCREF(__pyx_int_1);
5242 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_1);
5243 __Pyx_GIVEREF(__pyx_int_1);
5244 __Pyx_INCREF(__pyx_int_3);
5245 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_3);
5246 __Pyx_GIVEREF(__pyx_int_3);
5247 __Pyx_INCREF(__pyx_int_4);
5248 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_4);
5249 __Pyx_GIVEREF(__pyx_int_4);
5250 __Pyx_INCREF(__pyx_int_0);
5251 PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_int_0);
5252 __Pyx_GIVEREF(__pyx_int_0);
5253 PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_3);
5254 __Pyx_GIVEREF(__pyx_t_3);
5255 __Pyx_INCREF(__pyx_int_0);
5256 PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_0);
5257 __Pyx_GIVEREF(__pyx_int_0);
5259 if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__sam), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5260 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5262 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":468
5263 * 'psltbl' : ( 0x10000, 15, 17, 18, ord('#'), 0 ),
5264 * 'sam' : ( 1, 3, 4, 0, ord('#'), 0 ),
5265 * 'vcf' : ( 2, 1, 2, 0, ord('#'), 0 ), # <<<<<<<<<<<<<<
5266 * 'pileup': (3, 1, 2, 0, ord('#'), 0 ),
5269 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5270 __Pyx_GOTREF(__pyx_t_6);
5271 __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
5272 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_20));
5273 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
5274 __pyx_t_3 = PyObject_Call(__pyx_builtin_ord, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5275 __Pyx_GOTREF(__pyx_t_3);
5276 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5277 __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5278 __Pyx_GOTREF(__pyx_t_6);
5279 __Pyx_INCREF(__pyx_int_2);
5280 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_2);
5281 __Pyx_GIVEREF(__pyx_int_2);
5282 __Pyx_INCREF(__pyx_int_1);
5283 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_1);
5284 __Pyx_GIVEREF(__pyx_int_1);
5285 __Pyx_INCREF(__pyx_int_2);
5286 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_2);
5287 __Pyx_GIVEREF(__pyx_int_2);
5288 __Pyx_INCREF(__pyx_int_0);
5289 PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_int_0);
5290 __Pyx_GIVEREF(__pyx_int_0);
5291 PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_3);
5292 __Pyx_GIVEREF(__pyx_t_3);
5293 __Pyx_INCREF(__pyx_int_0);
5294 PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_0);
5295 __Pyx_GIVEREF(__pyx_int_0);
5297 if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__vcf), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5298 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5300 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":469
5301 * 'sam' : ( 1, 3, 4, 0, ord('#'), 0 ),
5302 * 'vcf' : ( 2, 1, 2, 0, ord('#'), 0 ),
5303 * 'pileup': (3, 1, 2, 0, ord('#'), 0 ), # <<<<<<<<<<<<<<
5307 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5308 __Pyx_GOTREF(__pyx_t_6);
5309 __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
5310 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_20));
5311 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
5312 __pyx_t_3 = PyObject_Call(__pyx_builtin_ord, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5313 __Pyx_GOTREF(__pyx_t_3);
5314 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5315 __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5316 __Pyx_GOTREF(__pyx_t_6);
5317 __Pyx_INCREF(__pyx_int_3);
5318 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_3);
5319 __Pyx_GIVEREF(__pyx_int_3);
5320 __Pyx_INCREF(__pyx_int_1);
5321 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_1);
5322 __Pyx_GIVEREF(__pyx_int_1);
5323 __Pyx_INCREF(__pyx_int_2);
5324 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_2);
5325 __Pyx_GIVEREF(__pyx_int_2);
5326 __Pyx_INCREF(__pyx_int_0);
5327 PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_int_0);
5328 __Pyx_GIVEREF(__pyx_int_0);
5329 PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_3);
5330 __Pyx_GIVEREF(__pyx_t_3);
5331 __Pyx_INCREF(__pyx_int_0);
5332 PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_0);
5333 __Pyx_GIVEREF(__pyx_int_0);
5335 if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__pileup), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5336 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5337 __Pyx_DECREF(((PyObject *)__pyx_v_preset2conf));
5338 __pyx_v_preset2conf = __pyx_t_2;
5341 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":472
5344 * if preset: # <<<<<<<<<<<<<<
5346 * conf_data = preset2conf[preset]
5348 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_preset); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5351 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":473
5354 * try: # <<<<<<<<<<<<<<
5355 * conf_data = preset2conf[preset]
5359 PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
5360 __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
5361 __Pyx_XGOTREF(__pyx_save_exc_type);
5362 __Pyx_XGOTREF(__pyx_save_exc_value);
5363 __Pyx_XGOTREF(__pyx_save_exc_tb);
5366 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":474
5369 * conf_data = preset2conf[preset] # <<<<<<<<<<<<<<
5371 * raise KeyError( "unknown preset '%s', valid presets are '%s'" % (preset, ",".join(preset2conf.keys() )))
5373 __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_preset2conf), __pyx_v_preset); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
5374 __Pyx_GOTREF(__pyx_t_2);
5375 __Pyx_DECREF(__pyx_v_conf_data);
5376 __pyx_v_conf_data = __pyx_t_2;
5379 __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
5380 __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
5381 __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
5382 goto __pyx_L17_try_end;
5384 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5385 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5386 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5387 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5389 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":475
5391 * conf_data = preset2conf[preset]
5392 * except KeyError: # <<<<<<<<<<<<<<
5393 * raise KeyError( "unknown preset '%s', valid presets are '%s'" % (preset, ",".join(preset2conf.keys() )))
5396 __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
5398 __Pyx_AddTraceback("ctabix.tabix_index");
5399 if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_6, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
5400 __Pyx_GOTREF(__pyx_t_2);
5401 __Pyx_GOTREF(__pyx_t_6);
5402 __Pyx_GOTREF(__pyx_t_3);
5404 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":476
5405 * conf_data = preset2conf[preset]
5407 * raise KeyError( "unknown preset '%s', valid presets are '%s'" % (preset, ",".join(preset2conf.keys() ))) # <<<<<<<<<<<<<<
5409 * if end_col == None: end_col = -1
5411 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_26), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
5412 __Pyx_GOTREF(__pyx_t_1);
5413 __pyx_t_9 = PyDict_Keys(((PyObject *)__pyx_v_preset2conf)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
5414 __Pyx_GOTREF(__pyx_t_9);
5415 __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
5416 __Pyx_GOTREF(__pyx_t_10);
5417 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
5418 __Pyx_GIVEREF(__pyx_t_9);
5420 __pyx_t_9 = PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
5421 __Pyx_GOTREF(__pyx_t_9);
5422 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5423 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5424 __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
5425 __Pyx_GOTREF(__pyx_t_10);
5426 __Pyx_INCREF(__pyx_v_preset);
5427 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_preset);
5428 __Pyx_GIVEREF(__pyx_v_preset);
5429 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
5430 __Pyx_GIVEREF(__pyx_t_9);
5432 __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_25), __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
5433 __Pyx_GOTREF(((PyObject *)__pyx_t_9));
5434 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5435 __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
5436 __Pyx_GOTREF(__pyx_t_10);
5437 PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_9));
5438 __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
5440 __pyx_t_9 = PyObject_Call(__pyx_builtin_KeyError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
5441 __Pyx_GOTREF(__pyx_t_9);
5442 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5443 __Pyx_Raise(__pyx_t_9, 0, 0);
5444 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5445 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
5446 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5447 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5448 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5449 goto __pyx_L11_exception_handled;
5451 __pyx_L12_except_error:;
5452 __Pyx_XGIVEREF(__pyx_save_exc_type);
5453 __Pyx_XGIVEREF(__pyx_save_exc_value);
5454 __Pyx_XGIVEREF(__pyx_save_exc_tb);
5455 __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
5456 goto __pyx_L1_error;
5457 __pyx_L11_exception_handled:;
5458 __Pyx_XGIVEREF(__pyx_save_exc_type);
5459 __Pyx_XGIVEREF(__pyx_save_exc_value);
5460 __Pyx_XGIVEREF(__pyx_save_exc_tb);
5461 __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
5468 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":478
5469 * raise KeyError( "unknown preset '%s', valid presets are '%s'" % (preset, ",".join(preset2conf.keys() )))
5471 * if end_col == None: end_col = -1 # <<<<<<<<<<<<<<
5475 __pyx_t_3 = PyObject_RichCompare(__pyx_v_end_col, Py_None, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5476 __Pyx_GOTREF(__pyx_t_3);
5477 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5478 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5480 __Pyx_INCREF(__pyx_int_neg_1);
5481 __Pyx_DECREF(__pyx_v_end_col);
5482 __pyx_v_end_col = __pyx_int_neg_1;
5487 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":479
5489 * if end_col == None: end_col = -1
5490 * preset = 0 # <<<<<<<<<<<<<<
5492 * # note that tabix internally works with 0-based coordinates and open/closed intervals.
5494 __Pyx_INCREF(__pyx_int_0);
5495 __Pyx_DECREF(__pyx_v_preset);
5496 __pyx_v_preset = __pyx_int_0;
5498 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":486
5499 * # -1 is subtracted from the start coordinate. To avoid doing this, set
5500 * # the TI_FLAG_UCSC=0x10000 flag:
5501 * if zerobased: preset = preset | 0x10000 # <<<<<<<<<<<<<<
5503 * conf_data = (preset, seq_col+1, start_col+1, end_col+1, ord(meta_char), 0)
5505 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_zerobased); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5507 __pyx_t_3 = PyNumber_Or(__pyx_v_preset, __pyx_int_0x10000); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5508 __Pyx_GOTREF(__pyx_t_3);
5509 __Pyx_DECREF(__pyx_v_preset);
5510 __pyx_v_preset = __pyx_t_3;
5516 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":488
5517 * if zerobased: preset = preset | 0x10000
5519 * conf_data = (preset, seq_col+1, start_col+1, end_col+1, ord(meta_char), 0) # <<<<<<<<<<<<<<
5521 * cdef ti_conf_t conf
5523 __pyx_t_3 = PyNumber_Add(__pyx_v_seq_col, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5524 __Pyx_GOTREF(__pyx_t_3);
5525 __pyx_t_6 = PyNumber_Add(__pyx_v_start_col, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5526 __Pyx_GOTREF(__pyx_t_6);
5527 __pyx_t_2 = PyNumber_Add(__pyx_v_end_col, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5528 __Pyx_GOTREF(__pyx_t_2);
5529 __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5530 __Pyx_GOTREF(__pyx_t_9);
5531 __Pyx_INCREF(__pyx_v_meta_char);
5532 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_meta_char);
5533 __Pyx_GIVEREF(__pyx_v_meta_char);
5534 __pyx_t_10 = PyObject_Call(__pyx_builtin_ord, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5535 __Pyx_GOTREF(__pyx_t_10);
5536 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5537 __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5538 __Pyx_GOTREF(__pyx_t_9);
5539 __Pyx_INCREF(__pyx_v_preset);
5540 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_preset);
5541 __Pyx_GIVEREF(__pyx_v_preset);
5542 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3);
5543 __Pyx_GIVEREF(__pyx_t_3);
5544 PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_6);
5545 __Pyx_GIVEREF(__pyx_t_6);
5546 PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_2);
5547 __Pyx_GIVEREF(__pyx_t_2);
5548 PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_10);
5549 __Pyx_GIVEREF(__pyx_t_10);
5550 __Pyx_INCREF(__pyx_int_0);
5551 PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_int_0);
5552 __Pyx_GIVEREF(__pyx_int_0);
5557 __Pyx_DECREF(__pyx_v_conf_data);
5558 __pyx_v_conf_data = __pyx_t_9;
5563 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":491
5565 * cdef ti_conf_t conf
5566 * conf.preset, conf.sc, conf.bc, conf.ec, conf.meta_char, conf.line_skip = conf_data # <<<<<<<<<<<<<<
5568 * ti_index_build( filename, &conf)
5570 if (PyTuple_CheckExact(__pyx_v_conf_data) && likely(PyTuple_GET_SIZE(__pyx_v_conf_data) == 6)) {
5571 PyObject* tuple = __pyx_v_conf_data;
5572 __pyx_t_9 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_9);
5573 __pyx_t_11 = __Pyx_PyInt_from_py_int32_t(__pyx_t_9); if (unlikely((__pyx_t_11 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5574 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5575 __pyx_t_10 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_10);
5576 __pyx_t_12 = __Pyx_PyInt_from_py_int32_t(__pyx_t_10); if (unlikely((__pyx_t_12 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5577 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5578 __pyx_t_2 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_2);
5579 __pyx_t_13 = __Pyx_PyInt_from_py_int32_t(__pyx_t_2); if (unlikely((__pyx_t_13 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5580 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5581 __pyx_t_6 = PyTuple_GET_ITEM(tuple, 3); __Pyx_INCREF(__pyx_t_6);
5582 __pyx_t_14 = __Pyx_PyInt_from_py_int32_t(__pyx_t_6); if (unlikely((__pyx_t_14 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5583 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5584 __pyx_t_3 = PyTuple_GET_ITEM(tuple, 4); __Pyx_INCREF(__pyx_t_3);
5585 __pyx_t_15 = __Pyx_PyInt_from_py_int32_t(__pyx_t_3); if (unlikely((__pyx_t_15 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5586 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5587 __pyx_t_1 = PyTuple_GET_ITEM(tuple, 5); __Pyx_INCREF(__pyx_t_1);
5588 __pyx_t_16 = __Pyx_PyInt_from_py_int32_t(__pyx_t_1); if (unlikely((__pyx_t_16 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5589 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5590 __pyx_v_conf.preset = __pyx_t_11;
5591 __pyx_v_conf.sc = __pyx_t_12;
5592 __pyx_v_conf.bc = __pyx_t_13;
5593 __pyx_v_conf.ec = __pyx_t_14;
5594 __pyx_v_conf.meta_char = __pyx_t_15;
5595 __pyx_v_conf.line_skip = __pyx_t_16;
5597 __pyx_t_17 = PyObject_GetIter(__pyx_v_conf_data); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5598 __Pyx_GOTREF(__pyx_t_17);
5599 __pyx_t_9 = __Pyx_UnpackItem(__pyx_t_17, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5600 __Pyx_GOTREF(__pyx_t_9);
5601 __pyx_t_16 = __Pyx_PyInt_from_py_int32_t(__pyx_t_9); if (unlikely((__pyx_t_16 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5602 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5603 __pyx_t_10 = __Pyx_UnpackItem(__pyx_t_17, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5604 __Pyx_GOTREF(__pyx_t_10);
5605 __pyx_t_15 = __Pyx_PyInt_from_py_int32_t(__pyx_t_10); if (unlikely((__pyx_t_15 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5606 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5607 __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_17, 2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5608 __Pyx_GOTREF(__pyx_t_2);
5609 __pyx_t_14 = __Pyx_PyInt_from_py_int32_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5610 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5611 __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_17, 3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5612 __Pyx_GOTREF(__pyx_t_6);
5613 __pyx_t_13 = __Pyx_PyInt_from_py_int32_t(__pyx_t_6); if (unlikely((__pyx_t_13 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5614 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5615 __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_17, 4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5616 __Pyx_GOTREF(__pyx_t_3);
5617 __pyx_t_12 = __Pyx_PyInt_from_py_int32_t(__pyx_t_3); if (unlikely((__pyx_t_12 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5618 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5619 __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_17, 5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5620 __Pyx_GOTREF(__pyx_t_1);
5621 __pyx_t_11 = __Pyx_PyInt_from_py_int32_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5622 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5623 if (__Pyx_EndUnpack(__pyx_t_17, 6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5624 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5625 __pyx_v_conf.preset = __pyx_t_16;
5626 __pyx_v_conf.sc = __pyx_t_15;
5627 __pyx_v_conf.bc = __pyx_t_14;
5628 __pyx_v_conf.ec = __pyx_t_13;
5629 __pyx_v_conf.meta_char = __pyx_t_12;
5630 __pyx_v_conf.line_skip = __pyx_t_11;
5633 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":493
5634 * conf.preset, conf.sc, conf.bc, conf.ec, conf.meta_char, conf.line_skip = conf_data
5636 * ti_index_build( filename, &conf) # <<<<<<<<<<<<<<
5640 __pyx_t_18 = PyBytes_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5641 ti_index_build(__pyx_t_18, (&__pyx_v_conf));
5643 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":495
5644 * ti_index_build( filename, &conf)
5646 * return filename # <<<<<<<<<<<<<<
5648 * __all__ = ["tabix_index",
5650 __Pyx_XDECREF(__pyx_r);
5651 __Pyx_INCREF(__pyx_v_filename);
5652 __pyx_r = __pyx_v_filename;
5655 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5658 __Pyx_XDECREF(__pyx_t_1);
5659 __Pyx_XDECREF(__pyx_t_2);
5660 __Pyx_XDECREF(__pyx_t_3);
5661 __Pyx_XDECREF(__pyx_t_6);
5662 __Pyx_XDECREF(__pyx_t_9);
5663 __Pyx_XDECREF(__pyx_t_10);
5664 __Pyx_XDECREF(__pyx_t_17);
5665 __Pyx_AddTraceback("ctabix.tabix_index");
5668 __Pyx_DECREF(__pyx_v_preset2conf);
5669 __Pyx_DECREF(__pyx_v_conf_data);
5670 __Pyx_DECREF(__pyx_v_filename);
5671 __Pyx_DECREF(__pyx_v_end_col);
5672 __Pyx_DECREF(__pyx_v_preset);
5673 __Pyx_XGIVEREF(__pyx_r);
5674 __Pyx_RefNannyFinishContext();
5678 static PyObject *__pyx_tp_new_6ctabix_Tabixfile(PyTypeObject *t, PyObject *a, PyObject *k) {
5679 PyObject *o = (*t->tp_alloc)(t, 0);
5681 if (__pyx_pf_6ctabix_9Tabixfile___cinit__(o, a, k) < 0) {
5682 Py_DECREF(o); o = 0;
5687 static void __pyx_tp_dealloc_6ctabix_Tabixfile(PyObject *o) {
5688 (*Py_TYPE(o)->tp_free)(o);
5691 static PyObject *__pyx_getprop_6ctabix_9Tabixfile_header(PyObject *o, void *x) {
5692 return __pyx_pf_6ctabix_9Tabixfile_6header___get__(o);
5695 static PyObject *__pyx_getprop_6ctabix_9Tabixfile_contigs(PyObject *o, void *x) {
5696 return __pyx_pf_6ctabix_9Tabixfile_7contigs___get__(o);
5699 static PyMethodDef __pyx_methods_6ctabix_Tabixfile[] = {
5700 {__Pyx_NAMESTR("_isOpen"), (PyCFunction)__pyx_pf_6ctabix_9Tabixfile__isOpen, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6ctabix_9Tabixfile__isOpen)},
5701 {__Pyx_NAMESTR("_open"), (PyCFunction)__pyx_pf_6ctabix_9Tabixfile__open, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6ctabix_9Tabixfile__open)},
5702 {__Pyx_NAMESTR("_parseRegion"), (PyCFunction)__pyx_pf_6ctabix_9Tabixfile__parseRegion, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6ctabix_9Tabixfile__parseRegion)},
5703 {__Pyx_NAMESTR("fetch"), (PyCFunction)__pyx_pf_6ctabix_9Tabixfile_fetch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6ctabix_9Tabixfile_fetch)},
5707 static struct PyGetSetDef __pyx_getsets_6ctabix_Tabixfile[] = {
5708 {(char *)"header", __pyx_getprop_6ctabix_9Tabixfile_header, 0, 0, 0},
5709 {(char *)"contigs", __pyx_getprop_6ctabix_9Tabixfile_contigs, 0, __Pyx_DOCSTR(__pyx_k_27), 0},
5713 static PyNumberMethods __pyx_tp_as_number_Tabixfile = {
5717 #if PY_MAJOR_VERSION < 3
5733 #if PY_MAJOR_VERSION < 3
5737 #if PY_MAJOR_VERSION < 3
5743 #if PY_MAJOR_VERSION < 3
5746 #if PY_MAJOR_VERSION < 3
5749 0, /*nb_inplace_add*/
5750 0, /*nb_inplace_subtract*/
5751 0, /*nb_inplace_multiply*/
5752 #if PY_MAJOR_VERSION < 3
5753 0, /*nb_inplace_divide*/
5755 0, /*nb_inplace_remainder*/
5756 0, /*nb_inplace_power*/
5757 0, /*nb_inplace_lshift*/
5758 0, /*nb_inplace_rshift*/
5759 0, /*nb_inplace_and*/
5760 0, /*nb_inplace_xor*/
5761 0, /*nb_inplace_or*/
5762 0, /*nb_floor_divide*/
5763 0, /*nb_true_divide*/
5764 0, /*nb_inplace_floor_divide*/
5765 0, /*nb_inplace_true_divide*/
5766 #if PY_VERSION_HEX >= 0x02050000
5771 static PySequenceMethods __pyx_tp_as_sequence_Tabixfile = {
5780 0, /*sq_inplace_concat*/
5781 0, /*sq_inplace_repeat*/
5784 static PyMappingMethods __pyx_tp_as_mapping_Tabixfile = {
5787 0, /*mp_ass_subscript*/
5790 static PyBufferProcs __pyx_tp_as_buffer_Tabixfile = {
5791 #if PY_MAJOR_VERSION < 3
5792 0, /*bf_getreadbuffer*/
5794 #if PY_MAJOR_VERSION < 3
5795 0, /*bf_getwritebuffer*/
5797 #if PY_MAJOR_VERSION < 3
5798 0, /*bf_getsegcount*/
5800 #if PY_MAJOR_VERSION < 3
5801 0, /*bf_getcharbuffer*/
5803 #if PY_VERSION_HEX >= 0x02060000
5806 #if PY_VERSION_HEX >= 0x02060000
5807 0, /*bf_releasebuffer*/
5811 PyTypeObject __pyx_type_6ctabix_Tabixfile = {
5812 PyVarObject_HEAD_INIT(0, 0)
5813 __Pyx_NAMESTR("ctabix.Tabixfile"), /*tp_name*/
5814 sizeof(struct __pyx_obj_6ctabix_Tabixfile), /*tp_basicsize*/
5816 __pyx_tp_dealloc_6ctabix_Tabixfile, /*tp_dealloc*/
5820 #if PY_MAJOR_VERSION < 3
5826 &__pyx_tp_as_number_Tabixfile, /*tp_as_number*/
5827 &__pyx_tp_as_sequence_Tabixfile, /*tp_as_sequence*/
5828 &__pyx_tp_as_mapping_Tabixfile, /*tp_as_mapping*/
5834 &__pyx_tp_as_buffer_Tabixfile, /*tp_as_buffer*/
5835 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
5836 __Pyx_DOCSTR("*(filename, mode='r')*\n\n opens a :term:`tabix file` for reading. A missing\n index (*filename* + \".tbi\") will raise an exception.\n "), /*tp_doc*/
5839 0, /*tp_richcompare*/
5840 0, /*tp_weaklistoffset*/
5843 __pyx_methods_6ctabix_Tabixfile, /*tp_methods*/
5845 __pyx_getsets_6ctabix_Tabixfile, /*tp_getset*/
5850 0, /*tp_dictoffset*/
5853 __pyx_tp_new_6ctabix_Tabixfile, /*tp_new*/
5859 0, /*tp_subclasses*/
5862 #if PY_VERSION_HEX >= 0x02060000
5863 0, /*tp_version_tag*/
5867 static PyObject *__pyx_tp_new_6ctabix_Parser(PyTypeObject *t, PyObject *a, PyObject *k) {
5868 PyObject *o = (*t->tp_alloc)(t, 0);
5873 static void __pyx_tp_dealloc_6ctabix_Parser(PyObject *o) {
5874 (*Py_TYPE(o)->tp_free)(o);
5877 static PyMethodDef __pyx_methods_6ctabix_Parser[] = {
5881 static PyNumberMethods __pyx_tp_as_number_Parser = {
5885 #if PY_MAJOR_VERSION < 3
5901 #if PY_MAJOR_VERSION < 3
5905 #if PY_MAJOR_VERSION < 3
5911 #if PY_MAJOR_VERSION < 3
5914 #if PY_MAJOR_VERSION < 3
5917 0, /*nb_inplace_add*/
5918 0, /*nb_inplace_subtract*/
5919 0, /*nb_inplace_multiply*/
5920 #if PY_MAJOR_VERSION < 3
5921 0, /*nb_inplace_divide*/
5923 0, /*nb_inplace_remainder*/
5924 0, /*nb_inplace_power*/
5925 0, /*nb_inplace_lshift*/
5926 0, /*nb_inplace_rshift*/
5927 0, /*nb_inplace_and*/
5928 0, /*nb_inplace_xor*/
5929 0, /*nb_inplace_or*/
5930 0, /*nb_floor_divide*/
5931 0, /*nb_true_divide*/
5932 0, /*nb_inplace_floor_divide*/
5933 0, /*nb_inplace_true_divide*/
5934 #if PY_VERSION_HEX >= 0x02050000
5939 static PySequenceMethods __pyx_tp_as_sequence_Parser = {
5948 0, /*sq_inplace_concat*/
5949 0, /*sq_inplace_repeat*/
5952 static PyMappingMethods __pyx_tp_as_mapping_Parser = {
5955 0, /*mp_ass_subscript*/
5958 static PyBufferProcs __pyx_tp_as_buffer_Parser = {
5959 #if PY_MAJOR_VERSION < 3
5960 0, /*bf_getreadbuffer*/
5962 #if PY_MAJOR_VERSION < 3
5963 0, /*bf_getwritebuffer*/
5965 #if PY_MAJOR_VERSION < 3
5966 0, /*bf_getsegcount*/
5968 #if PY_MAJOR_VERSION < 3
5969 0, /*bf_getcharbuffer*/
5971 #if PY_VERSION_HEX >= 0x02060000
5974 #if PY_VERSION_HEX >= 0x02060000
5975 0, /*bf_releasebuffer*/
5979 PyTypeObject __pyx_type_6ctabix_Parser = {
5980 PyVarObject_HEAD_INIT(0, 0)
5981 __Pyx_NAMESTR("ctabix.Parser"), /*tp_name*/
5982 sizeof(struct __pyx_obj_6ctabix_Parser), /*tp_basicsize*/
5984 __pyx_tp_dealloc_6ctabix_Parser, /*tp_dealloc*/
5988 #if PY_MAJOR_VERSION < 3
5994 &__pyx_tp_as_number_Parser, /*tp_as_number*/
5995 &__pyx_tp_as_sequence_Parser, /*tp_as_sequence*/
5996 &__pyx_tp_as_mapping_Parser, /*tp_as_mapping*/
6002 &__pyx_tp_as_buffer_Parser, /*tp_as_buffer*/
6003 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
6007 0, /*tp_richcompare*/
6008 0, /*tp_weaklistoffset*/
6011 __pyx_methods_6ctabix_Parser, /*tp_methods*/
6018 0, /*tp_dictoffset*/
6021 __pyx_tp_new_6ctabix_Parser, /*tp_new*/
6027 0, /*tp_subclasses*/
6030 #if PY_VERSION_HEX >= 0x02060000
6031 0, /*tp_version_tag*/
6035 static PyObject *__pyx_tp_new_6ctabix_TabixIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
6036 PyObject *o = (*t->tp_alloc)(t, 0);
6038 if (__pyx_pf_6ctabix_13TabixIterator___cinit__(o, a, k) < 0) {
6039 Py_DECREF(o); o = 0;
6044 static void __pyx_tp_dealloc_6ctabix_TabixIterator(PyObject *o) {
6046 PyObject *etype, *eval, *etb;
6047 PyErr_Fetch(&etype, &eval, &etb);
6049 __pyx_pf_6ctabix_13TabixIterator___dealloc__(o);
6050 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
6052 PyErr_Restore(etype, eval, etb);
6054 (*Py_TYPE(o)->tp_free)(o);
6057 static PyMethodDef __pyx_methods_6ctabix_TabixIterator[] = {
6058 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6ctabix_13TabixIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_6ctabix_13TabixIterator___next__)},
6062 static PyNumberMethods __pyx_tp_as_number_TabixIterator = {
6066 #if PY_MAJOR_VERSION < 3
6082 #if PY_MAJOR_VERSION < 3
6086 #if PY_MAJOR_VERSION < 3
6092 #if PY_MAJOR_VERSION < 3
6095 #if PY_MAJOR_VERSION < 3
6098 0, /*nb_inplace_add*/
6099 0, /*nb_inplace_subtract*/
6100 0, /*nb_inplace_multiply*/
6101 #if PY_MAJOR_VERSION < 3
6102 0, /*nb_inplace_divide*/
6104 0, /*nb_inplace_remainder*/
6105 0, /*nb_inplace_power*/
6106 0, /*nb_inplace_lshift*/
6107 0, /*nb_inplace_rshift*/
6108 0, /*nb_inplace_and*/
6109 0, /*nb_inplace_xor*/
6110 0, /*nb_inplace_or*/
6111 0, /*nb_floor_divide*/
6112 0, /*nb_true_divide*/
6113 0, /*nb_inplace_floor_divide*/
6114 0, /*nb_inplace_true_divide*/
6115 #if PY_VERSION_HEX >= 0x02050000
6120 static PySequenceMethods __pyx_tp_as_sequence_TabixIterator = {
6129 0, /*sq_inplace_concat*/
6130 0, /*sq_inplace_repeat*/
6133 static PyMappingMethods __pyx_tp_as_mapping_TabixIterator = {
6136 0, /*mp_ass_subscript*/
6139 static PyBufferProcs __pyx_tp_as_buffer_TabixIterator = {
6140 #if PY_MAJOR_VERSION < 3
6141 0, /*bf_getreadbuffer*/
6143 #if PY_MAJOR_VERSION < 3
6144 0, /*bf_getwritebuffer*/
6146 #if PY_MAJOR_VERSION < 3
6147 0, /*bf_getsegcount*/
6149 #if PY_MAJOR_VERSION < 3
6150 0, /*bf_getcharbuffer*/
6152 #if PY_VERSION_HEX >= 0x02060000
6155 #if PY_VERSION_HEX >= 0x02060000
6156 0, /*bf_releasebuffer*/
6160 PyTypeObject __pyx_type_6ctabix_TabixIterator = {
6161 PyVarObject_HEAD_INIT(0, 0)
6162 __Pyx_NAMESTR("ctabix.TabixIterator"), /*tp_name*/
6163 sizeof(struct __pyx_obj_6ctabix_TabixIterator), /*tp_basicsize*/
6165 __pyx_tp_dealloc_6ctabix_TabixIterator, /*tp_dealloc*/
6169 #if PY_MAJOR_VERSION < 3
6175 &__pyx_tp_as_number_TabixIterator, /*tp_as_number*/
6176 &__pyx_tp_as_sequence_TabixIterator, /*tp_as_sequence*/
6177 &__pyx_tp_as_mapping_TabixIterator, /*tp_as_mapping*/
6183 &__pyx_tp_as_buffer_TabixIterator, /*tp_as_buffer*/
6184 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
6185 __Pyx_DOCSTR("iterates over rows in *tabixfile* in region\n given by *tid*, *start* and *end*.\n "), /*tp_doc*/
6188 0, /*tp_richcompare*/
6189 0, /*tp_weaklistoffset*/
6190 __pyx_pf_6ctabix_13TabixIterator___iter__, /*tp_iter*/
6191 __pyx_pf_6ctabix_13TabixIterator___next__, /*tp_iternext*/
6192 __pyx_methods_6ctabix_TabixIterator, /*tp_methods*/
6199 0, /*tp_dictoffset*/
6202 __pyx_tp_new_6ctabix_TabixIterator, /*tp_new*/
6208 0, /*tp_subclasses*/
6211 #if PY_VERSION_HEX >= 0x02060000
6212 0, /*tp_version_tag*/
6216 static PyObject *__pyx_tp_new_6ctabix_TabixHeaderIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
6217 PyObject *o = (*t->tp_alloc)(t, 0);
6219 if (__pyx_pf_6ctabix_19TabixHeaderIterator___cinit__(o, a, k) < 0) {
6220 Py_DECREF(o); o = 0;
6225 static void __pyx_tp_dealloc_6ctabix_TabixHeaderIterator(PyObject *o) {
6227 PyObject *etype, *eval, *etb;
6228 PyErr_Fetch(&etype, &eval, &etb);
6230 __pyx_pf_6ctabix_19TabixHeaderIterator___dealloc__(o);
6231 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
6233 PyErr_Restore(etype, eval, etb);
6235 (*Py_TYPE(o)->tp_free)(o);
6238 static PyMethodDef __pyx_methods_6ctabix_TabixHeaderIterator[] = {
6239 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6ctabix_19TabixHeaderIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_6ctabix_19TabixHeaderIterator___next__)},
6243 static PyNumberMethods __pyx_tp_as_number_TabixHeaderIterator = {
6247 #if PY_MAJOR_VERSION < 3
6263 #if PY_MAJOR_VERSION < 3
6267 #if PY_MAJOR_VERSION < 3
6273 #if PY_MAJOR_VERSION < 3
6276 #if PY_MAJOR_VERSION < 3
6279 0, /*nb_inplace_add*/
6280 0, /*nb_inplace_subtract*/
6281 0, /*nb_inplace_multiply*/
6282 #if PY_MAJOR_VERSION < 3
6283 0, /*nb_inplace_divide*/
6285 0, /*nb_inplace_remainder*/
6286 0, /*nb_inplace_power*/
6287 0, /*nb_inplace_lshift*/
6288 0, /*nb_inplace_rshift*/
6289 0, /*nb_inplace_and*/
6290 0, /*nb_inplace_xor*/
6291 0, /*nb_inplace_or*/
6292 0, /*nb_floor_divide*/
6293 0, /*nb_true_divide*/
6294 0, /*nb_inplace_floor_divide*/
6295 0, /*nb_inplace_true_divide*/
6296 #if PY_VERSION_HEX >= 0x02050000
6301 static PySequenceMethods __pyx_tp_as_sequence_TabixHeaderIterator = {
6310 0, /*sq_inplace_concat*/
6311 0, /*sq_inplace_repeat*/
6314 static PyMappingMethods __pyx_tp_as_mapping_TabixHeaderIterator = {
6317 0, /*mp_ass_subscript*/
6320 static PyBufferProcs __pyx_tp_as_buffer_TabixHeaderIterator = {
6321 #if PY_MAJOR_VERSION < 3
6322 0, /*bf_getreadbuffer*/
6324 #if PY_MAJOR_VERSION < 3
6325 0, /*bf_getwritebuffer*/
6327 #if PY_MAJOR_VERSION < 3
6328 0, /*bf_getsegcount*/
6330 #if PY_MAJOR_VERSION < 3
6331 0, /*bf_getcharbuffer*/
6333 #if PY_VERSION_HEX >= 0x02060000
6336 #if PY_VERSION_HEX >= 0x02060000
6337 0, /*bf_releasebuffer*/
6341 PyTypeObject __pyx_type_6ctabix_TabixHeaderIterator = {
6342 PyVarObject_HEAD_INIT(0, 0)
6343 __Pyx_NAMESTR("ctabix.TabixHeaderIterator"), /*tp_name*/
6344 sizeof(struct __pyx_obj_6ctabix_TabixHeaderIterator), /*tp_basicsize*/
6346 __pyx_tp_dealloc_6ctabix_TabixHeaderIterator, /*tp_dealloc*/
6350 #if PY_MAJOR_VERSION < 3
6356 &__pyx_tp_as_number_TabixHeaderIterator, /*tp_as_number*/
6357 &__pyx_tp_as_sequence_TabixHeaderIterator, /*tp_as_sequence*/
6358 &__pyx_tp_as_mapping_TabixHeaderIterator, /*tp_as_mapping*/
6364 &__pyx_tp_as_buffer_TabixHeaderIterator, /*tp_as_buffer*/
6365 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
6366 __Pyx_DOCSTR("return header lines.\n "), /*tp_doc*/
6369 0, /*tp_richcompare*/
6370 0, /*tp_weaklistoffset*/
6371 __pyx_pf_6ctabix_19TabixHeaderIterator___iter__, /*tp_iter*/
6372 __pyx_pf_6ctabix_19TabixHeaderIterator___next__, /*tp_iternext*/
6373 __pyx_methods_6ctabix_TabixHeaderIterator, /*tp_methods*/
6380 0, /*tp_dictoffset*/
6383 __pyx_tp_new_6ctabix_TabixHeaderIterator, /*tp_new*/
6389 0, /*tp_subclasses*/
6392 #if PY_VERSION_HEX >= 0x02060000
6393 0, /*tp_version_tag*/
6397 static PyObject *__pyx_tp_new_6ctabix_asTuple(PyTypeObject *t, PyObject *a, PyObject *k) {
6398 PyObject *o = __pyx_tp_new_6ctabix_Parser(t, a, k);
6403 static PyMethodDef __pyx_methods_6ctabix_asTuple[] = {
6407 static PyNumberMethods __pyx_tp_as_number_asTuple = {
6411 #if PY_MAJOR_VERSION < 3
6427 #if PY_MAJOR_VERSION < 3
6431 #if PY_MAJOR_VERSION < 3
6437 #if PY_MAJOR_VERSION < 3
6440 #if PY_MAJOR_VERSION < 3
6443 0, /*nb_inplace_add*/
6444 0, /*nb_inplace_subtract*/
6445 0, /*nb_inplace_multiply*/
6446 #if PY_MAJOR_VERSION < 3
6447 0, /*nb_inplace_divide*/
6449 0, /*nb_inplace_remainder*/
6450 0, /*nb_inplace_power*/
6451 0, /*nb_inplace_lshift*/
6452 0, /*nb_inplace_rshift*/
6453 0, /*nb_inplace_and*/
6454 0, /*nb_inplace_xor*/
6455 0, /*nb_inplace_or*/
6456 0, /*nb_floor_divide*/
6457 0, /*nb_true_divide*/
6458 0, /*nb_inplace_floor_divide*/
6459 0, /*nb_inplace_true_divide*/
6460 #if PY_VERSION_HEX >= 0x02050000
6465 static PySequenceMethods __pyx_tp_as_sequence_asTuple = {
6474 0, /*sq_inplace_concat*/
6475 0, /*sq_inplace_repeat*/
6478 static PyMappingMethods __pyx_tp_as_mapping_asTuple = {
6481 0, /*mp_ass_subscript*/
6484 static PyBufferProcs __pyx_tp_as_buffer_asTuple = {
6485 #if PY_MAJOR_VERSION < 3
6486 0, /*bf_getreadbuffer*/
6488 #if PY_MAJOR_VERSION < 3
6489 0, /*bf_getwritebuffer*/
6491 #if PY_MAJOR_VERSION < 3
6492 0, /*bf_getsegcount*/
6494 #if PY_MAJOR_VERSION < 3
6495 0, /*bf_getcharbuffer*/
6497 #if PY_VERSION_HEX >= 0x02060000
6500 #if PY_VERSION_HEX >= 0x02060000
6501 0, /*bf_releasebuffer*/
6505 PyTypeObject __pyx_type_6ctabix_asTuple = {
6506 PyVarObject_HEAD_INIT(0, 0)
6507 __Pyx_NAMESTR("ctabix.asTuple"), /*tp_name*/
6508 sizeof(struct __pyx_obj_6ctabix_asTuple), /*tp_basicsize*/
6510 __pyx_tp_dealloc_6ctabix_Parser, /*tp_dealloc*/
6514 #if PY_MAJOR_VERSION < 3
6520 &__pyx_tp_as_number_asTuple, /*tp_as_number*/
6521 &__pyx_tp_as_sequence_asTuple, /*tp_as_sequence*/
6522 &__pyx_tp_as_mapping_asTuple, /*tp_as_mapping*/
6524 __pyx_pf_6ctabix_7asTuple___call__, /*tp_call*/
6528 &__pyx_tp_as_buffer_asTuple, /*tp_as_buffer*/
6529 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
6530 __Pyx_DOCSTR("converts a :term:`tabix row` into a python tuple."), /*tp_doc*/
6533 0, /*tp_richcompare*/
6534 0, /*tp_weaklistoffset*/
6537 __pyx_methods_6ctabix_asTuple, /*tp_methods*/
6544 0, /*tp_dictoffset*/
6547 __pyx_tp_new_6ctabix_asTuple, /*tp_new*/
6553 0, /*tp_subclasses*/
6556 #if PY_VERSION_HEX >= 0x02060000
6557 0, /*tp_version_tag*/
6561 static PyObject *__pyx_tp_new_6ctabix_asGTF(PyTypeObject *t, PyObject *a, PyObject *k) {
6562 PyObject *o = __pyx_tp_new_6ctabix_Parser(t, a, k);
6567 static PyMethodDef __pyx_methods_6ctabix_asGTF[] = {
6571 static PyNumberMethods __pyx_tp_as_number_asGTF = {
6575 #if PY_MAJOR_VERSION < 3
6591 #if PY_MAJOR_VERSION < 3
6595 #if PY_MAJOR_VERSION < 3
6601 #if PY_MAJOR_VERSION < 3
6604 #if PY_MAJOR_VERSION < 3
6607 0, /*nb_inplace_add*/
6608 0, /*nb_inplace_subtract*/
6609 0, /*nb_inplace_multiply*/
6610 #if PY_MAJOR_VERSION < 3
6611 0, /*nb_inplace_divide*/
6613 0, /*nb_inplace_remainder*/
6614 0, /*nb_inplace_power*/
6615 0, /*nb_inplace_lshift*/
6616 0, /*nb_inplace_rshift*/
6617 0, /*nb_inplace_and*/
6618 0, /*nb_inplace_xor*/
6619 0, /*nb_inplace_or*/
6620 0, /*nb_floor_divide*/
6621 0, /*nb_true_divide*/
6622 0, /*nb_inplace_floor_divide*/
6623 0, /*nb_inplace_true_divide*/
6624 #if PY_VERSION_HEX >= 0x02050000
6629 static PySequenceMethods __pyx_tp_as_sequence_asGTF = {
6638 0, /*sq_inplace_concat*/
6639 0, /*sq_inplace_repeat*/
6642 static PyMappingMethods __pyx_tp_as_mapping_asGTF = {
6645 0, /*mp_ass_subscript*/
6648 static PyBufferProcs __pyx_tp_as_buffer_asGTF = {
6649 #if PY_MAJOR_VERSION < 3
6650 0, /*bf_getreadbuffer*/
6652 #if PY_MAJOR_VERSION < 3
6653 0, /*bf_getwritebuffer*/
6655 #if PY_MAJOR_VERSION < 3
6656 0, /*bf_getsegcount*/
6658 #if PY_MAJOR_VERSION < 3
6659 0, /*bf_getcharbuffer*/
6661 #if PY_VERSION_HEX >= 0x02060000
6664 #if PY_VERSION_HEX >= 0x02060000
6665 0, /*bf_releasebuffer*/
6669 PyTypeObject __pyx_type_6ctabix_asGTF = {
6670 PyVarObject_HEAD_INIT(0, 0)
6671 __Pyx_NAMESTR("ctabix.asGTF"), /*tp_name*/
6672 sizeof(struct __pyx_obj_6ctabix_asGTF), /*tp_basicsize*/
6674 __pyx_tp_dealloc_6ctabix_Parser, /*tp_dealloc*/
6678 #if PY_MAJOR_VERSION < 3
6684 &__pyx_tp_as_number_asGTF, /*tp_as_number*/
6685 &__pyx_tp_as_sequence_asGTF, /*tp_as_sequence*/
6686 &__pyx_tp_as_mapping_asGTF, /*tp_as_mapping*/
6688 __pyx_pf_6ctabix_5asGTF___call__, /*tp_call*/
6692 &__pyx_tp_as_buffer_asGTF, /*tp_as_buffer*/
6693 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
6694 __Pyx_DOCSTR("converts a :term:`tabix row` into a GTF record."), /*tp_doc*/
6697 0, /*tp_richcompare*/
6698 0, /*tp_weaklistoffset*/
6701 __pyx_methods_6ctabix_asGTF, /*tp_methods*/
6708 0, /*tp_dictoffset*/
6711 __pyx_tp_new_6ctabix_asGTF, /*tp_new*/
6717 0, /*tp_subclasses*/
6720 #if PY_VERSION_HEX >= 0x02060000
6721 0, /*tp_version_tag*/
6725 static PyObject *__pyx_tp_new_6ctabix_asBed(PyTypeObject *t, PyObject *a, PyObject *k) {
6726 PyObject *o = __pyx_tp_new_6ctabix_Parser(t, a, k);
6731 static PyMethodDef __pyx_methods_6ctabix_asBed[] = {
6735 static PyNumberMethods __pyx_tp_as_number_asBed = {
6739 #if PY_MAJOR_VERSION < 3
6755 #if PY_MAJOR_VERSION < 3
6759 #if PY_MAJOR_VERSION < 3
6765 #if PY_MAJOR_VERSION < 3
6768 #if PY_MAJOR_VERSION < 3
6771 0, /*nb_inplace_add*/
6772 0, /*nb_inplace_subtract*/
6773 0, /*nb_inplace_multiply*/
6774 #if PY_MAJOR_VERSION < 3
6775 0, /*nb_inplace_divide*/
6777 0, /*nb_inplace_remainder*/
6778 0, /*nb_inplace_power*/
6779 0, /*nb_inplace_lshift*/
6780 0, /*nb_inplace_rshift*/
6781 0, /*nb_inplace_and*/
6782 0, /*nb_inplace_xor*/
6783 0, /*nb_inplace_or*/
6784 0, /*nb_floor_divide*/
6785 0, /*nb_true_divide*/
6786 0, /*nb_inplace_floor_divide*/
6787 0, /*nb_inplace_true_divide*/
6788 #if PY_VERSION_HEX >= 0x02050000
6793 static PySequenceMethods __pyx_tp_as_sequence_asBed = {
6802 0, /*sq_inplace_concat*/
6803 0, /*sq_inplace_repeat*/
6806 static PyMappingMethods __pyx_tp_as_mapping_asBed = {
6809 0, /*mp_ass_subscript*/
6812 static PyBufferProcs __pyx_tp_as_buffer_asBed = {
6813 #if PY_MAJOR_VERSION < 3
6814 0, /*bf_getreadbuffer*/
6816 #if PY_MAJOR_VERSION < 3
6817 0, /*bf_getwritebuffer*/
6819 #if PY_MAJOR_VERSION < 3
6820 0, /*bf_getsegcount*/
6822 #if PY_MAJOR_VERSION < 3
6823 0, /*bf_getcharbuffer*/
6825 #if PY_VERSION_HEX >= 0x02060000
6828 #if PY_VERSION_HEX >= 0x02060000
6829 0, /*bf_releasebuffer*/
6833 PyTypeObject __pyx_type_6ctabix_asBed = {
6834 PyVarObject_HEAD_INIT(0, 0)
6835 __Pyx_NAMESTR("ctabix.asBed"), /*tp_name*/
6836 sizeof(struct __pyx_obj_6ctabix_asBed), /*tp_basicsize*/
6838 __pyx_tp_dealloc_6ctabix_Parser, /*tp_dealloc*/
6842 #if PY_MAJOR_VERSION < 3
6848 &__pyx_tp_as_number_asBed, /*tp_as_number*/
6849 &__pyx_tp_as_sequence_asBed, /*tp_as_sequence*/
6850 &__pyx_tp_as_mapping_asBed, /*tp_as_mapping*/
6852 __pyx_pf_6ctabix_5asBed___call__, /*tp_call*/
6856 &__pyx_tp_as_buffer_asBed, /*tp_as_buffer*/
6857 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
6858 __Pyx_DOCSTR("converts a :term:`tabix row` into a GTF record."), /*tp_doc*/
6861 0, /*tp_richcompare*/
6862 0, /*tp_weaklistoffset*/
6865 __pyx_methods_6ctabix_asBed, /*tp_methods*/
6872 0, /*tp_dictoffset*/
6875 __pyx_tp_new_6ctabix_asBed, /*tp_new*/
6881 0, /*tp_subclasses*/
6884 #if PY_VERSION_HEX >= 0x02060000
6885 0, /*tp_version_tag*/
6889 static PyObject *__pyx_tp_new_6ctabix_asVCF(PyTypeObject *t, PyObject *a, PyObject *k) {
6890 PyObject *o = __pyx_tp_new_6ctabix_Parser(t, a, k);
6895 static PyMethodDef __pyx_methods_6ctabix_asVCF[] = {
6899 static PyNumberMethods __pyx_tp_as_number_asVCF = {
6903 #if PY_MAJOR_VERSION < 3
6919 #if PY_MAJOR_VERSION < 3
6923 #if PY_MAJOR_VERSION < 3
6929 #if PY_MAJOR_VERSION < 3
6932 #if PY_MAJOR_VERSION < 3
6935 0, /*nb_inplace_add*/
6936 0, /*nb_inplace_subtract*/
6937 0, /*nb_inplace_multiply*/
6938 #if PY_MAJOR_VERSION < 3
6939 0, /*nb_inplace_divide*/
6941 0, /*nb_inplace_remainder*/
6942 0, /*nb_inplace_power*/
6943 0, /*nb_inplace_lshift*/
6944 0, /*nb_inplace_rshift*/
6945 0, /*nb_inplace_and*/
6946 0, /*nb_inplace_xor*/
6947 0, /*nb_inplace_or*/
6948 0, /*nb_floor_divide*/
6949 0, /*nb_true_divide*/
6950 0, /*nb_inplace_floor_divide*/
6951 0, /*nb_inplace_true_divide*/
6952 #if PY_VERSION_HEX >= 0x02050000
6957 static PySequenceMethods __pyx_tp_as_sequence_asVCF = {
6966 0, /*sq_inplace_concat*/
6967 0, /*sq_inplace_repeat*/
6970 static PyMappingMethods __pyx_tp_as_mapping_asVCF = {
6973 0, /*mp_ass_subscript*/
6976 static PyBufferProcs __pyx_tp_as_buffer_asVCF = {
6977 #if PY_MAJOR_VERSION < 3
6978 0, /*bf_getreadbuffer*/
6980 #if PY_MAJOR_VERSION < 3
6981 0, /*bf_getwritebuffer*/
6983 #if PY_MAJOR_VERSION < 3
6984 0, /*bf_getsegcount*/
6986 #if PY_MAJOR_VERSION < 3
6987 0, /*bf_getcharbuffer*/
6989 #if PY_VERSION_HEX >= 0x02060000
6992 #if PY_VERSION_HEX >= 0x02060000
6993 0, /*bf_releasebuffer*/
6997 PyTypeObject __pyx_type_6ctabix_asVCF = {
6998 PyVarObject_HEAD_INIT(0, 0)
6999 __Pyx_NAMESTR("ctabix.asVCF"), /*tp_name*/
7000 sizeof(struct __pyx_obj_6ctabix_asVCF), /*tp_basicsize*/
7002 __pyx_tp_dealloc_6ctabix_Parser, /*tp_dealloc*/
7006 #if PY_MAJOR_VERSION < 3
7012 &__pyx_tp_as_number_asVCF, /*tp_as_number*/
7013 &__pyx_tp_as_sequence_asVCF, /*tp_as_sequence*/
7014 &__pyx_tp_as_mapping_asVCF, /*tp_as_mapping*/
7016 __pyx_pf_6ctabix_5asVCF___call__, /*tp_call*/
7020 &__pyx_tp_as_buffer_asVCF, /*tp_as_buffer*/
7021 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
7022 __Pyx_DOCSTR("converts a :term:`tabix row` into a VCF record."), /*tp_doc*/
7025 0, /*tp_richcompare*/
7026 0, /*tp_weaklistoffset*/
7029 __pyx_methods_6ctabix_asVCF, /*tp_methods*/
7036 0, /*tp_dictoffset*/
7039 __pyx_tp_new_6ctabix_asVCF, /*tp_new*/
7045 0, /*tp_subclasses*/
7048 #if PY_VERSION_HEX >= 0x02060000
7049 0, /*tp_version_tag*/
7053 static PyObject *__pyx_tp_new_6ctabix_TabixIteratorParsed(PyTypeObject *t, PyObject *a, PyObject *k) {
7054 struct __pyx_obj_6ctabix_TabixIteratorParsed *p;
7055 PyObject *o = (*t->tp_alloc)(t, 0);
7057 p = ((struct __pyx_obj_6ctabix_TabixIteratorParsed *)o);
7058 p->parser = ((struct __pyx_obj_6ctabix_Parser *)Py_None); Py_INCREF(Py_None);
7059 if (__pyx_pf_6ctabix_19TabixIteratorParsed___cinit__(o, a, k) < 0) {
7060 Py_DECREF(o); o = 0;
7065 static void __pyx_tp_dealloc_6ctabix_TabixIteratorParsed(PyObject *o) {
7066 struct __pyx_obj_6ctabix_TabixIteratorParsed *p = (struct __pyx_obj_6ctabix_TabixIteratorParsed *)o;
7068 PyObject *etype, *eval, *etb;
7069 PyErr_Fetch(&etype, &eval, &etb);
7071 __pyx_pf_6ctabix_19TabixIteratorParsed___dealloc__(o);
7072 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
7074 PyErr_Restore(etype, eval, etb);
7076 Py_XDECREF(((PyObject *)p->parser));
7077 (*Py_TYPE(o)->tp_free)(o);
7080 static int __pyx_tp_traverse_6ctabix_TabixIteratorParsed(PyObject *o, visitproc v, void *a) {
7082 struct __pyx_obj_6ctabix_TabixIteratorParsed *p = (struct __pyx_obj_6ctabix_TabixIteratorParsed *)o;
7084 e = (*v)(((PyObject*)p->parser), a); if (e) return e;
7089 static int __pyx_tp_clear_6ctabix_TabixIteratorParsed(PyObject *o) {
7090 struct __pyx_obj_6ctabix_TabixIteratorParsed *p = (struct __pyx_obj_6ctabix_TabixIteratorParsed *)o;
7092 tmp = ((PyObject*)p->parser);
7093 p->parser = ((struct __pyx_obj_6ctabix_Parser *)Py_None); Py_INCREF(Py_None);
7098 static PyMethodDef __pyx_methods_6ctabix_TabixIteratorParsed[] = {
7099 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6ctabix_19TabixIteratorParsed___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_6ctabix_19TabixIteratorParsed___next__)},
7103 static PyNumberMethods __pyx_tp_as_number_TabixIteratorParsed = {
7107 #if PY_MAJOR_VERSION < 3
7123 #if PY_MAJOR_VERSION < 3
7127 #if PY_MAJOR_VERSION < 3
7133 #if PY_MAJOR_VERSION < 3
7136 #if PY_MAJOR_VERSION < 3
7139 0, /*nb_inplace_add*/
7140 0, /*nb_inplace_subtract*/
7141 0, /*nb_inplace_multiply*/
7142 #if PY_MAJOR_VERSION < 3
7143 0, /*nb_inplace_divide*/
7145 0, /*nb_inplace_remainder*/
7146 0, /*nb_inplace_power*/
7147 0, /*nb_inplace_lshift*/
7148 0, /*nb_inplace_rshift*/
7149 0, /*nb_inplace_and*/
7150 0, /*nb_inplace_xor*/
7151 0, /*nb_inplace_or*/
7152 0, /*nb_floor_divide*/
7153 0, /*nb_true_divide*/
7154 0, /*nb_inplace_floor_divide*/
7155 0, /*nb_inplace_true_divide*/
7156 #if PY_VERSION_HEX >= 0x02050000
7161 static PySequenceMethods __pyx_tp_as_sequence_TabixIteratorParsed = {
7170 0, /*sq_inplace_concat*/
7171 0, /*sq_inplace_repeat*/
7174 static PyMappingMethods __pyx_tp_as_mapping_TabixIteratorParsed = {
7177 0, /*mp_ass_subscript*/
7180 static PyBufferProcs __pyx_tp_as_buffer_TabixIteratorParsed = {
7181 #if PY_MAJOR_VERSION < 3
7182 0, /*bf_getreadbuffer*/
7184 #if PY_MAJOR_VERSION < 3
7185 0, /*bf_getwritebuffer*/
7187 #if PY_MAJOR_VERSION < 3
7188 0, /*bf_getsegcount*/
7190 #if PY_MAJOR_VERSION < 3
7191 0, /*bf_getcharbuffer*/
7193 #if PY_VERSION_HEX >= 0x02060000
7196 #if PY_VERSION_HEX >= 0x02060000
7197 0, /*bf_releasebuffer*/
7201 PyTypeObject __pyx_type_6ctabix_TabixIteratorParsed = {
7202 PyVarObject_HEAD_INIT(0, 0)
7203 __Pyx_NAMESTR("ctabix.TabixIteratorParsed"), /*tp_name*/
7204 sizeof(struct __pyx_obj_6ctabix_TabixIteratorParsed), /*tp_basicsize*/
7206 __pyx_tp_dealloc_6ctabix_TabixIteratorParsed, /*tp_dealloc*/
7210 #if PY_MAJOR_VERSION < 3
7216 &__pyx_tp_as_number_TabixIteratorParsed, /*tp_as_number*/
7217 &__pyx_tp_as_sequence_TabixIteratorParsed, /*tp_as_sequence*/
7218 &__pyx_tp_as_mapping_TabixIteratorParsed, /*tp_as_mapping*/
7224 &__pyx_tp_as_buffer_TabixIteratorParsed, /*tp_as_buffer*/
7225 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
7226 __Pyx_DOCSTR("iterates over mapped reads in a region.\n\n Returns parsed data.\n "), /*tp_doc*/
7227 __pyx_tp_traverse_6ctabix_TabixIteratorParsed, /*tp_traverse*/
7228 __pyx_tp_clear_6ctabix_TabixIteratorParsed, /*tp_clear*/
7229 0, /*tp_richcompare*/
7230 0, /*tp_weaklistoffset*/
7231 __pyx_pf_6ctabix_19TabixIteratorParsed___iter__, /*tp_iter*/
7232 __pyx_pf_6ctabix_19TabixIteratorParsed___next__, /*tp_iternext*/
7233 __pyx_methods_6ctabix_TabixIteratorParsed, /*tp_methods*/
7240 0, /*tp_dictoffset*/
7243 __pyx_tp_new_6ctabix_TabixIteratorParsed, /*tp_new*/
7249 0, /*tp_subclasses*/
7252 #if PY_VERSION_HEX >= 0x02060000
7253 0, /*tp_version_tag*/
7257 static PyMethodDef __pyx_methods[] = {
7258 {__Pyx_NAMESTR("tabix_compress"), (PyCFunction)__pyx_pf_6ctabix_tabix_compress, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6ctabix_tabix_compress)},
7259 {__Pyx_NAMESTR("tabix_index"), (PyCFunction)__pyx_pf_6ctabix_tabix_index, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6ctabix_tabix_index)},
7263 #if PY_MAJOR_VERSION >= 3
7264 static struct PyModuleDef __pyx_moduledef = {
7265 PyModuleDef_HEAD_INIT,
7266 __Pyx_NAMESTR("ctabix"),
7269 __pyx_methods /* m_methods */,
7270 NULL, /* m_reload */
7271 NULL, /* m_traverse */
7277 static __Pyx_StringTabEntry __pyx_string_tab[] = {
7278 {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
7279 {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
7280 {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
7281 {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
7282 {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
7283 {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
7284 {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
7285 {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
7286 {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
7287 {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
7288 {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
7289 {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
7290 {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
7291 {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
7292 {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
7293 {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
7294 {&__pyx_kp_u_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0, 0},
7295 {&__pyx_kp_u_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 1, 0, 0},
7296 {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
7297 {&__pyx_kp_u_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 1, 0, 0},
7298 {&__pyx_kp_u_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 1, 0, 0},
7299 {&__pyx_kp_u_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 1, 0, 0},
7300 {&__pyx_kp_u_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 1, 0, 0},
7301 {&__pyx_kp_u_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 1, 0, 0},
7302 {&__pyx_kp_u_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 1, 0, 0},
7303 {&__pyx_kp_u_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0, 0},
7304 {&__pyx_kp_u_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 1, 0, 0},
7305 {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
7306 {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
7307 {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
7308 {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
7309 {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
7310 {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
7311 {&__pyx_n_s__IOError, __pyx_k__IOError, sizeof(__pyx_k__IOError), 0, 0, 1, 1},
7312 {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
7313 {&__pyx_n_s__OSError, __pyx_k__OSError, sizeof(__pyx_k__OSError), 0, 0, 1, 1},
7314 {&__pyx_n_s__O_RDONLY, __pyx_k__O_RDONLY, sizeof(__pyx_k__O_RDONLY), 0, 0, 1, 1},
7315 {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
7316 {&__pyx_n_s__TabixHeaderIterator, __pyx_k__TabixHeaderIterator, sizeof(__pyx_k__TabixHeaderIterator), 0, 0, 1, 1},
7317 {&__pyx_n_s__TabixIterator, __pyx_k__TabixIterator, sizeof(__pyx_k__TabixIterator), 0, 0, 1, 1},
7318 {&__pyx_n_s__TabixIteratorParsed, __pyx_k__TabixIteratorParsed, sizeof(__pyx_k__TabixIteratorParsed), 0, 0, 1, 1},
7319 {&__pyx_n_s__Tabixfile, __pyx_k__Tabixfile, sizeof(__pyx_k__Tabixfile), 0, 0, 1, 1},
7320 {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
7321 {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
7322 {&__pyx_n_s____get__, __pyx_k____get__, sizeof(__pyx_k____get__), 0, 0, 1, 1},
7323 {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
7324 {&__pyx_n_s____next__, __pyx_k____next__, sizeof(__pyx_k____next__), 0, 0, 1, 1},
7325 {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
7326 {&__pyx_n_s___isOpen, __pyx_k___isOpen, sizeof(__pyx_k___isOpen), 0, 0, 1, 1},
7327 {&__pyx_n_s___open, __pyx_k___open, sizeof(__pyx_k___open), 0, 0, 1, 1},
7328 {&__pyx_n_s___parseRegion, __pyx_k___parseRegion, sizeof(__pyx_k___parseRegion), 0, 0, 1, 1},
7329 {&__pyx_n_s__asBed, __pyx_k__asBed, sizeof(__pyx_k__asBed), 0, 0, 1, 1},
7330 {&__pyx_n_s__asGTF, __pyx_k__asGTF, sizeof(__pyx_k__asGTF), 0, 0, 1, 1},
7331 {&__pyx_n_s__asTuple, __pyx_k__asTuple, sizeof(__pyx_k__asTuple), 0, 0, 1, 1},
7332 {&__pyx_n_s__asVCF, __pyx_k__asVCF, sizeof(__pyx_k__asVCF), 0, 0, 1, 1},
7333 {&__pyx_n_s__bc, __pyx_k__bc, sizeof(__pyx_k__bc), 0, 0, 1, 1},
7334 {&__pyx_n_s__bed, __pyx_k__bed, sizeof(__pyx_k__bed), 0, 0, 1, 1},
7335 {&__pyx_n_s__buffer, __pyx_k__buffer, sizeof(__pyx_k__buffer), 0, 0, 1, 1},
7336 {&__pyx_n_s__close, __pyx_k__close, sizeof(__pyx_k__close), 0, 0, 1, 1},
7337 {&__pyx_n_s__copy, __pyx_k__copy, sizeof(__pyx_k__copy), 0, 0, 1, 1},
7338 {&__pyx_n_s__ctypes, __pyx_k__ctypes, sizeof(__pyx_k__ctypes), 0, 0, 1, 1},
7339 {&__pyx_n_s__ec, __pyx_k__ec, sizeof(__pyx_k__ec), 0, 0, 1, 1},
7340 {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
7341 {&__pyx_n_s__end_col, __pyx_k__end_col, sizeof(__pyx_k__end_col), 0, 0, 1, 1},
7342 {&__pyx_n_s__endswith, __pyx_k__endswith, sizeof(__pyx_k__endswith), 0, 0, 1, 1},
7343 {&__pyx_n_s__exists, __pyx_k__exists, sizeof(__pyx_k__exists), 0, 0, 1, 1},
7344 {&__pyx_n_s__fetch, __pyx_k__fetch, sizeof(__pyx_k__fetch), 0, 0, 1, 1},
7345 {&__pyx_n_s__filename, __pyx_k__filename, sizeof(__pyx_k__filename), 0, 0, 1, 1},
7346 {&__pyx_n_s__filename_in, __pyx_k__filename_in, sizeof(__pyx_k__filename_in), 0, 0, 1, 1},
7347 {&__pyx_n_s__filename_out, __pyx_k__filename_out, sizeof(__pyx_k__filename_out), 0, 0, 1, 1},
7348 {&__pyx_n_s__force, __pyx_k__force, sizeof(__pyx_k__force), 0, 0, 1, 1},
7349 {&__pyx_n_s__fp, __pyx_k__fp, sizeof(__pyx_k__fp), 0, 0, 1, 1},
7350 {&__pyx_n_s__gff, __pyx_k__gff, sizeof(__pyx_k__gff), 0, 0, 1, 1},
7351 {&__pyx_n_s__gzip, __pyx_k__gzip, sizeof(__pyx_k__gzip), 0, 0, 1, 1},
7352 {&__pyx_n_s__header, __pyx_k__header, sizeof(__pyx_k__header), 0, 0, 1, 1},
7353 {&__pyx_n_s__idx, __pyx_k__idx, sizeof(__pyx_k__idx), 0, 0, 1, 1},
7354 {&__pyx_n_s__iterator, __pyx_k__iterator, sizeof(__pyx_k__iterator), 0, 0, 1, 1},
7355 {&__pyx_n_s__itertools, __pyx_k__itertools, sizeof(__pyx_k__itertools), 0, 0, 1, 1},
7356 {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
7357 {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1},
7358 {&__pyx_n_s__len, __pyx_k__len, sizeof(__pyx_k__len), 0, 0, 1, 1},
7359 {&__pyx_n_s__line_skip, __pyx_k__line_skip, sizeof(__pyx_k__line_skip), 0, 0, 1, 1},
7360 {&__pyx_n_s__meta_char, __pyx_k__meta_char, sizeof(__pyx_k__meta_char), 0, 0, 1, 1},
7361 {&__pyx_n_s__mode, __pyx_k__mode, sizeof(__pyx_k__mode), 0, 0, 1, 1},
7362 {&__pyx_n_s__ord, __pyx_k__ord, sizeof(__pyx_k__ord), 0, 0, 1, 1},
7363 {&__pyx_n_s__os, __pyx_k__os, sizeof(__pyx_k__os), 0, 0, 1, 1},
7364 {&__pyx_n_s__parser, __pyx_k__parser, sizeof(__pyx_k__parser), 0, 0, 1, 1},
7365 {&__pyx_n_s__path, __pyx_k__path, sizeof(__pyx_k__path), 0, 0, 1, 1},
7366 {&__pyx_n_s__pileup, __pyx_k__pileup, sizeof(__pyx_k__pileup), 0, 0, 1, 1},
7367 {&__pyx_n_s__preset, __pyx_k__preset, sizeof(__pyx_k__preset), 0, 0, 1, 1},
7368 {&__pyx_n_s__psltbl, __pyx_k__psltbl, sizeof(__pyx_k__psltbl), 0, 0, 1, 1},
7369 {&__pyx_n_s__r, __pyx_k__r, sizeof(__pyx_k__r), 0, 0, 1, 1},
7370 {&__pyx_n_s__reference, __pyx_k__reference, sizeof(__pyx_k__reference), 0, 0, 1, 1},
7371 {&__pyx_n_s__region, __pyx_k__region, sizeof(__pyx_k__region), 0, 0, 1, 1},
7372 {&__pyx_n_s__sam, __pyx_k__sam, sizeof(__pyx_k__sam), 0, 0, 1, 1},
7373 {&__pyx_n_s__sc, __pyx_k__sc, sizeof(__pyx_k__sc), 0, 0, 1, 1},
7374 {&__pyx_n_s__seq_col, __pyx_k__seq_col, sizeof(__pyx_k__seq_col), 0, 0, 1, 1},
7375 {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
7376 {&__pyx_n_s__start_col, __pyx_k__start_col, sizeof(__pyx_k__start_col), 0, 0, 1, 1},
7377 {&__pyx_n_s__struct, __pyx_k__struct, sizeof(__pyx_k__struct), 0, 0, 1, 1},
7378 {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
7379 {&__pyx_n_s__tabix_compress, __pyx_k__tabix_compress, sizeof(__pyx_k__tabix_compress), 0, 0, 1, 1},
7380 {&__pyx_n_s__tabix_index, __pyx_k__tabix_index, sizeof(__pyx_k__tabix_index), 0, 0, 1, 1},
7381 {&__pyx_n_s__tabixfile, __pyx_k__tabixfile, sizeof(__pyx_k__tabixfile), 0, 0, 1, 1},
7382 {&__pyx_n_s__tempfile, __pyx_k__tempfile, sizeof(__pyx_k__tempfile), 0, 0, 1, 1},
7383 {&__pyx_n_s__tid, __pyx_k__tid, sizeof(__pyx_k__tid), 0, 0, 1, 1},
7384 {&__pyx_n_s__types, __pyx_k__types, sizeof(__pyx_k__types), 0, 0, 1, 1},
7385 {&__pyx_n_s__unlink, __pyx_k__unlink, sizeof(__pyx_k__unlink), 0, 0, 1, 1},
7386 {&__pyx_n_s__vcf, __pyx_k__vcf, sizeof(__pyx_k__vcf), 0, 0, 1, 1},
7387 {&__pyx_n_s__w, __pyx_k__w, sizeof(__pyx_k__w), 0, 0, 1, 1},
7388 {&__pyx_n_s__zerobased, __pyx_k__zerobased, sizeof(__pyx_k__zerobased), 0, 0, 1, 1},
7389 {0, 0, 0, 0, 0, 0, 0}
7391 static int __Pyx_InitCachedBuiltins(void) {
7392 __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7393 __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7394 __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7395 __pyx_builtin_OSError = __Pyx_GetName(__pyx_b, __pyx_n_s__OSError); if (!__pyx_builtin_OSError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7396 __pyx_builtin_ord = __Pyx_GetName(__pyx_b, __pyx_n_s__ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7397 __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7403 static int __Pyx_InitGlobals(void) {
7404 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
7405 __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;};
7406 __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;};
7407 __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;};
7408 __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;};
7409 __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;};
7410 __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;};
7411 __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;};
7412 __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
7413 __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
7414 __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
7415 __pyx_int_0x10000 = PyInt_FromLong(0x10000); if (unlikely(!__pyx_int_0x10000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
7421 #if PY_MAJOR_VERSION < 3
7422 PyMODINIT_FUNC initctabix(void); /*proto*/
7423 PyMODINIT_FUNC initctabix(void)
7425 PyMODINIT_FUNC PyInit_ctabix(void); /*proto*/
7426 PyMODINIT_FUNC PyInit_ctabix(void)
7429 PyObject *__pyx_t_1 = NULL;
7430 PyObject *__pyx_t_2 = NULL;
7431 PyObject *__pyx_t_3 = NULL;
7433 void* __pyx_refnanny = NULL;
7434 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
7435 if (!__Pyx_RefNanny) {
7437 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
7438 if (!__Pyx_RefNanny)
7439 Py_FatalError("failed to import 'refnanny' module");
7441 __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_ctabix(void)", __LINE__, __FILE__);
7443 __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;}
7444 __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;}
7445 #ifdef __pyx_binding_PyCFunctionType_USED
7446 if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7448 /*--- Library function declarations ---*/
7449 /*--- Threads initialization code ---*/
7450 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
7451 #ifdef WITH_THREAD /* Python build with threading support? */
7452 PyEval_InitThreads();
7455 /*--- Module creation code ---*/
7456 #if PY_MAJOR_VERSION < 3
7457 __pyx_m = Py_InitModule4(__Pyx_NAMESTR("ctabix"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
7459 __pyx_m = PyModule_Create(&__pyx_moduledef);
7461 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
7462 #if PY_MAJOR_VERSION < 3
7465 __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
7466 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
7467 if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
7468 /*--- Initialize various global constants etc. ---*/
7469 if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7470 if (__pyx_module_is_main_ctabix) {
7471 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;};
7473 /*--- Builtin init code ---*/
7474 if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7475 /*--- Global init code ---*/
7476 /*--- Function export code ---*/
7477 /*--- Type init code ---*/
7478 if (PyType_Ready(&__pyx_type_6ctabix_Tabixfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7479 if (__Pyx_SetAttrString(__pyx_m, "Tabixfile", (PyObject *)&__pyx_type_6ctabix_Tabixfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7480 __pyx_ptype_6ctabix_Tabixfile = &__pyx_type_6ctabix_Tabixfile;
7481 if (PyType_Ready(&__pyx_type_6ctabix_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7482 if (__Pyx_SetAttrString(__pyx_m, "Parser", (PyObject *)&__pyx_type_6ctabix_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7483 __pyx_ptype_6ctabix_Parser = &__pyx_type_6ctabix_Parser;
7484 if (PyType_Ready(&__pyx_type_6ctabix_TabixIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7486 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6ctabix_TabixIterator, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7487 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
7488 __pyx_wrapperbase_6ctabix_13TabixIterator___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
7489 __pyx_wrapperbase_6ctabix_13TabixIterator___next__.doc = __pyx_doc_6ctabix_13TabixIterator___next__;
7490 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6ctabix_13TabixIterator___next__;
7493 if (__Pyx_SetAttrString(__pyx_m, "TabixIterator", (PyObject *)&__pyx_type_6ctabix_TabixIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7494 __pyx_ptype_6ctabix_TabixIterator = &__pyx_type_6ctabix_TabixIterator;
7495 if (PyType_Ready(&__pyx_type_6ctabix_TabixHeaderIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7497 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6ctabix_TabixHeaderIterator, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7498 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
7499 __pyx_wrapperbase_6ctabix_19TabixHeaderIterator___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
7500 __pyx_wrapperbase_6ctabix_19TabixHeaderIterator___next__.doc = __pyx_doc_6ctabix_19TabixHeaderIterator___next__;
7501 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6ctabix_19TabixHeaderIterator___next__;
7504 if (__Pyx_SetAttrString(__pyx_m, "TabixHeaderIterator", (PyObject *)&__pyx_type_6ctabix_TabixHeaderIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7505 __pyx_ptype_6ctabix_TabixHeaderIterator = &__pyx_type_6ctabix_TabixHeaderIterator;
7506 __pyx_type_6ctabix_asTuple.tp_base = __pyx_ptype_6ctabix_Parser;
7507 if (PyType_Ready(&__pyx_type_6ctabix_asTuple) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7508 if (__Pyx_SetAttrString(__pyx_m, "asTuple", (PyObject *)&__pyx_type_6ctabix_asTuple) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7509 __pyx_ptype_6ctabix_asTuple = &__pyx_type_6ctabix_asTuple;
7510 __pyx_type_6ctabix_asGTF.tp_base = __pyx_ptype_6ctabix_Parser;
7511 if (PyType_Ready(&__pyx_type_6ctabix_asGTF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7512 if (__Pyx_SetAttrString(__pyx_m, "asGTF", (PyObject *)&__pyx_type_6ctabix_asGTF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7513 __pyx_ptype_6ctabix_asGTF = &__pyx_type_6ctabix_asGTF;
7514 __pyx_type_6ctabix_asBed.tp_base = __pyx_ptype_6ctabix_Parser;
7515 if (PyType_Ready(&__pyx_type_6ctabix_asBed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7516 if (__Pyx_SetAttrString(__pyx_m, "asBed", (PyObject *)&__pyx_type_6ctabix_asBed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7517 __pyx_ptype_6ctabix_asBed = &__pyx_type_6ctabix_asBed;
7518 __pyx_type_6ctabix_asVCF.tp_base = __pyx_ptype_6ctabix_Parser;
7519 if (PyType_Ready(&__pyx_type_6ctabix_asVCF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7520 if (__Pyx_SetAttrString(__pyx_m, "asVCF", (PyObject *)&__pyx_type_6ctabix_asVCF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7521 __pyx_ptype_6ctabix_asVCF = &__pyx_type_6ctabix_asVCF;
7522 if (PyType_Ready(&__pyx_type_6ctabix_TabixIteratorParsed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7524 PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6ctabix_TabixIteratorParsed, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7525 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
7526 __pyx_wrapperbase_6ctabix_19TabixIteratorParsed___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
7527 __pyx_wrapperbase_6ctabix_19TabixIteratorParsed___next__.doc = __pyx_doc_6ctabix_19TabixIteratorParsed___next__;
7528 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6ctabix_19TabixIteratorParsed___next__;
7531 if (__Pyx_SetAttrString(__pyx_m, "TabixIteratorParsed", (PyObject *)&__pyx_type_6ctabix_TabixIteratorParsed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7532 __pyx_ptype_6ctabix_TabixIteratorParsed = &__pyx_type_6ctabix_TabixIteratorParsed;
7533 /*--- Type import code ---*/
7534 __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7535 __pyx_ptype_10TabProxies_TupleProxy = __Pyx_ImportType("TabProxies", "TupleProxy", sizeof(struct __pyx_obj_10TabProxies_TupleProxy), 1); if (unlikely(!__pyx_ptype_10TabProxies_TupleProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7536 if (__Pyx_GetVtable(__pyx_ptype_10TabProxies_TupleProxy->tp_dict, &__pyx_vtabptr_10TabProxies_TupleProxy) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7537 __pyx_ptype_10TabProxies_GTFProxy = __Pyx_ImportType("TabProxies", "GTFProxy", sizeof(struct __pyx_obj_10TabProxies_GTFProxy), 1); if (unlikely(!__pyx_ptype_10TabProxies_GTFProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7538 if (__Pyx_GetVtable(__pyx_ptype_10TabProxies_GTFProxy->tp_dict, &__pyx_vtabptr_10TabProxies_GTFProxy) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7539 __pyx_ptype_10TabProxies_NamedTupleProxy = __Pyx_ImportType("TabProxies", "NamedTupleProxy", sizeof(struct __pyx_obj_10TabProxies_NamedTupleProxy), 1); if (unlikely(!__pyx_ptype_10TabProxies_NamedTupleProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7540 if (__Pyx_GetVtable(__pyx_ptype_10TabProxies_NamedTupleProxy->tp_dict, &__pyx_vtabptr_10TabProxies_NamedTupleProxy) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7541 __pyx_ptype_10TabProxies_BedProxy = __Pyx_ImportType("TabProxies", "BedProxy", sizeof(struct __pyx_obj_10TabProxies_BedProxy), 1); if (unlikely(!__pyx_ptype_10TabProxies_BedProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7542 if (__Pyx_GetVtable(__pyx_ptype_10TabProxies_BedProxy->tp_dict, &__pyx_vtabptr_10TabProxies_BedProxy) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7543 __pyx_ptype_10TabProxies_VCFProxy = __Pyx_ImportType("TabProxies", "VCFProxy", sizeof(struct __pyx_obj_10TabProxies_VCFProxy), 1); if (unlikely(!__pyx_ptype_10TabProxies_VCFProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7544 if (__Pyx_GetVtable(__pyx_ptype_10TabProxies_VCFProxy->tp_dict, &__pyx_vtabptr_10TabProxies_VCFProxy) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7545 /*--- Function import code ---*/
7546 /*--- Execution code ---*/
7548 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":4
7549 * # adds doc-strings for sphinx
7551 * import tempfile, os, sys, types, itertools, struct, ctypes, gzip # <<<<<<<<<<<<<<
7552 * from cpython cimport PyString_FromStringAndSize, PyString_AS_STRING
7553 * cimport TabProxies
7555 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__tempfile), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7556 __Pyx_GOTREF(__pyx_t_1);
7557 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tempfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7558 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7559 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__os), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7560 __Pyx_GOTREF(__pyx_t_1);
7561 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7562 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7563 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7564 __Pyx_GOTREF(__pyx_t_1);
7565 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7566 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7567 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__types), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7568 __Pyx_GOTREF(__pyx_t_1);
7569 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__types, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7570 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7571 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__itertools), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7572 __Pyx_GOTREF(__pyx_t_1);
7573 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__itertools, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7574 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7575 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__struct), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7576 __Pyx_GOTREF(__pyx_t_1);
7577 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7578 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7579 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__ctypes), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7580 __Pyx_GOTREF(__pyx_t_1);
7581 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ctypes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7582 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7583 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__gzip), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7584 __Pyx_GOTREF(__pyx_t_1);
7585 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gzip, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7586 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7588 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":364
7589 * def tabix_compress( filename_in,
7591 * force = False ): # <<<<<<<<<<<<<<
7595 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7596 __Pyx_GOTREF(__pyx_t_1);
7597 __pyx_k_14 = __pyx_t_1;
7598 __Pyx_GIVEREF(__pyx_t_1);
7601 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":408
7603 * def tabix_index( filename,
7604 * force = False, # <<<<<<<<<<<<<<
7608 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7609 __Pyx_GOTREF(__pyx_t_1);
7610 __pyx_k_19 = __pyx_t_1;
7611 __Pyx_GIVEREF(__pyx_t_1);
7614 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":414
7617 * zerobased = False, # <<<<<<<<<<<<<<
7621 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7622 __Pyx_GOTREF(__pyx_t_1);
7623 __pyx_k_21 = __pyx_t_1;
7624 __Pyx_GIVEREF(__pyx_t_1);
7627 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":497
7630 * __all__ = ["tabix_index", # <<<<<<<<<<<<<<
7634 __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7635 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
7636 __Pyx_INCREF(((PyObject *)__pyx_n_s__tabix_index));
7637 PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__tabix_index));
7638 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tabix_index));
7639 __Pyx_INCREF(((PyObject *)__pyx_n_s__tabix_compress));
7640 PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__tabix_compress));
7641 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tabix_compress));
7642 __Pyx_INCREF(((PyObject *)__pyx_n_s__Tabixfile));
7643 PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__Tabixfile));
7644 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Tabixfile));
7645 __Pyx_INCREF(((PyObject *)__pyx_n_s__asTuple));
7646 PyList_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_s__asTuple));
7647 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__asTuple));
7648 __Pyx_INCREF(((PyObject *)__pyx_n_s__asGTF));
7649 PyList_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_n_s__asGTF));
7650 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__asGTF));
7651 __Pyx_INCREF(((PyObject *)__pyx_n_s__asVCF));
7652 PyList_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_n_s__asVCF));
7653 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__asVCF));
7654 __Pyx_INCREF(((PyObject *)__pyx_n_s__asBed));
7655 PyList_SET_ITEM(__pyx_t_1, 6, ((PyObject *)__pyx_n_s__asBed));
7656 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__asBed));
7657 if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7658 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
7660 /* "/ifs/devel/pysam/pysam/pysam/ctabix.pyx":1
7661 * # cython: embedsignature=True # <<<<<<<<<<<<<<
7662 * # adds doc-strings for sphinx
7665 __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;}
7666 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
7667 __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Tabixfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7668 __Pyx_GOTREF(__pyx_t_2);
7669 __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___isOpen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7670 __Pyx_GOTREF(__pyx_t_3);
7671 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7672 __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7673 __Pyx_GOTREF(__pyx_t_2);
7674 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7675 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_28), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7676 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7677 __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Tabixfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7678 __Pyx_GOTREF(__pyx_t_2);
7679 __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___open); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7680 __Pyx_GOTREF(__pyx_t_3);
7681 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7682 __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7683 __Pyx_GOTREF(__pyx_t_2);
7684 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7685 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_29), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7686 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7687 __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Tabixfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7688 __Pyx_GOTREF(__pyx_t_2);
7689 __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___parseRegion); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7690 __Pyx_GOTREF(__pyx_t_3);
7691 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7692 __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7693 __Pyx_GOTREF(__pyx_t_2);
7694 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7695 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_30), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7696 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7697 __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Tabixfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7698 __Pyx_GOTREF(__pyx_t_2);
7699 __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__fetch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7700 __Pyx_GOTREF(__pyx_t_3);
7701 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7702 __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7703 __Pyx_GOTREF(__pyx_t_2);
7704 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7705 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_31), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7706 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7707 __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Tabixfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7708 __Pyx_GOTREF(__pyx_t_2);
7709 __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7710 __Pyx_GOTREF(__pyx_t_3);
7711 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7712 __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____get__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7713 __Pyx_GOTREF(__pyx_t_2);
7714 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7715 __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7716 __Pyx_GOTREF(__pyx_t_3);
7717 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7718 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_32), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7719 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7720 __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__TabixIterator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7721 __Pyx_GOTREF(__pyx_t_3);
7722 __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____next__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7723 __Pyx_GOTREF(__pyx_t_2);
7724 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7725 __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7726 __Pyx_GOTREF(__pyx_t_3);
7727 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7728 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_33), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7729 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7730 __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__TabixHeaderIterator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7731 __Pyx_GOTREF(__pyx_t_3);
7732 __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____next__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7733 __Pyx_GOTREF(__pyx_t_2);
7734 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7735 __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7736 __Pyx_GOTREF(__pyx_t_3);
7737 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7738 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_34), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7739 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7740 __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__TabixIteratorParsed); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7741 __Pyx_GOTREF(__pyx_t_3);
7742 __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____next__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7743 __Pyx_GOTREF(__pyx_t_2);
7744 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7745 __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7746 __Pyx_GOTREF(__pyx_t_3);
7747 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7748 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_35), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7749 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7750 __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__tabix_compress); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7751 __Pyx_GOTREF(__pyx_t_3);
7752 __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7753 __Pyx_GOTREF(__pyx_t_2);
7754 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7755 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_36), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7756 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7757 __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__tabix_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7758 __Pyx_GOTREF(__pyx_t_2);
7759 __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7760 __Pyx_GOTREF(__pyx_t_3);
7761 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7762 if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_37), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7763 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7764 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;}
7765 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
7767 /* "/ifs/apps/apps/python-2.7.1/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/cpython/type.pxd":2
7769 * cdef extern from "Python.h": # <<<<<<<<<<<<<<
7770 * # The C structure of the objects used to describe built-in types.
7775 __Pyx_XDECREF(__pyx_t_1);
7776 __Pyx_XDECREF(__pyx_t_2);
7777 __Pyx_XDECREF(__pyx_t_3);
7779 __Pyx_AddTraceback("init ctabix");
7780 Py_DECREF(__pyx_m); __pyx_m = 0;
7781 } else if (!PyErr_Occurred()) {
7782 PyErr_SetString(PyExc_ImportError, "init ctabix");
7785 __Pyx_RefNannyFinishContext();
7786 #if PY_MAJOR_VERSION < 3
7793 /* Runtime support code */
7795 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
7797 result = PyObject_GetAttr(dict, name);
7799 PyErr_SetObject(PyExc_NameError, name);
7803 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
7805 const char* function_name,
7810 while (PyDict_Next(kwdict, &pos, &key, 0)) {
7811 #if PY_MAJOR_VERSION < 3
7812 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
7814 if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
7816 goto invalid_keyword_type;
7818 if ((!kw_allowed) && unlikely(key))
7819 goto invalid_keyword;
7821 invalid_keyword_type:
7822 PyErr_Format(PyExc_TypeError,
7823 "%s() keywords must be strings", function_name);
7826 PyErr_Format(PyExc_TypeError,
7827 #if PY_MAJOR_VERSION < 3
7828 "%s() got an unexpected keyword argument '%s'",
7829 function_name, PyString_AsString(key));
7831 "%s() got an unexpected keyword argument '%U'",
7832 function_name, key);
7837 static void __Pyx_RaiseDoubleKeywordsError(
7838 const char* func_name,
7841 PyErr_Format(PyExc_TypeError,
7842 #if PY_MAJOR_VERSION >= 3
7843 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
7845 "%s() got multiple values for keyword argument '%s'", func_name,
7846 PyString_AS_STRING(kw_name));
7850 static void __Pyx_RaiseArgtupleInvalid(
7851 const char* func_name,
7855 Py_ssize_t num_found)
7857 Py_ssize_t num_expected;
7858 const char *number, *more_or_less;
7860 if (num_found < num_min) {
7861 num_expected = num_min;
7862 more_or_less = "at least";
7864 num_expected = num_max;
7865 more_or_less = "at most";
7868 more_or_less = "exactly";
7870 number = (num_expected == 1) ? "" : "s";
7871 PyErr_Format(PyExc_TypeError,
7872 #if PY_VERSION_HEX < 0x02050000
7873 "%s() takes %s %d positional argument%s (%d given)",
7875 "%s() takes %s %zd positional argument%s (%zd given)",
7877 func_name, more_or_less, num_expected, number, num_found);
7880 static int __Pyx_ParseOptionalKeywords(
7882 PyObject **argnames[],
7885 Py_ssize_t num_pos_args,
7886 const char* function_name)
7888 PyObject *key = 0, *value = 0;
7891 PyObject*** first_kw_arg = argnames + num_pos_args;
7893 while (PyDict_Next(kwds, &pos, &key, &value)) {
7894 name = first_kw_arg;
7895 while (*name && (**name != key)) name++;
7897 values[name-argnames] = value;
7899 #if PY_MAJOR_VERSION < 3
7900 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
7902 if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
7904 goto invalid_keyword_type;
7906 for (name = first_kw_arg; *name; name++) {
7907 #if PY_MAJOR_VERSION >= 3
7908 if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
7909 PyUnicode_Compare(**name, key) == 0) break;
7911 if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
7912 _PyString_Eq(**name, key)) break;
7916 values[name-argnames] = value;
7918 /* unexpected keyword found */
7919 for (name=argnames; name != first_kw_arg; name++) {
7920 if (**name == key) goto arg_passed_twice;
7921 #if PY_MAJOR_VERSION >= 3
7922 if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
7923 PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
7925 if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
7926 _PyString_Eq(**name, key)) goto arg_passed_twice;
7930 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
7932 goto invalid_keyword;
7940 __Pyx_RaiseDoubleKeywordsError(function_name, **name);
7942 invalid_keyword_type:
7943 PyErr_Format(PyExc_TypeError,
7944 "%s() keywords must be strings", function_name);
7947 PyErr_Format(PyExc_TypeError,
7948 #if PY_MAJOR_VERSION < 3
7949 "%s() got an unexpected keyword argument '%s'",
7950 function_name, PyString_AsString(key));
7952 "%s() got an unexpected keyword argument '%U'",
7953 function_name, key);
7960 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
7961 PyErr_Format(PyExc_ValueError,
7962 #if PY_VERSION_HEX < 0x02050000
7963 "need more than %d value%s to unpack", (int)index,
7965 "need more than %zd value%s to unpack", index,
7967 (index == 1) ? "" : "s");
7970 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
7971 PyErr_Format(PyExc_ValueError,
7972 #if PY_VERSION_HEX < 0x02050000
7973 "too many values to unpack (expected %d)", (int)expected);
7975 "too many values to unpack (expected %zd)", expected);
7979 static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
7981 if (!(item = PyIter_Next(iter))) {
7982 if (!PyErr_Occurred()) {
7983 __Pyx_RaiseNeedMoreValuesError(index);
7989 static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) {
7991 if ((item = PyIter_Next(iter))) {
7993 __Pyx_RaiseTooManyValuesError(expected);
7996 else if (!PyErr_Occurred())
8002 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
8003 const char *name, int exact)
8006 PyErr_Format(PyExc_SystemError, "Missing type object");
8009 if (none_allowed && obj == Py_None) return 1;
8011 if (Py_TYPE(obj) == type) return 1;
8014 if (PyObject_TypeCheck(obj, type)) return 1;
8016 PyErr_Format(PyExc_TypeError,
8017 "Argument '%s' has incorrect type (expected %s, got %s)",
8018 name, type->tp_name, Py_TYPE(obj)->tp_name);
8022 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
8023 PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
8026 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
8027 PyObject *local_type, *local_value, *local_tb;
8028 PyObject *tmp_type, *tmp_value, *tmp_tb;
8029 PyThreadState *tstate = PyThreadState_GET();
8030 local_type = tstate->curexc_type;
8031 local_value = tstate->curexc_value;
8032 local_tb = tstate->curexc_traceback;
8033 tstate->curexc_type = 0;
8034 tstate->curexc_value = 0;
8035 tstate->curexc_traceback = 0;
8036 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
8037 if (unlikely(tstate->curexc_type))
8039 #if PY_MAJOR_VERSION >= 3
8040 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
8044 *value = local_value;
8046 Py_INCREF(local_type);
8047 Py_INCREF(local_value);
8048 Py_INCREF(local_tb);
8049 tmp_type = tstate->exc_type;
8050 tmp_value = tstate->exc_value;
8051 tmp_tb = tstate->exc_traceback;
8052 tstate->exc_type = local_type;
8053 tstate->exc_value = local_value;
8054 tstate->exc_traceback = local_tb;
8055 /* Make sure tstate is in a consistent state when we XDECREF
8056 these objects (XDECREF may run arbitrary code). */
8057 Py_XDECREF(tmp_type);
8058 Py_XDECREF(tmp_value);
8065 Py_XDECREF(local_type);
8066 Py_XDECREF(local_value);
8067 Py_XDECREF(local_tb);
8072 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
8073 PyThreadState *tstate = PyThreadState_GET();
8074 *type = tstate->exc_type;
8075 *value = tstate->exc_value;
8076 *tb = tstate->exc_traceback;
8082 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
8083 PyObject *tmp_type, *tmp_value, *tmp_tb;
8084 PyThreadState *tstate = PyThreadState_GET();
8085 tmp_type = tstate->exc_type;
8086 tmp_value = tstate->exc_value;
8087 tmp_tb = tstate->exc_traceback;
8088 tstate->exc_type = type;
8089 tstate->exc_value = value;
8090 tstate->exc_traceback = tb;
8091 Py_XDECREF(tmp_type);
8092 Py_XDECREF(tmp_value);
8096 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
8097 PyObject *py_import = 0;
8098 PyObject *empty_list = 0;
8099 PyObject *module = 0;
8100 PyObject *global_dict = 0;
8101 PyObject *empty_dict = 0;
8103 py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
8109 empty_list = PyList_New(0);
8114 global_dict = PyModule_GetDict(__pyx_m);
8117 empty_dict = PyDict_New();
8120 module = PyObject_CallFunctionObjArgs(py_import,
8121 name, global_dict, empty_dict, list, NULL);
8123 Py_XDECREF(empty_list);
8124 Py_XDECREF(py_import);
8125 Py_XDECREF(empty_dict);
8129 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
8130 PyObject *tmp_type, *tmp_value, *tmp_tb;
8131 PyThreadState *tstate = PyThreadState_GET();
8133 tmp_type = tstate->curexc_type;
8134 tmp_value = tstate->curexc_value;
8135 tmp_tb = tstate->curexc_traceback;
8136 tstate->curexc_type = type;
8137 tstate->curexc_value = value;
8138 tstate->curexc_traceback = tb;
8139 Py_XDECREF(tmp_type);
8140 Py_XDECREF(tmp_value);
8144 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
8145 PyThreadState *tstate = PyThreadState_GET();
8146 *type = tstate->curexc_type;
8147 *value = tstate->curexc_value;
8148 *tb = tstate->curexc_traceback;
8150 tstate->curexc_type = 0;
8151 tstate->curexc_value = 0;
8152 tstate->curexc_traceback = 0;
8156 #if PY_MAJOR_VERSION < 3
8157 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
8161 /* First, check the traceback argument, replacing None with NULL. */
8162 if (tb == Py_None) {
8166 else if (tb != NULL && !PyTraceBack_Check(tb)) {
8167 PyErr_SetString(PyExc_TypeError,
8168 "raise: arg 3 must be a traceback or None");
8171 /* Next, replace a missing value with None */
8172 if (value == NULL) {
8176 #if PY_VERSION_HEX < 0x02050000
8177 if (!PyClass_Check(type))
8179 if (!PyType_Check(type))
8182 /* Raising an instance. The value should be a dummy. */
8183 if (value != Py_None) {
8184 PyErr_SetString(PyExc_TypeError,
8185 "instance exception may not have a separate value");
8188 /* Normalize to raise <class>, <instance> */
8191 #if PY_VERSION_HEX < 0x02050000
8192 if (PyInstance_Check(type)) {
8193 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
8198 PyErr_SetString(PyExc_TypeError,
8199 "raise: exception must be an old-style class or instance");
8203 type = (PyObject*) Py_TYPE(type);
8205 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
8206 PyErr_SetString(PyExc_TypeError,
8207 "raise: exception class must be a subclass of BaseException");
8213 __Pyx_ErrRestore(type, value, tb);
8222 #else /* Python 3+ */
8224 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
8225 if (tb == Py_None) {
8227 } else if (tb && !PyTraceBack_Check(tb)) {
8228 PyErr_SetString(PyExc_TypeError,
8229 "raise: arg 3 must be a traceback or None");
8232 if (value == Py_None)
8235 if (PyExceptionInstance_Check(type)) {
8237 PyErr_SetString(PyExc_TypeError,
8238 "instance exception may not have a separate value");
8242 type = (PyObject*) Py_TYPE(value);
8243 } else if (!PyExceptionClass_Check(type)) {
8244 PyErr_SetString(PyExc_TypeError,
8245 "raise: exception class must be a subclass of BaseException");
8249 PyErr_SetObject(type, value);
8252 PyThreadState *tstate = PyThreadState_GET();
8253 PyObject* tmp_tb = tstate->curexc_traceback;
8256 tstate->curexc_traceback = tb;
8266 static CYTHON_INLINE int32_t __Pyx_PyInt_from_py_int32_t(PyObject* x) {
8267 const int32_t neg_one = (int32_t)-1, const_zero = (int32_t)0;
8268 const int is_unsigned = const_zero < neg_one;
8269 if (sizeof(int32_t) == sizeof(char)) {
8271 return (int32_t)__Pyx_PyInt_AsUnsignedChar(x);
8273 return (int32_t)__Pyx_PyInt_AsSignedChar(x);
8274 } else if (sizeof(int32_t) == sizeof(short)) {
8276 return (int32_t)__Pyx_PyInt_AsUnsignedShort(x);
8278 return (int32_t)__Pyx_PyInt_AsSignedShort(x);
8279 } else if (sizeof(int32_t) == sizeof(int)) {
8281 return (int32_t)__Pyx_PyInt_AsUnsignedInt(x);
8283 return (int32_t)__Pyx_PyInt_AsSignedInt(x);
8284 } else if (sizeof(int32_t) == sizeof(long)) {
8286 return (int32_t)__Pyx_PyInt_AsUnsignedLong(x);
8288 return (int32_t)__Pyx_PyInt_AsSignedLong(x);
8289 } else if (sizeof(int32_t) == sizeof(PY_LONG_LONG)) {
8291 return (int32_t)__Pyx_PyInt_AsUnsignedLongLong(x);
8293 return (int32_t)__Pyx_PyInt_AsSignedLongLong(x);
8296 PyObject *v = __Pyx_PyNumber_Int(x);
8297 #if PY_VERSION_HEX < 0x03000000
8298 if (likely(v) && !PyLong_Check(v)) {
8300 v = PyNumber_Long(tmp);
8305 int one = 1; int is_little = (int)*(unsigned char *)&one;
8306 unsigned char *bytes = (unsigned char *)&val;
8307 int ret = _PyLong_AsByteArray((PyLongObject *)v,
8309 is_little, !is_unsigned);
8318 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
8319 const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
8320 const int is_unsigned = neg_one > const_zero;
8321 if (sizeof(unsigned char) < sizeof(long)) {
8322 long val = __Pyx_PyInt_AsLong(x);
8323 if (unlikely(val != (long)(unsigned char)val)) {
8324 if (!unlikely(val == -1 && PyErr_Occurred())) {
8325 PyErr_SetString(PyExc_OverflowError,
8326 (is_unsigned && unlikely(val < 0)) ?
8327 "can't convert negative value to unsigned char" :
8328 "value too large to convert to unsigned char");
8330 return (unsigned char)-1;
8332 return (unsigned char)val;
8334 return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
8337 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
8338 const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
8339 const int is_unsigned = neg_one > const_zero;
8340 if (sizeof(unsigned short) < sizeof(long)) {
8341 long val = __Pyx_PyInt_AsLong(x);
8342 if (unlikely(val != (long)(unsigned short)val)) {
8343 if (!unlikely(val == -1 && PyErr_Occurred())) {
8344 PyErr_SetString(PyExc_OverflowError,
8345 (is_unsigned && unlikely(val < 0)) ?
8346 "can't convert negative value to unsigned short" :
8347 "value too large to convert to unsigned short");
8349 return (unsigned short)-1;
8351 return (unsigned short)val;
8353 return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
8356 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
8357 const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
8358 const int is_unsigned = neg_one > const_zero;
8359 if (sizeof(unsigned int) < sizeof(long)) {
8360 long val = __Pyx_PyInt_AsLong(x);
8361 if (unlikely(val != (long)(unsigned int)val)) {
8362 if (!unlikely(val == -1 && PyErr_Occurred())) {
8363 PyErr_SetString(PyExc_OverflowError,
8364 (is_unsigned && unlikely(val < 0)) ?
8365 "can't convert negative value to unsigned int" :
8366 "value too large to convert to unsigned int");
8368 return (unsigned int)-1;
8370 return (unsigned int)val;
8372 return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
8375 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
8376 const char neg_one = (char)-1, const_zero = 0;
8377 const int is_unsigned = neg_one > const_zero;
8378 if (sizeof(char) < sizeof(long)) {
8379 long val = __Pyx_PyInt_AsLong(x);
8380 if (unlikely(val != (long)(char)val)) {
8381 if (!unlikely(val == -1 && PyErr_Occurred())) {
8382 PyErr_SetString(PyExc_OverflowError,
8383 (is_unsigned && unlikely(val < 0)) ?
8384 "can't convert negative value to char" :
8385 "value too large to convert to char");
8391 return (char)__Pyx_PyInt_AsLong(x);
8394 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
8395 const short neg_one = (short)-1, const_zero = 0;
8396 const int is_unsigned = neg_one > const_zero;
8397 if (sizeof(short) < sizeof(long)) {
8398 long val = __Pyx_PyInt_AsLong(x);
8399 if (unlikely(val != (long)(short)val)) {
8400 if (!unlikely(val == -1 && PyErr_Occurred())) {
8401 PyErr_SetString(PyExc_OverflowError,
8402 (is_unsigned && unlikely(val < 0)) ?
8403 "can't convert negative value to short" :
8404 "value too large to convert to short");
8410 return (short)__Pyx_PyInt_AsLong(x);
8413 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
8414 const int neg_one = (int)-1, const_zero = 0;
8415 const int is_unsigned = neg_one > const_zero;
8416 if (sizeof(int) < sizeof(long)) {
8417 long val = __Pyx_PyInt_AsLong(x);
8418 if (unlikely(val != (long)(int)val)) {
8419 if (!unlikely(val == -1 && PyErr_Occurred())) {
8420 PyErr_SetString(PyExc_OverflowError,
8421 (is_unsigned && unlikely(val < 0)) ?
8422 "can't convert negative value to int" :
8423 "value too large to convert to int");
8429 return (int)__Pyx_PyInt_AsLong(x);
8432 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
8433 const signed char neg_one = (signed char)-1, const_zero = 0;
8434 const int is_unsigned = neg_one > const_zero;
8435 if (sizeof(signed char) < sizeof(long)) {
8436 long val = __Pyx_PyInt_AsLong(x);
8437 if (unlikely(val != (long)(signed char)val)) {
8438 if (!unlikely(val == -1 && PyErr_Occurred())) {
8439 PyErr_SetString(PyExc_OverflowError,
8440 (is_unsigned && unlikely(val < 0)) ?
8441 "can't convert negative value to signed char" :
8442 "value too large to convert to signed char");
8444 return (signed char)-1;
8446 return (signed char)val;
8448 return (signed char)__Pyx_PyInt_AsSignedLong(x);
8451 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
8452 const signed short neg_one = (signed short)-1, const_zero = 0;
8453 const int is_unsigned = neg_one > const_zero;
8454 if (sizeof(signed short) < sizeof(long)) {
8455 long val = __Pyx_PyInt_AsLong(x);
8456 if (unlikely(val != (long)(signed short)val)) {
8457 if (!unlikely(val == -1 && PyErr_Occurred())) {
8458 PyErr_SetString(PyExc_OverflowError,
8459 (is_unsigned && unlikely(val < 0)) ?
8460 "can't convert negative value to signed short" :
8461 "value too large to convert to signed short");
8463 return (signed short)-1;
8465 return (signed short)val;
8467 return (signed short)__Pyx_PyInt_AsSignedLong(x);
8470 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
8471 const signed int neg_one = (signed int)-1, const_zero = 0;
8472 const int is_unsigned = neg_one > const_zero;
8473 if (sizeof(signed int) < sizeof(long)) {
8474 long val = __Pyx_PyInt_AsLong(x);
8475 if (unlikely(val != (long)(signed int)val)) {
8476 if (!unlikely(val == -1 && PyErr_Occurred())) {
8477 PyErr_SetString(PyExc_OverflowError,
8478 (is_unsigned && unlikely(val < 0)) ?
8479 "can't convert negative value to signed int" :
8480 "value too large to convert to signed int");
8482 return (signed int)-1;
8484 return (signed int)val;
8486 return (signed int)__Pyx_PyInt_AsSignedLong(x);
8489 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
8490 const int neg_one = (int)-1, const_zero = 0;
8491 const int is_unsigned = neg_one > const_zero;
8492 if (sizeof(int) < sizeof(long)) {
8493 long val = __Pyx_PyInt_AsLong(x);
8494 if (unlikely(val != (long)(int)val)) {
8495 if (!unlikely(val == -1 && PyErr_Occurred())) {
8496 PyErr_SetString(PyExc_OverflowError,
8497 (is_unsigned && unlikely(val < 0)) ?
8498 "can't convert negative value to int" :
8499 "value too large to convert to int");
8505 return (int)__Pyx_PyInt_AsLong(x);
8508 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
8509 const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
8510 const int is_unsigned = neg_one > const_zero;
8511 #if PY_VERSION_HEX < 0x03000000
8512 if (likely(PyInt_Check(x))) {
8513 long val = PyInt_AS_LONG(x);
8514 if (is_unsigned && unlikely(val < 0)) {
8515 PyErr_SetString(PyExc_OverflowError,
8516 "can't convert negative value to unsigned long");
8517 return (unsigned long)-1;
8519 return (unsigned long)val;
8522 if (likely(PyLong_Check(x))) {
8524 if (unlikely(Py_SIZE(x) < 0)) {
8525 PyErr_SetString(PyExc_OverflowError,
8526 "can't convert negative value to unsigned long");
8527 return (unsigned long)-1;
8529 return PyLong_AsUnsignedLong(x);
8531 return PyLong_AsLong(x);
8535 PyObject *tmp = __Pyx_PyNumber_Int(x);
8536 if (!tmp) return (unsigned long)-1;
8537 val = __Pyx_PyInt_AsUnsignedLong(tmp);
8543 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
8544 const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
8545 const int is_unsigned = neg_one > const_zero;
8546 #if PY_VERSION_HEX < 0x03000000
8547 if (likely(PyInt_Check(x))) {
8548 long val = PyInt_AS_LONG(x);
8549 if (is_unsigned && unlikely(val < 0)) {
8550 PyErr_SetString(PyExc_OverflowError,
8551 "can't convert negative value to unsigned PY_LONG_LONG");
8552 return (unsigned PY_LONG_LONG)-1;
8554 return (unsigned PY_LONG_LONG)val;
8557 if (likely(PyLong_Check(x))) {
8559 if (unlikely(Py_SIZE(x) < 0)) {
8560 PyErr_SetString(PyExc_OverflowError,
8561 "can't convert negative value to unsigned PY_LONG_LONG");
8562 return (unsigned PY_LONG_LONG)-1;
8564 return PyLong_AsUnsignedLongLong(x);
8566 return PyLong_AsLongLong(x);
8569 unsigned PY_LONG_LONG val;
8570 PyObject *tmp = __Pyx_PyNumber_Int(x);
8571 if (!tmp) return (unsigned PY_LONG_LONG)-1;
8572 val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
8578 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
8579 const long neg_one = (long)-1, const_zero = 0;
8580 const int is_unsigned = neg_one > const_zero;
8581 #if PY_VERSION_HEX < 0x03000000
8582 if (likely(PyInt_Check(x))) {
8583 long val = PyInt_AS_LONG(x);
8584 if (is_unsigned && unlikely(val < 0)) {
8585 PyErr_SetString(PyExc_OverflowError,
8586 "can't convert negative value to long");
8592 if (likely(PyLong_Check(x))) {
8594 if (unlikely(Py_SIZE(x) < 0)) {
8595 PyErr_SetString(PyExc_OverflowError,
8596 "can't convert negative value to long");
8599 return PyLong_AsUnsignedLong(x);
8601 return PyLong_AsLong(x);
8605 PyObject *tmp = __Pyx_PyNumber_Int(x);
8606 if (!tmp) return (long)-1;
8607 val = __Pyx_PyInt_AsLong(tmp);
8613 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
8614 const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
8615 const int is_unsigned = neg_one > const_zero;
8616 #if PY_VERSION_HEX < 0x03000000
8617 if (likely(PyInt_Check(x))) {
8618 long val = PyInt_AS_LONG(x);
8619 if (is_unsigned && unlikely(val < 0)) {
8620 PyErr_SetString(PyExc_OverflowError,
8621 "can't convert negative value to PY_LONG_LONG");
8622 return (PY_LONG_LONG)-1;
8624 return (PY_LONG_LONG)val;
8627 if (likely(PyLong_Check(x))) {
8629 if (unlikely(Py_SIZE(x) < 0)) {
8630 PyErr_SetString(PyExc_OverflowError,
8631 "can't convert negative value to PY_LONG_LONG");
8632 return (PY_LONG_LONG)-1;
8634 return PyLong_AsUnsignedLongLong(x);
8636 return PyLong_AsLongLong(x);
8640 PyObject *tmp = __Pyx_PyNumber_Int(x);
8641 if (!tmp) return (PY_LONG_LONG)-1;
8642 val = __Pyx_PyInt_AsLongLong(tmp);
8648 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
8649 const signed long neg_one = (signed long)-1, const_zero = 0;
8650 const int is_unsigned = neg_one > const_zero;
8651 #if PY_VERSION_HEX < 0x03000000
8652 if (likely(PyInt_Check(x))) {
8653 long val = PyInt_AS_LONG(x);
8654 if (is_unsigned && unlikely(val < 0)) {
8655 PyErr_SetString(PyExc_OverflowError,
8656 "can't convert negative value to signed long");
8657 return (signed long)-1;
8659 return (signed long)val;
8662 if (likely(PyLong_Check(x))) {
8664 if (unlikely(Py_SIZE(x) < 0)) {
8665 PyErr_SetString(PyExc_OverflowError,
8666 "can't convert negative value to signed long");
8667 return (signed long)-1;
8669 return PyLong_AsUnsignedLong(x);
8671 return PyLong_AsLong(x);
8675 PyObject *tmp = __Pyx_PyNumber_Int(x);
8676 if (!tmp) return (signed long)-1;
8677 val = __Pyx_PyInt_AsSignedLong(tmp);
8683 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
8684 const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
8685 const int is_unsigned = neg_one > const_zero;
8686 #if PY_VERSION_HEX < 0x03000000
8687 if (likely(PyInt_Check(x))) {
8688 long val = PyInt_AS_LONG(x);
8689 if (is_unsigned && unlikely(val < 0)) {
8690 PyErr_SetString(PyExc_OverflowError,
8691 "can't convert negative value to signed PY_LONG_LONG");
8692 return (signed PY_LONG_LONG)-1;
8694 return (signed PY_LONG_LONG)val;
8697 if (likely(PyLong_Check(x))) {
8699 if (unlikely(Py_SIZE(x) < 0)) {
8700 PyErr_SetString(PyExc_OverflowError,
8701 "can't convert negative value to signed PY_LONG_LONG");
8702 return (signed PY_LONG_LONG)-1;
8704 return PyLong_AsUnsignedLongLong(x);
8706 return PyLong_AsLongLong(x);
8709 signed PY_LONG_LONG val;
8710 PyObject *tmp = __Pyx_PyNumber_Int(x);
8711 if (!tmp) return (signed PY_LONG_LONG)-1;
8712 val = __Pyx_PyInt_AsSignedLongLong(tmp);
8718 #ifndef __PYX_HAVE_RT_ImportType
8719 #define __PYX_HAVE_RT_ImportType
8720 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
8721 long size, int strict)
8723 PyObject *py_module = 0;
8724 PyObject *result = 0;
8725 PyObject *py_name = 0;
8728 py_module = __Pyx_ImportModule(module_name);
8731 #if PY_MAJOR_VERSION < 3
8732 py_name = PyString_FromString(class_name);
8734 py_name = PyUnicode_FromString(class_name);
8738 result = PyObject_GetAttr(py_module, py_name);
8741 Py_DECREF(py_module);
8745 if (!PyType_Check(result)) {
8746 PyErr_Format(PyExc_TypeError,
8747 "%s.%s is not a type object",
8748 module_name, class_name);
8751 if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) {
8752 PyOS_snprintf(warning, sizeof(warning),
8753 "%s.%s size changed, may indicate binary incompatibility",
8754 module_name, class_name);
8755 #if PY_VERSION_HEX < 0x02050000
8756 PyErr_Warn(NULL, warning);
8758 PyErr_WarnEx(NULL, warning, 0);
8761 else if (((PyTypeObject *)result)->tp_basicsize != size) {
8762 PyErr_Format(PyExc_ValueError,
8763 "%s.%s has the wrong size, try recompiling",
8764 module_name, class_name);
8767 return (PyTypeObject *)result;
8769 Py_XDECREF(py_module);
8775 #ifndef __PYX_HAVE_RT_ImportModule
8776 #define __PYX_HAVE_RT_ImportModule
8777 static PyObject *__Pyx_ImportModule(const char *name) {
8778 PyObject *py_name = 0;
8779 PyObject *py_module = 0;
8781 #if PY_MAJOR_VERSION < 3
8782 py_name = PyString_FromString(name);
8784 py_name = PyUnicode_FromString(name);
8788 py_module = PyImport_Import(py_name);
8792 Py_XDECREF(py_name);
8797 static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) {
8798 PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__");
8801 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
8802 *(void **)vtabptr = PyCapsule_GetPointer(ob, 0);
8804 *(void **)vtabptr = PyCObject_AsVoidPtr(ob);
8806 if (!*(void **)vtabptr)
8815 #include "compile.h"
8816 #include "frameobject.h"
8817 #include "traceback.h"
8819 static void __Pyx_AddTraceback(const char *funcname) {
8820 PyObject *py_srcfile = 0;
8821 PyObject *py_funcname = 0;
8822 PyObject *py_globals = 0;
8823 PyCodeObject *py_code = 0;
8824 PyFrameObject *py_frame = 0;
8826 #if PY_MAJOR_VERSION < 3
8827 py_srcfile = PyString_FromString(__pyx_filename);
8829 py_srcfile = PyUnicode_FromString(__pyx_filename);
8831 if (!py_srcfile) goto bad;
8832 if (__pyx_clineno) {
8833 #if PY_MAJOR_VERSION < 3
8834 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
8836 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
8840 #if PY_MAJOR_VERSION < 3
8841 py_funcname = PyString_FromString(funcname);
8843 py_funcname = PyUnicode_FromString(funcname);
8846 if (!py_funcname) goto bad;
8847 py_globals = PyModule_GetDict(__pyx_m);
8848 if (!py_globals) goto bad;
8849 py_code = PyCode_New(
8850 0, /*int argcount,*/
8851 #if PY_MAJOR_VERSION >= 3
8852 0, /*int kwonlyargcount,*/
8855 0, /*int stacksize,*/
8857 __pyx_empty_bytes, /*PyObject *code,*/
8858 __pyx_empty_tuple, /*PyObject *consts,*/
8859 __pyx_empty_tuple, /*PyObject *names,*/
8860 __pyx_empty_tuple, /*PyObject *varnames,*/
8861 __pyx_empty_tuple, /*PyObject *freevars,*/
8862 __pyx_empty_tuple, /*PyObject *cellvars,*/
8863 py_srcfile, /*PyObject *filename,*/
8864 py_funcname, /*PyObject *name,*/
8865 __pyx_lineno, /*int firstlineno,*/
8866 __pyx_empty_bytes /*PyObject *lnotab*/
8868 if (!py_code) goto bad;
8869 py_frame = PyFrame_New(
8870 PyThreadState_GET(), /*PyThreadState *tstate,*/
8871 py_code, /*PyCodeObject *code,*/
8872 py_globals, /*PyObject *globals,*/
8873 0 /*PyObject *locals*/
8875 if (!py_frame) goto bad;
8876 py_frame->f_lineno = __pyx_lineno;
8877 PyTraceBack_Here(py_frame);
8879 Py_XDECREF(py_srcfile);
8880 Py_XDECREF(py_funcname);
8881 Py_XDECREF(py_code);
8882 Py_XDECREF(py_frame);
8885 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
8887 #if PY_MAJOR_VERSION < 3
8888 if (t->is_unicode) {
8889 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
8890 } else if (t->intern) {
8891 *t->p = PyString_InternFromString(t->s);
8893 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
8895 #else /* Python 3+ has unicode identifiers */
8896 if (t->is_unicode | t->is_str) {
8898 *t->p = PyUnicode_InternFromString(t->s);
8899 } else if (t->encoding) {
8900 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
8902 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
8905 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
8915 /* Type Conversion Functions */
8917 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
8918 int is_true = x == Py_True;
8919 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
8920 else return PyObject_IsTrue(x);
8923 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
8925 const char *name = NULL;
8926 PyObject *res = NULL;
8927 #if PY_VERSION_HEX < 0x03000000
8928 if (PyInt_Check(x) || PyLong_Check(x))
8930 if (PyLong_Check(x))
8932 return Py_INCREF(x), x;
8933 m = Py_TYPE(x)->tp_as_number;
8934 #if PY_VERSION_HEX < 0x03000000
8935 if (m && m->nb_int) {
8937 res = PyNumber_Int(x);
8939 else if (m && m->nb_long) {
8941 res = PyNumber_Long(x);
8944 if (m && m->nb_int) {
8946 res = PyNumber_Long(x);
8950 #if PY_VERSION_HEX < 0x03000000
8951 if (!PyInt_Check(res) && !PyLong_Check(res)) {
8953 if (!PyLong_Check(res)) {
8955 PyErr_Format(PyExc_TypeError,
8956 "__%s__ returned non-%s (type %.200s)",
8957 name, name, Py_TYPE(res)->tp_name);
8962 else if (!PyErr_Occurred()) {
8963 PyErr_SetString(PyExc_TypeError,
8964 "an integer is required");
8969 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
8971 PyObject* x = PyNumber_Index(b);
8973 ival = PyInt_AsSsize_t(x);
8978 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
8979 #if PY_VERSION_HEX < 0x02050000
8980 if (ival <= LONG_MAX)
8981 return PyInt_FromLong((long)ival);
8983 unsigned char *bytes = (unsigned char *) &ival;
8984 int one = 1; int little = (int)*(unsigned char*)&one;
8985 return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
8988 return PyInt_FromSize_t(ival);
8992 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
8993 unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
8994 if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
8996 } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
8997 PyErr_SetString(PyExc_OverflowError,
8998 "value too large to convert to size_t");
9005 #endif /* Py_PYTHON_H */