-static int __Pyx_InitCachedConstants(void) {
- __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");
-
- /* "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;
-}