-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC initctabix(void); /*proto*/
-PyMODINIT_FUNC initctabix(void)
-#else
-PyMODINIT_FUNC PyInit_ctabix(void); /*proto*/
-PyMODINIT_FUNC PyInit_ctabix(void)
-#endif
-{
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- #if CYTHON_REFNANNY
- void* __pyx_refnanny = NULL;
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
- if (!__Pyx_RefNanny) {
- PyErr_Clear();
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
- if (!__Pyx_RefNanny)
- Py_FatalError("failed to import 'refnanny' module");
- }
- __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_ctabix(void)", __LINE__, __FILE__);
- #endif
- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #ifdef __pyx_binding_PyCFunctionType_USED
- if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- /*--- Library function declarations ---*/
- /*--- Threads initialization code ---*/
- #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
- #ifdef WITH_THREAD /* Python build with threading support? */
- PyEval_InitThreads();
- #endif
- #endif
- /*--- Module creation code ---*/
- #if PY_MAJOR_VERSION < 3
- __pyx_m = Py_InitModule4(__Pyx_NAMESTR("ctabix"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
- #else
- __pyx_m = PyModule_Create(&__pyx_moduledef);
- #endif
- if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- #if PY_MAJOR_VERSION < 3
- Py_INCREF(__pyx_m);
- #endif
- __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
- if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- /*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_module_is_main_ctabix) {
- if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- }
- /*--- Builtin init code ---*/
- if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Global init code ---*/
- /*--- Function export code ---*/
- /*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type_6ctabix_Tabixfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- 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;}
- __pyx_ptype_6ctabix_Tabixfile = &__pyx_type_6ctabix_Tabixfile;
- if (PyType_Ready(&__pyx_type_6ctabix_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- 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;}
- __pyx_ptype_6ctabix_Parser = &__pyx_type_6ctabix_Parser;
- if (PyType_Ready(&__pyx_type_6ctabix_TabixIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- {
- 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;}
- if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_6ctabix_13TabixIterator___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_6ctabix_13TabixIterator___next__.doc = __pyx_doc_6ctabix_13TabixIterator___next__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6ctabix_13TabixIterator___next__;
- }
- }
- 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;}
- __pyx_ptype_6ctabix_TabixIterator = &__pyx_type_6ctabix_TabixIterator;
- if (PyType_Ready(&__pyx_type_6ctabix_TabixHeaderIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- {
- 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;}
- if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_6ctabix_19TabixHeaderIterator___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_6ctabix_19TabixHeaderIterator___next__.doc = __pyx_doc_6ctabix_19TabixHeaderIterator___next__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6ctabix_19TabixHeaderIterator___next__;
- }
- }
- 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;}
- __pyx_ptype_6ctabix_TabixHeaderIterator = &__pyx_type_6ctabix_TabixHeaderIterator;
- __pyx_type_6ctabix_asTuple.tp_base = __pyx_ptype_6ctabix_Parser;
- if (PyType_Ready(&__pyx_type_6ctabix_asTuple) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- 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;}
- __pyx_ptype_6ctabix_asTuple = &__pyx_type_6ctabix_asTuple;
- __pyx_type_6ctabix_asGTF.tp_base = __pyx_ptype_6ctabix_Parser;
- if (PyType_Ready(&__pyx_type_6ctabix_asGTF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- 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;}
- __pyx_ptype_6ctabix_asGTF = &__pyx_type_6ctabix_asGTF;
- __pyx_type_6ctabix_asBed.tp_base = __pyx_ptype_6ctabix_Parser;
- if (PyType_Ready(&__pyx_type_6ctabix_asBed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- 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;}
- __pyx_ptype_6ctabix_asBed = &__pyx_type_6ctabix_asBed;
- __pyx_type_6ctabix_asVCF.tp_base = __pyx_ptype_6ctabix_Parser;
- if (PyType_Ready(&__pyx_type_6ctabix_asVCF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- 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;}
- __pyx_ptype_6ctabix_asVCF = &__pyx_type_6ctabix_asVCF;
- if (PyType_Ready(&__pyx_type_6ctabix_TabixIteratorParsed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- {
- 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;}
+ /* "ctabix.pyx":126
+ *
+ * if not self._isOpen():
+ * raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
+ *
+ * region, rtid, rstart, rend = self._parseRegion( reference, start, end, region )
+ */
+ __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
+ PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_kp_s_11));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));
+
+ /* "ctabix.pyx":149
+ * '''filename associated with this object.'''
+ * def __get__(self):
+ * if not self._isOpen(): raise ValueError( "I/O operation on closed file" ) # <<<<<<<<<<<<<<
+ * return self._filename
+ *
+ */
+ __pyx_k_tuple_13 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_13));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
+ PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_kp_s_11));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
+
+ /* "ctabix.pyx":219
+ *
+ * if <void*>self.iterator == NULL:
+ * raise ValueError("malformatted query or wrong sequence name.\n") # <<<<<<<<<<<<<<
+ *
+ * def __iter__(self):
+ */
+ __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
+ PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_14));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));
+
+ /* "ctabix.pyx":266
+ *
+ * if <void*>self.iterator == NULL:
+ * raise ValueError("can't open header.\n") # <<<<<<<<<<<<<<
+ *
+ * def __iter__(self):
+ */
+ __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
+ PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_16));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
+
+ /* "ctabix.pyx":461
+ *
+ * if <void*>self.iterator == NULL:
+ * raise ValueError("malformatted query or wrong sequence name.\n") # <<<<<<<<<<<<<<
+ *
+ * def __iter__(self):
+ */
+ __pyx_k_tuple_18 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_18));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
+ PyTuple_SET_ITEM(__pyx_k_tuple_18, 0, ((PyObject *)__pyx_kp_s_14));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18));
+
+ /* "ctabix.pyx":512
+ * fp = bgzf_open( filename_out, "w")
+ * if fp == NULL:
+ * raise IOError( "could not open '%s' for writing" ) # <<<<<<<<<<<<<<
+ *
+ * fd_src = open(filename_in, O_RDONLY)
+ */
+ __pyx_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_22));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_21));
+ PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, ((PyObject *)__pyx_kp_s_21));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));
+
+ /* "ctabix.pyx":516
+ * fd_src = open(filename_in, O_RDONLY)
+ * if fd_src == 0:
+ * raise IOError( "could not open '%s' for reading" ) # <<<<<<<<<<<<<<
+ *
+ * buffer = malloc(WINDOW_SIZE)
+ */
+ __pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_24));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_23));
+ PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_kp_s_23));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
+
+ /* "ctabix.pyx":525
+ * if r < 0:
+ * free( buffer )
+ * raise OSError("writing failed") # <<<<<<<<<<<<<<
+ *
+ * free( buffer )
+ */
+ __pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_26));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
+ PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_kp_s_25));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));
+
+ /* "ctabix.pyx":529
+ * free( buffer )
+ * r = bgzf_close(fp)
+ * if r < 0: raise OSError("writing failed") # <<<<<<<<<<<<<<
+ *
+ * def tabix_index( filename,
+ */
+ __pyx_k_tuple_27 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_27));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
+ PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_kp_s_25));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));
+
+ /* "ctabix.pyx":575
+ * if not os.path.exists(filename): raise IOError("No such file '%s'" % filename)
+ *
+ * if not filename.endswith(".gz"): # <<<<<<<<<<<<<<
+ *
+ * tabix_compress( filename, filename + ".gz", force = force )
+ */
+ __pyx_k_tuple_33 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_33));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_32));
+ PyTuple_SET_ITEM(__pyx_k_tuple_33, 0, ((PyObject *)__pyx_kp_s_32));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_32));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33));
+
+ /* "ctabix.pyx":582
+ *
+ * if not force and os.path.exists(filename + ".tbi" ):
+ * raise IOError( "Filename '%s.tbi' already exists, use *force* to overwrite" ) # <<<<<<<<<<<<<<
+ *
+ * # columns (1-based)
+ */
+ __pyx_k_tuple_35 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_35));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
+ PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, ((PyObject *)__pyx_kp_s_34));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));
+
+ /* "ctabix.pyx":588
+ * # 0 is a missing column
+ * preset2conf = {
+ * 'gff' : ( 0, 1, 4, 5, ord('#'), 0 ), # <<<<<<<<<<<<<<
+ * 'bed' : ( 0x10000, 1, 2, 3, ord('#'), 0 ),
+ * 'psltbl' : ( 0x10000, 15, 17, 18, ord('#'), 0 ),
+ */
+ __pyx_k_tuple_36 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_36));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
+ PyTuple_SET_ITEM(__pyx_k_tuple_36, 0, ((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));
+
+ /* "ctabix.pyx":589
+ * preset2conf = {
+ * 'gff' : ( 0, 1, 4, 5, ord('#'), 0 ),
+ * 'bed' : ( 0x10000, 1, 2, 3, ord('#'), 0 ), # <<<<<<<<<<<<<<
+ * 'psltbl' : ( 0x10000, 15, 17, 18, ord('#'), 0 ),
+ * 'sam' : ( 1, 3, 4, 0, ord('#'), 0 ),
+ */
+ __pyx_k_tuple_37 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_37));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
+ PyTuple_SET_ITEM(__pyx_k_tuple_37, 0, ((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));
+
+ /* "ctabix.pyx":590
+ * 'gff' : ( 0, 1, 4, 5, ord('#'), 0 ),
+ * 'bed' : ( 0x10000, 1, 2, 3, ord('#'), 0 ),
+ * 'psltbl' : ( 0x10000, 15, 17, 18, ord('#'), 0 ), # <<<<<<<<<<<<<<
+ * 'sam' : ( 1, 3, 4, 0, ord('#'), 0 ),
+ * 'vcf' : ( 2, 1, 2, 0, ord('#'), 0 ),
+ */
+ __pyx_k_tuple_38 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_38));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
+ PyTuple_SET_ITEM(__pyx_k_tuple_38, 0, ((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));
+
+ /* "ctabix.pyx":591
+ * 'bed' : ( 0x10000, 1, 2, 3, ord('#'), 0 ),
+ * 'psltbl' : ( 0x10000, 15, 17, 18, ord('#'), 0 ),
+ * 'sam' : ( 1, 3, 4, 0, ord('#'), 0 ), # <<<<<<<<<<<<<<
+ * 'vcf' : ( 2, 1, 2, 0, ord('#'), 0 ),
+ * 'pileup': (3, 1, 2, 0, ord('#'), 0 ),
+ */
+ __pyx_k_tuple_39 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_39));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
+ PyTuple_SET_ITEM(__pyx_k_tuple_39, 0, ((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39));
+
+ /* "ctabix.pyx":592
+ * 'psltbl' : ( 0x10000, 15, 17, 18, ord('#'), 0 ),
+ * 'sam' : ( 1, 3, 4, 0, ord('#'), 0 ),
+ * 'vcf' : ( 2, 1, 2, 0, ord('#'), 0 ), # <<<<<<<<<<<<<<
+ * 'pileup': (3, 1, 2, 0, ord('#'), 0 ),
+ * }
+ */
+ __pyx_k_tuple_40 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_40));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
+ PyTuple_SET_ITEM(__pyx_k_tuple_40, 0, ((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));
+
+ /* "ctabix.pyx":593
+ * 'sam' : ( 1, 3, 4, 0, ord('#'), 0 ),
+ * 'vcf' : ( 2, 1, 2, 0, ord('#'), 0 ),
+ * 'pileup': (3, 1, 2, 0, ord('#'), 0 ), # <<<<<<<<<<<<<<
+ * }
+ *
+ */
+ __pyx_k_tuple_41 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_41));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
+ PyTuple_SET_ITEM(__pyx_k_tuple_41, 0, ((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __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;};
+ __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;};
+ __pyx_int_65536 = PyInt_FromLong(65536); if (unlikely(!__pyx_int_65536)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initctabix(void); /*proto*/
+PyMODINIT_FUNC initctabix(void)
+#else
+PyMODINIT_FUNC PyInit_ctabix(void); /*proto*/
+PyMODINIT_FUNC PyInit_ctabix(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ #if CYTHON_REFNANNY
+ void* __pyx_refnanny = NULL;
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_ctabix(void)", __LINE__, __FILE__);
+ #endif
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #ifdef __pyx_binding_PyCFunctionType_USED
+ if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4(__Pyx_NAMESTR("ctabix"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ #if PY_MAJOR_VERSION < 3
+ Py_INCREF(__pyx_m);
+ #endif
+ __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
+ if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_module_is_main_ctabix) {
+ if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
+ /*--- Builtin init code ---*/
+ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Constants init code ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ if (PyType_Ready(&__pyx_type_6ctabix_Tabixfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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;}
+ __pyx_ptype_6ctabix_Tabixfile = &__pyx_type_6ctabix_Tabixfile;
+ if (PyType_Ready(&__pyx_type_6ctabix_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "Parser", (PyObject *)&__pyx_type_6ctabix_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_6ctabix_Parser = &__pyx_type_6ctabix_Parser;
+ if (PyType_Ready(&__pyx_type_6ctabix_TabixIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {
+ PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6ctabix_TabixIterator, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}